diff options
author | Kurt Zenker <kz@openoffice.org> | 2009-12-03 13:22:13 +0100 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2009-12-03 13:22:13 +0100 |
commit | e9612df407b780c08100da96a7c8a5d457379468 (patch) | |
tree | 073e3ee661c118aeb91549ab25bc34d38935c7b6 /sc | |
parent | 97aa94b893936d4250201f1e2019fd806b4df053 (diff) | |
parent | ef9931cee162db34de60adb23ee7c54083105ff6 (diff) |
CWS-TOOLING: integrate CWS calc32stopper5_DEV300
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleText.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/app/inputwin.cxx | 41 | ||||
-rw-r--r-- | sc/source/ui/app/makefile.mk | 3 | ||||
-rw-r--r-- | sc/source/ui/inc/inputwin.hxx | 13 | ||||
-rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 3 |
5 files changed, 40 insertions, 26 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx index feeae8c73023..fd01269729db 100644 --- a/sc/source/ui/Accessibility/AccessibleText.cxx +++ b/sc/source/ui/Accessibility/AccessibleText.cxx @@ -1181,7 +1181,7 @@ ScAccessibleEditLineTextData::ScAccessibleEditLineTextData(EditView* pEditView, ScTextWnd* pTxtWnd = (ScTextWnd*)pWin; if (pTxtWnd) - pTxtWnd->SetAccessibleTextData(this); + pTxtWnd->InsertAccessibleTextData( *this ); } ScAccessibleEditLineTextData::~ScAccessibleEditLineTextData() @@ -1189,7 +1189,7 @@ ScAccessibleEditLineTextData::~ScAccessibleEditLineTextData() ScTextWnd* pTxtWnd = (ScTextWnd*)mpWindow; if (pTxtWnd) - pTxtWnd->SetAccessibleTextData(NULL); + pTxtWnd->RemoveAccessibleTextData( *this ); if (mbEditEngineCreated && mpEditEngine) { @@ -1210,7 +1210,7 @@ void ScAccessibleEditLineTextData::Dispose() ScTextWnd* pTxtWnd = (ScTextWnd*)mpWindow; if (pTxtWnd) - pTxtWnd->SetAccessibleTextData(NULL); + pTxtWnd->RemoveAccessibleTextData( *this ); ResetEditMode(); mpWindow = NULL; diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 33f26947f49f..fd8009051ec4 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -31,9 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sc.hxx" - - -//------------------------------------------------------------------ +#include <algorithm> #include "scitems.hxx" #include <svx/eeitem.hxx> @@ -738,7 +736,6 @@ ScTextWnd::ScTextWnd( Window* pParent ) DragSourceHelper( this ), pEditEngine ( NULL ), pEditView ( NULL ), - pAccTextData ( NULL ), bIsInsertMode( TRUE ), bFormulaMode ( FALSE ), bInputMode ( FALSE ) @@ -774,8 +771,8 @@ __EXPORT ScTextWnd::~ScTextWnd() { delete pEditView; delete pEditEngine; - if (pAccTextData) - pAccTextData->Dispose(); + for( AccTextDataVector::reverse_iterator aIt = maAccTextDatas.rbegin(), aEnd = maAccTextDatas.rend(); aIt != aEnd; ++aIt ) + (*aIt)->Dispose(); } void __EXPORT ScTextWnd::Paint( const Rectangle& rRec ) @@ -1112,8 +1109,8 @@ void ScTextWnd::StartEditEngine() pEditEngine->SetModifyHdl(LINK(this, ScTextWnd, NotifyHdl)); - if (pAccTextData) - pAccTextData->StartEdit(); + if (!maAccTextDatas.empty()) + maAccTextDatas.back()->StartEdit(); // as long as EditEngine and DrawText sometimes differ for CTL text, // repaint now to have the EditEngine's version visible @@ -1154,8 +1151,8 @@ void ScTextWnd::StopEditEngine( BOOL bAll ) { if (pEditView) { - if (pAccTextData) - pAccTextData->EndEdit(); + if (!maAccTextDatas.empty()) + maAccTextDatas.back()->EndEdit(); ScModule* pScMod = SC_MOD(); @@ -1259,8 +1256,8 @@ void ScTextWnd::SetTextString( const String& rNewString ) aString = rNewString; - if (pAccTextData) - pAccTextData->TextChanged(); + if (!maAccTextDatas.empty()) + maAccTextDatas.back()->TextChanged(); bInputMode = FALSE; } @@ -1317,8 +1314,8 @@ void ScTextWnd::MakeDialogEditView() if ( bIsRTL ) lcl_ModifyRTLVisArea( pEditView ); - if (pAccTextData) - pAccTextData->StartEdit(); + if (!maAccTextDatas.empty()) + maAccTextDatas.back()->StartEdit(); } void ScTextWnd::ImplInitSettings() @@ -1343,6 +1340,22 @@ void ScTextWnd::ImplInitSettings() rtl::OUString(String(ScResId(STR_ACC_EDITLINE_DESCR))), EditLine); } +void ScTextWnd::InsertAccessibleTextData( ScAccessibleEditLineTextData& rTextData ) +{ + OSL_ENSURE( ::std::find( maAccTextDatas.begin(), maAccTextDatas.end(), &rTextData ) == maAccTextDatas.end(), + "ScTextWnd::InsertAccessibleTextData - passed object already registered" ); + maAccTextDatas.push_back( &rTextData ); +} + +void ScTextWnd::RemoveAccessibleTextData( ScAccessibleEditLineTextData& rTextData ) +{ + AccTextDataVector::iterator aEnd = maAccTextDatas.end(); + AccTextDataVector::iterator aIt = ::std::find( maAccTextDatas.begin(), aEnd, &rTextData ); + OSL_ENSURE( aIt != aEnd, "ScTextWnd::RemoveAccessibleTextData - passed object not registered" ); + if( aIt != aEnd ) + maAccTextDatas.erase( aIt ); +} + // ----------------------------------------------------------------------- void ScTextWnd::DataChanged( const DataChangedEvent& rDCEvt ) diff --git a/sc/source/ui/app/makefile.mk b/sc/source/ui/app/makefile.mk index 4f3c2bdcb504..1dbac01e6a44 100644 --- a/sc/source/ui/app/makefile.mk +++ b/sc/source/ui/app/makefile.mk @@ -63,7 +63,8 @@ EXCEPTIONSFILES= \ $(SLO)$/drwtrans.obj \ $(SLO)$/scmod2.obj \ $(SLO)$/scmod.obj \ - $(SLO)$/client.obj + $(SLO)$/client.obj \ + $(SLO)$/inputwin.obj #LIB3TARGET=$(SLB)$/ysclib.lib #LIB3OBJFILES=$(SLO)$/sclib.obj diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx index 48a2a41b0fbc..bded402f5775 100644 --- a/sc/source/ui/inc/inputwin.hxx +++ b/sc/source/ui/inc/inputwin.hxx @@ -31,15 +31,11 @@ #ifndef SC_INPUTWIN_HXX #define SC_INPUTWIN_HXX - -#ifndef _TOOLBOX_HXX //autogen +#include <vector> #include <vcl/toolbox.hxx> -#endif #include <sfx2/childwin.hxx> #include <svtools/lstner.hxx> -#ifndef _COMBOBOX_HXX //autogen #include <vcl/combobox.hxx> -#endif #include <vcl/window.hxx> #include <svtools/transfer.hxx> @@ -77,7 +73,8 @@ public: virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible(); - void SetAccessibleTextData(ScAccessibleEditLineTextData* pTextData) {pAccTextData = pTextData;} + void InsertAccessibleTextData( ScAccessibleEditLineTextData& rTextData ); + void RemoveAccessibleTextData( ScAccessibleEditLineTextData& rTextData ); DECL_LINK( NotifyHdl, EENotify* ); @@ -102,11 +99,13 @@ private: void UpdateAutoCorrFlag(); private: + typedef ::std::vector< ScAccessibleEditLineTextData* > AccTextDataVector; + String aString; Font aTextFont; ScEditEngineDefaulter* pEditEngine; // erst bei Bedarf angelegt EditView* pEditView; - ScAccessibleEditLineTextData* pAccTextData; + AccTextDataVector maAccTextDatas; // #i105267# text datas may be cloned, remember all copies BOOL bIsRTL; BOOL bIsInsertMode; BOOL bFormulaMode; diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 3e2295d73471..7bb4f2b45f77 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -244,7 +244,8 @@ ScModelObj::~ScModelObj() uno::Reference< uno::XAggregation> ScModelObj::GetFormatter() { - if ( !xNumberAgg.is() ) + // pDocShell may be NULL if this is the base of a ScDocOptionsObj + if ( !xNumberAgg.is() && pDocShell ) { // setDelegator veraendert den RefCount, darum eine Referenz selber halten // (direkt am m_refCount, um sich beim release nicht selbst zu loeschen) |