fielduno.cxx (b3f79822) fielduno.cxx (7a980842)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 111 unchanged lines hidden (view full) ---

120};
121
122class ScUnoEditEngine : public ScEditEngineDefaulter
123{
124 ScUnoCollectMode eMode;
125 sal_uInt16 nFieldCount;
126 TypeId aFieldType;
127 SvxFieldData* pFound; // lokale Kopie
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 111 unchanged lines hidden (view full) ---

120};
121
122class ScUnoEditEngine : public ScEditEngineDefaulter
123{
124 ScUnoCollectMode eMode;
125 sal_uInt16 nFieldCount;
126 TypeId aFieldType;
127 SvxFieldData* pFound; // lokale Kopie
128 sal_uInt16 nFieldPar;
128 sal_uInt32 nFieldPar;
129 xub_StrLen nFieldPos;
130 sal_uInt16 nFieldIndex;
131
132public:
133 ScUnoEditEngine(ScEditEngineDefaulter* pSource);
134 ~ScUnoEditEngine();
135
136 //! nPos should be xub_StrLen
129 xub_StrLen nFieldPos;
130 sal_uInt16 nFieldIndex;
131
132public:
133 ScUnoEditEngine(ScEditEngineDefaulter* pSource);
134 ~ScUnoEditEngine();
135
136 //! nPos should be xub_StrLen
137 virtual String CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos,
137 virtual String CalcFieldValue( const SvxFieldItem& rField, sal_uInt32 nPara, sal_uInt16 nPos,
138 Color*& rTxtColor, Color*& rFldColor );
139
140 sal_uInt16 CountFields(TypeId aType);
141 SvxFieldData* FindByIndex(sal_uInt16 nIndex, TypeId aType);
138 Color*& rTxtColor, Color*& rFldColor );
139
140 sal_uInt16 CountFields(TypeId aType);
141 SvxFieldData* FindByIndex(sal_uInt16 nIndex, TypeId aType);
142 SvxFieldData* FindByPos(sal_uInt16 nPar, xub_StrLen nPos, TypeId aType);
142 SvxFieldData* FindByPos(sal_uInt32 nPar, xub_StrLen nPos, TypeId aType);
143
143
144 sal_uInt16 GetFieldPar() const { return nFieldPar; }
144 sal_uInt32 GetFieldPar() const { return nFieldPar; }
145 xub_StrLen GetFieldPos() const { return nFieldPos; }
146};
147
148ScUnoEditEngine::ScUnoEditEngine(ScEditEngineDefaulter* pSource) :
149 ScEditEngineDefaulter( *pSource ),
150 eMode( SC_UNO_COLLECT_NONE ),
151 nFieldCount( 0 ),
152 aFieldType( NULL ),

--- 8 unchanged lines hidden (view full) ---

161}
162
163ScUnoEditEngine::~ScUnoEditEngine()
164{
165 delete pFound;
166}
167
168String ScUnoEditEngine::CalcFieldValue( const SvxFieldItem& rField,
145 xub_StrLen GetFieldPos() const { return nFieldPos; }
146};
147
148ScUnoEditEngine::ScUnoEditEngine(ScEditEngineDefaulter* pSource) :
149 ScEditEngineDefaulter( *pSource ),
150 eMode( SC_UNO_COLLECT_NONE ),
151 nFieldCount( 0 ),
152 aFieldType( NULL ),

--- 8 unchanged lines hidden (view full) ---

