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 ) 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 )
200{
201 OUString aRet(EditEngine::CalcFieldValue( rField, nPara, nPos, rTxtColor, rFldColor ));
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{
280
281 if (pDocShell)
283
284 mpEditSource.reset();
285
286 // increment refcount to prevent double call off dtor
287 osl_atomic_increment( &m_refCount );
288
290 {
291 lang::EventObject aEvent;
292 aEvent.Source.set(static_cast<cppu::OWeakObject*>(this));
293 mpRefreshListeners->disposeAndClear(aEvent);
294 mpRefreshListeners.reset();
295 }
296}
297
299{
300 if ( dynamic_cast<const ScUpdateRefHint*>(&rHint) )
301 {
303 }
304 else if ( rHint.GetId() == SfxHintId::Dying )
305 {
306 pDocShell = nullptr; // became invalid
307 }
308
309 // EditSource registered itself as a listener
310}
311
312// XIndexAccess (via XTextFields)
313
314uno::Reference<text::XTextField> ScCellFieldsObj::GetObjectByIndex_Impl(sal_Int32 Index) const
315{
317 ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
318 ScUnoEditEngine aTempEngine(pEditEngine);
319 SvxFieldData* pData = aTempEngine.FindByIndex(static_cast<sal_uInt16>(Index));
320 if (!pData)
321 return uno::Reference<text::XTextField>();
322
323 sal_Int32 nPar = aTempEngine.GetFieldPar();
324 sal_Int32 nPos = aTempEngine.GetFieldPos();
325 ESelection aSelection( nPar, nPos, nPar, nPos+1 ); // Field size is 1 character
326
327 sal_Int32 eType = pData->GetClassId();
328 uno::Reference<text::XTextField> xRet(
329 new ScEditFieldObj(mxContent, std::make_unique<ScCellEditSource>(pDocShell, aCellPos), eType, aSelection));
330 return xRet;
331}
332
333sal_Int32 SAL_CALL ScCellFieldsObj::getCount()
334{
335 SolarMutexGuard aGuard;
336
338 ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
339 ScUnoEditEngine aTempEngine(pEditEngine);
340
341 return aTempEngine.CountFields(); // count the fields, we don't care about their type in the cell
342}
343
344uno::Any SAL_CALL ScCellFieldsObj::getByIndex( sal_Int32 nIndex )
345{
346 SolarMutexGuard aGuard;
347 uno::Reference<text::XTextField> xField(GetObjectByIndex_Impl(nIndex));
348 if (!xField.is())
349 throw lang::IndexOutOfBoundsException();
350
351 return uno::Any(xField);
352}
353
355{
357}
358
360{
361 SolarMutexGuard aGuard;
362 return ( getCount() != 0 );
363}
364
365uno::Reference<container::XEnumeration> SAL_CALL ScCellFieldsObj::createEnumeration()
366{
367 SolarMutexGuard aGuard;
368 return new ScIndexEnumeration(this, "com.sun.star.text.TextFieldEnumeration");
369}
370
372 const uno::Reference<container::XContainerListener>& /* xListener */ )
373{
374 OSL_FAIL("not implemented");
375}
376
378 const uno::Reference<container::XContainerListener>& /* xListener */ )
379{
380 OSL_FAIL("not implemented");
381}
382
383// XRefreshable
385{
387 {
388 // Call all listeners.
389 lang::EventObject aEvent;
390 aEvent.Source.set(uno::Reference< util::XRefreshable >(this));
391 mpRefreshListeners->notifyEach( &util::XRefreshListener::refreshed, aEvent );
392 }
393}
394
395void SAL_CALL ScCellFieldsObj::addRefreshListener( const uno::Reference< util::XRefreshListener >& xListener )
396{
397 if (xListener.is())
398 {
399 SolarMutexGuard aGuard;
402 mpRefreshListeners->addInterface(xListener);
403 }
404}
405
406void SAL_CALL ScCellFieldsObj::removeRefreshListener( const uno::Reference<util::XRefreshListener >& xListener )
407{
408 if (xListener.is())
409 {
410 SolarMutexGuard aGuard;
412 mpRefreshListeners->removeInterface(xListener);
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 off dtor
427 osl_atomic_increment( &m_refCount );
428
430 {
431 lang::EventObject aEvent;
432 aEvent.Source = static_cast<cppu::OWeakObject*>(this);
433 mpRefreshListeners->disposeAndClear(aEvent);
434 mpRefreshListeners.reset();
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{
537 {
538 // Call all listeners.
539 lang::EventObject aEvent;
540 aEvent.Source.set(uno::Reference< util::XRefreshable >(this));
541 mpRefreshListeners->notifyEach( &util::XRefreshListener::refreshed, aEvent);
542 }
543}
544
545void SAL_CALL ScHeaderFieldsObj::addRefreshListener( const uno::Reference< util::XRefreshListener >& xListener )
546{
547 if (xListener.is())
548 {
549 SolarMutexGuard aGuard;
552 mpRefreshListeners->addInterface(xListener);
553 }
554}
555
556void SAL_CALL ScHeaderFieldsObj::removeRefreshListener( const uno::Reference<util::XRefreshListener >& xListener )
557{
558 if (xListener.is())
559 {
560 SolarMutexGuard aGuard;
562 mpRefreshListeners->removeInterface(xListener);
563 }
564}
565
567{
568 if (!mpData)
569 {
570 switch (meType)
571 {
573 mpData.reset(new SvxDateField);
574 break;
575 case text::textfield::Type::EXTENDED_FILE:
576 mpData.reset(
577 new SvxExtFileField(OUString(), SvxFileType::Var, SvxFileFormat::NameAndExt));
578 break;
579 case text::textfield::Type::PAGE:
580 mpData.reset(new SvxPageField);
581 break;
582 case text::textfield::Type::PAGES:
583 mpData.reset(new SvxPagesField);
584 break;
586 mpData.reset(new SvxTableField);
587 break;
588 case text::textfield::Type::TIME:
589 mpData.reset(new SvxTimeField);
590 break;
591 case text::textfield::Type::EXTENDED_TIME:
592 {
593 if (mbIsDate)
594 mpData.reset(new SvxDateField);
595 else
596 mpData.reset(new SvxExtTimeField);
597 }
598 break;
599 case text::textfield::Type::DOCINFO_TITLE:
600 mpData.reset(new SvxFileField);
601 break;
602 case text::textfield::Type::URL:
603 mpData.reset(
604 new SvxURLField(OUString(), OUString(), SvxURLFormat::AppDefault));
605 break;
606 default:
607 mpData.reset(new SvxFieldData);
608 }
609 }
610 return *mpData;
611}
612
613void ScEditFieldObj::setPropertyValueURL(const OUString& rName, const css::uno::Any& rVal)
614{
615 OUString aStrVal;
616 if (mpEditSource)
617 {
618 // Edit engine instance already exists for this field item. Use it.
619 ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
620 ScUnoEditEngine aTempEngine(pEditEngine);
621
622 // don't care about the type (only URLs can be found in the cells)
623 SvxFieldData* pField = aTempEngine.FindByPos(
624 aSelection.nStartPara, aSelection.nStartPos, text::textfield::Type::UNSPECIFIED);
625 OSL_ENSURE(pField,"setPropertyValue: Field not found");
626 if (!pField)
627 return;
628
629 if (pField->GetClassId() != text::textfield::Type::URL)
630 // Make sure this is indeed a URL field.
631 return;
632
633 SvxURLField* pURL = static_cast<SvxURLField*>(pField);
634
635 if (rName == SC_UNONAME_URL)
636 {
637 if (rVal >>= aStrVal)
638 pURL->SetURL(aStrVal);
639 }
640 else if (rName == SC_UNONAME_REPR)
641 {
642 if (rVal >>= aStrVal)
643 pURL->SetRepresentation(aStrVal);
644 }
645 else if (rName == SC_UNONAME_TARGET)
646 {
647 if (rVal >>= aStrVal)
648 pURL->SetTargetFrame(aStrVal);
649 }
650 else
651 throw beans::UnknownPropertyException(rName);
652
653 pEditEngine->QuickInsertField( SvxFieldItem(*pField, EE_FEATURE_FIELD), aSelection );
654 mpEditSource->UpdateData();
655 return;
656 }
657
658 // Edit engine instance not yet present. Store the item data for later use.
659 SvxURLField& rData = static_cast<SvxURLField&>(getData());
660 if (rName == SC_UNONAME_URL)
661 {
662 if (rVal >>= aStrVal)
663 rData.SetURL(aStrVal);
664 }
665 else if (rName == SC_UNONAME_REPR)
666 {
667 if (rVal >>= aStrVal)
668 rData.SetRepresentation(aStrVal);
669 }
670 else if (rName == SC_UNONAME_TARGET)
671 {
672 if (rVal >>= aStrVal)
673 rData.SetTargetFrame(aStrVal);
674 }
675 else
676 throw beans::UnknownPropertyException(rName);
677}
678
680{
681 uno::Any aRet;
682
683 // anchor type is always "as character", text wrap always "none"
684
685 if (mpEditSource)
686 {
688 ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
689 ScUnoEditEngine aTempEngine(pEditEngine);
690
691 // don't care about the type (only URLs can be found in the cells)
692 const SvxFieldData* pField = aTempEngine.FindByPos(
693 aSelection.nStartPara, aSelection.nStartPos, text::textfield::Type::UNSPECIFIED);
694 OSL_ENSURE(pField,"getPropertyValue: Field not found");
695 if (!pField)
696 throw uno::RuntimeException();
697
698 if (pField->GetClassId() != text::textfield::Type::URL)
699 throw uno::RuntimeException();
700
701 const SvxURLField* pURL = static_cast<const SvxURLField*>(pField);
702
703 if (rName == SC_UNONAME_URL)
704 aRet <<= pURL->GetURL();
705 else if (rName == SC_UNONAME_REPR)
706 aRet <<= pURL->GetRepresentation();
707 else if (rName == SC_UNONAME_TARGET)
708 aRet <<= pURL->GetTargetFrame();
709 else
710 throw beans::UnknownPropertyException(rName);
711 }
712 else // not inserted yet
713 {
714 const SvxURLField& rURL = static_cast<const SvxURLField&>(getData());
715
716 if (rName == SC_UNONAME_URL)
717 aRet <<= rURL.GetURL();
718 else if (rName == SC_UNONAME_REPR)
719 aRet <<= rURL.GetRepresentation();
720 else if (rName == SC_UNONAME_TARGET)
721 aRet <<= rURL.GetTargetFrame();
722 else
723 throw beans::UnknownPropertyException(rName);
724 }
725 return aRet;
726}
727
728void ScEditFieldObj::setPropertyValueFile(const OUString& rName, const uno::Any& rVal)
729{
730 if (rName != SC_UNONAME_FILEFORM)
731 throw beans::UnknownPropertyException(rName);
732
733 sal_Int16 nIntVal = 0;
734 if (!(rVal >>= nIntVal))
735 return;
736
737 SvxFileFormat eFormat = lcl_UnoToSvxFileFormat(nIntVal);
738 if (mpEditSource)
739 {
740 ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
741 ScUnoEditEngine aTempEngine(pEditEngine);
742 SvxFieldData* pField = aTempEngine.FindByPos(
743 aSelection.nStartPara, aSelection.nStartPos, text::textfield::Type::EXTENDED_FILE);
744 OSL_ENSURE(pField, "setPropertyValueFile: Field not found");
745 if (pField)
746 {
747 SvxExtFileField* pExtFile = static_cast<SvxExtFileField*>(pField); // local to the ScUnoEditEngine
748 pExtFile->SetFormat(eFormat);
750 mpEditSource->UpdateData();
751 }
752 }
753 else
754 {
755 SvxExtFileField& rExtFile = static_cast<SvxExtFileField&>(getData());
756 rExtFile.SetFormat(eFormat);
757 }
758
759}
760
762{
763 uno::Any aRet;
764 if (rName != SC_UNONAME_FILEFORM)
765 throw beans::UnknownPropertyException(rName);
766
767 SvxFileFormat eFormat = SvxFileFormat::NameAndExt;
768 const SvxFieldData* pField = nullptr;
769 if (mpEditSource)
770 {
771 ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
772 ScUnoEditEngine aTempEngine(pEditEngine);
773 pField = aTempEngine.FindByPos(
774 aSelection.nStartPara, aSelection.nStartPos, text::textfield::Type::EXTENDED_FILE);
775 }
776 else
777 pField = &getData();
778
779 OSL_ENSURE(pField, "setPropertyValueFile: Field not found");
780 if (!pField)
781 throw uno::RuntimeException();
782
783 const SvxExtFileField* pExtFile = static_cast<const SvxExtFileField*>(pField);
784 eFormat = pExtFile->GetFormat();
785 sal_Int16 nIntVal = lcl_SvxToUnoFileFormat(eFormat);
786 aRet <<= nIntVal;
787
788 return aRet;
789}
790
791void ScEditFieldObj::setPropertyValueDateTime(const OUString& rName, const uno::Any& rVal)
792{
793 if (mpEditSource)
794 {
795 // Field already inserted.
796 ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
797 ScUnoEditEngine aTempEngine(pEditEngine);
798 SvxFieldData* pField = aTempEngine.FindByPos(aSelection.nStartPara, aSelection.nStartPos, meType);
799 if (!pField)
800 return;
801
802 switch (meType)
803 {
805 {
806 SvxDateField* p = static_cast<SvxDateField*>(pField);
807 if (rName == SC_UNONAME_ISDATE)
808 {
809 // Do nothing for now.
810 }
811 else if (rName == SC_UNONAME_ISFIXED)
812 {
813 SvxDateType eType = rVal.get<bool>() ? SvxDateType::Fix : SvxDateType::Var;
814 p->SetType(eType);
815 }
816 else if (rName == SC_UNONAME_DATETIME)
817 {
818 maDateTime = rVal.get<util::DateTime>();
819 Date aDate(maDateTime.Day, maDateTime.Month, maDateTime.Year);
820 p->SetFixDate(aDate);
821 }
822 else if (rName == SC_UNONAME_NUMFMT)
823 {
824 mnNumFormat = rVal.get<sal_Int32>();
825 p->SetFormat(static_cast<SvxDateFormat>(mnNumFormat));
826 }
827 else
828 throw beans::UnknownPropertyException(rName);
829 }
830 break;
831 case text::textfield::Type::TIME:
832 {
833 // SvxTimeField doesn't have any attributes.
834 if (rName != SC_UNONAME_ISDATE && rName != SC_UNONAME_ISFIXED &&
835 rName != SC_UNONAME_DATETIME && rName != SC_UNONAME_NUMFMT)
836 throw beans::UnknownPropertyException(rName);
837 }
838 break;
839 case text::textfield::Type::EXTENDED_TIME:
840 {
841 SvxExtTimeField* p = static_cast<SvxExtTimeField*>(pField);
842 if (rName == SC_UNONAME_ISDATE)
843 {
844 // Do nothing for now.
845 }
846 else if (rName == SC_UNONAME_ISFIXED)
847 {
848 SvxTimeType eType = rVal.get<bool>() ? SvxTimeType::Fix : SvxTimeType::Var;
849 p->SetType(eType);
850 }
851 else if (rName == SC_UNONAME_DATETIME)
852 {
853 maDateTime = rVal.get<util::DateTime>();
854 tools::Time aTime(maDateTime);
855 p->SetFixTime(aTime);
856 }
857 else if (rName == SC_UNONAME_NUMFMT)
858 {
859 mnNumFormat = rVal.get<sal_Int32>();
860 p->SetFormat(static_cast<SvxTimeFormat>(mnNumFormat));
861 }
862 else
863 throw beans::UnknownPropertyException(rName);
864 }
865 break;
866 default:
867 throw beans::UnknownPropertyException(rName);
868 }
869 }
870 else
871 {
872 if (rName == SC_UNONAME_ISDATE)
873 mbIsDate = rVal.get<bool>();
874 else if (rName == SC_UNONAME_ISFIXED)
875 mbIsFixed = rVal.get<bool>();
876 else if (rName == SC_UNONAME_DATETIME)
877 maDateTime = rVal.get<util::DateTime>();
878 else if (rName == SC_UNONAME_NUMFMT)
879 mnNumFormat = rVal.get<sal_Int32>();
880 else
881 throw beans::UnknownPropertyException(rName);
882 }
883}
884
886{
887 if (mpEditSource)
888 {
889 // Field already inserted.
890 ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
891 ScUnoEditEngine aTempEngine(pEditEngine);
892 SvxFieldData* pField = aTempEngine.FindByPos(aSelection.nStartPara, aSelection.nStartPos, meType);
893 if (!pField)
894 throw uno::RuntimeException();
895
896 switch (meType)
897 {
899 {
900 SvxDateField* p = static_cast<SvxDateField*>(pField);
901 if (rName == SC_UNONAME_ISDATE)
902 return uno::Any(true);
903
904 if (rName == SC_UNONAME_ISFIXED)
905 return uno::Any(p->GetType() == SvxDateType::Fix);
906
907 if (rName == SC_UNONAME_DATETIME)
908 {
909 Date aD(p->GetFixDate());
910 maDateTime.Year = aD.GetYear();
911 maDateTime.Month = aD.GetMonth();
912 maDateTime.Day = aD.GetDay();
913 maDateTime.Hours = 0;
914 maDateTime.Minutes = 0;
915 maDateTime.Seconds = 0;
916 maDateTime.NanoSeconds = 0;
917 return uno::Any(maDateTime);
918 }
919
920 if (rName == SC_UNONAME_NUMFMT)
921 return uno::Any(static_cast<sal_Int32>(p->GetFormat()));
922 }
923 break;
924 case text::textfield::Type::TIME:
925 {
926 // SvxTimeField doesn't have any attributes.
927 if (rName == SC_UNONAME_ISDATE)
928 return uno::Any(false);
929
930 if (rName == SC_UNONAME_ISFIXED)
931 return uno::Any(false);
932
933 if (rName == SC_UNONAME_DATETIME)
934 // This is the best we can do.
935 return uno::Any(maDateTime);
936
937 if (rName == SC_UNONAME_NUMFMT)
938 // Same as above.
939 return uno::Any(sal_Int32(0));
940 }
941 break;
942 case text::textfield::Type::EXTENDED_TIME:
943 {
944 SvxExtTimeField* p = static_cast<SvxExtTimeField*>(pField);
945 if (rName == SC_UNONAME_ISDATE)
946 return uno::Any(false);
947
948 if (rName == SC_UNONAME_ISFIXED)
949 return uno::Any(p->GetType() == SvxTimeType::Fix);
950
951 if (rName == SC_UNONAME_DATETIME)
952 {
953 tools::Time aT(p->GetFixTime());
954 maDateTime.Year = 0;
955 maDateTime.Month = 0;
956 maDateTime.Day = 0;
957 maDateTime.Hours = aT.GetHour();
958 maDateTime.Minutes = aT.GetMin();
959 maDateTime.Seconds = aT.GetSec();
960 maDateTime.NanoSeconds = aT.GetNanoSec();
961 return uno::Any(maDateTime);
962 }
963
964 if (rName == SC_UNONAME_NUMFMT)
965 return uno::Any(static_cast<sal_Int32>(p->GetFormat()));
966 }
967 break;
968 default:
969 ;
970 }
971 }
972 else
973 {
974 if (rName == SC_UNONAME_ISDATE)
975 return uno::Any(mbIsDate);
976
977 if (rName == SC_UNONAME_ISFIXED)
978 return uno::Any(mbIsFixed);
979
980 if (rName == SC_UNONAME_DATETIME)
981 return uno::Any(maDateTime);
982
983 if (rName == SC_UNONAME_NUMFMT)
984 return uno::Any(mnNumFormat);
985 }
986
987 throw beans::UnknownPropertyException(rName);
988}
989
990void ScEditFieldObj::setPropertyValueSheet(const OUString& rName, const uno::Any& rVal)
991{
992 if (mpEditSource)
993 {
994 // Edit engine instance already exists for this field item. Use it.
995 ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
996 ScUnoEditEngine aTempEngine(pEditEngine);
997
998 // don't care about the type (only URLs can be found in the cells)
999 SvxFieldData* pField = aTempEngine.FindByPos(
1000 aSelection.nStartPara, aSelection.nStartPos, text::textfield::Type::UNSPECIFIED);
1001 OSL_ENSURE(pField,"setPropertyValue: Field not found");
1002 if (!pField)
1003 return;
1004
1006 // Make sure this is indeed a URL field.
1007 return;
1008
1009 SvxTableField* p = static_cast<SvxTableField*>(pField);
1010
1011 if (rName != SC_UNONAME_TABLEPOS)
1012 throw beans::UnknownPropertyException(rName);
1013
1014 sal_Int32 nTab = rVal.get<sal_Int32>();
1015 p->SetTab(nTab);
1016
1017
1019 mpEditSource->UpdateData();
1020 return;
1021 }
1022
1023 // Edit engine instance not yet present. Store the item data for later use.
1024 SvxTableField& r = static_cast<SvxTableField&>(getData());
1025 if (rName != SC_UNONAME_TABLEPOS)
1026 throw beans::UnknownPropertyException(rName);
1027
1028 sal_Int32 nTab = rVal.get<sal_Int32>();
1029 r.SetTab(nTab);
1030}
1031
1033 uno::Reference<text::XTextRange> xContent,
1034 std::unique_ptr<ScEditSource> pEditSrc, sal_Int32 eType, const ESelection& rSel) :
1035 pPropSet(nullptr),
1036 mpEditSource(std::move(pEditSrc)),
1037 aSelection(rSel),
1038 meType(eType), mpContent(std::move(xContent)), mnNumFormat(0), mbIsDate(false), mbIsFixed(false)
1039{
1040 switch (meType)
1041 {
1042 case text::textfield::Type::DOCINFO_TITLE:
1043 pPropSet = getEmptyPropertySet();
1044 break;
1045 case text::textfield::Type::EXTENDED_FILE:
1046 pPropSet = lcl_GetFileFieldPropertySet();
1047 break;
1048 case text::textfield::Type::URL:
1049 pPropSet = lcl_GetURLPropertySet();
1050 break;
1052 case text::textfield::Type::TIME:
1053 case text::textfield::Type::EXTENDED_TIME:
1054 pPropSet = getDateTimePropertySet();
1055 break;
1056 default:
1057 pPropSet = lcl_GetHeaderFieldPropertySet();
1058 }
1059
1061 mbIsDate = true;
1062}
1063
1065 const uno::Reference<text::XTextRange>& rContent, std::unique_ptr<ScEditSource> pEditSrc, const ESelection& rSel)
1066{
1067 if (!mpEditSource)
1068 {
1069 mpContent = rContent;
1070 mpData.reset();
1071
1072 aSelection = rSel;
1073 mpEditSource = std::move( pEditSrc );
1074 }
1075}
1076
1078{
1079}
1080
1082{
1083 OSL_ENSURE( !mpEditSource, "CreateFieldItem with inserted field" );
1085}
1086
1088{
1089 if (mpEditSource)
1090 {
1091 SvxTextForwarder* pForwarder = mpEditSource->GetTextForwarder();
1092 pForwarder->QuickInsertText( OUString(), aSelection );
1093 mpEditSource->UpdateData();
1094
1097
1100 }
1101}
1102
1104{
1105 return mpEditSource != nullptr;
1106}
1107
1108// XTextField
1109
1110OUString SAL_CALL ScEditFieldObj::getPresentation( sal_Bool bShowCommand )
1111{
1112 SolarMutexGuard aGuard;
1113
1114 if (!mpEditSource)
1115 return OUString();
1116
1118 ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
1119 ScUnoEditEngine aTempEngine(pEditEngine);
1120
1121 // don't care about the type (only URLs can be found in the cells)
1122 const SvxFieldData* pField = aTempEngine.FindByPos(
1123 aSelection.nStartPara, aSelection.nStartPos, text::textfield::Type::UNSPECIFIED);
1124 OSL_ENSURE(pField,"getPresentation: Field not found");
1125 if (!pField)
1126 return OUString();
1127
1128 switch (meType)
1129 {
1130 case text::textfield::Type::URL:
1131 {
1132 if (pField->GetClassId() != text::textfield::Type::URL)
1133 // Not a URL field, but URL is expected.
1134 throw uno::RuntimeException();
1135
1136 const SvxURLField* pURL = static_cast<const SvxURLField*>(pField);
1137 return bShowCommand ? pURL->GetURL() : pURL->GetRepresentation();
1138 }
1139 break;
1140 default:
1141 ;
1142 }
1143 return OUString();
1144}
1145
1146// XTextContent
1147
1148void SAL_CALL ScEditFieldObj::attach( const uno::Reference<text::XTextRange>& xTextRange )
1149{
1150 SolarMutexGuard aGuard;
1151 if (xTextRange.is())
1152 {
1153 uno::Reference<text::XText> xText(xTextRange->getText());
1154 if (xText.is())
1155 {
1156 xText->insertTextContent( xTextRange, this, true );
1157 }
1158 }
1159}
1160
1161uno::Reference<text::XTextRange> SAL_CALL ScEditFieldObj::getAnchor()
1162{
1163 SolarMutexGuard aGuard;
1164 return mpContent;
1165}
1166
1167// XPropertySet
1168
1169uno::Reference<beans::XPropertySetInfo> SAL_CALL ScEditFieldObj::getPropertySetInfo()
1170{
1171 SolarMutexGuard aGuard;
1172 uno::Reference<beans::XPropertySetInfo> aRef = pPropSet->getPropertySetInfo();
1173 return aRef;
1174}
1175
1177 const OUString& aPropertyName, const uno::Any& aValue )
1178{
1179 SolarMutexGuard aGuard;
1180 if (aPropertyName == SC_UNONAME_ANCHOR)
1181 {
1182 aValue >>= mpContent;
1183 return;
1184 }
1185
1186 switch (meType)
1187 {
1188 case text::textfield::Type::URL:
1189 setPropertyValueURL(aPropertyName, aValue);
1190 break;
1191 case text::textfield::Type::EXTENDED_FILE:
1192 setPropertyValueFile(aPropertyName, aValue);
1193 break;
1195 case text::textfield::Type::TIME:
1196 case text::textfield::Type::EXTENDED_TIME:
1197 setPropertyValueDateTime(aPropertyName, aValue);
1198 break;
1200 setPropertyValueSheet(aPropertyName, aValue);
1201 break;
1202 case text::textfield::Type::DOCINFO_TITLE:
1203 default:
1204 throw beans::UnknownPropertyException(OUString::number(meType));
1205 }
1206}
1207
1208uno::Any SAL_CALL ScEditFieldObj::getPropertyValue( const OUString& aPropertyName )
1209{
1210 SolarMutexGuard aGuard;
1211 if (aPropertyName == SC_UNONAME_TEXTFIELD_TYPE)
1212 return uno::Any(meType);
1213
1214 if (aPropertyName == SC_UNONAME_ANCHOR)
1215 return uno::Any(mpContent);
1216
1217 if (aPropertyName == SC_UNONAME_ANCTYPE)
1218 {
1219 uno::Any aRet;
1220 aRet <<= text::TextContentAnchorType_AS_CHARACTER;
1221 return aRet;
1222 }
1223 if (aPropertyName == SC_UNONAME_ANCTYPES)
1224 {
1225 uno::Any aRet;
1226 uno::Sequence<text::TextContentAnchorType> aSeq { text::TextContentAnchorType_AS_CHARACTER };
1227 aRet <<= aSeq;
1228 return aRet;
1229 }
1230 if (aPropertyName == SC_UNONAME_TEXTWRAP)
1231 {
1232 uno::Any aRet;
1233 aRet <<= text::WrapTextMode_NONE;
1234 return aRet;
1235 }
1236
1237 switch (meType)
1238 {
1239 case text::textfield::Type::URL:
1240 return getPropertyValueURL(aPropertyName);
1241 case text::textfield::Type::EXTENDED_FILE:
1242 return getPropertyValueFile(aPropertyName);
1244 case text::textfield::Type::TIME:
1245 case text::textfield::Type::EXTENDED_TIME:
1246 return getPropertyValueDateTime(aPropertyName);
1247 case text::textfield::Type::DOCINFO_TITLE:
1248 default:
1249 throw beans::UnknownPropertyException(OUString::number(meType));
1250 }
1251}
1252
1254
1255// XUnoTunnel
1256
1258
1259// XServiceInfo
1260
1261OUString SAL_CALL ScEditFieldObj::getImplementationName()
1262{
1263 return "ScEditFieldObj";
1264}
1265
1266sal_Bool SAL_CALL ScEditFieldObj::supportsService( const OUString& rServiceName )
1267{
1268 return cppu::supportsService(this, rServiceName);
1269}
1270
1271uno::Sequence<OUString> SAL_CALL ScEditFieldObj::getSupportedServiceNames()
1272{
1273 return {"com.sun.star.text.TextField",
1274 "com.sun.star.text.TextContent"};
1275}
1276
1277uno::Sequence<uno::Type> SAL_CALL ScEditFieldObj::getTypes()
1278{
1281 uno::Sequence<uno::Type>
1282 {
1287 } );
1288}
1289
1290uno::Sequence<sal_Int8> SAL_CALL ScEditFieldObj::getImplementationId()
1291{
1292 return css::uno::Sequence<sal_Int8>();
1293}
1294
1295/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _ADOIndex Index
AnyEventRef aEvent
sal_Int16 GetYear() const
sal_uInt16 GetDay() const
sal_uInt16 GetMonth() const
std::unique_ptr< EditTextObject > CreateTextObject()
void QuickInsertField(const SvxFieldItem &rFld, const ESelection &rSel)
virtual OUString CalcFieldValue(const SvxFieldItem &rField, sal_Int32 nPara, sal_Int32 nPos, std::optional< Color > &rTxtColor, std::optional< Color > &rFldColor)
Data (incl.
Definition: editsrc.hxx:74
ScDocShell * pDocShell
Definition: fielduno.hxx:60
virtual void SAL_CALL removeRefreshListener(const css::uno::Reference< css::util::XRefreshListener > &l) override
Definition: fielduno.cxx:406
osl::Mutex aMutex
mutex to lock the InterfaceContainerHelper
Definition: fielduno.hxx:66
virtual ~ScCellFieldsObj() override
Definition: fielduno.cxx:277
virtual void SAL_CALL refresh() override
Definition: fielduno.cxx:384
css::uno::Reference< css::text::XTextField > GetObjectByIndex_Impl(sal_Int32 Index) const
Definition: fielduno.cxx:314
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: fielduno.cxx:365
std::unique_ptr< comphelper::OInterfaceContainerHelper3< css::util::XRefreshListener > > mpRefreshListeners
List of refresh listeners.
Definition: fielduno.hxx:64
std::unique_ptr< ScEditSource > mpEditSource
Definition: fielduno.hxx:62
virtual void SAL_CALL removeContainerListener(const css::uno::Reference< css::container::XContainerListener > &xListener) override
Definition: fielduno.cxx:377
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:359
virtual void SAL_CALL addRefreshListener(const css::uno::Reference< css::util::XRefreshListener > &l) override
Definition: fielduno.cxx:395
ScAddress aCellPos
Definition: fielduno.hxx:61
css::uno::Reference< css::text::XTextRange > mxContent
Definition: fielduno.hxx:59
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
Definition: fielduno.cxx:344
virtual sal_Int32 SAL_CALL getCount() override
Definition: fielduno.cxx:333
virtual css::uno::Type SAL_CALL getElementType() override
Definition: fielduno.cxx:354
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: fielduno.cxx:298
virtual void SAL_CALL addContainerListener(const css::uno::Reference< css::container::XContainerListener > &xListener) override
Definition: fielduno.cxx:371
const ScDocument & GetDocument() const
Definition: docsh.hxx:220
void AddUnoObject(SfxListener &rObject)
Definition: documen3.cxx:907
void RemoveUnoObject(SfxListener &rObject)
Definition: documen3.cxx:915
std::unique_ptr< ScEditSource > mpEditSource
Definition: fielduno.hxx:172
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: fielduno.cxx:1169
const SfxItemPropertySet * pPropSet
Definition: fielduno.hxx:171
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: fielduno.cxx:1271
css::uno::Any getPropertyValueDateTime(const OUString &rName)
Definition: fielduno.cxx:885
void InitDoc(const css::uno::Reference< css::text::XTextRange > &rContent, std::unique_ptr< ScEditSource > pEditSrc, const ESelection &rSel)
Definition: fielduno.cxx:1064
SvxFieldData & getData()
Definition: fielduno.cxx:566
sal_Int32 mnNumFormat
Definition: fielduno.hxx:180
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override
Definition: fielduno.cxx:1161
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: fielduno.cxx:1176
css::uno::Reference< css::text::XTextRange > mpContent
Definition: fielduno.hxx:177
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: fielduno.cxx:1208
css::util::DateTime maDateTime
Definition: fielduno.hxx:179
void DeleteField()
Definition: fielduno.cxx:1087
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: fielduno.cxx:1277
std::unique_ptr< SvxFieldData > mpData
Definition: fielduno.hxx:176
ScEditFieldObj()=delete
void setPropertyValueDateTime(const OUString &rName, const css::uno::Any &rVal)
Definition: fielduno.cxx:791
virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > &xTextRange) override
Definition: fielduno.cxx:1148
css::uno::Any getPropertyValueURL(const OUString &rName)
Definition: fielduno.cxx:679
css::uno::Any getPropertyValueFile(const OUString &rName)
Definition: fielduno.cxx:761
void setPropertyValueSheet(const OUString &rName, const css::uno::Any &rVal)
Definition: fielduno.cxx:990
virtual OUString SAL_CALL getPresentation(sal_Bool bShowCommand) override
Definition: fielduno.cxx:1110
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: fielduno.cxx:1266
void setPropertyValueURL(const OUString &rName, const css::uno::Any &rVal)
Definition: fielduno.cxx:613
SvxFieldItem CreateFieldItem()
Definition: fielduno.cxx:1081
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: fielduno.cxx:1290
ESelection aSelection
Definition: fielduno.hxx:173
bool IsInserted() const
Definition: fielduno.cxx:1103
sal_Int32 meType
Definition: fielduno.hxx:175
virtual ~ScEditFieldObj() override
Definition: fielduno.cxx:1077
void setPropertyValueFile(const OUString &rName, const css::uno::Any &rVal)
Definition: fielduno.cxx:728
std::unique_ptr< comphelper::OInterfaceContainerHelper3< css::util::XRefreshListener > > mpRefreshListeners
List of refresh listeners.
Definition: fielduno.hxx:118
virtual css::uno::Type SAL_CALL getElementType() override
Definition: fielduno.cxx:504
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
osl::Mutex aMutex
mutex to lock the InterfaceContainerHelper
Definition: fielduno.hxx:120
ScHeaderFooterTextData & mrData
Definition: fielduno.hxx:114
virtual void SAL_CALL addRefreshListener(const css::uno::Reference< css::util::XRefreshListener > &l) override
Definition: fielduno.cxx:545
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:556
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:115
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:144
ScHeaderFooterTextObj keeps the authoritative copy of ScHeaderFooterTextData that this class holds re...
Definition: editsrc.hxx:50
ScHeaderFooterPart GetPart() const
Definition: textuno.hxx:125
css::uno::Reference< css::sheet::XHeaderFooterContent > GetContentObj() const
Definition: textuno.hxx:126
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)
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)
UNO3_GETIMPLEMENTATION_IMPL(ScEditFieldObj)
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:340
constexpr OUStringLiteral SC_UNONAME_NUMFMT
Definition: unonames.hxx:107
constexpr OUStringLiteral SC_UNONAME_FILEFORM
Definition: unonames.hxx:326
constexpr OUStringLiteral SC_UNONAME_REPR
Definition: unonames.hxx:330
constexpr OUStringLiteral SC_UNONAME_ANCHOR
Definition: unonames.hxx:195
constexpr OUStringLiteral SC_UNONAME_ANCTYPES
Definition: unonames.hxx:324
constexpr OUStringLiteral SC_UNONAME_ANCTYPE
Definition: unonames.hxx:323
constexpr OUStringLiteral SC_UNONAME_URL
Definition: unonames.hxx:332
constexpr OUStringLiteral SC_UNONAME_TARGET
Definition: unonames.hxx:331
constexpr OUStringLiteral SC_UNONAME_ISDATE
Definition: unonames.hxx:335
constexpr OUStringLiteral SC_UNONAME_TEXTFIELD_TYPE
Definition: unonames.hxx:327
constexpr OUStringLiteral SC_UNONAME_ISFIXED
Definition: unonames.hxx:336
constexpr OUStringLiteral SC_UNONAME_TEXTWRAP
Definition: unonames.hxx:325
constexpr OUStringLiteral SC_UNONAME_DATETIME
Definition: unonames.hxx:337
RedlineType meType
@ TABLE
Definition: xmldpimp.hxx:43