LibreOffice Module sc (master) 1
fielduno.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <memory>
21#include <fielduno.hxx>
22#include <textuno.hxx>
23#include <miscuno.hxx>
24#include <docsh.hxx>
25#include <hints.hxx>
26#include <editsrc.hxx>
27#include <unonames.hxx>
28#include <editutil.hxx>
29
30#include <svl/hint.hxx>
31#include <utility>
32#include <vcl/svapp.hxx>
33
34#include <editeng/eeitem.hxx>
35
36#include <editeng/editeng.hxx>
37#include <editeng/editobj.hxx>
38#include <editeng/flditem.hxx>
41
42#include <com/sun/star/beans/PropertyAttribute.hpp>
43#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
44#include <com/sun/star/text/TextContentAnchorType.hpp>
45#include <com/sun/star/text/WrapTextMode.hpp>
46#include <com/sun/star/text/FilenameDisplayFormat.hpp>
47#include <com/sun/star/text/textfield/Type.hpp>
48
49using namespace com::sun::star;
50
51namespace {
52
53// no Which-ID here, map only for PropertySetInfo
54
55const SfxItemPropertySet* getDateTimePropertySet()
56{
57 static const SfxItemPropertyMapEntry aMapContent[] =
58 {
63 };
64 static SfxItemPropertySet aMap(aMapContent);
65 return &aMap;
66}
67
68const SfxItemPropertySet* getEmptyPropertySet()
69{
70 static SfxItemPropertySet aMap({});
71 return &aMap;
72}
73
74const SfxItemPropertySet* lcl_GetURLPropertySet()
75{
76 static const SfxItemPropertyMapEntry aURLPropertyMap_Impl[] =
77 {
78 { SC_UNONAME_ANCTYPE, 0, cppu::UnoType<text::TextContentAnchorType>::get(), beans::PropertyAttribute::READONLY, 0 },
79 { SC_UNONAME_ANCTYPES, 0, cppu::UnoType<uno::Sequence<text::TextContentAnchorType>>::get(), beans::PropertyAttribute::READONLY, 0 },
82 { SC_UNONAME_TEXTWRAP, 0, cppu::UnoType<text::WrapTextMode>::get(), beans::PropertyAttribute::READONLY, 0 },
84 };
85 static SfxItemPropertySet aURLPropertySet_Impl( aURLPropertyMap_Impl );
86 return &aURLPropertySet_Impl;
87}
88
89const SfxItemPropertySet* lcl_GetHeaderFieldPropertySet()
90{
91 static const SfxItemPropertyMapEntry aHeaderFieldPropertyMap_Impl[] =
92 {
93 { SC_UNONAME_ANCTYPE, 0, cppu::UnoType<text::TextContentAnchorType>::get(), beans::PropertyAttribute::READONLY, 0 },
94 { SC_UNONAME_ANCTYPES, 0, cppu::UnoType<uno::Sequence<text::TextContentAnchorType>>::get(), beans::PropertyAttribute::READONLY, 0 },
95 { SC_UNONAME_TEXTWRAP, 0, cppu::UnoType<text::WrapTextMode>::get(), beans::PropertyAttribute::READONLY, 0 },
96 };
97 static SfxItemPropertySet aHeaderFieldPropertySet_Impl( aHeaderFieldPropertyMap_Impl );
98 return &aHeaderFieldPropertySet_Impl;
99}
100
101const SfxItemPropertySet* lcl_GetFileFieldPropertySet()
102{
103 static const SfxItemPropertyMapEntry aFileFieldPropertyMap_Impl[] =
104 {
105 { SC_UNONAME_ANCTYPE, 0, cppu::UnoType<text::TextContentAnchorType>::get(), beans::PropertyAttribute::READONLY, 0 },
106 { SC_UNONAME_ANCTYPES, 0, cppu::UnoType<uno::Sequence<text::TextContentAnchorType>>::get(), beans::PropertyAttribute::READONLY, 0 },
108 { SC_UNONAME_TEXTWRAP, 0, cppu::UnoType<text::WrapTextMode>::get(), beans::PropertyAttribute::READONLY, 0 },
109 };
110 static SfxItemPropertySet aFileFieldPropertySet_Impl( aFileFieldPropertyMap_Impl );
111 return &aFileFieldPropertySet_Impl;
112}
113
114SvxFileFormat lcl_UnoToSvxFileFormat( sal_Int16 nUnoValue )
115{
116 switch( nUnoValue )
117 {
118 case text::FilenameDisplayFormat::FULL: return SvxFileFormat::PathFull;
119 case text::FilenameDisplayFormat::PATH: return SvxFileFormat::PathOnly;
120 case text::FilenameDisplayFormat::NAME: return SvxFileFormat::NameOnly;
121 default:
122 return SvxFileFormat::NameAndExt;
123 }
124}
125
126sal_Int16 lcl_SvxToUnoFileFormat( SvxFileFormat nSvxValue )
127{
128 switch( nSvxValue )
129 {
130 case SvxFileFormat::NameAndExt: return text::FilenameDisplayFormat::NAME_AND_EXT;
131 case SvxFileFormat::PathFull: return text::FilenameDisplayFormat::FULL;
132 case SvxFileFormat::PathOnly: return text::FilenameDisplayFormat::PATH;
133 default:
134 return text::FilenameDisplayFormat::NAME;
135 }
136}
137
138}
139
140SC_SIMPLE_SERVICE_INFO( ScCellFieldsObj, "ScCellFieldsObj", "com.sun.star.text.TextFields" )
141SC_SIMPLE_SERVICE_INFO( ScHeaderFieldsObj, "ScHeaderFieldsObj", "com.sun.star.text.TextFields" )
142
143namespace {
144
145enum ScUnoCollectMode
146{
147 SC_UNO_COLLECT_NONE,
148 SC_UNO_COLLECT_COUNT,
149 SC_UNO_COLLECT_FINDINDEX,
150 SC_UNO_COLLECT_FINDPOS
151};
152
158class ScUnoEditEngine : public ScEditEngineDefaulter
159{
160 ScUnoCollectMode eMode;
161 sal_uInt16 nFieldCount;
162 sal_Int32 mnFieldType;
163 std::unique_ptr<SvxFieldData>
164 pFound; // local copy
165 sal_Int32 nFieldPar;
166 sal_Int32 nFieldPos;
167 sal_uInt16 nFieldIndex;
168
169public:
170 explicit ScUnoEditEngine(ScEditEngineDefaulter* pSource);
171
172 virtual OUString CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos,
173 std::optional<Color>& rTxtColor, std::optional<Color>& rFldColor, std::optional<FontLineStyle>& rFldLineStyle ) override;
174
175 sal_uInt16 CountFields();
176 SvxFieldData* FindByIndex(sal_uInt16 nIndex);
177 SvxFieldData* FindByPos(sal_Int32 nPar, sal_Int32 nPos, sal_Int32 nType);
178
179 sal_Int32 GetFieldPar() const { return nFieldPar; }
180 sal_Int32 GetFieldPos() const { return nFieldPos; }
181};
182
183}
184
185ScUnoEditEngine::ScUnoEditEngine(ScEditEngineDefaulter* pSource)
186 : ScEditEngineDefaulter(*pSource)
187 , eMode(SC_UNO_COLLECT_NONE)
188 , nFieldCount(0)
189 , mnFieldType(text::textfield::Type::UNSPECIFIED)
190 , nFieldPar(0)
191 , nFieldPos(0)
192 , nFieldIndex(0)
193{
194 std::unique_ptr<EditTextObject> pData = pSource->CreateTextObject();
195 SetTextCurrentDefaults( *pData );
196}
197
198OUString ScUnoEditEngine::CalcFieldValue( const SvxFieldItem& rField,
199 sal_Int32 nPara, sal_Int32 nPos, std::optional<Color>& rTxtColor, std::optional<Color>& rFldColor, std::optional<FontLineStyle>& rFldLineStyle )
200{
201 OUString aRet(EditEngine::CalcFieldValue( rField, nPara, nPos, rTxtColor, rFldColor, rFldLineStyle ));
202 if (eMode != SC_UNO_COLLECT_NONE)
203 {
204 const SvxFieldData* pFieldData = rField.GetField();
205 if ( pFieldData )
206 {
207 if (mnFieldType == text::textfield::Type::UNSPECIFIED || pFieldData->GetClassId() == mnFieldType)
208 {
209 if ( eMode == SC_UNO_COLLECT_FINDINDEX && !pFound && nFieldCount == nFieldIndex )
210 {
211 pFound = pFieldData->Clone();
212 nFieldPar = nPara;
213 nFieldPos = nPos;
214 }
215 if ( eMode == SC_UNO_COLLECT_FINDPOS && !pFound &&
216 nPara == nFieldPar && nPos == nFieldPos )
217 {
218 pFound = pFieldData->Clone();
219 nFieldIndex = nFieldCount;
220 }
221 ++nFieldCount;
222 }
223 }
224 }
225 return aRet;
226}
227
228sal_uInt16 ScUnoEditEngine::CountFields()
229{
230 eMode = SC_UNO_COLLECT_COUNT;
231 mnFieldType = text::textfield::Type::UNSPECIFIED;
232 nFieldCount = 0;
233 UpdateFields();
234 eMode = SC_UNO_COLLECT_NONE;
235
236 return nFieldCount;
237}
238
239SvxFieldData* ScUnoEditEngine::FindByIndex(sal_uInt16 nIndex)
240{
241 eMode = SC_UNO_COLLECT_FINDINDEX;
242 nFieldIndex = nIndex;
243 mnFieldType = text::textfield::Type::UNSPECIFIED;
244 nFieldCount = 0;
245 UpdateFields();
246 eMode = SC_UNO_COLLECT_NONE;
247
248 return pFound.get();
249}
250
251SvxFieldData* ScUnoEditEngine::FindByPos(sal_Int32 nPar, sal_Int32 nPos, sal_Int32 nType)
252{
253 eMode = SC_UNO_COLLECT_FINDPOS;
254 nFieldPar = nPar;
255 nFieldPos = nPos;
256 mnFieldType = nType;
257 nFieldCount = 0;
258 UpdateFields();
259 mnFieldType = text::textfield::Type::UNSPECIFIED;
260 eMode = SC_UNO_COLLECT_NONE;
261
262 return pFound.get();
263}
264
266 uno::Reference<text::XTextRange> xContent,
267 ScDocShell* pDocSh, const ScAddress& rPos) :
268 mxContent(std::move(xContent)),
269 pDocShell( pDocSh ),
270 aCellPos( rPos )
271{
273
275}
276
278{
279 {
281
282 if (pDocShell)
284
285 mpEditSource.reset();
286 }
287
288 // increment refcount to prevent double call off dtor
289 osl_atomic_increment( &m_refCount );
290
291 std::unique_lock g(aMutex);
293 {
294 lang::EventObject aEvent;
295 aEvent.Source.set(getXWeak());
297 }
298}
299
301{
302 if ( dynamic_cast<const ScUpdateRefHint*>(&rHint) )
303 {
305 }
306 else if ( rHint.GetId() == SfxHintId::Dying )
307 {
308 pDocShell = nullptr; // became invalid
309 }
310
311 // EditSource registered itself as a listener
312}
313
314// XIndexAccess (via XTextFields)
315
316uno::Reference<text::XTextField> ScCellFieldsObj::GetObjectByIndex_Impl(sal_Int32 Index) const
317{
319 ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
320 ScUnoEditEngine aTempEngine(pEditEngine);
321 SvxFieldData* pData = aTempEngine.FindByIndex(static_cast<sal_uInt16>(Index));
322 if (!pData)
323 return uno::Reference<text::XTextField>();
324
325 sal_Int32 nPar = aTempEngine.GetFieldPar();
326 sal_Int32 nPos = aTempEngine.GetFieldPos();
327 ESelection aSelection( nPar, nPos, nPar, nPos+1 ); // Field size is 1 character
328
329 sal_Int32 eType = pData->GetClassId();
330 uno::Reference<text::XTextField> xRet(
331 new ScEditFieldObj(mxContent, std::make_unique<ScCellEditSource>(pDocShell, aCellPos), eType, aSelection));
332 return xRet;
333}
334
335sal_Int32 SAL_CALL ScCellFieldsObj::getCount()
336{
337 SolarMutexGuard aGuard;
338
340 ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
341 ScUnoEditEngine aTempEngine(pEditEngine);
342
343 return aTempEngine.CountFields(); // count the fields, we don't care about their type in the cell
344}
345
346uno::Any SAL_CALL ScCellFieldsObj::getByIndex( sal_Int32 nIndex )
347{
348 SolarMutexGuard aGuard;
349 uno::Reference<text::XTextField> xField(GetObjectByIndex_Impl(nIndex));
350 if (!xField.is())
351 throw lang::IndexOutOfBoundsException();
352
353 return uno::Any(xField);
354}
355
357{
359}
360
362{
363 SolarMutexGuard aGuard;
364 return ( getCount() != 0 );
365}
366
367uno::Reference<container::XEnumeration> SAL_CALL ScCellFieldsObj::createEnumeration()
368{
369 SolarMutexGuard aGuard;
370 return new ScIndexEnumeration(this, "com.sun.star.text.TextFieldEnumeration");
371}
372
374 const uno::Reference<container::XContainerListener>& /* xListener */ )
375{
376 OSL_FAIL("not implemented");
377}
378
380 const uno::Reference<container::XContainerListener>& /* xListener */ )
381{
382 OSL_FAIL("not implemented");
383}
384
385// XRefreshable
387{
388 std::unique_lock g(aMutex);
390 {
391 // Call all listeners.
392 lang::EventObject aEvent;
393 aEvent.Source.set(uno::Reference< util::XRefreshable >(this));
394 maRefreshListeners.notifyEach( g, &util::XRefreshListener::refreshed, aEvent );
395 }
396}
397
398void SAL_CALL ScCellFieldsObj::addRefreshListener( const uno::Reference< util::XRefreshListener >& xListener )
399{
400 if (xListener.is())
401 {
402 std::unique_lock g(aMutex);
403 maRefreshListeners.addInterface(g, xListener);
404 }
405}
406
407void SAL_CALL ScCellFieldsObj::removeRefreshListener( const uno::Reference<util::XRefreshListener >& xListener )
408{
409 if (xListener.is())
410 {
411 std::unique_lock g(aMutex);
413 }
414}
415
417 mrData(rData)
418{
419 mpEditSource.reset( new ScHeaderFooterEditSource(rData) );
420}
421
423{
424 mpEditSource.reset();
425
426 // increment refcount to prevent double call of dtor
427 osl_atomic_increment( &m_refCount );
428
429 std::unique_lock g(aMutex);
431 {
432 lang::EventObject aEvent;
433 aEvent.Source = getXWeak();
435 }
436}
437
438// XIndexAccess (via XTextFields)
439
440uno::Reference<text::XTextField> ScHeaderFieldsObj::GetObjectByIndex_Impl(sal_Int32 Index) const
441{
443 ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
444 ScUnoEditEngine aTempEngine(pEditEngine);
445
446 SvxFieldData* pData = aTempEngine.FindByIndex(static_cast<sal_uInt16>(Index));
447 if (!pData)
448 return nullptr;
449
450 // Get the parent text range instance.
451 uno::Reference<text::XTextRange> xTextRange;
452 uno::Reference<sheet::XHeaderFooterContent> xContentObj = mrData.GetContentObj();
453 if (!xContentObj.is())
454 throw uno::RuntimeException("");
455
457 uno::Reference<text::XText> xText;
458
459 switch ( mrData.GetPart() )
460 {
462 xText = pContentObj->getLeftText();
463 break;
465 xText = pContentObj->getCenterText();
466 break;
468 xText = pContentObj->getRightText();
469 break;
470 }
471
472 xTextRange = xText;
473
474 sal_Int32 nPar = aTempEngine.GetFieldPar();
475 sal_Int32 nPos = aTempEngine.GetFieldPos();
476 ESelection aSelection( nPar, nPos, nPar, nPos+1 ); // Field size is 1 character
477
478 sal_Int32 eRealType = pData->GetClassId();
479 uno::Reference<text::XTextField> xRet(
480 new ScEditFieldObj(xTextRange, std::make_unique<ScHeaderFooterEditSource>(mrData), eRealType, aSelection));
481 return xRet;
482}
483
484sal_Int32 SAL_CALL ScHeaderFieldsObj::getCount()
485{
486 SolarMutexGuard aGuard;
487
489 ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
490 ScUnoEditEngine aTempEngine(pEditEngine);
491 return aTempEngine.CountFields();
492}
493
494uno::Any SAL_CALL ScHeaderFieldsObj::getByIndex( sal_Int32 nIndex )
495{
496 SolarMutexGuard aGuard;
497 uno::Reference<text::XTextField> xField(GetObjectByIndex_Impl(nIndex));
498 if (!xField.is())
499 throw lang::IndexOutOfBoundsException();
500
501 return uno::Any(xField);
502}
503
505{
507}
508
510{
511 SolarMutexGuard aGuard;
512 return ( getCount() != 0 );
513}
514
515uno::Reference<container::XEnumeration> SAL_CALL ScHeaderFieldsObj::createEnumeration()
516{
517 SolarMutexGuard aGuard;
518 return new ScIndexEnumeration(this, "com.sun.star.text.TextFieldEnumeration");
519}
520
522 const uno::Reference<container::XContainerListener>& /* xListener */ )
523{
524 OSL_FAIL("not implemented");
525}
526
528 const uno::Reference<container::XContainerListener>& /* xListener */ )
529{
530 OSL_FAIL("not implemented");
531}
532
533// XRefreshable
535{
536 std::unique_lock g(aMutex);
538 {
539 // Call all listeners.
540 lang::EventObject aEvent;
541 aEvent.Source.set(uno::Reference< util::XRefreshable >(this));
542 maRefreshListeners.notifyEach( g, &util::XRefreshListener::refreshed, aEvent);
543 }
544}
545
546void SAL_CALL ScHeaderFieldsObj::addRefreshListener( const uno::Reference< util::XRefreshListener >& xListener )
547{
548 if (xListener.is())
549 {
550 std::unique_lock g(aMutex);
551 maRefreshListeners.addInterface(g, xListener);
552 }
553}
554
555void SAL_CALL ScHeaderFieldsObj::removeRefreshListener( const uno::Reference<util::XRefreshListener >& xListener )
556{
557 if (xListener.is())
558 {
559 std::unique_lock g(aMutex);
561 }
562}
563
565{
566 if (!mpData)
567 {
568 switch (meType)
569 {
571 mpData.reset(new SvxDateField);
572 break;
573 case text::textfield::Type::EXTENDED_FILE:
574 mpData.reset(
575 new SvxExtFileField(OUString(), SvxFileType::Var, SvxFileFormat::NameAndExt));
576 break;
577 case text::textfield::Type::PAGE:
578 mpData.reset(new SvxPageField);
579 break;
580 case text::textfield::Type::PAGES:
581 mpData.reset(new SvxPagesField);
582 break;
584 mpData.reset(new SvxTableField);
585 break;
586 case text::textfield::Type::TIME:
587 mpData.reset(new SvxTimeField);
588 break;
589 case text::textfield::Type::EXTENDED_TIME:
590 {
591 if (mbIsDate)
592 mpData.reset(new SvxDateField);
593 else
594 mpData.reset(new SvxExtTimeField);
595 }
596 break;
597 case text::textfield::Type::DOCINFO_TITLE:
598 mpData.reset(new SvxFileField);
599 break;
600 case text::textfield::Type::URL:
601 mpData.reset(
602 new SvxURLField(OUString(), OUString(), SvxURLFormat::AppDefault));
603 break;
604 default:
605 mpData.reset(new SvxFieldData);
606 }
607 }
608 return *mpData;
609}
610
611void ScEditFieldObj::setPropertyValueURL(const OUString& rName, const css::uno::Any& rVal)
612{
613 OUString aStrVal;
614 if (mpEditSource)
615 {
616 // Edit engine instance already exists for this field item. Use it.
617 ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
618 ScUnoEditEngine aTempEngine(pEditEngine);
619
620 // don't care about the type (only URLs can be found in the cells)
621 SvxFieldData* pField = aTempEngine.FindByPos(
622 aSelection.nStartPara, aSelection.nStartPos, text::textfield::Type::UNSPECIFIED);
623 OSL_ENSURE(pField,"setPropertyValue: Field not found");
624 if (!pField)
625 return;
626
627 if (pField->GetClassId() != text::textfield::Type::URL)
628 // Make sure this is indeed a URL field.
629 return;
630
631 SvxURLField* pURL = static_cast<SvxURLField*>(pField);
632
633 if (rName == SC_UNONAME_URL)
634 {
635 if (rVal >>= aStrVal)
636 pURL->SetURL(aStrVal);
637 }
638 else if (rName == SC_UNONAME_REPR)
639 {
640 if (rVal >>= aStrVal)
641 pURL->SetRepresentation(aStrVal);
642 }
643 else if (rName == SC_UNONAME_TARGET)
644 {
645 if (rVal >>= aStrVal)
646 pURL->SetTargetFrame(aStrVal);
647 }
648 else
649 throw beans::UnknownPropertyException(rName);
650
651 pEditEngine->QuickInsertField( SvxFieldItem(*pField, EE_FEATURE_FIELD), aSelection );
652 mpEditSource->UpdateData();
653 return;
654 }
655
656 // Edit engine instance not yet present. Store the item data for later use.
657 SvxURLField& rData = static_cast<SvxURLField&>(getData());
658 if (rName == SC_UNONAME_URL)
659 {
660 if (rVal >>= aStrVal)
661 rData.SetURL(aStrVal);
662 }
663 else if (rName == SC_UNONAME_REPR)
664 {
665 if (rVal >>= aStrVal)
666 rData.SetRepresentation(aStrVal);
667 }
668 else if (rName == SC_UNONAME_TARGET)
669 {
670 if (rVal >>= aStrVal)
671 rData.SetTargetFrame(aStrVal);
672 }
673 else
674 throw beans::UnknownPropertyException(rName);
675}
676
678{
679 uno::Any aRet;
680
681 // anchor type is always "as character", text wrap always "none"
682
683 if (mpEditSource)
684 {
686 ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
687 ScUnoEditEngine aTempEngine(pEditEngine);
688
689 // don't care about the type (only URLs can be found in the cells)
690 const SvxFieldData* pField = aTempEngine.FindByPos(
691 aSelection.nStartPara, aSelection.nStartPos, text::textfield::Type::UNSPECIFIED);
692 OSL_ENSURE(pField,"getPropertyValue: Field not found");
693 if (!pField)
694 throw uno::RuntimeException();
695
696 if (pField->GetClassId() != text::textfield::Type::URL)
697 throw uno::RuntimeException();
698
699 const SvxURLField* pURL = static_cast<const SvxURLField*>(pField);
700
701 if (rName == SC_UNONAME_URL)
702 aRet <<= pURL->GetURL();
703 else if (rName == SC_UNONAME_REPR)
704 aRet <<= pURL->GetRepresentation();
705 else if (rName == SC_UNONAME_TARGET)
706 aRet <<= pURL->GetTargetFrame();
707 else
708 throw beans::UnknownPropertyException(rName);
709 }
710 else // not inserted yet
711 {
712 const SvxURLField& rURL = static_cast<const SvxURLField&>(getData());
713
714 if (rName == SC_UNONAME_URL)
715 aRet <<= rURL.GetURL();
716 else if (rName == SC_UNONAME_REPR)
717 aRet <<= rURL.GetRepresentation();
718 else if (rName == SC_UNONAME_TARGET)
719 aRet <<= rURL.GetTargetFrame();
720 else
721 throw beans::UnknownPropertyException(rName);
722 }
723 return aRet;
724}
725
726void ScEditFieldObj::setPropertyValueFile(const OUString& rName, const uno::Any& rVal)
727{
728 if (rName != SC_UNONAME_FILEFORM)
729 throw beans::UnknownPropertyException(rName);
730
731 sal_Int16 nIntVal = 0;
732 if (!(rVal >>= nIntVal))
733 return;
734
735 SvxFileFormat eFormat = lcl_UnoToSvxFileFormat(nIntVal);
736 if (mpEditSource)
737 {
738 ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
739 ScUnoEditEngine aTempEngine(pEditEngine);
740 SvxFieldData* pField = aTempEngine.FindByPos(
741 aSelection.nStartPara, aSelection.nStartPos, text::textfield::Type::EXTENDED_FILE);
742 OSL_ENSURE(pField, "setPropertyValueFile: Field not found");
743 if (pField)
744 {
745 SvxExtFileField* pExtFile = static_cast<SvxExtFileField*>(pField); // local to the ScUnoEditEngine
746 pExtFile->SetFormat(eFormat);
748 mpEditSource->UpdateData();
749 }
750 }
751 else
752 {
753 SvxExtFileField& rExtFile = static_cast<SvxExtFileField&>(getData());
754 rExtFile.SetFormat(eFormat);
755 }
756
757}
758
760{
761 uno::Any aRet;
762 if (rName != SC_UNONAME_FILEFORM)
763 throw beans::UnknownPropertyException(rName);
764
765 SvxFileFormat eFormat = SvxFileFormat::NameAndExt;
766 const SvxFieldData* pField = nullptr;
767 if (mpEditSource)
768 {
769 ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
770 ScUnoEditEngine aTempEngine(pEditEngine);
771 pField = aTempEngine.FindByPos(
772 aSelection.nStartPara, aSelection.nStartPos, text::textfield::Type::EXTENDED_FILE);
773 }
774 else
775 pField = &getData();
776
777 OSL_ENSURE(pField, "setPropertyValueFile: Field not found");
778 if (!pField)
779 throw uno::RuntimeException();
780
781 const SvxExtFileField* pExtFile = static_cast<const SvxExtFileField*>(pField);
782 eFormat = pExtFile->GetFormat();
783 sal_Int16 nIntVal = lcl_SvxToUnoFileFormat(eFormat);
784 aRet <<= nIntVal;
785
786 return aRet;
787}
788
789void ScEditFieldObj::setPropertyValueDateTime(const OUString& rName, const uno::Any& rVal)
790{
791 if (mpEditSource)
792 {
793 // Field already inserted.
794 ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
795 ScUnoEditEngine aTempEngine(pEditEngine);
796 SvxFieldData* pField = aTempEngine.FindByPos(aSelection.nStartPara, aSelection.nStartPos, meType);
797 if (!pField)
798 return;
799
800 switch (meType)
801 {
803 {
804 SvxDateField* p = static_cast<SvxDateField*>(pField);
805 if (rName == SC_UNONAME_ISDATE)
806 {
807 // Do nothing for now.
808 }
809 else if (rName == SC_UNONAME_ISFIXED)
810 {
811 SvxDateType eType = rVal.get<bool>() ? SvxDateType::Fix : SvxDateType::Var;
812 p->SetType(eType);
813 }
814 else if (rName == SC_UNONAME_DATETIME)
815 {
816 maDateTime = rVal.get<util::DateTime>();
817 Date aDate(maDateTime.Day, maDateTime.Month, maDateTime.Year);
818 p->SetFixDate(aDate);
819 }
820 else if (rName == SC_UNONAME_NUMFMT)
821 {
822 mnNumFormat = rVal.get<sal_Int32>();
823 p->SetFormat(static_cast<SvxDateFormat>(mnNumFormat));
824 }
825 else
826 throw beans::UnknownPropertyException(rName);
827 }
828 break;
829 case text::textfield::Type::TIME:
830 {
831 // SvxTimeField doesn't have any attributes.
832 if (rName != SC_UNONAME_ISDATE && rName != SC_UNONAME_ISFIXED &&
833 rName != SC_UNONAME_DATETIME && rName != SC_UNONAME_NUMFMT)
834 throw beans::UnknownPropertyException(rName);
835 }
836 break;
837 case text::textfield::Type::EXTENDED_TIME:
838 {
839 SvxExtTimeField* p = static_cast<SvxExtTimeField*>(pField);
840 if (rName == SC_UNONAME_ISDATE)
841 {
842 // Do nothing for now.
843 }
844 else if (rName == SC_UNONAME_ISFIXED)
845 {
846 SvxTimeType eType = rVal.get<bool>() ? SvxTimeType::Fix : SvxTimeType::Var;
847 p->SetType(eType);
848 }
849 else if (rName == SC_UNONAME_DATETIME)
850 {
851 maDateTime = rVal.get<util::DateTime>();
852 tools::Time aTime(maDateTime);
853 p->SetFixTime(aTime);
854 }
855 else if (rName == SC_UNONAME_NUMFMT)
856 {
857 mnNumFormat = rVal.get<sal_Int32>();
858 p->SetFormat(static_cast<SvxTimeFormat>(mnNumFormat));
859 }
860 else
861 throw beans::UnknownPropertyException(rName);
862 }
863 break;
864 default:
865 throw beans::UnknownPropertyException(rName);
866 }
867 }
868 else
869 {
870 if (rName == SC_UNONAME_ISDATE)
871 mbIsDate = rVal.get<bool>();
872 else if (rName == SC_UNONAME_ISFIXED)
873 mbIsFixed = rVal.get<bool>();
874 else if (rName == SC_UNONAME_DATETIME)
875 maDateTime = rVal.get<util::DateTime>();
876 else if (rName == SC_UNONAME_NUMFMT)
877 mnNumFormat = rVal.get<sal_Int32>();
878 else
879 throw beans::UnknownPropertyException(rName);
880 }
881}
882
884{
885 if (mpEditSource)
886 {
887 // Field already inserted.
888 ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
889 ScUnoEditEngine aTempEngine(pEditEngine);
890 SvxFieldData* pField = aTempEngine.FindByPos(aSelection.nStartPara, aSelection.nStartPos, meType);
891 if (!pField)
892 throw uno::RuntimeException();
893
894 switch (meType)
895 {
897 {
898 SvxDateField* p = static_cast<SvxDateField*>(pField);
899 if (rName == SC_UNONAME_ISDATE)
900 return uno::Any(true);
901
902 if (rName == SC_UNONAME_ISFIXED)
903 return uno::Any(p->GetType() == SvxDateType::Fix);
904
905 if (rName == SC_UNONAME_DATETIME)
906 {
907 Date aD(p->GetFixDate());
908 maDateTime.Year = aD.GetYear();
909 maDateTime.Month = aD.GetMonth();
910 maDateTime.Day = aD.GetDay();
911 maDateTime.Hours = 0;
912 maDateTime.Minutes = 0;
913 maDateTime.Seconds = 0;
914 maDateTime.NanoSeconds = 0;
915 return uno::Any(maDateTime);
916 }
917
918 if (rName == SC_UNONAME_NUMFMT)
919 return uno::Any(static_cast<sal_Int32>(p->GetFormat()));
920 }
921 break;
922 case text::textfield::Type::TIME:
923 {
924 // SvxTimeField doesn't have any attributes.
925 if (rName == SC_UNONAME_ISDATE)
926 return uno::Any(false);
927
928 if (rName == SC_UNONAME_ISFIXED)
929 return uno::Any(false);
930
931 if (rName == SC_UNONAME_DATETIME)
932 // This is the best we can do.
933 return uno::Any(maDateTime);
934
935 if (rName == SC_UNONAME_NUMFMT)
936 // Same as above.
937 return uno::Any(sal_Int32(0));
938 }
939 break;
940 case text::textfield::Type::EXTENDED_TIME:
941 {
942 SvxExtTimeField* p = static_cast<SvxExtTimeField*>(pField);
943 if (rName == SC_UNONAME_ISDATE)
944 return uno::Any(false);
945
946 if (rName == SC_UNONAME_ISFIXED)
947 return uno::Any(p->GetType() == SvxTimeType::Fix);
948
949 if (rName == SC_UNONAME_DATETIME)
950 {
951 tools::Time aT(p->GetFixTime());
952 maDateTime.Year = 0;
953 maDateTime.Month = 0;
954 maDateTime.Day = 0;
955 maDateTime.Hours = aT.GetHour();
956 maDateTime.Minutes = aT.GetMin();
957 maDateTime.Seconds = aT.GetSec();
958 maDateTime.NanoSeconds = aT.GetNanoSec();
959 return uno::Any(maDateTime);
960 }
961
962 if (rName == SC_UNONAME_NUMFMT)
963 return uno::Any(static_cast<sal_Int32>(p->GetFormat()));
964 }
965 break;
966 default:
967 ;
968 }
969 }
970 else
971 {
972 if (rName == SC_UNONAME_ISDATE)
973 return uno::Any(mbIsDate);
974
975 if (rName == SC_UNONAME_ISFIXED)
976 return uno::Any(mbIsFixed);
977
978 if (rName == SC_UNONAME_DATETIME)
979 return uno::Any(maDateTime);
980
981 if (rName == SC_UNONAME_NUMFMT)
982 return uno::Any(mnNumFormat);
983 }
984
985 throw beans::UnknownPropertyException(rName);
986}
987
988void ScEditFieldObj::setPropertyValueSheet(const OUString& rName, const uno::Any& rVal)
989{
990 if (mpEditSource)
991 {
992 // Edit engine instance already exists for this field item. Use it.
993 ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
994 ScUnoEditEngine aTempEngine(pEditEngine);
995
996 // don't care about the type (only URLs can be found in the cells)
997 SvxFieldData* pField = aTempEngine.FindByPos(
998 aSelection.nStartPara, aSelection.nStartPos, text::textfield::Type::UNSPECIFIED);
999 OSL_ENSURE(pField,"setPropertyValue: Field not found");
1000 if (!pField)
1001 return;
1002
1004 // Make sure this is indeed a URL field.
1005 return;
1006
1007 SvxTableField* p = static_cast<SvxTableField*>(pField);
1008
1009 if (rName != SC_UNONAME_TABLEPOS)
1010 throw beans::UnknownPropertyException(rName);
1011
1012 sal_Int32 nTab = rVal.get<sal_Int32>();
1013 p->SetTab(nTab);
1014
1015
1017 mpEditSource->UpdateData();
1018 return;
1019 }
1020
1021 // Edit engine instance not yet present. Store the item data for later use.
1022 SvxTableField& r = static_cast<SvxTableField&>(getData());
1023 if (rName != SC_UNONAME_TABLEPOS)
1024 throw beans::UnknownPropertyException(rName);
1025
1026 sal_Int32 nTab = rVal.get<sal_Int32>();
1027 r.SetTab(nTab);
1028}
1029
1031 uno::Reference<text::XTextRange> xContent,
1032 std::unique_ptr<ScEditSource> pEditSrc, sal_Int32 eType, const ESelection& rSel) :
1033 pPropSet(nullptr),
1034 mpEditSource(std::move(pEditSrc)),
1035 aSelection(rSel),
1036 meType(eType), mpContent(std::move(xContent)), mnNumFormat(0), mbIsDate(false), mbIsFixed(false)
1037{
1038 switch (meType)
1039 {
1040 case text::textfield::Type::DOCINFO_TITLE:
1041 pPropSet = getEmptyPropertySet();
1042 break;
1043 case text::textfield::Type::EXTENDED_FILE:
1044 pPropSet = lcl_GetFileFieldPropertySet();
1045 break;
1046 case text::textfield::Type::URL:
1047 pPropSet = lcl_GetURLPropertySet();
1048 break;
1050 case text::textfield::Type::TIME:
1051 case text::textfield::Type::EXTENDED_TIME:
1052 pPropSet = getDateTimePropertySet();
1053 break;
1054 default:
1055 pPropSet = lcl_GetHeaderFieldPropertySet();
1056 }
1057
1059 mbIsDate = true;
1060}
1061
1063 const uno::Reference<text::XTextRange>& rContent, std::unique_ptr<ScEditSource> pEditSrc, const ESelection& rSel)
1064{
1065 if (!mpEditSource)
1066 {
1067 mpContent = rContent;
1068 mpData.reset();
1069
1070 aSelection = rSel;
1071 mpEditSource = std::move( pEditSrc );
1072 }
1073}
1074
1076{
1077}
1078
1080{
1081 OSL_ENSURE( !mpEditSource, "CreateFieldItem with inserted field" );
1083}
1084
1086{
1087 if (mpEditSource)
1088 {
1089 SvxTextForwarder* pForwarder = mpEditSource->GetTextForwarder();
1090 pForwarder->QuickInsertText( OUString(), aSelection );
1091 mpEditSource->UpdateData();
1092
1095
1098 }
1099}
1100
1102{
1103 return mpEditSource != nullptr;
1104}
1105
1106// XTextField
1107
1108OUString SAL_CALL ScEditFieldObj::getPresentation( sal_Bool bShowCommand )
1109{
1110 SolarMutexGuard aGuard;
1111
1112 if (!mpEditSource)
1113 return OUString();
1114
1116 ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
1117 ScUnoEditEngine aTempEngine(pEditEngine);
1118
1119 // don't care about the type (only URLs can be found in the cells)
1120 const SvxFieldData* pField = aTempEngine.FindByPos(
1121 aSelection.nStartPara, aSelection.nStartPos, text::textfield::Type::UNSPECIFIED);
1122 OSL_ENSURE(pField,"getPresentation: Field not found");
1123 if (!pField)
1124 return OUString();
1125
1126 switch (meType)
1127 {
1128 case text::textfield::Type::URL:
1129 {
1130 if (pField->GetClassId() != text::textfield::Type::URL)
1131 // Not a URL field, but URL is expected.
1132 throw uno::RuntimeException();
1133
1134 const SvxURLField* pURL = static_cast<const SvxURLField*>(pField);
1135 return bShowCommand ? pURL->GetURL() : pURL->GetRepresentation();
1136 }
1137 break;
1138 default:
1139 ;
1140 }
1141 return OUString();
1142}
1143
1144// XTextContent
1145
1146void SAL_CALL ScEditFieldObj::attach( const uno::Reference<text::XTextRange>& xTextRange )
1147{
1148 SolarMutexGuard aGuard;
1149 if (xTextRange.is())
1150 {
1151 uno::Reference<text::XText> xText(xTextRange->getText());
1152 if (xText.is())
1153 {
1154 xText->insertTextContent( xTextRange, this, true );
1155 }
1156 }
1157}
1158
1159uno::Reference<text::XTextRange> SAL_CALL ScEditFieldObj::getAnchor()
1160{
1161 SolarMutexGuard aGuard;
1162 return mpContent;
1163}
1164
1165// XPropertySet
1166
1167uno::Reference<beans::XPropertySetInfo> SAL_CALL ScEditFieldObj::getPropertySetInfo()
1168{
1169 SolarMutexGuard aGuard;
1170 uno::Reference<beans::XPropertySetInfo> aRef = pPropSet->getPropertySetInfo();
1171 return aRef;
1172}
1173
1175 const OUString& aPropertyName, const uno::Any& aValue )
1176{
1177 SolarMutexGuard aGuard;
1178 if (aPropertyName == SC_UNONAME_ANCHOR)
1179 {
1180 aValue >>= mpContent;
1181 return;
1182 }
1183
1184 switch (meType)
1185 {
1186 case text::textfield::Type::URL:
1187 setPropertyValueURL(aPropertyName, aValue);
1188 break;
1189 case text::textfield::Type::EXTENDED_FILE:
1190 setPropertyValueFile(aPropertyName, aValue);
1191 break;
1193 case text::textfield::Type::TIME:
1194 case text::textfield::Type::EXTENDED_TIME:
1195 setPropertyValueDateTime(aPropertyName, aValue);
1196 break;
1198 setPropertyValueSheet(aPropertyName, aValue);
1199 break;
1200 case text::textfield::Type::DOCINFO_TITLE:
1201 default:
1202 throw beans::UnknownPropertyException(OUString::number(meType));
1203 }
1204}
1205
1206uno::Any SAL_CALL ScEditFieldObj::getPropertyValue( const OUString& aPropertyName )
1207{
1208 SolarMutexGuard aGuard;
1209 if (aPropertyName == SC_UNONAME_TEXTFIELD_TYPE)
1210 return uno::Any(meType);
1211
1212 if (aPropertyName == SC_UNONAME_ANCHOR)
1213 return uno::Any(mpContent);
1214
1215 if (aPropertyName == SC_UNONAME_ANCTYPE)
1216 {
1217 uno::Any aRet;
1218 aRet <<= text::TextContentAnchorType_AS_CHARACTER;
1219 return aRet;
1220 }
1221 if (aPropertyName == SC_UNONAME_ANCTYPES)
1222 {
1223 uno::Any aRet;
1224 uno::Sequence<text::TextContentAnchorType> aSeq { text::TextContentAnchorType_AS_CHARACTER };
1225 aRet <<= aSeq;
1226 return aRet;
1227 }
1228 if (aPropertyName == SC_UNONAME_TEXTWRAP)
1229 {
1230 uno::Any aRet;
1231 aRet <<= text::WrapTextMode_NONE;
1232 return aRet;
1233 }
1234
1235 switch (meType)
1236 {
1237 case text::textfield::Type::URL:
1238 return getPropertyValueURL(aPropertyName);
1239 case text::textfield::Type::EXTENDED_FILE:
1240 return getPropertyValueFile(aPropertyName);
1242 case text::textfield::Type::TIME:
1243 case text::textfield::Type::EXTENDED_TIME:
1244 return getPropertyValueDateTime(aPropertyName);
1245 case text::textfield::Type::DOCINFO_TITLE:
1246 default:
1247 throw beans::UnknownPropertyException(OUString::number(meType));
1248 }
1249}
1250
1252
1253// XServiceInfo
1254
1255OUString SAL_CALL ScEditFieldObj::getImplementationName()
1256{
1257 return "ScEditFieldObj";
1258}
1259
1260sal_Bool SAL_CALL ScEditFieldObj::supportsService( const OUString& rServiceName )
1261{
1262 return cppu::supportsService(this, rServiceName);
1263}
1264
1265uno::Sequence<OUString> SAL_CALL ScEditFieldObj::getSupportedServiceNames()
1266{
1267 return {"com.sun.star.text.TextField",
1268 "com.sun.star.text.TextContent"};
1269}
1270
1271uno::Sequence<uno::Type> SAL_CALL ScEditFieldObj::getTypes()
1272{
1275 uno::Sequence<uno::Type>
1276 {
1281 } );
1282}
1283
1284uno::Sequence<sal_Int8> SAL_CALL ScEditFieldObj::getImplementationId()
1285{
1286 return css::uno::Sequence<sal_Int8>();
1287}
1288
1289/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _ADOIndex Index
AnyEventRef aEvent
sal_Int16 GetYear() const
sal_uInt16 GetDay() const
sal_uInt16 GetMonth() const
virtual OUString CalcFieldValue(const SvxFieldItem &rField, sal_Int32 nPara, sal_Int32 nPos, std::optional< Color > &rTxtColor, std::optional< Color > &rFldColor, std::optional< FontLineStyle > &rFldLineStyle)
std::unique_ptr< EditTextObject > CreateTextObject()
void QuickInsertField(const SvxFieldItem &rFld, const ESelection &rSel)
Data (incl.
Definition: editsrc.hxx:74
ScDocShell * pDocShell
Definition: fielduno.hxx:59
virtual void SAL_CALL removeRefreshListener(const css::uno::Reference< css::util::XRefreshListener > &l) override
Definition: fielduno.cxx:407
virtual ~ScCellFieldsObj() override
Definition: fielduno.cxx:277
virtual void SAL_CALL refresh() override
Definition: fielduno.cxx:386
css::uno::Reference< css::text::XTextField > GetObjectByIndex_Impl(sal_Int32 Index) const
Definition: fielduno.cxx:316
comphelper::OInterfaceContainerHelper4< css::util::XRefreshListener > maRefreshListeners
List of refresh listeners.
Definition: fielduno.hxx:63
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: fielduno.cxx:367
std::unique_ptr< ScEditSource > mpEditSource
Definition: fielduno.hxx:61
virtual void SAL_CALL removeContainerListener(const css::uno::Reference< css::container::XContainerListener > &xListener) override
Definition: fielduno.cxx:379
ScCellFieldsObj(css::uno::Reference< css::text::XTextRange > xContent, ScDocShell *pDocSh, const ScAddress &rPos)
Definition: fielduno.cxx:265
virtual sal_Bool SAL_CALL hasElements() override
Definition: fielduno.cxx:361
virtual void SAL_CALL addRefreshListener(const css::uno::Reference< css::util::XRefreshListener > &l) override
Definition: fielduno.cxx:398
ScAddress aCellPos
Definition: fielduno.hxx:60
css::uno::Reference< css::text::XTextRange > mxContent
Definition: fielduno.hxx:58
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
Definition: fielduno.cxx:346
virtual sal_Int32 SAL_CALL getCount() override
Definition: fielduno.cxx:335
virtual css::uno::Type SAL_CALL getElementType() override
Definition: fielduno.cxx:356
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: fielduno.cxx:300
virtual void SAL_CALL addContainerListener(const css::uno::Reference< css::container::XContainerListener > &xListener) override
Definition: fielduno.cxx:373
std::mutex aMutex
mutex to lock the InterfaceContainerHelper
Definition: fielduno.hxx:65
const ScDocument & GetDocument() const
Definition: docsh.hxx:219
void AddUnoObject(SfxListener &rObject)
Definition: documen3.cxx:901
void RemoveUnoObject(SfxListener &rObject)
Definition: documen3.cxx:909
std::unique_ptr< ScEditSource > mpEditSource
Definition: fielduno.hxx:170
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: fielduno.cxx:1167
const SfxItemPropertySet * pPropSet
Definition: fielduno.hxx:169
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: fielduno.cxx:1265
css::uno::Any getPropertyValueDateTime(const OUString &rName)
Definition: fielduno.cxx:883
void InitDoc(const css::uno::Reference< css::text::XTextRange > &rContent, std::unique_ptr< ScEditSource > pEditSrc, const ESelection &rSel)
Definition: fielduno.cxx:1062
SvxFieldData & getData()
Definition: fielduno.cxx:564
sal_Int32 mnNumFormat
Definition: fielduno.hxx:178
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override
Definition: fielduno.cxx:1159
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: fielduno.cxx:1174
css::uno::Reference< css::text::XTextRange > mpContent
Definition: fielduno.hxx:175
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: fielduno.cxx:1206
css::util::DateTime maDateTime
Definition: fielduno.hxx:177
void DeleteField()
Definition: fielduno.cxx:1085
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: fielduno.cxx:1271
std::unique_ptr< SvxFieldData > mpData
Definition: fielduno.hxx:174
ScEditFieldObj()=delete
void setPropertyValueDateTime(const OUString &rName, const css::uno::Any &rVal)
Definition: fielduno.cxx:789
virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > &xTextRange) override
Definition: fielduno.cxx:1146
css::uno::Any getPropertyValueURL(const OUString &rName)
Definition: fielduno.cxx:677
css::uno::Any getPropertyValueFile(const OUString &rName)
Definition: fielduno.cxx:759
void setPropertyValueSheet(const OUString &rName, const css::uno::Any &rVal)
Definition: fielduno.cxx:988
virtual OUString SAL_CALL getPresentation(sal_Bool bShowCommand) override
Definition: fielduno.cxx:1108
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: fielduno.cxx:1260
void setPropertyValueURL(const OUString &rName, const css::uno::Any &rVal)
Definition: fielduno.cxx:611
SvxFieldItem CreateFieldItem()
Definition: fielduno.cxx:1079
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: fielduno.cxx:1284
ESelection aSelection
Definition: fielduno.hxx:171
bool IsInserted() const
Definition: fielduno.cxx:1101
sal_Int32 meType
Definition: fielduno.hxx:173
virtual ~ScEditFieldObj() override
Definition: fielduno.cxx:1075
void setPropertyValueFile(const OUString &rName, const css::uno::Any &rVal)
Definition: fielduno.cxx:726
virtual css::uno::Type SAL_CALL getElementType() override
Definition: fielduno.cxx:504
std::mutex aMutex
mutex to lock the InterfaceContainerHelper
Definition: fielduno.hxx:119
virtual void SAL_CALL addContainerListener(const css::uno::Reference< css::container::XContainerListener > &xListener) override
Definition: fielduno.cxx:521
virtual sal_Bool SAL_CALL hasElements() override
Definition: fielduno.cxx:509
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
Definition: fielduno.cxx:494
ScHeaderFieldsObj(ScHeaderFooterTextData &rData)
Definition: fielduno.cxx:416
ScHeaderFooterTextData & mrData
Definition: fielduno.hxx:113
virtual void SAL_CALL addRefreshListener(const css::uno::Reference< css::util::XRefreshListener > &l) override
Definition: fielduno.cxx:546
css::uno::Reference< css::text::XTextField > GetObjectByIndex_Impl(sal_Int32 Index) const
Definition: fielduno.cxx:440
virtual sal_Int32 SAL_CALL getCount() override
Definition: fielduno.cxx:484
virtual void SAL_CALL removeRefreshListener(const css::uno::Reference< css::util::XRefreshListener > &l) override
Definition: fielduno.cxx:555
virtual void SAL_CALL refresh() override
Definition: fielduno.cxx:534
virtual ~ScHeaderFieldsObj() override
Definition: fielduno.cxx:422
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: fielduno.cxx:515
std::unique_ptr< ScEditSource > mpEditSource
Definition: fielduno.hxx:114
comphelper::OInterfaceContainerHelper4< css::util::XRefreshListener > maRefreshListeners
List of refresh listeners.
Definition: fielduno.hxx:117
virtual void SAL_CALL removeContainerListener(const css::uno::Reference< css::container::XContainerListener > &xListener) override
Definition: fielduno.cxx:527
static rtl::Reference< ScHeaderFooterContentObj > getImplementation(const css::uno::Reference< css::sheet::XHeaderFooterContent > &rObj)
Definition: textuno.cxx:130
ScHeaderFooterTextObj keeps the authoritative copy of ScHeaderFooterTextData that this class holds re...
Definition: editsrc.hxx:50
ScHeaderFooterPart GetPart() const
Definition: textuno.hxx:118
css::uno::Reference< css::sheet::XHeaderFooterContent > GetContentObj() const
Definition: textuno.hxx:119
SfxHintId GetId() const
css::uno::Reference< css::beans::XPropertySetInfo > const & getPropertySetInfo() const
SvxFileFormat GetFormat() const
void SetFormat(SvxFileFormat eFmt)
virtual std::unique_ptr< SvxFieldData > Clone() const
virtual sal_Int32 GetClassId() const
const SvxFieldData * GetField() const
void SetTab(int nTab)
virtual void QuickInsertText(const OUString &rText, const ESelection &rSel)=0
const OUString & GetRepresentation() const
void SetTargetFrame(const OUString &rFrm)
const OUString & GetTargetFrame() const
void SetURL(const OUString &rURL)
const OUString & GetURL() const
void SetRepresentation(const OUString &rRep)
sal_Int32 addInterface(std::unique_lock< std::mutex > &rGuard, const css::uno::Reference< ListenerT > &rxIFace)
void notifyEach(std::unique_lock< std::mutex > &rGuard, void(SAL_CALL ListenerT::*NotificationMethod)(const EventT &), const EventT &Event) const
void disposeAndClear(::std::unique_lock<::std::mutex > &rGuard, const css::lang::EventObject &rEvt)
sal_Int32 getLength(std::unique_lock< std::mutex > &rGuard) const
sal_Int32 removeInterface(std::unique_lock< std::mutex > &rGuard, const css::uno::Reference< ListenerT > &rxIFace)
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
css::uno::Type const & get()
sal_uInt16 GetSec() const
sal_uInt16 GetMin() const
sal_uInt16 GetHour() const
sal_uInt32 GetNanoSec() const
ULONG m_refCount
constexpr TypedWhichId< SvxFieldItem > EE_FEATURE_FIELD(EE_FEATURE_NOTCONV+1)
SvxFileFormat
SvxTimeFormat
SvxTimeType
SvxDateType
SvxDateFormat
DocumentType eType
sal_Int32 nIndex
Mode eMode
void * p
sal_uInt16 nPos
Sequence< sal_Int8 > aSeq
std::unique_ptr< sal_Int32[]> pData
#define SC_SIMPLE_SERVICE_INFO(ClassName, ClassNameAscii, ServiceAscii)
Definition: miscuno.hxx:63
#define SC_IMPL_DUMMY_PROPERTY_LISTENER(ClassName)
Definition: miscuno.hxx:72
def text(shape, orig_st)
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &... rSn)
Type
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
HashMap_OWString_Interface aMap
ObjectFormatterData & mrData
QPRO_FUNC_TYPE nType
Definition: qproform.cxx:398
sal_Int32 nStartPara
sal_Int32 nEndPos
sal_Int32 nStartPos
sal_Int32 nEndPara
unsigned char sal_Bool
constexpr OUStringLiteral SC_UNONAME_TABLEPOS
Definition: unonames.hxx:348
constexpr OUStringLiteral SC_UNONAME_NUMFMT
Definition: unonames.hxx:109
constexpr OUStringLiteral SC_UNONAME_FILEFORM
Definition: unonames.hxx:334
constexpr OUStringLiteral SC_UNONAME_REPR
Definition: unonames.hxx:338
constexpr OUStringLiteral SC_UNONAME_ANCHOR
Definition: unonames.hxx:202
constexpr OUStringLiteral SC_UNONAME_ANCTYPES
Definition: unonames.hxx:332
constexpr OUStringLiteral SC_UNONAME_ANCTYPE
Definition: unonames.hxx:331
constexpr OUStringLiteral SC_UNONAME_URL
Definition: unonames.hxx:340
constexpr OUStringLiteral SC_UNONAME_TARGET
Definition: unonames.hxx:339
constexpr OUStringLiteral SC_UNONAME_ISDATE
Definition: unonames.hxx:343
constexpr OUStringLiteral SC_UNONAME_TEXTFIELD_TYPE
Definition: unonames.hxx:335
constexpr OUStringLiteral SC_UNONAME_ISFIXED
Definition: unonames.hxx:344
constexpr OUStringLiteral SC_UNONAME_TEXTWRAP
Definition: unonames.hxx:333
constexpr OUStringLiteral SC_UNONAME_DATETIME
Definition: unonames.hxx:345
RedlineType meType
@ TABLE
Definition: xmldpimp.hxx:43