161}
162
163ScUnoEditEngine::~ScUnoEditEngine()
164{
165 delete pFound;
166}
167
168String ScUnoEditEngine::CalcFieldValue( const SvxFieldItem& rField,
169 sal_uInt16 nPara, sal_uInt16 nPos, Color*& rTxtColor, Color*& rFldColor )
169 sal_uInt32 nPara, sal_uInt16 nPos, Color*& rTxtColor, Color*& rFldColor )
170{
171 String aRet(EditEngine::CalcFieldValue( rField, nPara, nPos, rTxtColor, rFldColor ));
172 if (eMode != SC_UNO_COLLECT_NONE)
173 {
174 const SvxFieldData* pFieldData = rField.GetField();
175 if ( pFieldData )
176 {
177 if ( !aFieldType || pFieldData->Type() == aFieldType )

--- 37 unchanged lines hidden (view full) ---

215 nFieldCount = 0;
216 UpdateFields();
217 aFieldType = NULL;
218 eMode = SC_UNO_COLLECT_NONE;
219
220 return pFound;
221}
222
170{
171 String aRet(EditEngine::CalcFieldValue( rField, nPara, nPos, rTxtColor, rFldColor ));
172 if (eMode != SC_UNO_COLLECT_NONE)
173 {
174 const SvxFieldData* pFieldData = rField.GetField();
175 if ( pFieldData )
176 {
177 if ( !aFieldType || pFieldData->Type() == aFieldType )

--- 37 unchanged lines hidden (view full) ---

215 nFieldCount = 0;
216 UpdateFields();
217 aFieldType = NULL;
218 eMode = SC_UNO_COLLECT_NONE;
219
220 return pFound;
221}
222
223SvxFieldData* ScUnoEditEngine::FindByPos(sal_uInt16 nPar, xub_StrLen nPos, TypeId aType)
223SvxFieldData* ScUnoEditEngine::FindByPos(sal_uInt32 nPar, xub_StrLen nPos, TypeId aType)
224{
225 eMode = SC_UNO_COLLECT_FINDPOS;
226 nFieldPar = nPar;
227 nFieldPos = nPos;
228 aFieldType = aType;
229 nFieldCount = 0;
230 UpdateFields();
231 aFieldType = NULL;

--- 58 unchanged lines hidden (view full) ---

290ScCellFieldObj* ScCellFieldsObj::GetObjectByIndex_Impl(sal_Int32 Index) const
291{
292 //! Feld-Funktionen muessen an den Forwarder !!!
293 ScEditEngineDefaulter* pEditEngine = ((ScCellEditSource*)pEditSource)->GetEditEngine();
294 ScUnoEditEngine aTempEngine(pEditEngine);
295
296 if ( aTempEngine.FindByIndex( (sal_uInt16)Index, NULL ) ) // in der Zelle ist der Typ egal
297 {
224{
225 eMode = SC_UNO_COLLECT_FINDPOS;
226 nFieldPar = nPar;
227 nFieldPos = nPos;
228 aFieldType = aType;
229 nFieldCount = 0;
230 UpdateFields();
231 aFieldType = NULL;

--- 58 unchanged lines hidden (view full) ---

290ScCellFieldObj* ScCellFieldsObj::GetObjectByIndex_Impl(sal_Int32 Index) const
291{
292 //! Feld-Funktionen muessen an den Forwarder !!!
293 ScEditEngineDefaulter* pEditEngine = ((ScCellEditSource*)pEditSource)->GetEditEngine();
294 ScUnoEditEngine aTempEngine(pEditEngine);
295
296 if ( aTempEngine.FindByIndex( (sal_uInt16)Index, NULL ) ) // in der Zelle ist der Typ egal
297 {
298 sal_uInt16 nPar = aTempEngine.GetFieldPar();
298 sal_uInt32 nPar = aTempEngine.GetFieldPar();
299 xub_StrLen nPos = aTempEngine.GetFieldPos();
300 ESelection aSelection( nPar, nPos, nPar, nPos+1 ); // Feld ist 1 Zeichen
301 return new ScCellFieldObj( pDocShell, aCellPos, aSelection );
302 }
303 return NULL;
304}
305
306sal_Int32 SAL_CALL ScCellFieldsObj::getCount() throw(uno::RuntimeException)

--- 616 unchanged lines hidden (view full) ---

923 case SC_SERVICE_TITLEFIELD: aTypeId = TYPE(SvxFileField); break;
924 case SC_SERVICE_FILEFIELD: aTypeId = TYPE(SvxExtFileField); break;
925 case SC_SERVICE_SHEETFIELD: aTypeId = TYPE(SvxTableField); break;
926 // bei SC_SERVICE_INVALID bleibt TypeId Null
927 }
928 SvxFieldData* pData = aTempEngine.FindByIndex( (sal_uInt16)Index, aTypeId );
929 if ( pData )
930 {
299 xub_StrLen nPos = aTempEngine.GetFieldPos();
300 ESelection aSelection( nPar, nPos, nPar, nPos+1 ); // Feld ist 1 Zeichen
301 return new ScCellFieldObj( pDocShell, aCellPos, aSelection );
302 }
303 return NULL;
304}
305
306sal_Int32 SAL_CALL ScCellFieldsObj::getCount() throw(uno::RuntimeException)

--- 616 unchanged lines hidden (view full) ---

923 case SC_SERVICE_TITLEFIELD: aTypeId = TYPE(SvxFileField); break;
924 case SC_SERVICE_FILEFIELD: aTypeId = TYPE(SvxExtFileField); break;
925 case SC_SERVICE_SHEETFIELD: aTypeId = TYPE(SvxTableField); break;
926 // bei SC_SERVICE_INVALID bleibt TypeId Null
927 }
928 SvxFieldData* pData = aTempEngine.FindByIndex( (sal_uInt16)Index, aTypeId );
929 if ( pData )
930 {
931 sal_uInt16 nPar = aTempEngine.GetFieldPar();
931 sal_uInt32 nPar = aTempEngine.GetFieldPar();
932 xub_StrLen nPos = aTempEngine.GetFieldPos();
933
934 sal_uInt16 nFieldType = nType;
935 if ( nFieldType == SC_SERVICE_INVALID )
936 {
937 if ( pData->ISA( SvxPageField ) ) nFieldType = SC_SERVICE_PAGEFIELD;
938 else if ( pData->ISA( SvxPagesField ) ) nFieldType = SC_SERVICE_PAGESFIELD;
939 else if ( pData->ISA( SvxDateField ) ) nFieldType = SC_SERVICE_DATEFIELD;

--- 606 unchanged lines hidden ---
932 xub_StrLen nPos = aTempEngine.GetFieldPos();
933
934 sal_uInt16 nFieldType = nType;
935 if ( nFieldType == SC_SERVICE_INVALID )
936 {
937 if ( pData->ISA( SvxPageField ) ) nFieldType = SC_SERVICE_PAGEFIELD;
938 else if ( pData->ISA( SvxPagesField ) ) nFieldType = SC_SERVICE_PAGESFIELD;
939 else if ( pData->ISA( SvxDateField ) ) nFieldType = SC_SERVICE_DATEFIELD;

--- 606 unchanged lines hidden ---