LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/sc/source/ui/unoobj - fielduno.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 446 728 61.3 %
Date: 2013-07-09 Functions: 60 90 66.7 %
Legend: Lines: hit not hit

          Line data    Source code
       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 "fielduno.hxx"
      21             : #include "textuno.hxx"
      22             : #include "miscuno.hxx"
      23             : #include "docsh.hxx"
      24             : #include "hints.hxx"
      25             : #include "editsrc.hxx"
      26             : #include "cellsuno.hxx"
      27             : #include "servuno.hxx"      // fuer IDs
      28             : #include "unonames.hxx"
      29             : #include "editutil.hxx"
      30             : 
      31             : #include <svl/smplhint.hxx>
      32             : #include <vcl/svapp.hxx>
      33             : 
      34             : 
      35             : #include <editeng/eeitem.hxx>
      36             : 
      37             : #include <editeng/editeng.hxx>
      38             : #include <editeng/editobj.hxx>
      39             : #include <editeng/flditem.hxx>
      40             : #include <comphelper/servicehelper.hxx>
      41             : 
      42             : #include <com/sun/star/beans/PropertyAttribute.hpp>
      43             : #include <com/sun/star/text/TextContentAnchorType.hpp>
      44             : #include <com/sun/star/text/WrapTextMode.hpp>
      45             : #include <com/sun/star/text/FilenameDisplayFormat.hpp>
      46             : #include <com/sun/star/text/textfield/Type.hpp>
      47             : 
      48             : using namespace com::sun::star;
      49             : 
      50             : namespace {
      51             : 
      52             : //  alles ohne Which-ID, Map nur fuer PropertySetInfo
      53             : 
      54         162 : const SfxItemPropertySet* getDateTimePropertySet()
      55             : {
      56             :     static SfxItemPropertyMapEntry aMapContent[] =
      57             :     {
      58          22 :         { MAP_CHAR_LEN(SC_UNONAME_DATETIME), 0, &getCppuType((const util::DateTime*)0), 0, 0 },
      59          22 :         { MAP_CHAR_LEN(SC_UNONAME_ISFIXED),  0, &getBooleanCppuType(),                  0, 0 },
      60          22 :         { MAP_CHAR_LEN(SC_UNONAME_ISDATE),   0, &getBooleanCppuType(),                  0, 0 },
      61          22 :         { MAP_CHAR_LEN(SC_UNONAME_NUMFMT),   0, &getCppuType((const sal_Int32*)0),      0, 0 },
      62             :         {0,0,0,0,0,0}
      63         250 :     };
      64         162 :     static SfxItemPropertySet aMap(aMapContent);
      65         162 :     return &aMap;
      66             : }
      67             : 
      68          78 : const SfxItemPropertySet* getEmptyPropertySet()
      69             : {
      70             :     static SfxItemPropertyMapEntry aMapContent[] =
      71             :     {
      72             :         {0,0,0,0,0,0}
      73             :     };
      74          78 :     static SfxItemPropertySet aMap(aMapContent);
      75          78 :     return &aMap;
      76             : }
      77             : 
      78          16 : const SfxItemPropertySet* lcl_GetURLPropertySet()
      79             : {
      80             :     static SfxItemPropertyMapEntry aURLPropertyMap_Impl[] =
      81             :     {
      82           2 :         {MAP_CHAR_LEN(SC_UNONAME_ANCTYPE),  0,  &getCppuType((text::TextContentAnchorType*)0), beans::PropertyAttribute::READONLY, 0 },
      83           2 :         {MAP_CHAR_LEN(SC_UNONAME_ANCTYPES), 0,  &getCppuType((uno::Sequence<text::TextContentAnchorType>*)0), beans::PropertyAttribute::READONLY, 0 },
      84           2 :         {MAP_CHAR_LEN(SC_UNONAME_REPR),     0,  &getCppuType((OUString*)0),    0, 0},
      85           2 :         {MAP_CHAR_LEN(SC_UNONAME_TARGET),   0,  &getCppuType((OUString*)0),    0, 0},
      86           2 :         {MAP_CHAR_LEN(SC_UNONAME_TEXTWRAP), 0,  &getCppuType((text::WrapTextMode*)0), beans::PropertyAttribute::READONLY, 0 },
      87           2 :         {MAP_CHAR_LEN(SC_UNONAME_URL),      0,  &getCppuType((OUString*)0),    0, 0},
      88             :         {0,0,0,0,0,0}
      89          28 :     };
      90          16 :     static SfxItemPropertySet aURLPropertySet_Impl( aURLPropertyMap_Impl );
      91          16 :     return &aURLPropertySet_Impl;
      92             : }
      93             : 
      94         443 : const SfxItemPropertySet* lcl_GetHeaderFieldPropertySet()
      95             : {
      96             :     static SfxItemPropertyMapEntry aHeaderFieldPropertyMap_Impl[] =
      97             :     {
      98          20 :         {MAP_CHAR_LEN(SC_UNONAME_ANCTYPE),  0,  &getCppuType((text::TextContentAnchorType*)0), beans::PropertyAttribute::READONLY, 0 },
      99          20 :         {MAP_CHAR_LEN(SC_UNONAME_ANCTYPES), 0,  &getCppuType((uno::Sequence<text::TextContentAnchorType>*)0), beans::PropertyAttribute::READONLY, 0 },
     100          20 :         {MAP_CHAR_LEN(SC_UNONAME_TEXTWRAP), 0,  &getCppuType((text::WrapTextMode*)0), beans::PropertyAttribute::READONLY, 0 },
     101             :         {0,0,0,0,0,0}
     102         503 :     };
     103         443 :     static SfxItemPropertySet aHeaderFieldPropertySet_Impl( aHeaderFieldPropertyMap_Impl );
     104         443 :     return &aHeaderFieldPropertySet_Impl;
     105             : }
     106             : 
     107           2 : const SfxItemPropertySet* lcl_GetFileFieldPropertySet()
     108             : {
     109             :     static SfxItemPropertyMapEntry aFileFieldPropertyMap_Impl[] =
     110             :     {
     111           1 :         {MAP_CHAR_LEN(SC_UNONAME_ANCTYPE),  0,  &getCppuType((text::TextContentAnchorType*)0), beans::PropertyAttribute::READONLY, 0 },
     112           1 :         {MAP_CHAR_LEN(SC_UNONAME_ANCTYPES), 0,  &getCppuType((uno::Sequence<text::TextContentAnchorType>*)0), beans::PropertyAttribute::READONLY, 0 },
     113           1 :         {MAP_CHAR_LEN(SC_UNONAME_FILEFORM), 0,  &getCppuType((sal_Int16*)0),        0, 0 },
     114           1 :         {MAP_CHAR_LEN(SC_UNONAME_TEXTWRAP), 0,  &getCppuType((text::WrapTextMode*)0), beans::PropertyAttribute::READONLY, 0 },
     115             :         {0,0,0,0,0,0}
     116           6 :     };
     117           2 :     static SfxItemPropertySet aFileFieldPropertySet_Impl( aFileFieldPropertyMap_Impl );
     118           2 :     return &aFileFieldPropertySet_Impl;
     119             : }
     120             : 
     121           0 : SvxFileFormat lcl_UnoToSvxFileFormat( sal_Int16 nUnoValue )
     122             : {
     123           0 :     switch( nUnoValue )
     124             :     {
     125           0 :         case text::FilenameDisplayFormat::FULL: return SVXFILEFORMAT_FULLPATH;
     126           0 :         case text::FilenameDisplayFormat::PATH: return SVXFILEFORMAT_PATH;
     127           0 :         case text::FilenameDisplayFormat::NAME: return SVXFILEFORMAT_NAME;
     128             :         default:
     129           0 :             return SVXFILEFORMAT_NAME_EXT;
     130             :     }
     131             : }
     132             : 
     133           0 : sal_Int16 lcl_SvxToUnoFileFormat( SvxFileFormat nSvxValue )
     134             : {
     135           0 :     switch( nSvxValue )
     136             :     {
     137           0 :         case SVXFILEFORMAT_NAME_EXT:    return text::FilenameDisplayFormat::NAME_AND_EXT;
     138           0 :         case SVXFILEFORMAT_FULLPATH:    return text::FilenameDisplayFormat::FULL;
     139           0 :         case SVXFILEFORMAT_PATH:        return text::FilenameDisplayFormat::PATH;
     140             :         default:
     141           0 :             return text::FilenameDisplayFormat::NAME;
     142             :     }
     143             : }
     144             : 
     145             : }
     146             : 
     147             : #define SCTEXTFIELD_SERVICE         "com.sun.star.text.TextField"
     148             : #define SCTEXTCONTENT_SERVICE       "com.sun.star.text.TextContent"
     149             : 
     150           0 : SC_SIMPLE_SERVICE_INFO( ScCellFieldsObj, "ScCellFieldsObj", "com.sun.star.text.TextFields" )
     151           0 : SC_SIMPLE_SERVICE_INFO( ScHeaderFieldsObj, "ScHeaderFieldsObj", "com.sun.star.text.TextFields" )
     152             : 
     153             : //------------------------------------------------------------------------
     154             : 
     155             : //  ScUnoEditEngine nur um aus einer EditEngine die Felder herauszubekommen...
     156             : 
     157             : enum ScUnoCollectMode
     158             : {
     159             :     SC_UNO_COLLECT_NONE,
     160             :     SC_UNO_COLLECT_COUNT,
     161             :     SC_UNO_COLLECT_FINDINDEX,
     162             :     SC_UNO_COLLECT_FINDPOS
     163             : };
     164             : 
     165             : /**
     166             :  * This class exists solely to allow searching through field items.  TODO:
     167             :  * Look into providing the same functionality directly in EditEngine, to
     168             :  * avoid having this class altogether.
     169             :  */
     170             : class ScUnoEditEngine : public ScEditEngineDefaulter
     171             : {
     172             :     ScUnoCollectMode    eMode;
     173             :     sal_uInt16              nFieldCount;
     174             :     sal_Int32           mnFieldType;
     175             :     SvxFieldData*       pFound;         // lokale Kopie
     176             :     sal_Int32           nFieldPar;
     177             :     xub_StrLen          nFieldPos;
     178             :     sal_uInt16              nFieldIndex;
     179             : 
     180             : public:
     181             :                 ScUnoEditEngine(ScEditEngineDefaulter* pSource);
     182             :                 ~ScUnoEditEngine();
     183             : 
     184             :                     //! nPos should be xub_StrLen
     185             :     virtual OUString  CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos,
     186             :                                     Color*& rTxtColor, Color*& rFldColor );
     187             : 
     188             :     sal_uInt16 CountFields();
     189             :     SvxFieldData* FindByIndex(sal_uInt16 nIndex);
     190             :     SvxFieldData* FindByPos(sal_Int32 nPar, xub_StrLen nPos, sal_Int32 nType);
     191             : 
     192           2 :     sal_Int32       GetFieldPar() const     { return nFieldPar; }
     193           2 :     xub_StrLen      GetFieldPos() const     { return nFieldPos; }
     194             : };
     195             : 
     196          86 : ScUnoEditEngine::ScUnoEditEngine(ScEditEngineDefaulter* pSource) :
     197             :     ScEditEngineDefaulter( *pSource ),
     198             :     eMode( SC_UNO_COLLECT_NONE ),
     199             :     nFieldCount( 0 ),
     200             :     mnFieldType(text::textfield::Type::UNSPECIFIED),
     201          86 :     pFound( NULL )
     202             : {
     203          86 :     if (pSource)
     204             :     {
     205          86 :         EditTextObject* pData = pSource->CreateTextObject();
     206          86 :         SetText( *pData );
     207          86 :         delete pData;
     208             :     }
     209          86 : }
     210             : 
     211         172 : ScUnoEditEngine::~ScUnoEditEngine()
     212             : {
     213          86 :     delete pFound;
     214          86 : }
     215             : 
     216         172 : OUString ScUnoEditEngine::CalcFieldValue( const SvxFieldItem& rField,
     217             :             sal_Int32 nPara, sal_uInt16 nPos, Color*& rTxtColor, Color*& rFldColor )
     218             : {
     219         172 :     OUString aRet(EditEngine::CalcFieldValue( rField, nPara, nPos, rTxtColor, rFldColor ));
     220         172 :     if (eMode != SC_UNO_COLLECT_NONE)
     221             :     {
     222          86 :         const SvxFieldData* pFieldData = rField.GetField();
     223          86 :         if ( pFieldData )
     224             :         {
     225          86 :             if (mnFieldType == text::textfield::Type::UNSPECIFIED || pFieldData->GetClassId() == mnFieldType)
     226             :             {
     227          86 :                 if ( eMode == SC_UNO_COLLECT_FINDINDEX && !pFound && nFieldCount == nFieldIndex )
     228             :                 {
     229           2 :                     pFound = pFieldData->Clone();
     230           2 :                     nFieldPar = nPara;
     231           2 :                     nFieldPos = nPos;
     232             :                 }
     233         163 :                 if ( eMode == SC_UNO_COLLECT_FINDPOS && !pFound &&
     234         154 :                         nPara == nFieldPar && nPos == nFieldPos )
     235             :                 {
     236          77 :                     pFound = pFieldData->Clone();
     237          77 :                     nFieldIndex = nFieldCount;
     238             :                 }
     239          86 :                 ++nFieldCount;
     240             :             }
     241             :         }
     242             :     }
     243         172 :     return aRet;
     244             : }
     245             : 
     246           6 : sal_uInt16 ScUnoEditEngine::CountFields()
     247             : {
     248           6 :     eMode = SC_UNO_COLLECT_COUNT;
     249           6 :     mnFieldType = text::textfield::Type::UNSPECIFIED;
     250           6 :     nFieldCount = 0;
     251           6 :     UpdateFields();
     252           6 :     eMode = SC_UNO_COLLECT_NONE;
     253             : 
     254           6 :     return nFieldCount;
     255             : }
     256             : 
     257           3 : SvxFieldData* ScUnoEditEngine::FindByIndex(sal_uInt16 nIndex)
     258             : {
     259           3 :     eMode = SC_UNO_COLLECT_FINDINDEX;
     260           3 :     nFieldIndex = nIndex;
     261           3 :     mnFieldType = text::textfield::Type::UNSPECIFIED;
     262           3 :     nFieldCount = 0;
     263           3 :     UpdateFields();
     264           3 :     eMode = SC_UNO_COLLECT_NONE;
     265             : 
     266           3 :     return pFound;
     267             : }
     268             : 
     269          77 : SvxFieldData* ScUnoEditEngine::FindByPos(sal_Int32 nPar, xub_StrLen nPos, sal_Int32 nType)
     270             : {
     271          77 :     eMode = SC_UNO_COLLECT_FINDPOS;
     272          77 :     nFieldPar = nPar;
     273          77 :     nFieldPos = nPos;
     274          77 :     mnFieldType = nType;
     275          77 :     nFieldCount = 0;
     276          77 :     UpdateFields();
     277          77 :     mnFieldType = text::textfield::Type::UNSPECIFIED;
     278          77 :     eMode = SC_UNO_COLLECT_NONE;
     279             : 
     280          77 :     return pFound;
     281             : }
     282             : 
     283             : //------------------------------------------------------------------------
     284             : 
     285           4 : ScCellFieldsObj::ScCellFieldsObj(
     286             :     const uno::Reference<text::XTextRange>& xContent,
     287             :     ScDocShell* pDocSh, const ScAddress& rPos) :
     288             :     mxContent(xContent),
     289             :     pDocShell( pDocSh ),
     290             :     aCellPos( rPos ),
     291           4 :     mpRefreshListeners( NULL )
     292             : {
     293           4 :     pDocShell->GetDocument()->AddUnoObject(*this);
     294             : 
     295           4 :     mpEditSource = new ScCellEditSource( pDocShell, aCellPos );
     296           4 : }
     297             : 
     298          12 : ScCellFieldsObj::~ScCellFieldsObj()
     299             : {
     300           4 :     if (pDocShell)
     301           0 :         pDocShell->GetDocument()->RemoveUnoObject(*this);
     302             : 
     303           4 :     delete mpEditSource;
     304             : 
     305             :     // increment refcount to prevent double call off dtor
     306           4 :     osl_atomic_increment( &m_refCount );
     307             : 
     308           4 :     if (mpRefreshListeners)
     309             :     {
     310           1 :         lang::EventObject aEvent;
     311           1 :         aEvent.Source.set(static_cast<cppu::OWeakObject*>(this));
     312           1 :         if (mpRefreshListeners)
     313             :         {
     314           1 :             mpRefreshListeners->disposeAndClear(aEvent);
     315           1 :             DELETEZ( mpRefreshListeners );
     316           1 :         }
     317             :     }
     318           8 : }
     319             : 
     320           4 : void ScCellFieldsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
     321             : {
     322           4 :     if ( rHint.ISA( ScUpdateRefHint ) )
     323             :     {
     324             :         //! Ref-Update
     325             :     }
     326           8 :     else if ( rHint.ISA( SfxSimpleHint ) &&
     327           4 :             ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
     328             :     {
     329           4 :         pDocShell = NULL;       // ungueltig geworden
     330             :     }
     331             : 
     332             :     //  EditSource hat sich selber als Listener angemeldet
     333           4 : }
     334             : 
     335             : // XIndexAccess (via XTextFields)
     336             : 
     337           3 : uno::Reference<text::XTextField> ScCellFieldsObj::GetObjectByIndex_Impl(sal_Int32 Index) const
     338             : {
     339             :     //! Feld-Funktionen muessen an den Forwarder !!!
     340           3 :     ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
     341           3 :     ScUnoEditEngine aTempEngine(pEditEngine);
     342           3 :     SvxFieldData* pData = aTempEngine.FindByIndex(static_cast<sal_uInt16>(Index));
     343           3 :     if (!pData)
     344           1 :         return uno::Reference<text::XTextField>();
     345             : 
     346           2 :     sal_Int32 nPar = aTempEngine.GetFieldPar();
     347           2 :     xub_StrLen nPos = aTempEngine.GetFieldPos();
     348           2 :     ESelection aSelection( nPar, nPos, nPar, nPos+1 );      // Feld ist 1 Zeichen
     349             : 
     350           2 :     sal_Int32 eType = pData->GetClassId();
     351             :     uno::Reference<text::XTextField> xRet(
     352           4 :         new ScEditFieldObj(mxContent, new ScCellEditSource(pDocShell, aCellPos), eType, aSelection));
     353           5 :     return xRet;
     354             : }
     355             : 
     356           5 : sal_Int32 SAL_CALL ScCellFieldsObj::getCount() throw(uno::RuntimeException)
     357             : {
     358           5 :     SolarMutexGuard aGuard;
     359             : 
     360             :     //! Feld-Funktionen muessen an den Forwarder !!!
     361           5 :     ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
     362          10 :     ScUnoEditEngine aTempEngine(pEditEngine);
     363             : 
     364          10 :     return aTempEngine.CountFields();       // Felder zaehlen, in Zelle ist der Typ egal
     365             : }
     366             : 
     367           3 : uno::Any SAL_CALL ScCellFieldsObj::getByIndex( sal_Int32 nIndex )
     368             :                             throw(lang::IndexOutOfBoundsException,
     369             :                                     lang::WrappedTargetException, uno::RuntimeException)
     370             : {
     371           3 :     SolarMutexGuard aGuard;
     372           6 :     uno::Reference<text::XTextField> xField(GetObjectByIndex_Impl(nIndex));
     373           3 :     if (xField.is())
     374           4 :         return uno::makeAny(xField);
     375             :     else
     376           4 :         throw lang::IndexOutOfBoundsException();
     377             : }
     378             : 
     379           1 : uno::Type SAL_CALL ScCellFieldsObj::getElementType() throw(uno::RuntimeException)
     380             : {
     381           1 :     SolarMutexGuard aGuard;
     382           1 :     return getCppuType((uno::Reference<text::XTextField>*)0);
     383             : }
     384             : 
     385           1 : sal_Bool SAL_CALL ScCellFieldsObj::hasElements() throw(uno::RuntimeException)
     386             : {
     387           1 :     SolarMutexGuard aGuard;
     388           1 :     return ( getCount() != 0 );
     389             : }
     390             : 
     391           3 : uno::Reference<container::XEnumeration> SAL_CALL ScCellFieldsObj::createEnumeration()
     392             :                                                     throw(uno::RuntimeException)
     393             : {
     394           3 :     SolarMutexGuard aGuard;
     395           3 :     return new ScIndexEnumeration(this, OUString("com.sun.star.text.TextFieldEnumeration"));
     396             : }
     397             : 
     398           0 : void SAL_CALL ScCellFieldsObj::addContainerListener(
     399             :                                 const uno::Reference<container::XContainerListener>& /* xListener */ )
     400             :                                     throw(uno::RuntimeException)
     401             : {
     402             :     OSL_FAIL("not implemented");
     403           0 : }
     404             : 
     405           0 : void SAL_CALL ScCellFieldsObj::removeContainerListener(
     406             :                                 const uno::Reference<container::XContainerListener>& /* xListener */ )
     407             :                                     throw(uno::RuntimeException)
     408             : {
     409             :     OSL_FAIL("not implemented");
     410           0 : }
     411             : 
     412             : // XRefreshable
     413           2 : void SAL_CALL ScCellFieldsObj::refresh(  )
     414             :                                     throw (uno::RuntimeException)
     415             : {
     416           2 :     if (mpRefreshListeners)
     417             :     {
     418             :         //  Call all listeners.
     419           2 :         uno::Sequence< uno::Reference< uno::XInterface > > aListeners(mpRefreshListeners->getElements());
     420           2 :         sal_uInt32 nLength(aListeners.getLength());
     421           2 :         if (nLength)
     422             :         {
     423           1 :             const uno::Reference< uno::XInterface >* pInterfaces = aListeners.getConstArray();
     424           1 :             if (pInterfaces)
     425             :             {
     426           1 :                 lang::EventObject aEvent;
     427           1 :                 aEvent.Source.set(uno::Reference< util::XRefreshable >(const_cast<ScCellFieldsObj*>(this)));
     428           1 :                 sal_uInt32 i(0);
     429           3 :                 while (i < nLength)
     430             :                 {
     431             :                     try
     432             :                     {
     433           3 :                         while(i < nLength)
     434             :                         {
     435           1 :                             static_cast< util::XRefreshListener* >(pInterfaces->get())->refreshed(aEvent);
     436           1 :                             ++pInterfaces;
     437           1 :                             ++i;
     438             :                         }
     439             :                     }
     440           0 :                     catch(uno::RuntimeException&)
     441             :                     {
     442           0 :                         ++pInterfaces;
     443           0 :                         ++i;
     444             :                     }
     445           1 :                 }
     446             :             }
     447           2 :         }
     448             :     }
     449           2 : }
     450             : 
     451           1 : void SAL_CALL ScCellFieldsObj::addRefreshListener( const uno::Reference< util::XRefreshListener >& xListener )
     452             :                                     throw (uno::RuntimeException)
     453             : {
     454           1 :     if (xListener.is())
     455             :     {
     456           1 :         SolarMutexGuard aGuard;
     457           1 :         if (!mpRefreshListeners)
     458           1 :             mpRefreshListeners = new cppu::OInterfaceContainerHelper(aMutex);
     459           1 :         mpRefreshListeners->addInterface(xListener);
     460             :     }
     461           1 : }
     462             : 
     463           1 : void SAL_CALL ScCellFieldsObj::removeRefreshListener( const uno::Reference<util::XRefreshListener >& xListener )
     464             :                                     throw (uno::RuntimeException)
     465             : {
     466           1 :     if (xListener.is())
     467             :     {
     468           1 :         SolarMutexGuard aGuard;
     469           1 :         if (mpRefreshListeners)
     470           1 :             mpRefreshListeners->removeInterface(xListener);
     471             :     }
     472           1 : }
     473             : 
     474           1 : ScHeaderFieldsObj::ScHeaderFieldsObj(ScHeaderFooterTextData& rData) :
     475             :     mrData(rData),
     476           1 :     mpRefreshListeners( NULL )
     477             : {
     478           1 :     mpEditSource = new ScHeaderFooterEditSource(rData);
     479           1 : }
     480             : 
     481           3 : ScHeaderFieldsObj::~ScHeaderFieldsObj()
     482             : {
     483           1 :     delete mpEditSource;
     484             : 
     485             :     // increment refcount to prevent double call off dtor
     486           1 :     osl_atomic_increment( &m_refCount );
     487             : 
     488           1 :     if (mpRefreshListeners)
     489             :     {
     490           1 :         lang::EventObject aEvent;
     491           1 :         aEvent.Source = static_cast<cppu::OWeakObject*>(this);
     492           1 :         if (mpRefreshListeners)
     493             :         {
     494           1 :             mpRefreshListeners->disposeAndClear(aEvent);
     495           1 :             DELETEZ( mpRefreshListeners );
     496           1 :         }
     497             :     }
     498           2 : }
     499             : 
     500             : // XIndexAccess (via XTextFields)
     501             : 
     502           0 : uno::Reference<text::XTextField> ScHeaderFieldsObj::GetObjectByIndex_Impl(sal_Int32 Index) const
     503             : {
     504             :     //! Feld-Funktionen muessen an den Forwarder !!!
     505           0 :     ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
     506           0 :     ScUnoEditEngine aTempEngine(pEditEngine);
     507             : 
     508           0 :     SvxFieldData* pData = aTempEngine.FindByIndex(static_cast<sal_uInt16>(Index));
     509           0 :     if (!pData)
     510           0 :         return NULL;
     511             : 
     512             :     // Get the parent text range instance.
     513           0 :     uno::Reference<text::XTextRange> xTextRange;
     514           0 :     ScHeaderFooterContentObj& rContentObj = mrData.GetContentObj();
     515           0 :     uno::Reference<text::XText> xText;
     516           0 :     sal_uInt16 nPart = mrData.GetPart();
     517           0 :     if (nPart == SC_HDFT_LEFT)
     518           0 :         xText = rContentObj.getLeftText();
     519           0 :     else if (nPart == SC_HDFT_CENTER)
     520           0 :         xText = rContentObj.getCenterText();
     521             :     else
     522           0 :         xText = rContentObj.getRightText();
     523             : 
     524           0 :     uno::Reference<text::XTextRange> xTemp(xText, uno::UNO_QUERY);
     525           0 :     xTextRange = xTemp;
     526             : 
     527           0 :     sal_Int32 nPar = aTempEngine.GetFieldPar();
     528           0 :     xub_StrLen nPos = aTempEngine.GetFieldPos();
     529           0 :     ESelection aSelection( nPar, nPos, nPar, nPos+1 );      // Field is 1 character
     530             : 
     531           0 :     sal_Int32 eRealType = pData->GetClassId();
     532             :     uno::Reference<text::XTextField> xRet(
     533           0 :         new ScEditFieldObj(xTextRange, new ScHeaderFooterEditSource(mrData), eRealType, aSelection));
     534           0 :     return xRet;
     535             : }
     536             : 
     537           1 : sal_Int32 SAL_CALL ScHeaderFieldsObj::getCount() throw(uno::RuntimeException)
     538             : {
     539           1 :     SolarMutexGuard aGuard;
     540             : 
     541             :     //! Feld-Funktionen muessen an den Forwarder !!!
     542           1 :     ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
     543           2 :     ScUnoEditEngine aTempEngine(pEditEngine);
     544           2 :     return aTempEngine.CountFields();
     545             : }
     546             : 
     547           0 : uno::Any SAL_CALL ScHeaderFieldsObj::getByIndex( sal_Int32 nIndex )
     548             :                             throw(lang::IndexOutOfBoundsException,
     549             :                                     lang::WrappedTargetException, uno::RuntimeException)
     550             : {
     551           0 :     SolarMutexGuard aGuard;
     552           0 :     uno::Reference<text::XTextField> xField(GetObjectByIndex_Impl(nIndex));
     553           0 :     if (xField.is())
     554           0 :         return uno::makeAny(xField);
     555             :     else
     556           0 :         throw lang::IndexOutOfBoundsException();
     557             : }
     558             : 
     559           1 : uno::Type SAL_CALL ScHeaderFieldsObj::getElementType() throw(uno::RuntimeException)
     560             : {
     561           1 :     SolarMutexGuard aGuard;
     562           1 :     return getCppuType((uno::Reference<text::XTextField>*)0);
     563             : }
     564             : 
     565           1 : sal_Bool SAL_CALL ScHeaderFieldsObj::hasElements() throw(uno::RuntimeException)
     566             : {
     567           1 :     SolarMutexGuard aGuard;
     568           1 :     return ( getCount() != 0 );
     569             : }
     570             : 
     571           1 : uno::Reference<container::XEnumeration> SAL_CALL ScHeaderFieldsObj::createEnumeration()
     572             :                                                     throw(uno::RuntimeException)
     573             : {
     574           1 :     SolarMutexGuard aGuard;
     575           1 :     return new ScIndexEnumeration(this, OUString("com.sun.star.text.TextFieldEnumeration"));
     576             : }
     577             : 
     578           0 : void SAL_CALL ScHeaderFieldsObj::addContainerListener(
     579             :                                 const uno::Reference<container::XContainerListener>& /* xListener */ )
     580             :                                     throw(uno::RuntimeException)
     581             : {
     582             :     OSL_FAIL("not implemented");
     583           0 : }
     584             : 
     585           0 : void SAL_CALL ScHeaderFieldsObj::removeContainerListener(
     586             :                                 const uno::Reference<container::XContainerListener>& /* xListener */ )
     587             :                                     throw(uno::RuntimeException)
     588             : {
     589             :     OSL_FAIL("not implemented");
     590           0 : }
     591             : 
     592             : // XRefreshable
     593           2 : void SAL_CALL ScHeaderFieldsObj::refresh(  )
     594             :                                     throw (uno::RuntimeException)
     595             : {
     596           2 :     if (mpRefreshListeners)
     597             :     {
     598             :         //  Call all listeners.
     599           2 :         uno::Sequence< uno::Reference< uno::XInterface > > aListeners(mpRefreshListeners->getElements());
     600           2 :         sal_uInt32 nLength(aListeners.getLength());
     601           2 :         if (nLength)
     602             :         {
     603           1 :             const uno::Reference< uno::XInterface >* pInterfaces = aListeners.getConstArray();
     604           1 :             if (pInterfaces)
     605             :             {
     606           1 :                 lang::EventObject aEvent;
     607           1 :                 aEvent.Source.set(uno::Reference< util::XRefreshable >(const_cast<ScHeaderFieldsObj*>(this)));
     608           1 :                 sal_uInt32 i(0);
     609           3 :                 while (i < nLength)
     610             :                 {
     611             :                     try
     612             :                     {
     613           3 :                         while(i < nLength)
     614             :                         {
     615           1 :                             static_cast< util::XRefreshListener* >(pInterfaces->get())->refreshed(aEvent);
     616           1 :                             ++pInterfaces;
     617           1 :                             ++i;
     618             :                         }
     619             :                     }
     620           0 :                     catch(uno::RuntimeException&)
     621             :                     {
     622           0 :                         ++pInterfaces;
     623           0 :                         ++i;
     624             :                     }
     625           1 :                 }
     626             :             }
     627           2 :         }
     628             :     }
     629           2 : }
     630             : 
     631           1 : void SAL_CALL ScHeaderFieldsObj::addRefreshListener( const uno::Reference< util::XRefreshListener >& xListener )
     632             :                                     throw (uno::RuntimeException)
     633             : {
     634           1 :     if (xListener.is())
     635             :     {
     636           1 :         SolarMutexGuard aGuard;
     637           1 :         if (!mpRefreshListeners)
     638           1 :             mpRefreshListeners = new cppu::OInterfaceContainerHelper(aMutex);
     639           1 :         mpRefreshListeners->addInterface(xListener);
     640             :     }
     641           1 : }
     642             : 
     643           1 : void SAL_CALL ScHeaderFieldsObj::removeRefreshListener( const uno::Reference<util::XRefreshListener >& xListener )
     644             :                                     throw (uno::RuntimeException)
     645             : {
     646           1 :     if (xListener.is())
     647             :     {
     648           1 :         SolarMutexGuard aGuard;
     649           1 :         if (mpRefreshListeners)
     650           1 :             mpRefreshListeners->removeInterface(xListener);
     651             :     }
     652           1 : }
     653             : 
     654         675 : SvxFieldData* ScEditFieldObj::getData()
     655             : {
     656         675 :     if (!mpData)
     657             :     {
     658         671 :         switch (meType)
     659             :         {
     660             :             case text::textfield::Type::DATE:
     661           0 :                 mpData.reset(new SvxDateField);
     662           0 :             break;
     663             :             case text::textfield::Type::EXTENDED_FILE:
     664             :                 mpData.reset(
     665           0 :                     new SvxExtFileField(OUString(), SVXFILETYPE_VAR, SVXFILEFORMAT_NAME_EXT));
     666           0 :             break;
     667             :             case text::textfield::Type::PAGE:
     668         181 :                 mpData.reset(new SvxPageField);
     669         181 :             break;
     670             :             case text::textfield::Type::PAGES:
     671          75 :                 mpData.reset(new SvxPagesField);
     672          75 :             break;
     673             :             case text::textfield::Type::TABLE:
     674         181 :                 mpData.reset(new SvxTableField);
     675         181 :             break;
     676             :             case text::textfield::Type::TIME:
     677           3 :                 mpData.reset(new SvxTimeField);
     678           3 :             break;
     679             :             case text::textfield::Type::EXTENDED_TIME:
     680             :             {
     681         150 :                 if (mbIsDate)
     682          75 :                     mpData.reset(new SvxDateField);
     683             :                 else
     684          75 :                     mpData.reset(new SvxExtTimeField);
     685             :             }
     686         150 :             break;
     687             :             case text::textfield::Type::DOCINFO_TITLE:
     688          75 :                 mpData.reset(new SvxFileField);
     689          75 :             break;
     690             :             case text::textfield::Type::URL:
     691             :                 mpData.reset(
     692           6 :                     new SvxURLField(OUString(), OUString(), SVXURLFORMAT_APPDEFAULT));
     693           6 :             break;
     694             :             default:
     695           0 :                 mpData.reset(new SvxFieldData);
     696             :         }
     697             :     }
     698         675 :     return mpData.get();
     699             : }
     700             : 
     701          16 : void ScEditFieldObj::setPropertyValueURL(const OUString& rName, const com::sun::star::uno::Any& rVal)
     702             : {
     703          16 :     OUString aStrVal;
     704          16 :     if (mpEditSource)
     705             :     {
     706             :         // Edit engine instance already exists for this field item.  Use it.
     707          12 :         ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
     708          12 :         ScUnoEditEngine aTempEngine(pEditEngine);
     709             : 
     710             :         //  Typ egal (in Zellen gibts nur URLs)
     711             :         SvxFieldData* pField = aTempEngine.FindByPos(
     712          12 :             aSelection.nStartPara, aSelection.nStartPos, text::textfield::Type::UNSPECIFIED);
     713             :         OSL_ENSURE(pField,"setPropertyValue: Feld nicht gefunden");
     714          12 :         if (!pField)
     715           0 :             return;
     716             : 
     717          12 :         if (pField->GetClassId() != text::textfield::Type::URL)
     718             :             // Make sure this is indeed a URL field.
     719           0 :             return;
     720             : 
     721          12 :         SvxURLField* pURL = static_cast<SvxURLField*>(pField);
     722             : 
     723          12 :         if (rName == SC_UNONAME_URL)
     724             :         {
     725           4 :             if (rVal >>= aStrVal)
     726           4 :                 pURL->SetURL(aStrVal);
     727             :         }
     728           8 :         else if (rName == SC_UNONAME_REPR)
     729             :         {
     730           4 :             if (rVal >>= aStrVal)
     731           4 :                 pURL->SetRepresentation(aStrVal);
     732             :         }
     733           4 :         else if (rName == SC_UNONAME_TARGET)
     734             :         {
     735           4 :             if (rVal >>= aStrVal)
     736           4 :                 pURL->SetTargetFrame(aStrVal);
     737             :         }
     738             :         else
     739           0 :             throw beans::UnknownPropertyException();
     740             : 
     741          12 :         pEditEngine->QuickInsertField( SvxFieldItem(*pField, EE_FEATURE_FIELD), aSelection );
     742          12 :         mpEditSource->UpdateData();
     743          12 :         return;
     744             :     }
     745             : 
     746             :     // Edit engine instance not yet present.  Store the item data for later use.
     747           4 :     SvxFieldData* pData = getData();
     748           4 :     if (!pData)
     749           0 :         throw uno::RuntimeException();
     750             : 
     751           4 :     SvxURLField* p = static_cast<SvxURLField*>(pData);
     752           4 :     if (rName == SC_UNONAME_URL)
     753             :     {
     754           2 :         if (rVal >>= aStrVal)
     755           2 :             p->SetURL(aStrVal);
     756             :     }
     757           2 :     else if (rName == SC_UNONAME_REPR)
     758             :     {
     759           2 :         if (rVal >>= aStrVal)
     760           2 :             p->SetRepresentation(aStrVal);
     761             :     }
     762           0 :     else if (rName == SC_UNONAME_TARGET)
     763             :     {
     764           0 :         if (rVal >>= aStrVal)
     765           0 :             p->SetTargetFrame(aStrVal);
     766             :     }
     767             :     else
     768           0 :         throw beans::UnknownPropertyException();
     769             : }
     770             : 
     771          27 : uno::Any ScEditFieldObj::getPropertyValueURL(const OUString& rName)
     772             : {
     773          27 :     uno::Any aRet;
     774             : 
     775             :     // anchor type is always "as character", text wrap always "none"
     776             : 
     777          27 :     if (mpEditSource)
     778             :     {
     779             :         //! Feld-Funktionen muessen an den Forwarder !!!
     780          27 :         ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
     781          27 :         ScUnoEditEngine aTempEngine(pEditEngine);
     782             : 
     783             :         //  Typ egal (in Zellen gibts nur URLs)
     784             :         const SvxFieldData* pField = aTempEngine.FindByPos(
     785          27 :             aSelection.nStartPara, aSelection.nStartPos, text::textfield::Type::UNSPECIFIED);
     786             :         OSL_ENSURE(pField,"getPropertyValue: Feld nicht gefunden");
     787          27 :         if (!pField)
     788           0 :             throw uno::RuntimeException();
     789             : 
     790          27 :         if (pField->GetClassId() != text::textfield::Type::URL)
     791           0 :             throw uno::RuntimeException();
     792             : 
     793          27 :         const SvxURLField* pURL = static_cast<const SvxURLField*>(pField);
     794             : 
     795          27 :         if (rName == SC_UNONAME_URL)
     796           9 :             aRet <<= pURL->GetURL();
     797          18 :         else if (rName == SC_UNONAME_REPR)
     798           9 :             aRet <<= pURL->GetRepresentation();
     799           9 :         else if (rName == SC_UNONAME_TARGET)
     800           9 :             aRet <<= pURL->GetTargetFrame();
     801             :         else
     802           0 :             throw beans::UnknownPropertyException();
     803             :     }
     804             :     else        // noch nicht eingefuegt
     805             :     {
     806           0 :         const SvxFieldData* pField = getData();
     807           0 :         if (!pField)
     808           0 :             return aRet;
     809             : 
     810           0 :         const SvxURLField* pURL = static_cast<const SvxURLField*>(pField);
     811           0 :         if (rName == SC_UNONAME_URL)
     812           0 :             aRet <<= pURL->GetURL();
     813           0 :         else if (rName == SC_UNONAME_REPR)
     814           0 :             aRet <<= pURL->GetRepresentation();
     815           0 :         else if (rName == SC_UNONAME_TARGET)
     816           0 :             aRet <<= pURL->GetTargetFrame();
     817             :         else
     818           0 :             throw beans::UnknownPropertyException();
     819             :     }
     820          27 :     return aRet;
     821             : }
     822             : 
     823           0 : void ScEditFieldObj::setPropertyValueFile(const OUString& rName, const uno::Any& rVal)
     824             : {
     825           0 :     if (rName == SC_UNONAME_FILEFORM)
     826             :     {
     827           0 :         sal_Int16 nIntVal = 0;
     828           0 :         if (rVal >>= nIntVal)
     829             :         {
     830           0 :             SvxFileFormat eFormat = lcl_UnoToSvxFileFormat(nIntVal);
     831           0 :             if (mpEditSource)
     832             :             {
     833           0 :                 ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
     834           0 :                 ScUnoEditEngine aTempEngine(pEditEngine);
     835             :                 SvxFieldData* pField = aTempEngine.FindByPos(
     836           0 :                         aSelection.nStartPara, aSelection.nStartPos, text::textfield::Type::EXTENDED_FILE);
     837             :                 OSL_ENSURE(pField, "setPropertyValueFile: Field not found");
     838           0 :                 if (pField)
     839             :                 {
     840           0 :                     SvxExtFileField* pExtFile = static_cast<SvxExtFileField*>(pField);   // local to the ScUnoEditEngine
     841           0 :                     pExtFile->SetFormat(eFormat);
     842           0 :                     pEditEngine->QuickInsertField(SvxFieldItem(*pField, EE_FEATURE_FIELD), aSelection);
     843           0 :                     mpEditSource->UpdateData();
     844           0 :                 }
     845             :             }
     846             :             else
     847             :             {
     848           0 :                 SvxFieldData* pField = getData();
     849           0 :                 SvxExtFileField* pExtFile = static_cast<SvxExtFileField*>(pField);
     850           0 :                 pExtFile->SetFormat(eFormat);
     851             :             }
     852             :         }
     853             :     }
     854             :     else
     855           0 :         throw beans::UnknownPropertyException();
     856           0 : }
     857             : 
     858           0 : uno::Any ScEditFieldObj::getPropertyValueFile(const OUString& rName)
     859             : {
     860           0 :     uno::Any aRet;
     861           0 :     if (rName == SC_UNONAME_FILEFORM)
     862             :     {
     863           0 :         SvxFileFormat eFormat = SVXFILEFORMAT_NAME_EXT;
     864           0 :         const SvxFieldData* pField = NULL;
     865           0 :         if (mpEditSource)
     866             :         {
     867           0 :             ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
     868           0 :             ScUnoEditEngine aTempEngine(pEditEngine);
     869             :             pField = aTempEngine.FindByPos(
     870           0 :                 aSelection.nStartPara, aSelection.nStartPos, text::textfield::Type::EXTENDED_FILE);
     871             :         }
     872             :         else
     873           0 :             pField = getData();
     874             : 
     875             :         OSL_ENSURE(pField, "setPropertyValueFile: Field not found");
     876           0 :         if (!pField)
     877           0 :             throw uno::RuntimeException();
     878             : 
     879           0 :         const SvxExtFileField* pExtFile = static_cast<const SvxExtFileField*>(pField);
     880           0 :         eFormat = pExtFile->GetFormat();
     881           0 :         sal_Int16 nIntVal = lcl_SvxToUnoFileFormat(eFormat);
     882           0 :         aRet <<= nIntVal;
     883             :     }
     884             :     else
     885           0 :         throw beans::UnknownPropertyException();
     886             : 
     887           0 :     return aRet;
     888             : }
     889             : 
     890         312 : void ScEditFieldObj::setPropertyValueDateTime(const OUString& rName, const uno::Any& rVal)
     891             : {
     892         312 :     if (mpEditSource)
     893             :     {
     894             :         // Field already inserted.
     895          12 :         ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
     896          12 :         ScUnoEditEngine aTempEngine(pEditEngine);
     897          12 :         SvxFieldData* pField = aTempEngine.FindByPos(aSelection.nStartPara, aSelection.nStartPos, meType);
     898          12 :         if (!pField)
     899         312 :             return;
     900             : 
     901          12 :         switch (meType)
     902             :         {
     903             :             case text::textfield::Type::DATE:
     904             :             {
     905           0 :                 SvxDateField* p = static_cast<SvxDateField*>(pField);
     906           0 :                 if (rName == SC_UNONAME_ISDATE)
     907             :                 {
     908             :                     // Do nothing for now.
     909             :                 }
     910           0 :                 else if (rName == SC_UNONAME_ISFIXED)
     911             :                 {
     912           0 :                     SvxDateType eType = rVal.get<sal_Bool>() ? SVXDATETYPE_FIX : SVXDATETYPE_VAR;
     913           0 :                     p->SetType(eType);
     914             :                 }
     915           0 :                 else if (rName == SC_UNONAME_DATETIME)
     916             :                 {
     917           0 :                     maDateTime = rVal.get<util::DateTime>();
     918           0 :                     Date aDate(maDateTime.Day, maDateTime.Month, maDateTime.Year);
     919           0 :                     p->SetFixDate(aDate);
     920             :                 }
     921           0 :                 else if (rName == SC_UNONAME_NUMFMT)
     922             :                 {
     923           0 :                     mnNumFormat = rVal.get<sal_Int32>();
     924           0 :                     p->SetFormat(static_cast<SvxDateFormat>(mnNumFormat));
     925             :                 }
     926             :                 else
     927           0 :                     throw beans::UnknownPropertyException();
     928             :             }
     929           0 :             break;
     930             :             case text::textfield::Type::TIME:
     931             :             {
     932             :                 // SvxTimeField doesn't have any attributes.
     933          39 :                 if (rName != SC_UNONAME_ISDATE && rName != SC_UNONAME_ISFIXED &&
     934          21 :                     rName != SC_UNONAME_DATETIME && rName != SC_UNONAME_NUMFMT)
     935           0 :                     throw beans::UnknownPropertyException();
     936             :             }
     937          12 :             break;
     938             :             case text::textfield::Type::EXTENDED_TIME:
     939             :             {
     940           0 :                 SvxExtTimeField* p = static_cast<SvxExtTimeField*>(pField);
     941           0 :                 if (rName == SC_UNONAME_ISDATE)
     942             :                 {
     943             :                     // Do nothing for now.
     944             :                 }
     945           0 :                 else if (rName == SC_UNONAME_ISFIXED)
     946             :                 {
     947           0 :                     SvxTimeType eType = rVal.get<sal_Bool>() ? SVXTIMETYPE_FIX : SVXTIMETYPE_VAR;
     948           0 :                     p->SetType(eType);
     949             :                 }
     950           0 :                 else if (rName == SC_UNONAME_DATETIME)
     951             :                 {
     952           0 :                     maDateTime = rVal.get<util::DateTime>();
     953           0 :                     Time aTime(maDateTime.Hours, maDateTime.Minutes, maDateTime.Seconds, maDateTime.NanoSeconds);
     954           0 :                     p->SetFixTime(aTime);
     955             :                 }
     956           0 :                 else if (rName == SC_UNONAME_NUMFMT)
     957             :                 {
     958           0 :                     mnNumFormat = rVal.get<sal_Int32>();
     959           0 :                     p->SetFormat(static_cast<SvxTimeFormat>(mnNumFormat));
     960             :                 }
     961             :                 else
     962           0 :                     throw beans::UnknownPropertyException();
     963             :             }
     964           0 :             break;
     965             :             default:
     966           0 :                 throw beans::UnknownPropertyException();
     967          12 :         }
     968             :     }
     969             :     else
     970             :     {
     971         300 :         if (rName == SC_UNONAME_ISDATE)
     972         150 :             mbIsDate = rVal.get<sal_Bool>();
     973         150 :         else if (rName == SC_UNONAME_ISFIXED)
     974         150 :             mbIsFixed = rVal.get<sal_Bool>();
     975           0 :         else if (rName == SC_UNONAME_DATETIME)
     976           0 :             maDateTime = rVal.get<util::DateTime>();
     977           0 :         else if (rName == SC_UNONAME_NUMFMT)
     978           0 :             mnNumFormat = rVal.get<sal_Int32>();
     979             :         else
     980           0 :             throw beans::UnknownPropertyException();
     981             :     }
     982             : }
     983             : 
     984          24 : uno::Any ScEditFieldObj::getPropertyValueDateTime(const OUString& rName)
     985             : {
     986          24 :     if (mpEditSource)
     987             :     {
     988             :         // Field already inserted.
     989          24 :         ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
     990          24 :         ScUnoEditEngine aTempEngine(pEditEngine);
     991          24 :         SvxFieldData* pField = aTempEngine.FindByPos(aSelection.nStartPara, aSelection.nStartPos, meType);
     992          24 :         if (!pField)
     993           0 :             throw uno::RuntimeException();
     994             : 
     995          24 :         switch (meType)
     996             :         {
     997             :             case text::textfield::Type::DATE:
     998             :             {
     999           0 :                 SvxDateField* p = static_cast<SvxDateField*>(pField);
    1000           0 :                 if (rName == SC_UNONAME_ISDATE)
    1001           0 :                     return uno::makeAny(sal_True);
    1002             : 
    1003           0 :                 if (rName == SC_UNONAME_ISFIXED)
    1004           0 :                     return uno::makeAny<sal_Bool>(p->GetType() == SVXDATETYPE_FIX);
    1005             : 
    1006           0 :                 if (rName == SC_UNONAME_DATETIME)
    1007             :                 {
    1008           0 :                     Date aD(p->GetFixDate());
    1009           0 :                     maDateTime.Year = aD.GetYear();
    1010           0 :                     maDateTime.Month = aD.GetMonth();
    1011           0 :                     maDateTime.Day = aD.GetDay();
    1012           0 :                     maDateTime.Hours = 0;
    1013           0 :                     maDateTime.Minutes = 0;
    1014           0 :                     maDateTime.Seconds = 0;
    1015           0 :                     maDateTime.NanoSeconds = 0;
    1016           0 :                     return uno::makeAny(maDateTime);
    1017             :                 }
    1018             : 
    1019           0 :                 if (rName == SC_UNONAME_NUMFMT)
    1020           0 :                     return uno::makeAny<sal_Int32>(p->GetFormat());
    1021             :             }
    1022           0 :             break;
    1023             :             case text::textfield::Type::TIME:
    1024             :             {
    1025             :                 // SvxTimeField doesn't have any attributes.
    1026          24 :                 if (rName == SC_UNONAME_ISDATE)
    1027           6 :                     return uno::makeAny(sal_False);
    1028             : 
    1029          18 :                 if (rName == SC_UNONAME_ISFIXED)
    1030           6 :                     return uno::makeAny(sal_False);
    1031             : 
    1032          12 :                 if (rName == SC_UNONAME_DATETIME)
    1033             :                     // This is the best we can do.
    1034           6 :                     return uno::makeAny(maDateTime);
    1035             : 
    1036           6 :                 if (rName == SC_UNONAME_NUMFMT)
    1037             :                     // Same as above.
    1038           6 :                     return uno::makeAny<sal_Int32>(0);
    1039             :             }
    1040           0 :             break;
    1041             :             case text::textfield::Type::EXTENDED_TIME:
    1042             :             {
    1043           0 :                 SvxExtTimeField* p = static_cast<SvxExtTimeField*>(pField);
    1044           0 :                 if (rName == SC_UNONAME_ISDATE)
    1045           0 :                     return uno::makeAny(sal_False);
    1046             : 
    1047           0 :                 if (rName == SC_UNONAME_ISFIXED)
    1048           0 :                     return uno::makeAny<sal_Bool>(p->GetType() == SVXTIMETYPE_FIX);
    1049             : 
    1050           0 :                 if (rName == SC_UNONAME_DATETIME)
    1051             :                 {
    1052           0 :                     Time aT(p->GetFixTime());
    1053           0 :                     maDateTime.Year = 0;
    1054           0 :                     maDateTime.Month = 0;
    1055           0 :                     maDateTime.Day = 0;
    1056           0 :                     maDateTime.Hours = aT.GetHour();
    1057           0 :                     maDateTime.Minutes = aT.GetMin();
    1058           0 :                     maDateTime.Seconds = aT.GetSec();
    1059           0 :                     maDateTime.NanoSeconds = aT.GetNanoSec();
    1060           0 :                     return uno::makeAny(maDateTime);
    1061             :                 }
    1062             : 
    1063           0 :                 if (rName == SC_UNONAME_NUMFMT)
    1064           0 :                     return uno::makeAny<sal_Int32>(p->GetFormat());
    1065             :             }
    1066           0 :             break;
    1067             :             default:
    1068             :                 ;
    1069           0 :         }
    1070             :     }
    1071             :     else
    1072             :     {
    1073           0 :         if (rName == SC_UNONAME_ISDATE)
    1074           0 :             return uno::makeAny<sal_Bool>(mbIsDate);
    1075             : 
    1076           0 :         if (rName == SC_UNONAME_ISFIXED)
    1077           0 :             return uno::makeAny<sal_Bool>(mbIsFixed);
    1078             : 
    1079           0 :         if (rName == SC_UNONAME_DATETIME)
    1080           0 :             return uno::makeAny(maDateTime);
    1081             : 
    1082           0 :         if (rName == SC_UNONAME_NUMFMT)
    1083           0 :             return uno::makeAny(mnNumFormat);
    1084             :     }
    1085             : 
    1086           0 :     throw beans::UnknownPropertyException();
    1087             : }
    1088             : 
    1089           0 : void ScEditFieldObj::setPropertyValueSheet(const OUString& rName, const uno::Any& rVal)
    1090             : {
    1091           0 :     if (mpEditSource)
    1092             :     {
    1093             :         // Edit engine instance already exists for this field item.  Use it.
    1094           0 :         ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
    1095           0 :         ScUnoEditEngine aTempEngine(pEditEngine);
    1096             : 
    1097             :         //  Typ egal (in Zellen gibts nur URLs)
    1098             :         SvxFieldData* pField = aTempEngine.FindByPos(
    1099           0 :             aSelection.nStartPara, aSelection.nStartPos, text::textfield::Type::UNSPECIFIED);
    1100             :         OSL_ENSURE(pField,"setPropertyValue: Feld nicht gefunden");
    1101           0 :         if (!pField)
    1102           0 :             return;
    1103             : 
    1104           0 :         if (pField->GetClassId() != text::textfield::Type::TABLE)
    1105             :             // Make sure this is indeed a URL field.
    1106           0 :             return;
    1107             : 
    1108           0 :         SvxTableField* p = static_cast<SvxTableField*>(pField);
    1109             : 
    1110           0 :         if (rName == SC_UNONAME_TABLEPOS)
    1111             :         {
    1112           0 :             sal_Int32 nTab = rVal.get<sal_Int32>();
    1113           0 :             p->SetTab(nTab);
    1114             :         }
    1115             :         else
    1116           0 :             throw beans::UnknownPropertyException();
    1117             : 
    1118           0 :         pEditEngine->QuickInsertField(SvxFieldItem(*pField, EE_FEATURE_FIELD), aSelection);
    1119           0 :         mpEditSource->UpdateData();
    1120           0 :         return;
    1121             :     }
    1122             : 
    1123             :     // Edit engine instance not yet present.  Store the item data for later use.
    1124           0 :     SvxFieldData* pData = getData();
    1125           0 :     if (!pData)
    1126           0 :         throw uno::RuntimeException();
    1127             : 
    1128           0 :     SvxTableField* p = static_cast<SvxTableField*>(pData);
    1129           0 :     if (rName == SC_UNONAME_TABLEPOS)
    1130             :     {
    1131           0 :         sal_Int32 nTab = rVal.get<sal_Int32>();
    1132           0 :         p->SetTab(nTab);
    1133             :     }
    1134             :     else
    1135           0 :         throw beans::UnknownPropertyException();
    1136             : 
    1137             : }
    1138             : 
    1139         701 : ScEditFieldObj::ScEditFieldObj(
    1140             :     const uno::Reference<text::XTextRange>& rContent,
    1141             :     ScEditSource* pEditSrc, sal_Int32 eType, const ESelection& rSel) :
    1142         701 :     OComponentHelper(getMutex()),
    1143             :     pPropSet(NULL),
    1144             :     mpEditSource(pEditSrc),
    1145             :     aSelection(rSel),
    1146        1402 :     meType(eType), mpData(NULL), mpContent(rContent), mnNumFormat(0), mbIsDate(false), mbIsFixed(false)
    1147             : {
    1148         701 :     switch (meType)
    1149             :     {
    1150             :         case text::textfield::Type::DOCINFO_TITLE:
    1151          78 :             pPropSet = getEmptyPropertySet();
    1152          78 :         break;
    1153             :         case text::textfield::Type::EXTENDED_FILE:
    1154           2 :             pPropSet = lcl_GetFileFieldPropertySet();
    1155           2 :         break;
    1156             :         case text::textfield::Type::URL:
    1157          16 :             pPropSet = lcl_GetURLPropertySet();
    1158          16 :         break;
    1159             :         case text::textfield::Type::DATE:
    1160             :         case text::textfield::Type::TIME:
    1161             :         case text::textfield::Type::EXTENDED_TIME:
    1162         162 :             pPropSet = getDateTimePropertySet();
    1163         162 :         break;
    1164             :         default:
    1165         443 :             pPropSet = lcl_GetHeaderFieldPropertySet();
    1166             :     }
    1167             : 
    1168         701 :     if (meType == text::textfield::Type::DATE)
    1169           3 :         mbIsDate = true;
    1170         701 : }
    1171             : 
    1172         671 : void ScEditFieldObj::InitDoc(
    1173             :     const uno::Reference<text::XTextRange>& rContent, ScEditSource* pEditSrc, const ESelection& rSel)
    1174             : {
    1175         671 :     if (!mpEditSource)
    1176             :     {
    1177         671 :         mpContent = rContent;
    1178         671 :         mpData.reset();
    1179             : 
    1180         671 :         aSelection = rSel;
    1181         671 :         mpEditSource = pEditSrc;
    1182             :     }
    1183         671 : }
    1184             : 
    1185        2103 : ScEditFieldObj::~ScEditFieldObj()
    1186             : {
    1187         701 :     delete mpEditSource;
    1188        1402 : }
    1189             : 
    1190         671 : SvxFieldItem ScEditFieldObj::CreateFieldItem()
    1191             : {
    1192             :     OSL_ENSURE( !mpEditSource, "CreateFieldItem mit eingefuegtem Feld" );
    1193         671 :     return SvxFieldItem(*getData(), EE_FEATURE_FIELD);
    1194             : }
    1195             : 
    1196           6 : sal_Int32 ScEditFieldObj::GetFieldType() const
    1197             : {
    1198           6 :     return meType;
    1199             : }
    1200             : 
    1201           2 : void ScEditFieldObj::DeleteField()
    1202             : {
    1203           2 :     if (mpEditSource)
    1204             :     {
    1205           2 :         SvxTextForwarder* pForwarder = mpEditSource->GetTextForwarder();
    1206           2 :         pForwarder->QuickInsertText( String(), aSelection );
    1207           2 :         mpEditSource->UpdateData();
    1208             : 
    1209           2 :         aSelection.nEndPara = aSelection.nStartPara;
    1210           2 :         aSelection.nEndPos  = aSelection.nStartPos;
    1211             : 
    1212             :         //! Broadcast, um Selektion in anderen Objekten anzupassen
    1213             :         //! (auch bei anderen Aktionen)
    1214             :     }
    1215           2 : }
    1216             : 
    1217         673 : bool ScEditFieldObj::IsInserted() const
    1218             : {
    1219         673 :     return mpEditSource != NULL;
    1220             : }
    1221             : 
    1222             : // XTextField
    1223             : 
    1224           2 : OUString SAL_CALL ScEditFieldObj::getPresentation( sal_Bool bShowCommand )
    1225             :                                                     throw(uno::RuntimeException)
    1226             : {
    1227           2 :     SolarMutexGuard aGuard;
    1228             : 
    1229           2 :     if (!mpEditSource)
    1230           0 :         return OUString();
    1231             : 
    1232             :     //! Feld-Funktionen muessen an den Forwarder !!!
    1233           2 :     ScEditEngineDefaulter* pEditEngine = mpEditSource->GetEditEngine();
    1234           4 :     ScUnoEditEngine aTempEngine(pEditEngine);
    1235             : 
    1236             :     //  Typ egal (in Zellen gibts nur URLs)
    1237             :     const SvxFieldData* pField = aTempEngine.FindByPos(
    1238           2 :         aSelection.nStartPara, aSelection.nStartPos, text::textfield::Type::UNSPECIFIED);
    1239             :     OSL_ENSURE(pField,"getPresentation: Feld nicht gefunden");
    1240           2 :     if (!pField)
    1241           0 :         return OUString();
    1242             : 
    1243           2 :     switch (meType)
    1244             :     {
    1245             :         case text::textfield::Type::URL:
    1246             :         {
    1247           2 :             if (pField->GetClassId() != text::textfield::Type::URL)
    1248             :                 // Not an URL field, but URL is expected.
    1249           0 :                 throw uno::RuntimeException();
    1250             : 
    1251           2 :             const SvxURLField* pURL = static_cast<const SvxURLField*>(pField);
    1252           2 :             return bShowCommand ? pURL->GetURL() : pURL->GetRepresentation();
    1253             :         }
    1254             :         break;
    1255             :         default:
    1256             :             ;
    1257             :     }
    1258           2 :     return OUString();
    1259             : }
    1260             : 
    1261             : // XTextContent
    1262             : 
    1263           2 : void SAL_CALL ScEditFieldObj::attach( const uno::Reference<text::XTextRange>& xTextRange )
    1264             :                                 throw(lang::IllegalArgumentException, uno::RuntimeException)
    1265             : {
    1266           2 :     SolarMutexGuard aGuard;
    1267           2 :     if (xTextRange.is())
    1268             :     {
    1269           2 :         uno::Reference<text::XText> xText(xTextRange->getText());
    1270           2 :         if (xText.is())
    1271             :         {
    1272           3 :             xText->insertTextContent( xTextRange, this, sal_True );
    1273           2 :         }
    1274           2 :     }
    1275           1 : }
    1276             : 
    1277           4 : uno::Reference<text::XTextRange> SAL_CALL ScEditFieldObj::getAnchor() throw(uno::RuntimeException)
    1278             : {
    1279           4 :     SolarMutexGuard aGuard;
    1280           4 :     return mpContent;
    1281             : }
    1282             : 
    1283             : // XComponent
    1284             : 
    1285           0 : void SAL_CALL ScEditFieldObj::dispose() throw(uno::RuntimeException)
    1286             : {
    1287           0 :     OComponentHelper::dispose();
    1288           0 : }
    1289             : 
    1290           0 : void SAL_CALL ScEditFieldObj::addEventListener(
    1291             :                         const uno::Reference<lang::XEventListener>& xListener )
    1292             :                                                     throw(uno::RuntimeException)
    1293             : {
    1294           0 :     OComponentHelper::addEventListener( xListener );
    1295           0 : }
    1296             : 
    1297           0 : void SAL_CALL ScEditFieldObj::removeEventListener(
    1298             :                         const uno::Reference<lang::XEventListener>& xListener )
    1299             :                                                     throw(uno::RuntimeException)
    1300             : {
    1301           0 :     OComponentHelper::removeEventListener( xListener );
    1302           0 : }
    1303             : 
    1304             : // XPropertySet
    1305             : 
    1306         464 : uno::Reference<beans::XPropertySetInfo> SAL_CALL ScEditFieldObj::getPropertySetInfo()
    1307             :                                                         throw(uno::RuntimeException)
    1308             : {
    1309         464 :     SolarMutexGuard aGuard;
    1310         464 :     uno::Reference<beans::XPropertySetInfo> aRef = pPropSet->getPropertySetInfo();
    1311         464 :     return aRef;
    1312             : }
    1313             : 
    1314         328 : void SAL_CALL ScEditFieldObj::setPropertyValue(
    1315             :                         const OUString& aPropertyName, const uno::Any& aValue )
    1316             :                 throw(beans::UnknownPropertyException, beans::PropertyVetoException,
    1317             :                         lang::IllegalArgumentException, lang::WrappedTargetException,
    1318             :                         uno::RuntimeException)
    1319             : {
    1320         328 :     SolarMutexGuard aGuard;
    1321         328 :     if (aPropertyName == SC_UNONAME_ANCHOR)
    1322             :     {
    1323           0 :         aValue >>= mpContent;
    1324         328 :         return;
    1325             :     }
    1326             : 
    1327         328 :     switch (meType)
    1328             :     {
    1329             :         case text::textfield::Type::URL:
    1330          16 :             setPropertyValueURL(aPropertyName, aValue);
    1331          16 :         break;
    1332             :         case text::textfield::Type::EXTENDED_FILE:
    1333           0 :             setPropertyValueFile(aPropertyName, aValue);
    1334           0 :         break;
    1335             :         case text::textfield::Type::DATE:
    1336             :         case text::textfield::Type::TIME:
    1337             :         case text::textfield::Type::EXTENDED_TIME:
    1338         312 :             setPropertyValueDateTime(aPropertyName, aValue);
    1339         312 :         break;
    1340             :         case text::textfield::Type::TABLE:
    1341           0 :             setPropertyValueSheet(aPropertyName, aValue);
    1342           0 :         break;
    1343             :         case text::textfield::Type::DOCINFO_TITLE:
    1344             :         default:
    1345           0 :             throw beans::UnknownPropertyException();
    1346         328 :     }
    1347             : }
    1348             : 
    1349          54 : uno::Any SAL_CALL ScEditFieldObj::getPropertyValue( const OUString& aPropertyName )
    1350             :                 throw(beans::UnknownPropertyException, lang::WrappedTargetException,
    1351             :                         uno::RuntimeException)
    1352             : {
    1353          54 :     SolarMutexGuard aGuard;
    1354          54 :     if (aPropertyName.equals(SC_UNONAME_TEXTFIELD_TYPE))
    1355           0 :         return uno::makeAny(meType);
    1356             : 
    1357          54 :     if (aPropertyName == SC_UNONAME_ANCHOR)
    1358           0 :         return uno::makeAny(mpContent);
    1359             : 
    1360          54 :     if (aPropertyName == SC_UNONAME_ANCTYPE)
    1361             :     {
    1362           1 :         uno::Any aRet;
    1363           1 :         aRet <<= text::TextContentAnchorType_AS_CHARACTER;
    1364           1 :         return aRet;
    1365             :     }
    1366          53 :     if (aPropertyName == SC_UNONAME_ANCTYPES)
    1367             :     {
    1368           1 :         uno::Any aRet;
    1369           2 :         uno::Sequence<text::TextContentAnchorType> aSeq(1);
    1370           1 :         aSeq[0] = text::TextContentAnchorType_AS_CHARACTER;
    1371           1 :         aRet <<= aSeq;
    1372           2 :         return aRet;
    1373             :     }
    1374          52 :     if (aPropertyName == SC_UNONAME_TEXTWRAP)
    1375             :     {
    1376           1 :         uno::Any aRet;
    1377           1 :         aRet <<= text::WrapTextMode_NONE;
    1378           1 :         return aRet;
    1379             :     }
    1380             : 
    1381          51 :     switch (meType)
    1382             :     {
    1383             :         case text::textfield::Type::URL:
    1384          27 :             return getPropertyValueURL(aPropertyName);
    1385             :         case text::textfield::Type::EXTENDED_FILE:
    1386           0 :             return getPropertyValueFile(aPropertyName);
    1387             :         case text::textfield::Type::DATE:
    1388             :         case text::textfield::Type::TIME:
    1389             :         case text::textfield::Type::EXTENDED_TIME:
    1390          24 :             return getPropertyValueDateTime(aPropertyName);
    1391             :         case text::textfield::Type::DOCINFO_TITLE:
    1392             :         default:
    1393           0 :             throw beans::UnknownPropertyException();
    1394          54 :     }
    1395             : }
    1396             : 
    1397           0 : SC_IMPL_DUMMY_PROPERTY_LISTENER( ScEditFieldObj )
    1398             : 
    1399             : // XUnoTunnel
    1400             : 
    1401         673 : sal_Int64 SAL_CALL ScEditFieldObj::getSomething(
    1402             :                 const uno::Sequence<sal_Int8 >& rId ) throw(uno::RuntimeException)
    1403             : {
    1404        1346 :     if ( rId.getLength() == 16 &&
    1405         673 :           0 == memcmp( getUnoTunnelId().getConstArray(),
    1406        1346 :                                     rId.getConstArray(), 16 ) )
    1407             :     {
    1408         673 :         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
    1409             :     }
    1410           0 :     return 0;
    1411             : }
    1412             : 
    1413             : namespace
    1414             : {
    1415             :     class theScEditFieldObjUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theScEditFieldObjUnoTunnelId> {};
    1416             : }
    1417             : 
    1418        1346 : const uno::Sequence<sal_Int8>& ScEditFieldObj::getUnoTunnelId()
    1419             : {
    1420        1346 :     return theScEditFieldObjUnoTunnelId::get().getSeq();
    1421             : }
    1422             : 
    1423         673 : ScEditFieldObj* ScEditFieldObj::getImplementation(const uno::Reference<text::XTextContent>& xObj)
    1424             : {
    1425         673 :     ScEditFieldObj* pRet = NULL;
    1426         673 :     uno::Reference<lang::XUnoTunnel> xUT( xObj, uno::UNO_QUERY );
    1427         673 :     if (xUT.is())
    1428         673 :         pRet = reinterpret_cast<ScEditFieldObj*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId())));
    1429         673 :     return pRet;
    1430             : }
    1431             : 
    1432             : // XServiceInfo
    1433             : 
    1434           0 : OUString SAL_CALL ScEditFieldObj::getImplementationName() throw(uno::RuntimeException)
    1435             : {
    1436           0 :     return OUString("ScEditFieldObj");
    1437             : }
    1438             : 
    1439           0 : sal_Bool SAL_CALL ScEditFieldObj::supportsService( const OUString& rServiceName )
    1440             :                                                     throw(uno::RuntimeException)
    1441             : {
    1442           0 :     return rServiceName == SCTEXTFIELD_SERVICE || rServiceName == SCTEXTCONTENT_SERVICE;
    1443             : }
    1444             : 
    1445           0 : uno::Sequence<OUString> SAL_CALL ScEditFieldObj::getSupportedServiceNames()
    1446             :                                                     throw(uno::RuntimeException)
    1447             : {
    1448           0 :     uno::Sequence<OUString> aRet(2);
    1449           0 :     OUString* pArray = aRet.getArray();
    1450           0 :     pArray[0] = SCTEXTFIELD_SERVICE;
    1451           0 :     pArray[1] = SCTEXTCONTENT_SERVICE;
    1452           0 :     return aRet;
    1453             : }
    1454             : 
    1455           0 : uno::Sequence<uno::Type> SAL_CALL ScEditFieldObj::getTypes() throw(uno::RuntimeException)
    1456             : {
    1457           0 :     static uno::Sequence<uno::Type> aTypes;
    1458           0 :     if ( aTypes.getLength() == 0 )
    1459             :     {
    1460           0 :         uno::Sequence<uno::Type> aParentTypes(OComponentHelper::getTypes());
    1461           0 :         long nParentLen = aParentTypes.getLength();
    1462           0 :         const uno::Type* pParentPtr = aParentTypes.getConstArray();
    1463             : 
    1464           0 :         aTypes.realloc( nParentLen + 4 );
    1465           0 :         uno::Type* pPtr = aTypes.getArray();
    1466           0 :         pPtr[nParentLen + 0] = getCppuType((const uno::Reference<text::XTextField>*)0);
    1467           0 :         pPtr[nParentLen + 1] = getCppuType((const uno::Reference<beans::XPropertySet>*)0);
    1468           0 :         pPtr[nParentLen + 2] = getCppuType((const uno::Reference<lang::XUnoTunnel>*)0);
    1469           0 :         pPtr[nParentLen + 3] = getCppuType((const uno::Reference<lang::XServiceInfo>*)0);
    1470             : 
    1471           0 :         for (long i=0; i<nParentLen; i++)
    1472           0 :             pPtr[i] = pParentPtr[i];                // parent types first
    1473             :     }
    1474           0 :     return aTypes;
    1475             : }
    1476             : 
    1477             : namespace
    1478             : {
    1479             :     class theScEditFieldObjImplementationId : public rtl::Static<UnoTunnelIdInit, theScEditFieldObjImplementationId> {};
    1480             : }
    1481             : 
    1482           0 : uno::Sequence<sal_Int8> SAL_CALL ScEditFieldObj::getImplementationId()
    1483             :                                                     throw(uno::RuntimeException)
    1484             : {
    1485           0 :     return theScEditFieldObjImplementationId::get().getSeq();
    1486          93 : }
    1487             : 
    1488             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10