-- cgit v1.2.3 From 78ada7fa6a3b45aeb44cca28a6ff9e35c29adf41 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Mon, 13 Jul 2009 11:08:01 +0000 Subject: #i1601# sentence case transliteration --- sc/sdi/cellsh.sdi | 1 + sc/sdi/drtxtob.sdi | 1 + sc/sdi/editsh.sdi | 1 + sc/source/ui/view/viewutil.cxx | 5 +++++ sc/uiconfig/scalc/menubar/menubar.xml | 1 + 5 files changed, 9 insertions(+) diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi index 7f97a8a0161e..3a5f99c28a1e 100644 --- a/sc/sdi/cellsh.sdi +++ b/sc/sdi/cellsh.sdi @@ -194,6 +194,7 @@ interface CellSelection SID_TRANSLITERATE_UPPER [ ExecMethod = ExecuteTrans; StateMethod = GetBlockState; ] SID_TRANSLITERATE_LOWER [ ExecMethod = ExecuteTrans; StateMethod = GetBlockState; ] + SID_TRANSLITERATE_SENTENCE_CASE [ ExecMethod = ExecuteTrans; StateMethod = GetBlockState; ] SID_TRANSLITERATE_HALFWIDTH [ ExecMethod = ExecuteTrans; StateMethod = GetBlockState; ] SID_TRANSLITERATE_FULLWIDTH [ ExecMethod = ExecuteTrans; StateMethod = GetBlockState; ] SID_TRANSLITERATE_HIRAGANA [ ExecMethod = ExecuteTrans; StateMethod = GetBlockState; ] diff --git a/sc/sdi/drtxtob.sdi b/sc/sdi/drtxtob.sdi index 0d226895af4a..043257ce2656 100644 --- a/sc/sdi/drtxtob.sdi +++ b/sc/sdi/drtxtob.sdi @@ -131,6 +131,7 @@ interface TableDrawText SID_TRANSLITERATE_UPPER [ ExecMethod = ExecuteTrans; StateMethod = GetState; Export = FALSE; ] SID_TRANSLITERATE_LOWER [ ExecMethod = ExecuteTrans; StateMethod = GetState; Export = FALSE; ] + SID_TRANSLITERATE_SENTENCE_CASE [ ExecMethod = ExecuteTrans; StateMethod = GetState; Export = FALSE; ] SID_TRANSLITERATE_HALFWIDTH [ ExecMethod = ExecuteTrans; StateMethod = GetState; Export = FALSE; ] SID_TRANSLITERATE_FULLWIDTH [ ExecMethod = ExecuteTrans; StateMethod = GetState; Export = FALSE; ] SID_TRANSLITERATE_HIRAGANA [ ExecMethod = ExecuteTrans; StateMethod = GetState; Export = FALSE; ] diff --git a/sc/sdi/editsh.sdi b/sc/sdi/editsh.sdi index c8ad37208744..3e61201d9ea5 100644 --- a/sc/sdi/editsh.sdi +++ b/sc/sdi/editsh.sdi @@ -85,6 +85,7 @@ interface TableText SID_TRANSLITERATE_UPPER [ ExecMethod = ExecuteTrans; StateMethod = GetState; Export = FALSE; ] SID_TRANSLITERATE_LOWER [ ExecMethod = ExecuteTrans; StateMethod = GetState; Export = FALSE; ] + SID_TRANSLITERATE_SENTENCE_CASE [ ExecMethod = ExecuteTrans; StateMethod = GetState; Export = FALSE; ] SID_TRANSLITERATE_HALFWIDTH [ ExecMethod = ExecuteTrans; StateMethod = GetState; Export = FALSE; ] SID_TRANSLITERATE_FULLWIDTH [ ExecMethod = ExecuteTrans; StateMethod = GetState; Export = FALSE; ] SID_TRANSLITERATE_HIRAGANA [ ExecMethod = ExecuteTrans; StateMethod = GetState; Export = FALSE; ] diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx index 83dd05c9d33c..8155d8405335 100644 --- a/sc/source/ui/view/viewutil.cxx +++ b/sc/source/ui/view/viewutil.cxx @@ -56,6 +56,8 @@ #include #include +#include + #include "viewutil.hxx" #include "global.hxx" @@ -130,6 +132,9 @@ sal_Int32 ScViewUtil::GetTransliterationType( USHORT nSlotID ) case SID_TRANSLITERATE_LOWER: nType = com::sun::star::i18n::TransliterationModules_UPPERCASE_LOWERCASE; break; + case SID_TRANSLITERATE_SENTENCE_CASE: + nType = com::sun::star::i18n::TransliterationModulesExtra::SENTENCE_CASE; + break; case SID_TRANSLITERATE_HALFWIDTH: nType = com::sun::star::i18n::TransliterationModules_FULLWIDTH_HALFWIDTH; break; diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml index ab3f121809fa..08abe2e6b12a 100644 --- a/sc/uiconfig/scalc/menubar/menubar.xml +++ b/sc/uiconfig/scalc/menubar/menubar.xml @@ -235,6 +235,7 @@ + -- cgit v1.2.3 From f5fff995555763996b1ecdea81e60d839ed57302 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Mon, 13 Jul 2009 12:48:12 +0000 Subject: undoing r273933 which was accidently commited on master m51 --- sc/sdi/cellsh.sdi | 1 - sc/sdi/drtxtob.sdi | 1 - sc/sdi/editsh.sdi | 1 - sc/source/ui/view/viewutil.cxx | 5 ----- sc/uiconfig/scalc/menubar/menubar.xml | 1 - 5 files changed, 9 deletions(-) diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi index 3a5f99c28a1e..7f97a8a0161e 100644 --- a/sc/sdi/cellsh.sdi +++ b/sc/sdi/cellsh.sdi @@ -194,7 +194,6 @@ interface CellSelection SID_TRANSLITERATE_UPPER [ ExecMethod = ExecuteTrans; StateMethod = GetBlockState; ] SID_TRANSLITERATE_LOWER [ ExecMethod = ExecuteTrans; StateMethod = GetBlockState; ] - SID_TRANSLITERATE_SENTENCE_CASE [ ExecMethod = ExecuteTrans; StateMethod = GetBlockState; ] SID_TRANSLITERATE_HALFWIDTH [ ExecMethod = ExecuteTrans; StateMethod = GetBlockState; ] SID_TRANSLITERATE_FULLWIDTH [ ExecMethod = ExecuteTrans; StateMethod = GetBlockState; ] SID_TRANSLITERATE_HIRAGANA [ ExecMethod = ExecuteTrans; StateMethod = GetBlockState; ] diff --git a/sc/sdi/drtxtob.sdi b/sc/sdi/drtxtob.sdi index 043257ce2656..0d226895af4a 100644 --- a/sc/sdi/drtxtob.sdi +++ b/sc/sdi/drtxtob.sdi @@ -131,7 +131,6 @@ interface TableDrawText SID_TRANSLITERATE_UPPER [ ExecMethod = ExecuteTrans; StateMethod = GetState; Export = FALSE; ] SID_TRANSLITERATE_LOWER [ ExecMethod = ExecuteTrans; StateMethod = GetState; Export = FALSE; ] - SID_TRANSLITERATE_SENTENCE_CASE [ ExecMethod = ExecuteTrans; StateMethod = GetState; Export = FALSE; ] SID_TRANSLITERATE_HALFWIDTH [ ExecMethod = ExecuteTrans; StateMethod = GetState; Export = FALSE; ] SID_TRANSLITERATE_FULLWIDTH [ ExecMethod = ExecuteTrans; StateMethod = GetState; Export = FALSE; ] SID_TRANSLITERATE_HIRAGANA [ ExecMethod = ExecuteTrans; StateMethod = GetState; Export = FALSE; ] diff --git a/sc/sdi/editsh.sdi b/sc/sdi/editsh.sdi index 3e61201d9ea5..c8ad37208744 100644 --- a/sc/sdi/editsh.sdi +++ b/sc/sdi/editsh.sdi @@ -85,7 +85,6 @@ interface TableText SID_TRANSLITERATE_UPPER [ ExecMethod = ExecuteTrans; StateMethod = GetState; Export = FALSE; ] SID_TRANSLITERATE_LOWER [ ExecMethod = ExecuteTrans; StateMethod = GetState; Export = FALSE; ] - SID_TRANSLITERATE_SENTENCE_CASE [ ExecMethod = ExecuteTrans; StateMethod = GetState; Export = FALSE; ] SID_TRANSLITERATE_HALFWIDTH [ ExecMethod = ExecuteTrans; StateMethod = GetState; Export = FALSE; ] SID_TRANSLITERATE_FULLWIDTH [ ExecMethod = ExecuteTrans; StateMethod = GetState; Export = FALSE; ] SID_TRANSLITERATE_HIRAGANA [ ExecMethod = ExecuteTrans; StateMethod = GetState; Export = FALSE; ] diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx index 8155d8405335..83dd05c9d33c 100644 --- a/sc/source/ui/view/viewutil.cxx +++ b/sc/source/ui/view/viewutil.cxx @@ -56,8 +56,6 @@ #include #include -#include - #include "viewutil.hxx" #include "global.hxx" @@ -132,9 +130,6 @@ sal_Int32 ScViewUtil::GetTransliterationType( USHORT nSlotID ) case SID_TRANSLITERATE_LOWER: nType = com::sun::star::i18n::TransliterationModules_UPPERCASE_LOWERCASE; break; - case SID_TRANSLITERATE_SENTENCE_CASE: - nType = com::sun::star::i18n::TransliterationModulesExtra::SENTENCE_CASE; - break; case SID_TRANSLITERATE_HALFWIDTH: nType = com::sun::star::i18n::TransliterationModules_FULLWIDTH_HALFWIDTH; break; diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml index 08abe2e6b12a..ab3f121809fa 100644 --- a/sc/uiconfig/scalc/menubar/menubar.xml +++ b/sc/uiconfig/scalc/menubar/menubar.xml @@ -235,7 +235,6 @@ - -- cgit v1.2.3 From a25665726be7f5c51f5bb248447742c42ba8664b Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Fri, 10 Jul 2009 14:03:42 +0200 Subject: #i103452#: replace PRODUCT by !DBG_UTIL; replace assert by OSL_ASSERT where possible --- chart2/source/tools/OPropertySet.cxx | 2 +- sc/source/core/data/cell2.cxx | 4 ++-- sc/source/core/tool/token.cxx | 2 +- sc/source/filter/xml/XMLExportDatabaseRanges.cxx | 4 ++-- sc/source/filter/xml/xmlexprt.cxx | 8 ++++---- sc/source/ui/Accessibility/AccessibleDocument.cxx | 4 ++-- sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx | 2 +- sc/source/ui/docshell/docsh3.cxx | 4 ++-- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/chart2/source/tools/OPropertySet.cxx b/chart2/source/tools/OPropertySet.cxx index 4ba7f99edcc1..d1cf27758110 100644 --- a/chart2/source/tools/OPropertySet.cxx +++ b/chart2/source/tools/OPropertySet.cxx @@ -377,7 +377,7 @@ void SAL_CALL OPropertySet::getFastPropertyValue uno::Reference< beans::XFastPropertySet > xStylePropSet( m_pImplProperties->GetStyle(), uno::UNO_QUERY ); if( xStylePropSet.is() ) { -#ifndef NDEBUG +#ifdef DBG_UTIL { // check if the handle of the style points to the same property // name as the handle in this property set diff --git a/sc/source/core/data/cell2.cxx b/sc/source/core/data/cell2.cxx index 7ef182660656..adacaf622d94 100644 --- a/sc/source/core/data/cell2.cxx +++ b/sc/source/core/data/cell2.cxx @@ -349,7 +349,7 @@ USHORT ScFormulaCell::GetMatrixEdge( ScAddress& rOrgPos ) } else { -#ifndef PRODUCT +#ifdef DBG_UTIL String aTmp; ByteString aMsg( "broken Matrix, no MatFormula at origin, Pos: " ); aPos.Format( aTmp, SCA_VALID_COL | SCA_VALID_ROW, pDocument ); @@ -379,7 +379,7 @@ USHORT ScFormulaCell::GetMatrixEdge( ScAddress& rOrgPos ) if ( !nEdges ) nEdges = 1; // mittendrin } -#ifndef PRODUCT +#ifdef DBG_UTIL else { String aTmp; diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 0f03d31d3fc8..1ef138b1a87e 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -394,7 +394,7 @@ ScRawToken* ScRawToken::Clone() const FormulaToken* ScRawToken::CreateToken() const { -#ifndef PRODUCT +#ifdef DBG_UTIL #define IF_NOT_OPCODE_ERROR(o,c) if (eOp!=o) DBG_ERROR1( #c "::ctor: OpCode %d lost, converted to " #o "; maybe inherit from FormulaToken instead!", int(eOp)) #else #define IF_NOT_OPCODE_ERROR(o,c) diff --git a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx index 4ca83809843d..370341dc96d3 100644 --- a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx +++ b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx @@ -446,7 +446,7 @@ void ScXMLExportDatabaseRanges::WriteSortDescriptor(const uno::Sequence GetNext(aRange)) { -#ifndef PRODUCT +#ifdef DBG_UTIL DBG_ASSERT(bIsFirst || (!bIsFirst && (nPrevCol + nCols == aRange.nStartColumn)), "here are some columns missing"); #endif if (bIsFirst) @@ -1111,7 +1111,7 @@ void ScXMLExport::WriteRowContent() bIsAutoStyle = aRange.bIsAutoStyle; nCols = aRange.nRepeatColumns; bIsFirst = sal_False; -#ifndef PRODUCT +#ifdef DBG_UTIL nPrevCol = aRange.nStartColumn; #endif } @@ -1138,7 +1138,7 @@ void ScXMLExport::WriteRowContent() bIsAutoStyle = aRange.bIsAutoStyle; nCols = aRange.nRepeatColumns; nPrevValidationIndex = aRange.nValidationIndex; -#ifndef PRODUCT +#ifdef DBG_UTIL nPrevCol = aRange.nStartColumn; #endif } diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index 616071be52d4..6e0f4f10abec 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -608,7 +608,7 @@ sal_Bool ScChildrenShapes::IsSelected(sal_Int32 nIndex, bResult = maZOrderedShapes[nIndex]->bSelected; rShape = maZOrderedShapes[nIndex]->xShape; -#ifndef PRODUCT // test whether it is truly selected by a slower method +#ifdef DBG_UTIL // test whether it is truly selected by a slower method uno::Reference< drawing::XShape > xReturnShape; sal_Bool bDebugResult(sal_False); uno::Reference xIndexAccess; @@ -1204,7 +1204,7 @@ sal_Bool ScChildrenShapes::FindShape(const uno::Reference& xSha if ((rItr != maZOrderedShapes.end()) && (*rItr != NULL) && ((*rItr)->xShape.get() == xShape.get())) bResult = sal_True; // if the shape is found -#ifndef PRODUCT // test whether it finds truly the correct shape (perhaps it is not really sorted) +#ifdef DBG_UTIL // test whether it finds truly the correct shape (perhaps it is not really sorted) SortedShapes::iterator aDebugItr = maZOrderedShapes.begin(); SortedShapes::iterator aEndItr = maZOrderedShapes.end(); sal_Bool bFound(sal_False); diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx index 7d66c19cfb79..bd09a1f93359 100644 --- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx @@ -1213,7 +1213,7 @@ void ScShapeChilds::FillShapes(const Rectangle& aPixelPaintRect, const MapMode& //UNUSED2008-05 if (rItr->mxShape.get() == xShape.get()) //UNUSED2008-05 bResult = sal_True; // if the shape is found //UNUSED2008-05 -//UNUSED2008-05 /*#ifndef PRODUCT // test whether it finds truly the correct shape (perhaps it is not really sorted) +//UNUSED2008-05 /*#ifdef DBG_UTIL // test whether it finds truly the correct shape (perhaps it is not really sorted) //UNUSED2008-05 ScShapeChildVec::iterator aDebugItr = std::find(rShapes.begin(), rShapes.end(), aShape); //UNUSED2008-05 DBG_ASSERT(rItr == aDebugItr, "wrong Shape found"); //UNUSED2008-05 #endif*/ diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index fcdfa8612a02..36989cff8a80 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -964,7 +964,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck // -> wird weggelassen //! ??? Loesch-Aktion rueckgaengig machen ??? //! ??? Aktion irgendwo anders speichern ??? -#ifndef PRODUCT +#ifdef DBG_UTIL String aValue; if ( eSourceType == SC_CAT_CONTENT ) ((const ScChangeActionContent*)pSourceAction)->GetNewString( aValue ); @@ -1122,7 +1122,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck ScChangeAction* pAct = pThisTrack->GetLast(); if ( pAct && pAct->GetActionNumber() > nOldActionMax ) pAct->SetComment( rComment ); -#ifndef PRODUCT +#ifdef DBG_UTIL else DBG_ERROR( "MergeDocument: wohin mit dem Kommentar?!?" ); #endif -- cgit v1.2.3 From 44174c5a30d47320779820c5f494785d27aab172 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Thu, 30 Jul 2009 09:37:08 +0200 Subject: more dependencies fixed --- sc/prj/build.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc/prj/build.lst b/sc/prj/build.lst index c893349232e7..f2338bf5ca71 100644 --- a/sc/prj/build.lst +++ b/sc/prj/build.lst @@ -1,4 +1,4 @@ -sc sc : l10n oovbaapi svx stoc uui BOOST:boost formula oox NULL +sc sc : l10n oovbaapi svx stoc BOOST:boost formula oox NULL sc sc usr1 - all sc_mkout NULL sc sc\inc nmake - all sc_inc NULL sc sc\prj get - all sc_prj NULL -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 From dfc77d75e1bbf9ff8b9ad43d1d79caee38f927f0 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Fri, 18 Sep 2009 15:24:22 +0000 Subject: initial commit of code reorg, existing files that are modified --- sc/inc/cellsuno.hxx | 4 +- sc/prj/build.lst | 2 +- sc/source/filter/excel/excimp8.cxx | 30 +- sc/source/ui/docshell/docsh.cxx | 14 +- sc/source/ui/inc/tabview.hxx | 2 +- sc/source/ui/inc/viewdata.hxx | 3 + sc/source/ui/unoobj/docuno.cxx | 15 + sc/source/ui/vba/helperdecl.hxx | 108 +-- sc/source/ui/vba/makefile.mk | 33 +- sc/source/ui/vba/service.cxx | 22 +- sc/source/ui/vba/testvba/TestDocuments/Ranges.xls | Bin 2248192 -> 2236416 bytes .../ui/vba/testvba/TestDocuments/TestAddress.xls | Bin 52736 -> 84480 bytes .../vba/testvba/TestDocuments/logs/unix/Ranges.log | 20 +- .../TestDocuments/logs/unix/TestAddress.log | 11 +- .../vba/testvba/TestDocuments/logs/unix/format.log | 4 +- .../testvba/TestDocuments/logs/unix/replace.log | 4 +- .../testvba/TestDocuments/logs/unix/window2.log | 24 +- sc/source/ui/vba/testvba/TestDocuments/window2.xls | Bin 91136 -> 72192 bytes sc/source/ui/vba/testvba/runTests.pl | 2 +- sc/source/ui/vba/vbaapplication.cxx | 286 +++---- sc/source/ui/vba/vbaapplication.hxx | 21 +- sc/source/ui/vba/vbaassistant.hxx | 4 +- sc/source/ui/vba/vbaaxes.hxx | 2 +- sc/source/ui/vba/vbaaxis.hxx | 4 +- sc/source/ui/vba/vbaborders.hxx | 2 +- sc/source/ui/vba/vbacharacters.hxx | 2 +- sc/source/ui/vba/vbachart.hxx | 2 +- sc/source/ui/vba/vbachartobject.cxx | 7 +- sc/source/ui/vba/vbachartobject.hxx | 2 +- sc/source/ui/vba/vbachartobjects.hxx | 4 +- sc/source/ui/vba/vbacharts.cxx | 6 +- sc/source/ui/vba/vbacharts.hxx | 6 +- sc/source/ui/vba/vbacomment.hxx | 2 +- sc/source/ui/vba/vbacomments.hxx | 4 +- sc/source/ui/vba/vbacondition.hxx | 2 +- sc/source/ui/vba/vbacontrol.cxx | 468 ------------ sc/source/ui/vba/vbadialog.cxx | 32 +- sc/source/ui/vba/vbadialog.hxx | 17 +- sc/source/ui/vba/vbadialogs.cxx | 25 +- sc/source/ui/vba/vbadialogs.hxx | 13 +- sc/source/ui/vba/vbafont.cxx | 139 +--- sc/source/ui/vba/vbafont.hxx | 15 +- sc/source/ui/vba/vbaformat.cxx | 5 +- sc/source/ui/vba/vbaformat.hxx | 2 +- sc/source/ui/vba/vbaformatconditions.cxx | 3 +- sc/source/ui/vba/vbaformatconditions.hxx | 2 +- sc/source/ui/vba/vbaglobals.cxx | 204 +++-- sc/source/ui/vba/vbaglobals.hxx | 52 +- sc/source/ui/vba/vbahelper.cxx | 828 --------------------- sc/source/ui/vba/vbahyperlink.cxx | 2 +- sc/source/ui/vba/vbahyperlink.hxx | 2 +- sc/source/ui/vba/vbainterior.cxx | 26 +- sc/source/ui/vba/vbainterior.hxx | 3 +- sc/source/ui/vba/vbaname.cxx | 7 +- sc/source/ui/vba/vbaname.hxx | 4 +- sc/source/ui/vba/vbanames.cxx | 4 +- sc/source/ui/vba/vbanames.hxx | 5 +- sc/source/ui/vba/vbaoleobject.cxx | 56 +- sc/source/ui/vba/vbaoleobject.hxx | 6 +- sc/source/ui/vba/vbaoleobjects.hxx | 4 +- sc/source/ui/vba/vbaoutline.hxx | 2 +- sc/source/ui/vba/vbapagebreak.cxx | 34 + sc/source/ui/vba/vbapagebreak.hxx | 21 +- sc/source/ui/vba/vbapagebreaks.cxx | 73 +- sc/source/ui/vba/vbapagebreaks.hxx | 33 +- sc/source/ui/vba/vbapagesetup.cxx | 285 +------ sc/source/ui/vba/vbapagesetup.hxx | 25 +- sc/source/ui/vba/vbapalette.cxx | 2 +- sc/source/ui/vba/vbapalette.hxx | 4 +- sc/source/ui/vba/vbapane.hxx | 2 +- sc/source/ui/vba/vbapivotcache.hxx | 2 +- sc/source/ui/vba/vbapivottable.hxx | 4 +- sc/source/ui/vba/vbapivottables.hxx | 6 +- sc/source/ui/vba/vbapropvalue.hxx | 2 +- sc/source/ui/vba/vbarange.cxx | 106 ++- sc/source/ui/vba/vbarange.hxx | 5 +- sc/source/ui/vba/vbaseriescollection.hxx | 6 +- sc/source/ui/vba/vbastyle.cxx | 4 +- sc/source/ui/vba/vbastyles.cxx | 1 + sc/source/ui/vba/vbastyles.hxx | 2 +- sc/source/ui/vba/vbatextboxshape.cxx | 4 +- sc/source/ui/vba/vbatextboxshape.hxx | 4 +- sc/source/ui/vba/vbatextframe.cxx | 118 +-- sc/source/ui/vba/vbatextframe.hxx | 40 +- sc/source/ui/vba/vbatitle.hxx | 5 +- sc/source/ui/vba/vbavalidation.hxx | 2 +- sc/source/ui/vba/vbawindow.cxx | 195 +---- sc/source/ui/vba/vbawindow.hxx | 17 +- sc/source/ui/vba/vbawindows.cxx | 29 +- sc/source/ui/vba/vbawindows.hxx | 7 +- sc/source/ui/vba/vbaworkbook.cxx | 175 +---- sc/source/ui/vba/vbaworkbook.hxx | 20 +- sc/source/ui/vba/vbaworkbooks.cxx | 224 +----- sc/source/ui/vba/vbaworkbooks.hxx | 9 +- sc/source/ui/vba/vbaworksheet.cxx | 124 ++- sc/source/ui/vba/vbaworksheet.hxx | 7 +- sc/source/ui/vba/vbaworksheets.cxx | 31 +- sc/source/ui/vba/vbaworksheets.hxx | 3 +- sc/source/ui/view/viewdata.cxx | 97 ++- sc/util/makefile.mk | 3 + 100 files changed, 1148 insertions(+), 3163 deletions(-) diff --git a/sc/inc/cellsuno.hxx b/sc/inc/cellsuno.hxx index 2dd0bd6cc16e..5256931aedac 100644 --- a/sc/inc/cellsuno.hxx +++ b/sc/inc/cellsuno.hxx @@ -152,8 +152,10 @@ public: namespace ooo { namespace vba { + namespace excel { class ScVbaCellRangeAccess; // Vba Helper class } + } } class SC_DLLPUBLIC ScCellRangesBase : public com::sun::star::beans::XPropertySet, @@ -175,7 +177,7 @@ class SC_DLLPUBLIC ScCellRangesBase : public com::sun::star::beans::XPropertySet { friend class ScTabViewObj; // fuer select() friend class ScTableSheetObj; // fuer createCursorByRange() - friend class ooo::vba::ScVbaCellRangeAccess; + friend class ooo::vba::excel::ScVbaCellRangeAccess; private: const SfxItemPropertySet* pPropSet; diff --git a/sc/prj/build.lst b/sc/prj/build.lst index c893349232e7..8426ba021f60 100644 --- a/sc/prj/build.lst +++ b/sc/prj/build.lst @@ -1,4 +1,4 @@ -sc sc : l10n oovbaapi svx stoc uui BOOST:boost formula oox NULL +sc sc : l10n vbahelper oovbaapi svx stoc uui BOOST:boost formula oox NULL sc sc usr1 - all sc_mkout NULL sc sc\inc nmake - all sc_inc NULL sc sc\prj get - all sc_prj NULL diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index 1d209b91bc68..a3de34afacdc 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -102,6 +102,10 @@ #include #include +#include +#include +#include +#include using namespace com::sun::star; @@ -248,16 +252,6 @@ void ImportExcel8::SheetProtection( void ) GetSheetProtectBuffer().ReadOptions( aIn, GetCurrScTab() ); } -bool lcl_hasVBAEnabled() -{ - uno::Reference< beans::XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY); - // test if vba service is present - uno::Reference< uno::XComponentContext > xCtx( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY ); - uno::Reference< uno::XInterface > xGlobals( xCtx->getValueByName( ::rtl::OUString::createFromAscii( "/singletons/ooo.vba.theGlobals") ), uno::UNO_QUERY ); - - return xGlobals.is(); -} - void ImportExcel8::ReadBasic( void ) { bHasBasic = TRUE; @@ -272,9 +266,23 @@ void ImportExcel8::ReadBasic( void ) bool bLoadStrg = pFilterOpt->IsLoadExcelBasicStorage(); if( bLoadCode || bLoadStrg ) { + uno::Any aGlobs; + uno::Sequence< uno::Any > aArgs(1); + aArgs[ 0 ] <<= pShell->GetModel(); + aGlobs <<= ::comphelper::getProcessServiceFactory()->createInstanceWithArguments( ::rtl::OUString::createFromAscii( "ooo.vba.excel.Globals"), aArgs ); + pShell->GetBasicManager()->SetGlobalUNOConstant( "VBAGlobals", aGlobs ); SvxImportMSVBasic aBasicImport( *pShell, *xRootStrg, bLoadCode, bLoadStrg ); - bool bAsComment = !bLoadExecutable || !lcl_hasVBAEnabled(); + bool bAsComment = !bLoadExecutable || !aGlobs.hasValue(); aBasicImport.Import( EXC_STORAGE_VBA_PROJECT, EXC_STORAGE_VBA, bAsComment ); + // There may be implications setting the current component + // too early :-/ so I will just manually set the Basic Variables + BasicManager* pAppMgr = SFX_APP()->GetBasicManager(); + if ( pAppMgr ) + pAppMgr->SetGlobalUNOConstant( "ThisComponent", makeAny( pShell->GetModel() ) ); + { + uno::Any aModel = uno::makeAny( pShell->GetModel() ); + pAppMgr->SetGlobalUNOConstant( "ThisExcelDoc", aModel ); + } } } } diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index c8a41e81497d..df7cb24e605f 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -128,7 +128,8 @@ #include #include - +#include +#include using namespace com::sun::star; // STATIC DATA ----------------------------------------------------------- @@ -358,7 +359,16 @@ void ScDocShell::AfterXMLLoading(sal_Bool bRet) } else aDocument.SetInsertingFromOtherDoc( FALSE ); - + // add vba globals ( if they are availabl ) + SfxObjectShell* pShell = aDocument.GetDocumentShell(); + if ( pShell ) + { + uno::Any aGlobs; + uno::Sequence< uno::Any > aArgs(1); + aArgs[ 0 ] <<= pShell->GetModel(); + aGlobs <<= ::comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.excel.Globals" ) ), aArgs ); + pShell->GetBasicManager()->SetGlobalUNOConstant( "VBAGlobals", aGlobs ); + } aDocument.SetImportingXML( FALSE ); aDocument.EnableExecuteLink( true ); aDocument.EnableUndo( TRUE ); diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx index fe5da618e895..9ec5ce507209 100644 --- a/sc/source/ui/inc/tabview.hxx +++ b/sc/source/ui/inc/tabview.hxx @@ -292,7 +292,7 @@ public: void TabChanged(); void SetZoom( const Fraction& rNewX, const Fraction& rNewY, BOOL bAll ); - void RefreshZoom(); + SC_DLLPUBLIC void RefreshZoom(); void SetPagebreakMode( BOOL bSet ); void UpdateLayerLocks(); diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx index 709bd7898e22..dc2fe4522ecd 100644 --- a/sc/source/ui/inc/viewdata.hxx +++ b/sc/source/ui/inc/viewdata.hxx @@ -225,6 +225,7 @@ private: SC_DLLPRIVATE void CalcPPT(); SC_DLLPRIVATE void CreateTabData( SCTAB nNewTab ); + SC_DLLPRIVATE void CreateTabData( std::vector< SCTAB >& rvTabs ); SC_DLLPRIVATE void CreateSelectedTabData(); public: @@ -311,6 +312,8 @@ public: void SetPagebreakMode( BOOL bSet ); void SetZoomType( SvxZoomType eNew, BOOL bAll ); + void SetZoomType( SvxZoomType eNew, std::vector< SCTAB >& tabs ); + void SetZoom( const Fraction& rNewX, const Fraction& rNewY, std::vector< SCTAB >& tabs ); void SetZoom( const Fraction& rNewX, const Fraction& rNewY, BOOL bAll ); void RefreshZoom(); diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index cd63adc33989..0e6a1f7ca49a 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -102,6 +102,7 @@ using namespace com::sun::star; +#define SC_UNO_VBADOCOBJ "ThisVBADocObj" // perhaps we want to actually make this ThisWorkbook ? //------------------------------------------------------------------------ // alles ohne Which-ID, Map nur fuer PropertySetInfo @@ -116,6 +117,7 @@ const SfxItemPropertyMapEntry* lcl_GetDocOptPropertyMap() {MAP_CHAR_LEN(SC_UNO_AUTOCONTFOC), 0, &getBooleanCppuType(), 0, 0}, {MAP_CHAR_LEN(SC_UNO_BASICLIBRARIES), 0, &getCppuType((uno::Reference< script::XLibraryContainer >*)0), beans::PropertyAttribute::READONLY, 0}, {MAP_CHAR_LEN(SC_UNO_DIALOGLIBRARIES), 0, &getCppuType((uno::Reference< script::XLibraryContainer >*)0), beans::PropertyAttribute::READONLY, 0}, + {MAP_CHAR_LEN(SC_UNO_VBADOCOBJ), 0, &getCppuType((beans::PropertyValue*)0), beans::PropertyAttribute::READONLY, 0}, {MAP_CHAR_LEN(SC_UNO_CALCASSHOWN), PROP_UNO_CALCASSHOWN, &getBooleanCppuType(), 0, 0}, {MAP_CHAR_LEN(SC_UNONAME_CLOCAL), 0, &getCppuType((lang::Locale*)0), 0, 0}, {MAP_CHAR_LEN(SC_UNO_CJK_CLOCAL), 0, &getCppuType((lang::Locale*)0), 0, 0}, @@ -1568,6 +1570,13 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const rtl::OUString& aPropertyNa { aRet <<= pDocShell->GetDialogContainer(); } + else if ( aString.EqualsAscii( SC_UNO_VBADOCOBJ ) ) + { + beans::PropertyValue aProp; + aProp.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ThisExcelDoc") ); + aProp.Value <<= pDocShell->GetModel(); + aRet <<= aProp; + } else if ( aString.EqualsAscii( SC_UNO_RUNTIMEUID ) ) { aRet <<= getRuntimeUID(); @@ -1771,6 +1780,12 @@ sal_Int64 SAL_CALL ScModelObj::getSomething( return sal::static_int_cast(reinterpret_cast(this)); } + if ( rId.getLength() == 16 && + 0 == rtl_compareMemory( SfxObjectShell::getUnoTunnelId().getConstArray(), + rId.getConstArray(), 16 ) ) + { + return sal::static_int_cast(reinterpret_cast(pDocShell )); + } // aggregated number formats supplier has XUnoTunnel, too // interface from aggregated object must be obtained via queryAggregation diff --git a/sc/source/ui/vba/helperdecl.hxx b/sc/source/ui/vba/helperdecl.hxx index 95569a993b9c..9c37d418a561 100644 --- a/sc/source/ui/vba/helperdecl.hxx +++ b/sc/source/ui/vba/helperdecl.hxx @@ -32,107 +32,25 @@ namespace comphelper { namespace service_decl { - -namespace detail { -namespace css = ::com::sun::star; -template -class OwnServiceImpl - : public ImplT, - private ::boost::noncopyable -{ - typedef ImplT BaseT; - -public: - OwnServiceImpl( - ServiceDecl const& rServiceDecl, - css::uno::Sequence const& args, - css::uno::Reference const& xContext ) - :BaseT(args, xContext), m_rServiceDecl(rServiceDecl) {} - OwnServiceImpl( - ServiceDecl const& rServiceDecl, - css::uno::Reference const& xContext ) - : BaseT(xContext), m_rServiceDecl(rServiceDecl) {} - - // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName() - throw (css::uno::RuntimeException) { - return m_rServiceDecl.getImplementationName(); - } - virtual sal_Bool SAL_CALL supportsService( ::rtl::OUString const& name ) - throw (css::uno::RuntimeException) { - return m_rServiceDecl.supportsService(name); - } - virtual css::uno::Sequence< ::rtl::OUString> - SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException) { - return m_rServiceDecl.getSupportedServiceNames(); - } - -private: - ServiceDecl const& m_rServiceDecl; -}; - - -template -struct OwnCreateFunc; - -template -struct OwnCreateFunc > { - explicit OwnCreateFunc( ) - {} - - css::uno::Reference - operator()( ServiceDecl const& rServiceDecl, - css::uno::Sequence const&, - css::uno::Reference - const& xContext ) const - { - return css::uno::Reference< ooo::vba::XHelperInterface >(new OwnServiceImpl( rServiceDecl, xContext )); - } -}; - -template -struct OwnCreateFunc > { - explicit OwnCreateFunc( ) - {} - - css::uno::Reference - operator()( ServiceDecl const& rServiceDecl, - css::uno::Sequence const& args, - css::uno::Reference - const& xContext ) const - { - css::uno::Reference< ooo::vba::XHelperInterface > xHelp( - new OwnServiceImpl( rServiceDecl, args, xContext ) ); - css::uno::Reference< css::uno::XInterface > xIf( xHelp, css::uno::UNO_QUERY ) ; - return xIf; - } -}; - -} // namespace detail - -/** Defines a service implementation class. - - @tpl ImplT_ service implementation class - @WithArgsT whether the implementation class ctor expects arguments - (uno::Sequence, uno::Reference) - or just (uno::Reference) -*/ template > -struct vba_service_class_ { - typedef ImplT_ ImplT; - typedef detail::OwnServiceImpl ServiceImplT; - - detail::CreateFuncF const m_createFunc; - +struct vba_service_class_ : public serviceimpl_base< detail::OwnServiceImpl, WithArgsT > +{ + typedef serviceimpl_base< detail::OwnServiceImpl, WithArgsT > baseT; /** Default ctor. Implementation class without args, expecting component context as single argument. */ - vba_service_class_() : m_createFunc( - detail::OwnCreateFunc() ) {} - + vba_service_class_() : baseT() {} + template + /** Ctor to pass a post processing function/functor. + + @tpl PostProcessDefaultT let your compiler deduce this + @param postProcessFunc function/functor that gets the yet unacquired + ImplT_ pointer returning a + uno::Reference + */ + explicit vba_service_class_( PostProcessFuncT const& postProcessFunc ) : baseT( postProcessFunc ) {} }; - } // namespace service_decl } // namespace comphelper diff --git a/sc/source/ui/vba/makefile.mk b/sc/source/ui/vba/makefile.mk index fb1cc00488b8..e07d5fdcb7e3 100644 --- a/sc/source/ui/vba/makefile.mk +++ b/sc/source/ui/vba/makefile.mk @@ -64,7 +64,7 @@ SLOFILES= \ $(SLO)$/vbaworksheet.obj \ $(SLO)$/vbaoutline.obj \ $(SLO)$/vbafont.obj\ - $(SLO)$/vbahelper.obj\ + $(SLO)$/excelvbahelper.obj\ $(SLO)$/vbainterior.obj\ $(SLO)$/vbawsfunction.obj\ $(SLO)$/vbawindow.obj\ @@ -81,28 +81,11 @@ SLOFILES= \ $(SLO)$/vbapalette.obj \ $(SLO)$/vbaborders.obj \ $(SLO)$/vbacharacters.obj \ - $(SLO)$/vbacombobox.obj \ $(SLO)$/vbavalidation.obj \ - $(SLO)$/vbacontrol.obj \ - $(SLO)$/vbacontrols.obj \ $(SLO)$/vbaoleobject.obj \ $(SLO)$/vbaoleobjects.obj \ - $(SLO)$/vbabutton.obj \ - $(SLO)$/vbalabel.obj \ - $(SLO)$/vbatextbox.obj \ $(SLO)$/vbatextboxshape.obj \ - $(SLO)$/vbaradiobutton.obj \ - $(SLO)$/vbalistbox.obj \ - $(SLO)$/vbalistcontrolhelper.obj \ - $(SLO)$/vbapropvalue.obj \ $(SLO)$/vbapane.obj \ - $(SLO)$/vbashape.obj \ - $(SLO)$/vbacolorformat.obj \ - $(SLO)$/vbashapes.obj \ - $(SLO)$/vbalineformat.obj \ - $(SLO)$/vbafillformat.obj \ - $(SLO)$/vbapictureformat.obj \ - $(SLO)$/vbashaperange.obj \ $(SLO)$/vbatextframe.obj \ $(SLO)$/vbacharttitle.obj \ $(SLO)$/vbacharts.obj \ @@ -116,24 +99,10 @@ SLOFILES= \ $(SLO)$/vbastyle.obj \ $(SLO)$/vbastyles.obj \ $(SLO)$/vbaassistant.obj \ - $(SLO)$/vbauserform.obj \ - $(SLO)$/vbacheckbox.obj \ - $(SLO)$/vbatogglebutton.obj \ - $(SLO)$/vbaframe.obj \ - $(SLO)$/vbascrollbar.obj \ - $(SLO)$/vbaprogressbar.obj \ - $(SLO)$/vbamultipage.obj \ - $(SLO)$/vbapages.obj \ - $(SLO)$/vbacommandbarcontrol.obj \ - $(SLO)$/vbacommandbarcontrols.obj \ - $(SLO)$/vbacommandbar.obj \ - $(SLO)$/vbacommandbars.obj \ $(SLO)$/vbahyperlink.obj \ $(SLO)$/vbapagesetup.obj \ $(SLO)$/vbapagebreak.obj \ $(SLO)$/vbapagebreaks.obj \ - $(SLO)$/vbaspinbutton.obj \ - $(SLO)$/vbaimage.obj \ $(SLO)$/service.obj # --- Targets ------------------------------------------------------ diff --git a/sc/source/ui/vba/service.cxx b/sc/source/ui/vba/service.cxx index 53ed2d3bebcb..6286b6873321 100644 --- a/sc/source/ui/vba/service.cxx +++ b/sc/source/ui/vba/service.cxx @@ -61,11 +61,15 @@ namespace globals { extern sdecl::ServiceDecl const serviceDecl; } -namespace userform +namespace hyperlink { extern sdecl::ServiceDecl const serviceDecl; } -namespace hyperlink +namespace application +{ +extern sdecl::ServiceDecl const serviceDecl; +} +namespace textframe { extern sdecl::ServiceDecl const serviceDecl; } @@ -83,10 +87,10 @@ extern "C" lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey ) { OSL_TRACE("In component_writeInfo"); - +#if 0 // Component registration if ( component_writeInfoHelper( pServiceManager, pRegistryKey, - range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, userform::serviceDecl, window::serviceDecl, hyperlink::serviceDecl ) ) + range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, window::serviceDecl, hyperlink::serviceDecl, application::serviceDecl ) ) { // Singleton registration try @@ -106,6 +110,12 @@ extern "C" } } return sal_False; +#else + // Component registration + return component_writeInfoHelper( pServiceManager, pRegistryKey, + range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, window::serviceDecl, hyperlink::serviceDecl, application::serviceDecl ) && component_writeInfoHelper( pServiceManager, pRegistryKey, textframe::serviceDecl ); +#endif + } SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( @@ -114,7 +124,9 @@ extern "C" { OSL_TRACE("In component_getFactory for %s", pImplName ); void* pRet = component_getFactoryHelper( - pImplName, pServiceManager, pRegistryKey, range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, userform::serviceDecl, window::serviceDecl, hyperlink::serviceDecl ); + pImplName, pServiceManager, pRegistryKey, range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, window::serviceDecl, hyperlink::serviceDecl, application::serviceDecl ); + if( !pRet ) + pRet = component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, textframe::serviceDecl ); OSL_TRACE("Ret is 0x%x", pRet); return pRet; } diff --git a/sc/source/ui/vba/testvba/TestDocuments/Ranges.xls b/sc/source/ui/vba/testvba/TestDocuments/Ranges.xls index 3abdc4620aa8..1c1d74d37486 100644 Binary files a/sc/source/ui/vba/testvba/TestDocuments/Ranges.xls and b/sc/source/ui/vba/testvba/TestDocuments/Ranges.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments/TestAddress.xls b/sc/source/ui/vba/testvba/TestDocuments/TestAddress.xls index 1834bd649f3d..48d30cbe2e9e 100644 Binary files a/sc/source/ui/vba/testvba/TestDocuments/TestAddress.xls and b/sc/source/ui/vba/testvba/TestDocuments/TestAddress.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments/logs/unix/Ranges.log b/sc/source/ui/vba/testvba/TestDocuments/logs/unix/Ranges.log index dd4fb4923209..cdd18685e977 100644 --- a/sc/source/ui/vba/testvba/TestDocuments/logs/unix/Ranges.log +++ b/sc/source/ui/vba/testvba/TestDocuments/logs/unix/Ranges.log @@ -1,4 +1,4 @@ -Test run started : 17/12/2008 14:18:34 +Test run started : 10/03/2008 15:15:11 ---------------------------------------------------------------- ApplicationMethods TEST START : ApplicationMethods @@ -7,8 +7,8 @@ ApplicationMethods ITEM Assertion OK : Address of Application.Rows is: $1:$1 ITEM Assertion OK : Address of Application.Range is: $1:$1,$5:$7 ITEM Assertion OK : Please check manually: DefaultFilePath is: /data4/home/npower/Documents - ITEM Assertion OK : Please check manually: Library Path is: /media/disk/BUILD-related/CWS/my_working_copy/INSTALL_FOR_TEST/opt/UserInstallation/user/basic - ITEM Assertion OK : Please check manually: Template Path is: /media/disk/BUILD-related/CWS/my_working_copy/INSTALL_FOR_TEST/opt/UserInstallation/user/template + ITEM Assertion OK : Please check manually: Library Path is: /data4/home/npower/.ooo-2.0/user/basic + ITEM Assertion OK : Please check manually: Template Path is: /data4/home/npower/.ooo-2.0/user/template ITEM Assertion OK : FileSeparator is / ITEM Assertion OK : Name of ActiveWorkbook is: Ranges.xls END 'ApplicationMethods' Symbol @@ -111,8 +111,8 @@ END 'Value-Issue' Symbol ---------------------------------------------------------------- AutoFit issue TEST START : AutoFit issue - ITEM Assertion OK : Columns.AutoFit: CurrentWidth is 679 - ITEM Assertion OK : Rows.AutoFit: CurrentHeight is 546 + ITEM Assertion OK : Columns.AutoFit: CurrentWidth is 680 + ITEM Assertion OK : Rows.AutoFit: CurrentHeight is 554 END 'AutoFit issue' Symbol TEST OK : AutoFit issue ---------------------------------------------------------------- @@ -204,11 +204,11 @@ Heights and Widths ITEM Assertion OK : Range RowHeight is 40 ITEM Assertion OK : Range ColumnWidth is 50 ITEM Assertion OK : Range Height is 240 - ITEM Assertion OK : Range Width is 787.5 + ITEM Assertion OK : Range Width is 795 ITEM Assertion OK : Range RowHeight is 50 ITEM Assertion OK : Range ColumnWidth is 50 ITEM Assertion OK : Range Height is 300 - ITEM Assertion OK : Range Width is 787.5 + ITEM Assertion OK : Range Width is 795 ITEM Assertion OK : RowHeight is null: True ITEM Assertion OK : ColumnWidth is null: True END 'Heights and Widths' Symbol @@ -218,7 +218,7 @@ RangeRowColumn-Issue TEST START : RangeRowColumn-Issue ITEM Assertion OK : Row is: 8 ITEM Assertion OK : Column is: 5 - ITEM Assertion OK : EntireRow.Columns.Count = 1024 + ITEM Assertion OK : EntireRow.Columns.Count = 256 ITEM Assertion OK : EntireColumn.Rows.Count = 131072 END 'RangeRowColumn-Issue' Symbol TEST OK : RangeRowColumn-Issue @@ -255,7 +255,7 @@ End issue ITEM Assertion OK : - = $E$3 ITEM Assertion OK : - = $A$8 ITEM Assertion OK : - = $B$8 - ITEM Assertion FAIL : - = $AMJ$8 + ITEM Assertion OK : - = $IV$8 ITEM Assertion OK : - = $Z$8 END 'End issue' Symbol TEST OK : End issue @@ -277,4 +277,4 @@ Validation ITEM Assertion OK : Validation Error Title is : Microsoft Excel END 'Validation' Symbol TEST OK : Validation -Test run finished : 17/12/2008 14:18:40 +Test run finished : 10/03/2008 15:15:13 diff --git a/sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestAddress.log b/sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestAddress.log index 42360c3ffe8a..4fa4bc820f59 100644 --- a/sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestAddress.log +++ b/sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestAddress.log @@ -1,4 +1,4 @@ -Test run started : 17/07/2007 20:56:04 +Test run started : 12/05/2009 11:23:35 ---------------------------------------------------------------- TestAddress TEST START : TestAddress @@ -51,12 +51,17 @@ TestAddress ITEM Assertion OK : test47 Range('a2:b4').Rows('1:2') ITEM Assertion OK : test48 Range('a2:b4').Rows('2:2') ITEM Assertion OK : test49 Range('a2:b4').Rows('2:3') + ITEM Assertion OK : test50 Range(' A2:B4 ') + ITEM Assertion OK : test51 Range('A 2:B 4') + ITEM Assertion OK : test52 Range('A2 : B4 ') + ITEM Assertion OK : test53 Range('Sheet1 !A2 : B4 ') + ITEM Assertion OK : test54 Range('Sheet1! A2 : B4 ') Test Results ============ -Tests passed: 49 +Tests passed: 54 Tests failed: 0 END 'TestAddress TEST OK : TestAddress -Test run finished : 17/07/2007 20:56:05 +Test run finished : 12/05/2009 11:23:35 diff --git a/sc/source/ui/vba/testvba/TestDocuments/logs/unix/format.log b/sc/source/ui/vba/testvba/TestDocuments/logs/unix/format.log index 50fac171544b..96725bf7daa8 100644 --- a/sc/source/ui/vba/testvba/TestDocuments/logs/unix/format.log +++ b/sc/source/ui/vba/testvba/TestDocuments/logs/unix/format.log @@ -1,4 +1,4 @@ -Test run started : 17/12/2008 14:15:22 +Test run started : 2008/09/18 11:35:34 BEGIN Format TEST START : Test Predefined_Number_Format_Sample function ITEM Assertion OK : General Number: 562486.2356 @@ -33,4 +33,4 @@ BEGIN Format ITEM Assertion OK : >: VBA TEST OK : Test Custom_Text_Format_Sample function END Format -Test run finished : 17/12/2008 14:15:22 +Test run finished : 2008/09/18 11:35:34 diff --git a/sc/source/ui/vba/testvba/TestDocuments/logs/unix/replace.log b/sc/source/ui/vba/testvba/TestDocuments/logs/unix/replace.log index 461955dc2402..8f600faaa6b1 100644 --- a/sc/source/ui/vba/testvba/TestDocuments/logs/unix/replace.log +++ b/sc/source/ui/vba/testvba/TestDocuments/logs/unix/replace.log @@ -1,4 +1,4 @@ -Test run started : 17/12/2008 13:53:49 +Test run started : 09/05/2008 10:21:46 AM BEGIN Replace TEST START : Test Replace function ITEM Assertion OK : common string:aefefdBc @@ -11,4 +11,4 @@ BEGIN Replace ITEM Assertion OK : start = 1, count = 0, not support in Unix: abcbcdBc TEST OK : Test Replace function END Replace -Test run finished : 17/12/2008 13:53:49 +Test run finished : 09/05/2008 10:21:47 AM diff --git a/sc/source/ui/vba/testvba/TestDocuments/logs/unix/window2.log b/sc/source/ui/vba/testvba/TestDocuments/logs/unix/window2.log index 5d297f80a152..8e26d0580621 100644 --- a/sc/source/ui/vba/testvba/TestDocuments/logs/unix/window2.log +++ b/sc/source/ui/vba/testvba/TestDocuments/logs/unix/window2.log @@ -1,20 +1,15 @@ -Test run started : 05/29/2008 02:55:48 PM +Test run started : 2008/09/22 11:18:57 BEGIN Window2 TEST START : Test Window.SplitRow - ITEM Assertion OK : Test SplitColumn: 2 - ITEM Assertion FAIL : Test SplitRow: 5 - ITEM Assertion FAIL : Test SplitVertical: 64.5090003183026 - ITEM Assertion OK : Test SplitHorizontal: 502.570118758869 - ITEM Assertion OK : Test SplitVertical: 242.283803521067 - ITEM Assertion OK : Test SplitRow: 19 - ITEM Assertion OK : Test SplitHorizontal: 242.283803521067 - ITEM Assertion OK : Test SplitColumn: 1 - ITEM Assertion FAIL : Test SplitRow: 8 - ITEM Assertion OK : Test SplitColumn: 10 + ITEM Assertion OK : Test SplitColumn: 2 (Test only applies to maximized Window and at least has 800*600 solotion) + ITEM Assertion OK : Test SplitRow: 2 (Test only applies to maximized Window and at least has 800*600 solotion) + ITEM Assertion OK : Test SplitVertical: 242.465788476212 + ITEM Assertion OK : Test SplitHorizontal: 242.465788476212 + ITEM Assertion OK : Test SplitRow: 4 (Test only applies to maximized Window and at least has 800*600 solotion) + ITEM Assertion OK : Test SplitColumn: 3 (Test only applies to maximized Window and at least has 800*600 solotion) ITEM Assertion OK : Test SplitColumn: 0 ITEM Assertion OK : Test SplitRow: 0 TEST OK : Test Window.SplitRow -TEST ERROR - no test begun: Test Window.SplitRow TEST START : Test Window.DisplayGridlines ITEM Assertion OK : Test gridlines are on ITEM Assertion OK : Test gridlines are off @@ -25,7 +20,8 @@ TEST ERROR - no test begun: Test Window.SplitRow TEST OK : Test Window.DisplayHeadings TEST START : Test Window.Visibility ITEM Assertion OK : Window is visible - TEST FAIL : Test Window.Visibility (hit error handler). + ITEM Assertion OK : Window is not visible + TEST OK : Test Window.Visibility TEST START : Test Window.FreezePanes ITEM Assertion OK : Test no panes frozen ITEM Assertion OK : Test panes frozen at center @@ -42,4 +38,4 @@ TEST ERROR - no test begun: Test Window.SplitRow ITEM Assertion OK : Application.Windows Count: 1 TEST OK : Test Windows.Count END Window2 -Test run finished : 05/29/2008 02:55:48 PM +Test run finished : 2008/09/22 11:18:58 diff --git a/sc/source/ui/vba/testvba/TestDocuments/window2.xls b/sc/source/ui/vba/testvba/TestDocuments/window2.xls index 1bb2cd5a67da..4d5e1cbfe944 100755 Binary files a/sc/source/ui/vba/testvba/TestDocuments/window2.xls and b/sc/source/ui/vba/testvba/TestDocuments/window2.xls differ diff --git a/sc/source/ui/vba/testvba/runTests.pl b/sc/source/ui/vba/testvba/runTests.pl index 8f8f329504c0..f5051516a9c4 100644 --- a/sc/source/ui/vba/testvba/runTests.pl +++ b/sc/source/ui/vba/testvba/runTests.pl @@ -20,7 +20,7 @@ my $theResult; my $officepath = shift || die "please specify path to office installation program dir"; my $DocName = shift || ""; my $programpath = "$officepath"."3/program:$officepath/program:"; -my $basiclibrarypath = "$officepath/basis3.1/program"; +my $basiclibrarypath = "$officepath/basis3.2/program"; my $urelibpath = "$officepath/ure/lib"; my $binext = ""; my $testDocDir = "$binDir/TestDocuments"; diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx index 32ed5f9e0af2..880a691701ff 100644 --- a/sc/source/ui/vba/vbaapplication.cxx +++ b/sc/source/ui/vba/vbaapplication.cxx @@ -57,10 +57,9 @@ #include "tabvwsh.hxx" #include "gridwin.hxx" #include "vbanames.hxx" -#include "vbashape.hxx" +#include #include "vbatextboxshape.hxx" #include "vbaassistant.hxx" -#include "vbacommandbars.hxx" #include "sc.hrc" #include @@ -85,6 +84,9 @@ #include "convuno.hxx" #include "cellsuno.hxx" #include "docsh.hxx" +#include +#include "excelvbahelper.hxx" + using namespace ::ooo::vba; using namespace ::com::sun::star; @@ -102,20 +104,20 @@ using namespace ::com::sun::star; #define FILE_PATH_SEPERATOR "\\" #endif -#define EXCELVERSION "11.0" +uno::Any sbxToUnoValue( SbxVariable* pVar ); class ActiveWorkbook : public ScVbaWorkbook { protected: virtual uno::Reference< frame::XModel > getModel() { - return getCurrentDocument(); + return getCurrentExcelDoc(mxContext); } public: ActiveWorkbook( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext) : ScVbaWorkbook( xParent, xContext ){} }; -ScVbaApplication::ScVbaApplication( uno::Reference& xContext ): ScVbaApplication_BASE( uno::Reference< XHelperInterface >(), xContext ), m_xCalculation( excel::XlCalculation::xlCalculationAutomatic ) +ScVbaApplication::ScVbaApplication( const uno::Reference& xContext ): ScVbaApplication_BASE( xContext ), m_xCalculation( excel::XlCalculation::xlCalculationAutomatic ) { } @@ -123,7 +125,10 @@ ScVbaApplication::~ScVbaApplication() { } - +SfxObjectShell* ScVbaApplication::GetDocShell( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException) +{ + return static_cast< SfxObjectShell* >( excel::getDocShell( xModel ) ); +} uno::Reference< excel::XWorkbook > ScVbaApplication::getActiveWorkbook() throw (uno::RuntimeException) @@ -142,24 +147,16 @@ ScVbaApplication::getAssistant() throw (uno::RuntimeException) return uno::Reference< XAssistant >( new ScVbaAssistant( this, mxContext ) ); } -uno::Any SAL_CALL -ScVbaApplication::CommandBars( const uno::Any& aIndex ) throw (uno::RuntimeException) -{ - uno::Reference< XCommandBars > xCommandBars( new ScVbaCommandBars( this, mxContext, uno::Reference< container::XIndexAccess >() ) ); - if( aIndex.hasValue() ) - return uno::makeAny( xCommandBars->Item( aIndex, uno::Any() ) ); - return uno::makeAny( xCommandBars ); -} - uno::Any SAL_CALL ScVbaApplication::getSelection() throw (uno::RuntimeException) { OSL_TRACE("** ScVbaApplication::getSelection() ** "); - uno::Reference< lang::XServiceInfo > xServiceInfo( getCurrentDocument()->getCurrentSelection(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModel > xModel( getCurrentDocument() ); + uno::Reference< lang::XServiceInfo > xServiceInfo( xModel->getCurrentController(), uno::UNO_QUERY_THROW ); rtl::OUString sImpementaionName = xServiceInfo->getImplementationName(); if( sImpementaionName.equalsIgnoreAsciiCaseAscii("com.sun.star.drawing.SvxShapeCollection") ) { - uno::Reference< drawing::XShapes > xShapes( getCurrentDocument()->getCurrentSelection(), uno::UNO_QUERY_THROW ); + uno::Reference< drawing::XShapes > xShapes( xModel->getCurrentSelection(), uno::UNO_QUERY_THROW ); uno::Reference< container::XIndexAccess > xIndexAccess( xShapes, uno::UNO_QUERY_THROW ); uno::Reference< drawing::XShape > xShape( xIndexAccess->getByIndex(0), uno::UNO_QUERY_THROW ); // if ScVbaShape::getType( xShape ) == office::MsoShapeType::msoAutoShape @@ -170,10 +167,10 @@ ScVbaApplication::getSelection() throw (uno::RuntimeException) uno::Reference< lang::XServiceInfo > xShapeServiceInfo( xShape, uno::UNO_QUERY_THROW ); if ( xShapeServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.Text" ) ) ) ) { - return uno::makeAny( uno::Reference< msforms::XTextBoxShape >(new ScVbaTextBoxShape( mxContext, xShape, xShapes, getCurrentDocument() ) ) ); + return uno::makeAny( uno::Reference< msforms::XTextBoxShape >(new ScVbaTextBoxShape( mxContext, xShape, xShapes, xModel ) ) ); } } - return uno::makeAny( uno::Reference< msforms::XShape >(new ScVbaShape( this, mxContext, xShape, xShapes, ScVbaShape::getType( xShape ) ) ) ); + return uno::makeAny( uno::Reference< msforms::XShape >(new ScVbaShape( this, mxContext, xShape, xShapes, xModel, ScVbaShape::getType( xShape ) ) ) ); } else if( xServiceInfo->supportsService( rtl::OUString::createFromAscii("com.sun.star.sheet.SheetCellRange")) || xServiceInfo->supportsService( rtl::OUString::createFromAscii("com.sun.star.sheet.SheetCellRanges"))) @@ -199,7 +196,7 @@ ScVbaApplication::getActiveCell() throw (uno::RuntimeException ) { uno::Reference< sheet::XSpreadsheetView > xView( getCurrentDocument()->getCurrentController(), uno::UNO_QUERY_THROW ); uno::Reference< table::XCellRange > xRange( xView->getActiveSheet(), ::uno::UNO_QUERY_THROW); - ScTabViewShell* pViewShell = getCurrentBestViewShell(); + ScTabViewShell* pViewShell = excel::getCurrentBestViewShell(mxContext); if ( !pViewShell ) throw uno::RuntimeException( rtl::OUString::createFromAscii("No ViewShell available"), uno::Reference< uno::XInterface >() ); ScViewData* pTabView = pViewShell->GetViewData(); @@ -212,65 +209,6 @@ ScVbaApplication::getActiveCell() throw (uno::RuntimeException ) return new ScVbaRange( this, mxContext, xRange->getCellRangeByPosition( nCursorX, nCursorY, nCursorX, nCursorY ) ); } -sal_Bool -ScVbaApplication::getScreenUpdating() throw (uno::RuntimeException) -{ - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); - return !xModel->hasControllersLocked(); -} - -void -ScVbaApplication::setScreenUpdating(sal_Bool bUpdate) throw (uno::RuntimeException) -{ - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); - if (bUpdate) - xModel->unlockControllers(); - else - xModel->lockControllers(); -} - -sal_Bool -ScVbaApplication::getDisplayStatusBar() throw (uno::RuntimeException) -{ - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); - uno::Reference< frame::XFrame > xFrame( xModel->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW ); - uno::Reference< beans::XPropertySet > xProps( xFrame, uno::UNO_QUERY_THROW ); - - if( xProps.is() ){ - uno::Reference< frame::XLayoutManager > xLayoutManager( xProps->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LayoutManager")) ), uno::UNO_QUERY_THROW ); - rtl::OUString url(RTL_CONSTASCII_USTRINGPARAM( "private:resource/statusbar/statusbar" )); - if( xLayoutManager.is() && xLayoutManager->isElementVisible( url ) ){ - return sal_True; - } - } - return sal_False; -} - -void -ScVbaApplication::setDisplayStatusBar(sal_Bool bDisplayStatusBar) throw (uno::RuntimeException) -{ - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); - uno::Reference< frame::XFrame > xFrame( xModel->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW ); - uno::Reference< beans::XPropertySet > xProps( xFrame, uno::UNO_QUERY_THROW ); - - if( xProps.is() ){ - uno::Reference< frame::XLayoutManager > xLayoutManager( xProps->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LayoutManager")) ), uno::UNO_QUERY_THROW ); - rtl::OUString url(RTL_CONSTASCII_USTRINGPARAM( "private:resource/statusbar/statusbar" )); - if( xLayoutManager.is() ){ - if( bDisplayStatusBar && !xLayoutManager->isElementVisible( url ) ){ - if( !xLayoutManager->showElement( url ) ) - xLayoutManager->createElement( url ); - return; - } - else if( !bDisplayStatusBar && xLayoutManager->isElementVisible( url ) ){ - xLayoutManager->hideElement( url ); - return; - } - } - } - return; -} - uno::Any SAL_CALL ScVbaApplication::Workbooks( const uno::Any& aIndex ) throw (uno::RuntimeException) { @@ -319,7 +257,7 @@ ScVbaApplication::Evaluate( const ::rtl::OUString& Name ) throw (uno::RuntimeExc uno::Any ScVbaApplication::Dialogs( const uno::Any &aIndex ) throw (uno::RuntimeException) { - uno::Reference< excel::XDialogs > xDialogs( new ScVbaDialogs( uno::Reference< XHelperInterface >( ScVbaGlobals::getGlobalsImpl( mxContext )->getApplication(), uno::UNO_QUERY_THROW ), mxContext ) ); + uno::Reference< excel::XDialogs > xDialogs( new ScVbaDialogs( uno::Reference< XHelperInterface >( this ), mxContext, getCurrentDocument() ) ); if( !aIndex.hasValue() ) return uno::Any( xDialogs ); return uno::Any( xDialogs->Item( aIndex ) ); @@ -341,12 +279,6 @@ ScVbaApplication::getCutCopyMode() throw (uno::RuntimeException) return result; } -::rtl::OUString -ScVbaApplication::getVersion() throw (uno::RuntimeException) -{ - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(EXCELVERSION)); -} - void SAL_CALL ScVbaApplication::setCutCopyMode( const uno::Any& /*_cutcopymode*/ ) throw (uno::RuntimeException) { @@ -432,7 +364,7 @@ ScVbaApplication::setCalculation( ::sal_Int32 _calculation ) throw (uno::Runtime uno::Any SAL_CALL ScVbaApplication::Windows( const uno::Any& aIndex ) throw (uno::RuntimeException) { - uno::Reference< XCollection > xWindows = ScVbaWindows::Windows( mxContext ); + uno::Reference< excel::XWindows > xWindows( new ScVbaWindows( this, mxContext ) ); if ( aIndex.getValueTypeClass() == uno::TypeClass_VOID ) return uno::Any( xWindows ); return uno::Any( xWindows->Item( aIndex, uno::Any() ) ); @@ -543,11 +475,11 @@ ScVbaApplication::GoTo( const uno::Any& Reference, const uno::Any& Scroll ) thro xModel->getCurrentController(), uno::UNO_QUERY_THROW ); uno::Reference< sheet::XSpreadsheet > xDoc = xSpreadsheet->getActiveSheet(); - ScTabViewShell* pShell = getCurrentBestViewShell(); + ScTabViewShell* pShell = excel::getCurrentBestViewShell( mxContext ); ScGridWindow* gridWindow = (ScGridWindow*)pShell->GetWindow(); try { - uno::Reference< excel::XRange > xVbaSheetRange = ScVbaRange::getRangeObjectForName( mxContext, sRangeName, getDocShell( xModel ), formula::FormulaGrammar::CONV_XL_R1C1 ); + uno::Reference< excel::XRange > xVbaSheetRange = ScVbaRange::getRangeObjectForName( mxContext, sRangeName, excel::getDocShell( xModel ), formula::FormulaGrammar::CONV_XL_R1C1 ); ; if( bScroll ) { @@ -585,7 +517,7 @@ ScVbaApplication::GoTo( const uno::Any& Reference, const uno::Any& Scroll ) thro if( Reference >>= xRange ) { uno::Reference< excel::XRange > xVbaRange( Reference, uno::UNO_QUERY ); - ScTabViewShell* pShell = getCurrentBestViewShell(); + ScTabViewShell* pShell = excel::getCurrentBestViewShell( mxContext ); ScGridWindow* gridWindow = (ScGridWindow*)pShell->GetWindow(); if ( xVbaRange.is() ) { @@ -615,38 +547,10 @@ ScVbaApplication::GoTo( const uno::Any& Reference, const uno::Any& Scroll ) thro uno::Reference< uno::XInterface >() ); } -namespace -{ - static uno::Reference< frame::XController > lcl_getCurrentController() - { - const uno::Reference< frame::XModel > xWorkingDoc( SfxObjectShell::GetCurrentComponent(), uno::UNO_QUERY ); - uno::Reference< frame::XController > xController; - if ( xWorkingDoc.is() ) - xController.set( xWorkingDoc->getCurrentController(), uno::UNO_SET_THROW ); - else - xController.set( SfxObjectShell::GetCurrentComponent(), uno::UNO_QUERY_THROW ); - return xController; - } -} - sal_Int32 SAL_CALL ScVbaApplication::getCursor() throw (uno::RuntimeException) { - sal_Int32 nPointerStyle( POINTER_ARROW ); - try - { - const uno::Reference< frame::XController > xController( lcl_getCurrentController(), uno::UNO_SET_THROW ); - const uno::Reference< frame::XFrame > xFrame ( xController->getFrame(), uno::UNO_SET_THROW ); - const uno::Reference< awt::XWindow > xWindow ( xFrame->getContainerWindow(), uno::UNO_SET_THROW ); - // why the heck isn't there an XWindowPeer::getPointer, but a setPointer only? - const Window* pWindow = VCLUnoHelper::GetWindow( xWindow ); - if ( pWindow ) - nPointerStyle = pWindow->GetSystemWindow()->GetPointer().GetStyle(); - } - catch( const uno::Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } + sal_Int32 nPointerStyle = getPointerStyle(getCurrentDocument()); switch( nPointerStyle ) { @@ -668,81 +572,34 @@ ScVbaApplication::setCursor( sal_Int32 _cursor ) throw (uno::RuntimeException) { try { - ::std::vector< uno::Reference< frame::XController > > aControllers; - - const uno::Reference< frame::XModel2 > xModel2( SfxObjectShell::GetCurrentComponent(), uno::UNO_QUERY ); - if ( xModel2.is() ) - { - const uno::Reference< container::XEnumeration > xEnumControllers( xModel2->getControllers(), uno::UNO_SET_THROW ); - while ( xEnumControllers->hasMoreElements() ) - { - const uno::Reference< frame::XController > xController( xEnumControllers->nextElement(), uno::UNO_QUERY_THROW ); - aControllers.push_back( xController ); - } - } - else + uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); + switch( _cursor ) { - const uno::Reference< frame::XModel > xModel( SfxObjectShell::GetCurrentComponent(), uno::UNO_QUERY ); - if ( xModel.is() ) + case excel::XlMousePointer::xlNorthwestArrow: { - const uno::Reference< frame::XController > xController( xModel->getCurrentController(), uno::UNO_SET_THROW ); - aControllers.push_back( xController ); + const Pointer& rPointer( POINTER_ARROW ); + setCursorHelper( xModel, rPointer, sal_False ); + break; } - else + case excel::XlMousePointer::xlWait: + case excel::XlMousePointer::xlIBeam: { - const uno::Reference< frame::XController > xController( SfxObjectShell::GetCurrentComponent(), uno::UNO_QUERY_THROW ); - aControllers.push_back( xController ); + const Pointer& rPointer( static_cast< PointerStyle >( _cursor ) ); + //It will set the edit window, toobar and statusbar's mouse pointer. + setCursorHelper( xModel, rPointer, sal_True ); + break; } - } - - for ( ::std::vector< uno::Reference< frame::XController > >::const_iterator controller = aControllers.begin(); - controller != aControllers.end(); - ++controller - ) - { - const uno::Reference< frame::XFrame > xFrame ( (*controller)->getFrame(), uno::UNO_SET_THROW ); - const uno::Reference< awt::XWindow > xWindow ( xFrame->getContainerWindow(), uno::UNO_SET_THROW ); - - Window* pWindow = VCLUnoHelper::GetWindow( xWindow ); - OSL_ENSURE( pWindow, "ScVbaApplication::setCursor: no window!" ); - if ( !pWindow ) - continue; - - switch( _cursor ) + case excel::XlMousePointer::xlDefault: { - case excel::XlMousePointer::xlNorthwestArrow: - { - const Pointer& rPointer( POINTER_ARROW ); - pWindow->GetSystemWindow()->SetPointer( rPointer ); - pWindow->GetSystemWindow()->EnableChildPointerOverwrite( sal_False ); - break; - } - case excel::XlMousePointer::xlWait: - case excel::XlMousePointer::xlIBeam: - { - const Pointer& rPointer( static_cast< PointerStyle >( _cursor ) ); - //It will set the edit window, toobar and statusbar's mouse pointer. - pWindow->GetSystemWindow()->SetPointer( rPointer ); - pWindow->GetSystemWindow()->EnableChildPointerOverwrite( sal_True ); - //It only set the edit window's mouse pointer - //pWindow->.SetPointer( rPointer ); - //pWindow->.EnableChildPointerOverwrite( sal_True ); - //printf("\nset Cursor...%d\n", pWindow->.GetType()); - break; - } - case excel::XlMousePointer::xlDefault: - { - const Pointer& rPointer( POINTER_NULL ); - pWindow->GetSystemWindow()->SetPointer( rPointer ); - pWindow->GetSystemWindow()->EnableChildPointerOverwrite( sal_False ); - break; - } - default: - throw uno::RuntimeException( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("Unknown value for Cursor pointer")), uno::Reference< uno::XInterface >() ); - // TODO: isn't this a flaw in the API? It should be allowed to throw an - // IllegalArgumentException, or so + const Pointer& rPointer( POINTER_NULL ); + setCursorHelper( xModel, rPointer, sal_False ); + break; } + default: + throw uno::RuntimeException( rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("Unknown value for Cursor pointer")), uno::Reference< uno::XInterface >() ); + // TODO: isn't this a flaw in the API? It should be allowed to throw an + // IllegalArgumentException, or so } } catch( const uno::Exception& ) @@ -1117,7 +974,7 @@ ScVbaApplication::Intersect( const uno::Reference< excel::XRange >& Arg1, const } uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); - ScDocShell* pDocShell = getDocShell( xModel ); + ScDocShell* pDocShell = excel::getDocShell( xModel ); if ( aCellRanges.Count() == 1 ) { xRefRange = new ScVbaRange( uno::Reference< XHelperInterface >(), mxContext, new ScCellRangeObj( pDocShell, *aCellRanges.First() ) ); @@ -1206,7 +1063,7 @@ ScVbaApplication::Union( const uno::Reference< excel::XRange >& Arg1, const uno: aCellRanges.Append( *it ); uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); - ScDocShell* pDocShell = getDocShell( xModel ); + ScDocShell* pDocShell = excel::getDocShell( xModel ); if ( aCellRanges.Count() == 1 ) { // normal range @@ -1228,29 +1085,17 @@ ScVbaApplication::Volatile( const uno::Any& aVolatile ) throw ( uno::RuntimeExc sal_Bool bVolatile = sal_True; aVolatile >>= bVolatile; return; -/* - if ( bVolatile ) - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Volatile - not supported" ) ), uno::Reference< uno::XInterface >() ); - // bVoloatile is false - currently this only would make sense if - // the autocalculate mode is set to be true. - - // so really this is crap, #TODO try and understand how ( or if ) - // the calculation mode and volatile interoperate - if ( ! getCalculation() == excel::XlCalculation::xlCalculationAutomatic ) - setCalculation( excel::XlCalculation::xlCalculationAutomatic ); -*/ } void SAL_CALL ScVbaApplication::DoEvents() throw ( uno::RuntimeException ) { } - ::sal_Bool SAL_CALL ScVbaApplication::getDisplayFormulaBar() throw ( css::uno::RuntimeException ) { sal_Bool bRes = sal_False; - ScTabViewShell* pViewShell = getCurrentBestViewShell(); + ScTabViewShell* pViewShell = excel::getCurrentBestViewShell( mxContext ); if ( pViewShell ) { SfxBoolItem sfxFormBar( FID_TOGGLEINPUTLINE); @@ -1268,7 +1113,7 @@ ScVbaApplication::getDisplayFormulaBar() throw ( css::uno::RuntimeException ) void SAL_CALL ScVbaApplication::setDisplayFormulaBar( ::sal_Bool _displayformulabar ) throw ( css::uno::RuntimeException ) { - ScTabViewShell* pViewShell = getCurrentBestViewShell(); + ScTabViewShell* pViewShell = excel::getCurrentBestViewShell( mxContext ); if ( pViewShell && ( _displayformulabar != getDisplayFormulaBar() ) ) { SfxBoolItem sfxFormBar( FID_TOGGLEINPUTLINE, _displayformulabar); @@ -1278,6 +1123,31 @@ ScVbaApplication::setDisplayFormulaBar( ::sal_Bool _displayformulabar ) throw ( } } +uno::Any SAL_CALL +ScVbaApplication::Caller( const uno::Any& /*aIndex*/ ) throw ( uno::RuntimeException ) +{ + StarBASIC* pBasic = SFX_APP()->GetBasic(); + SFX_APP()->EnterBasicCall(); + SbMethod* pMeth = (SbMethod*)pBasic->GetRtl()->Find( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FuncCaller") ), SbxCLASS_METHOD ); + uno::Any aRet; + if ( pMeth ) + { + SbxVariableRef refTemp = pMeth; + // forces a broadcast + SbxVariableRef pNew = new SbxMethod( *((SbxMethod*)pMeth)); + OSL_TRACE("pNew has type %d and string value %s", pNew->GetType(), rtl::OUStringToOString( pNew->GetString(), RTL_TEXTENCODING_UTF8 ).getStr() ); + aRet = sbxToUnoValue( pNew ); + } + SFX_APP()->LeaveBasicCall(); + return aRet; +} + +uno::Reference< frame::XModel > +ScVbaApplication::getCurrentDocument() throw (css::uno::RuntimeException) +{ + return getCurrentExcelDoc(mxContext); +} + rtl::OUString& ScVbaApplication::getServiceImplName() { @@ -1296,3 +1166,13 @@ ScVbaApplication::getServiceNames() } return aServiceNames; } + +namespace application +{ +namespace sdecl = comphelper::service_decl; +sdecl::vba_service_class_ > serviceImpl; +extern sdecl::ServiceDecl const serviceDecl( + serviceImpl, + "ScVbaApplication", + "ooo.vba.excel.Application" ); +} diff --git a/sc/source/ui/vba/vbaapplication.hxx b/sc/source/ui/vba/vbaapplication.hxx index dd828298fe2a..8d5f4a3b2354 100644 --- a/sc/source/ui/vba/vbaapplication.hxx +++ b/sc/source/ui/vba/vbaapplication.hxx @@ -35,21 +35,25 @@ #include #include -#include "vbahelperinterface.hxx" +#include +#include +#include -typedef InheritedHelperInterfaceImpl1< ov::excel::XApplication > ScVbaApplication_BASE; +//typedef InheritedHelperInterfaceImpl1< ov::excel::XApplication > ScVbaApplication_BASE; +typedef cppu::ImplInheritanceHelper1< VbaApplicationBase, ov::excel::XApplication > ScVbaApplication_BASE; class ScVbaApplication : public ScVbaApplication_BASE { private: sal_Int32 m_xCalculation; rtl::OUString getOfficePath( const rtl::OUString& sPath ) throw ( css::uno::RuntimeException ); +protected: + virtual css::uno::Reference< css::frame::XModel > getCurrentDocument() throw (css::uno::RuntimeException); public: - ScVbaApplication( css::uno::Reference< css::uno::XComponentContext >& m_xContext ); + ScVbaApplication( const css::uno::Reference< css::uno::XComponentContext >& m_xContext ); virtual ~ScVbaApplication(); - // XHelperInterface ( parent is itself ) - virtual css::uno::Reference< ov::XHelperInterface > SAL_CALL getParent( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) { return this; } + virtual SfxObjectShell* GetDocShell( const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException); // XApplication virtual ::rtl::OUString SAL_CALL PathSeparator( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); @@ -68,15 +72,10 @@ public: virtual css::uno::Reference< ov::excel::XRange > SAL_CALL getActiveCell() throw ( css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XWindow > SAL_CALL getActiveWindow() throw (css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL getActiveSheet() throw (css::uno::RuntimeException); - virtual sal_Bool SAL_CALL getScreenUpdating() throw (css::uno::RuntimeException); - virtual void SAL_CALL setScreenUpdating(sal_Bool bUpdate) throw (css::uno::RuntimeException); - virtual sal_Bool SAL_CALL getDisplayStatusBar() throw (css::uno::RuntimeException); - virtual void SAL_CALL setDisplayStatusBar(sal_Bool bDisplayStatusBar) throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL getDisplayFormulaBar() throw ( css::uno::RuntimeException ); virtual void SAL_CALL setDisplayFormulaBar( ::sal_Bool _displayformulabar ) throw ( css::uno::RuntimeException ); virtual css::uno::Reference< ov::XAssistant > SAL_CALL getAssistant() throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL CommandBars( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XWorkbook > SAL_CALL getThisWorkbook() throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Workbooks( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Worksheets( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); @@ -85,7 +84,6 @@ public: virtual css::uno::Any SAL_CALL Dialogs( const css::uno::Any& DialogIndex ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getCutCopyMode() throw (css::uno::RuntimeException); virtual void SAL_CALL setCutCopyMode( const css::uno::Any& _cutcopymode ) throw (css::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getVersion() throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getStatusBar() throw (css::uno::RuntimeException); virtual void SAL_CALL setStatusBar( const css::uno::Any& _statusbar ) throw (css::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getCursor() throw (css::uno::RuntimeException); @@ -103,6 +101,7 @@ public: virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Union( const css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< ov::excel::XRange >& Arg2, const css::uno::Any& Arg3, const css::uno::Any& Arg4, const css::uno::Any& Arg5, const css::uno::Any& Arg6, const css::uno::Any& Arg7, const css::uno::Any& Arg8, const css::uno::Any& Arg9, const css::uno::Any& Arg10, const css::uno::Any& Arg11, const css::uno::Any& Arg12, const css::uno::Any& Arg13, const css::uno::Any& Arg14, const css::uno::Any& Arg15, const css::uno::Any& Arg16, const css::uno::Any& Arg17, const css::uno::Any& Arg18, const css::uno::Any& Arg19, const css::uno::Any& Arg20, const css::uno::Any& Arg21, const css::uno::Any& Arg22, const css::uno::Any& Arg23, const css::uno::Any& Arg24, const css::uno::Any& Arg25, const css::uno::Any& Arg26, const css::uno::Any& Arg27, const css::uno::Any& Arg28, const css::uno::Any& Arg29, const css::uno::Any& Arg30 ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual void SAL_CALL Volatile( const css::uno::Any& Volatile ) throw (css::uno::RuntimeException ); virtual void SAL_CALL DoEvents() throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Caller( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); // XHelperInterface virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence getServiceNames(); diff --git a/sc/source/ui/vba/vbaassistant.hxx b/sc/source/ui/vba/vbaassistant.hxx index a91d1bfd9c39..fa811f548430 100644 --- a/sc/source/ui/vba/vbaassistant.hxx +++ b/sc/source/ui/vba/vbaassistant.hxx @@ -40,8 +40,8 @@ #include -#include "vbahelper.hxx" -#include "vbahelperinterface.hxx" +#include "excelvbahelper.hxx" +#include typedef ::cppu::WeakImplHelper1< ov::XAssistant > Assistant; typedef InheritedHelperInterfaceImpl< Assistant > ScVbaAssistantImpl_BASE; diff --git a/sc/source/ui/vba/vbaaxes.hxx b/sc/source/ui/vba/vbaaxes.hxx index e0bfbe350acb..62be9ba97a39 100644 --- a/sc/source/ui/vba/vbaaxes.hxx +++ b/sc/source/ui/vba/vbaaxes.hxx @@ -32,7 +32,7 @@ #include #include #include -#include "vbacollectionimpl.hxx" +#include typedef CollTestImplHelper< ov::excel::XAxes > ScVbaAxes_BASE; class ScVbaAxes : public ScVbaAxes_BASE diff --git a/sc/source/ui/vba/vbaaxis.hxx b/sc/source/ui/vba/vbaaxis.hxx index b8fafed82ee1..72ff614805e4 100644 --- a/sc/source/ui/vba/vbaaxis.hxx +++ b/sc/source/ui/vba/vbaaxis.hxx @@ -32,8 +32,8 @@ #include #include #include -#include "vbahelperinterface.hxx" - +#include +#include typedef InheritedHelperInterfaceImpl1< ov::excel::XAxis > ScVbaAxis_BASE; class ScVbaChart; class ScVbaAxis : public ScVbaAxis_BASE diff --git a/sc/source/ui/vba/vbaborders.hxx b/sc/source/ui/vba/vbaborders.hxx index bcaecff05aff..ec7deed20ebe 100644 --- a/sc/source/ui/vba/vbaborders.hxx +++ b/sc/source/ui/vba/vbaborders.hxx @@ -38,7 +38,7 @@ #include -#include "vbacollectionimpl.hxx" +#include typedef CollTestImplHelper< ov::excel::XBorders > ScVbaBorders_BASE; class ScVbaPalette; diff --git a/sc/source/ui/vba/vbacharacters.hxx b/sc/source/ui/vba/vbacharacters.hxx index 10fcfc5bbddf..092d80a91e02 100644 --- a/sc/source/ui/vba/vbacharacters.hxx +++ b/sc/source/ui/vba/vbacharacters.hxx @@ -36,7 +36,7 @@ #include #include -#include "vbahelperinterface.hxx" +#include #include "vbapalette.hxx" typedef InheritedHelperInterfaceImpl1< ov::excel::XCharacters > ScVbaCharacters_BASE; diff --git a/sc/source/ui/vba/vbachart.hxx b/sc/source/ui/vba/vbachart.hxx index 19efc430f2fd..3ec8e77c4dc5 100644 --- a/sc/source/ui/vba/vbachart.hxx +++ b/sc/source/ui/vba/vbachart.hxx @@ -41,7 +41,7 @@ #include #include #include -#include "vbahelperinterface.hxx" +#include typedef InheritedHelperInterfaceImpl1 ChartImpl_BASE; diff --git a/sc/source/ui/vba/vbachartobject.cxx b/sc/source/ui/vba/vbachartobject.cxx index feecb7182d97..85104ff20cde 100644 --- a/sc/source/ui/vba/vbachartobject.cxx +++ b/sc/source/ui/vba/vbachartobject.cxx @@ -120,10 +120,11 @@ ScVbaChartObject::Activate() throw ( script::BasicErrorException ) { try { - // #TODO #FIXME should be ThisWorkbook or equivelant - // XModel + // #TODO #FIXME should be ThisWorkbook or equivelant, or in + // fact probably the chart object should be created with + // the XModel owner //uno::Reference< view::XSelectionSupplier > xSelectionSupplier( getXModel().getCurrentController()); - uno::Reference< view::XSelectionSupplier > xSelectionSupplier( getCurrentDocument()->getCurrentController(), uno::UNO_QUERY_THROW ); + uno::Reference< view::XSelectionSupplier > xSelectionSupplier( getCurrentExcelDoc(mxContext)->getCurrentController(), uno::UNO_QUERY_THROW ); xSelectionSupplier->select(uno::makeAny(xShape)); } catch (uno::Exception& ) diff --git a/sc/source/ui/vba/vbachartobject.hxx b/sc/source/ui/vba/vbachartobject.hxx index 3b2b6b3469ec..c7bfbd15c4c1 100644 --- a/sc/source/ui/vba/vbachartobject.hxx +++ b/sc/source/ui/vba/vbachartobject.hxx @@ -36,7 +36,7 @@ #include #include #include -#include "vbahelperinterface.hxx" +#include #include typedef InheritedHelperInterfaceImpl1 ChartObjectImpl_BASE; diff --git a/sc/source/ui/vba/vbachartobjects.hxx b/sc/source/ui/vba/vbachartobjects.hxx index a966dbb66518..5a11e92e8dbc 100644 --- a/sc/source/ui/vba/vbachartobjects.hxx +++ b/sc/source/ui/vba/vbachartobjects.hxx @@ -36,8 +36,8 @@ #include #include #include -#include"vbacollectionimpl.hxx" -#include "vbahelper.hxx" +#include +#include "excelvbahelper.hxx" #include typedef CollTestImplHelper< ov::excel::XChartObjects > ChartObjects_BASE; diff --git a/sc/source/ui/vba/vbacharts.cxx b/sc/source/ui/vba/vbacharts.cxx index 73be2b84e6c6..4c21720ca7f3 100644 --- a/sc/source/ui/vba/vbacharts.cxx +++ b/sc/source/ui/vba/vbacharts.cxx @@ -35,11 +35,9 @@ using namespace ::com::sun::star; using namespace ::ooo::vba; -ScVbaCharts::ScVbaCharts( const css::uno::Reference< ov::XHelperInterface >& _xParent, const css::uno::Reference< css::uno::XComponentContext >& _xContext ) : Charts_BASE(_xParent, _xContext, uno::Reference< container::XIndexAccess >() ) +ScVbaCharts::ScVbaCharts( const css::uno::Reference< ov::XHelperInterface >& _xParent, const css::uno::Reference< css::uno::XComponentContext >& _xContext, const uno::Reference< frame::XModel >& xModel ) : Charts_BASE(_xParent, _xContext, uno::Reference< container::XIndexAccess >()) { - // #TODO #FIXME surely this is wrong, you should never use the - // currently documement ( it could be anything ) - xComponent.set( getCurrentDocument(), uno::UNO_QUERY_THROW ); + xComponent.set( xModel, uno::UNO_QUERY_THROW ); xSpreadsheetDocument.set( xComponent, uno::UNO_QUERY_THROW ); } diff --git a/sc/source/ui/vba/vbacharts.hxx b/sc/source/ui/vba/vbacharts.hxx index f3bbf80f8d16..ac804e5ac873 100644 --- a/sc/source/ui/vba/vbacharts.hxx +++ b/sc/source/ui/vba/vbacharts.hxx @@ -31,8 +31,8 @@ #define SC_VBA_CHARTS_HXX #include #include -#include"vbacollectionimpl.hxx" -#include "vbahelper.hxx" +#include +#include "excelvbahelper.hxx" #include typedef CollTestImplHelper< ov::excel::XCharts > Charts_BASE; @@ -43,7 +43,7 @@ class ScVbaCharts : public Charts_BASE css::uno::Reference< css::sheet::XSpreadsheetDocument > xSpreadsheetDocument; css::uno::Reference< css::lang::XComponent > xComponent; public: - ScVbaCharts( const css::uno::Reference< ov::XHelperInterface >& _xParent, const css::uno::Reference< css::uno::XComponentContext >& _xContext ); + ScVbaCharts( const css::uno::Reference< ov::XHelperInterface >& _xParent, const css::uno::Reference< css::uno::XComponentContext >& _xContext, const css::uno::Reference< css::frame::XModel >& xModel ); // XCharts virtual css::uno::Any SAL_CALL Add() throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XChart > SAL_CALL getActiveChart( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); diff --git a/sc/source/ui/vba/vbacomment.hxx b/sc/source/ui/vba/vbacomment.hxx index 6676d09bd660..8601fa303844 100644 --- a/sc/source/ui/vba/vbacomment.hxx +++ b/sc/source/ui/vba/vbacomment.hxx @@ -39,7 +39,7 @@ #include #include -#include "vbahelperinterface.hxx" +#include typedef InheritedHelperInterfaceImpl1< ov::excel::XComment > ScVbaComment_BASE; diff --git a/sc/source/ui/vba/vbacomments.hxx b/sc/source/ui/vba/vbacomments.hxx index 098dfd5153a3..be876ab2f76e 100644 --- a/sc/source/ui/vba/vbacomments.hxx +++ b/sc/source/ui/vba/vbacomments.hxx @@ -34,8 +34,8 @@ #include -#include "vbahelper.hxx" -#include "vbacollectionimpl.hxx" +#include "excelvbahelper.hxx" +#include #include "vbacomment.hxx" typedef CollTestImplHelper< ov::excel::XComments > ScVbaComments_BASE; diff --git a/sc/source/ui/vba/vbacondition.hxx b/sc/source/ui/vba/vbacondition.hxx index ac44130e5127..823e889ae298 100644 --- a/sc/source/ui/vba/vbacondition.hxx +++ b/sc/source/ui/vba/vbacondition.hxx @@ -31,7 +31,7 @@ #define SC_VBA_CONDITION_HXX #include #include -#include "vbahelperinterface.hxx" +#include #include template< typename Ifc1 > diff --git a/sc/source/ui/vba/vbacontrol.cxx b/sc/source/ui/vba/vbacontrol.cxx index eaf9365016ec..e69de29bb2d1 100644 --- a/sc/source/ui/vba/vbacontrol.cxx +++ b/sc/source/ui/vba/vbacontrol.cxx @@ -1,468 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbacontrol.cxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef VBA_OOBUILD_HACK -#include -#endif -#include"vbacontrol.hxx" -#include"vbacombobox.hxx" -#include "vbabutton.hxx" -#include "vbalabel.hxx" -#include "vbatextbox.hxx" -#include "vbaradiobutton.hxx" -#include "vbalistbox.hxx" -#include "vbatogglebutton.hxx" -#include "vbacheckbox.hxx" -#include "vbaframe.hxx" -#include "vbascrollbar.hxx" -#include "vbaprogressbar.hxx" -#include "vbamultipage.hxx" -#include "vbaspinbutton.hxx" -#include "vbaimage.hxx" - - -using namespace com::sun::star; -using namespace ooo::vba; - -uno::Reference< css::awt::XWindowPeer > -ScVbaControl::getWindowPeer() throw (uno::RuntimeException) -{ - uno::Reference< drawing::XControlShape > xControlShape( m_xControl, uno::UNO_QUERY ); - - uno::Reference< awt::XControlModel > xControlModel; - uno::Reference< css::awt::XWindowPeer > xWinPeer; - if ( !xControlShape.is() ) - { - // would seem to be a Userform control - uno::Reference< awt::XControl > xControl( m_xControl, uno::UNO_QUERY_THROW ); - xWinPeer = xControl->getPeer(); - return xWinPeer; - } - // form control - xControlModel.set( xControlShape->getControl(), uno::UNO_QUERY_THROW ); - - uno::Reference< view::XControlAccess > xControlAccess( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW ); - try - { - uno::Reference< awt::XControl > xControl( xControlAccess->getControl( xControlModel ), uno::UNO_QUERY ); - xWinPeer = xControl->getPeer(); - } - catch( uno::Exception ) - { - throw uno::RuntimeException( rtl::OUString::createFromAscii( "The Control does not exsit" ), - uno::Reference< uno::XInterface >() ); - } - return xWinPeer; -} - -//ScVbaControlListener -class ScVbaControlListener: public cppu::WeakImplHelper1< lang::XEventListener > -{ -private: - ScVbaControl *pControl; -public: - ScVbaControlListener( ScVbaControl *pTmpControl ); - virtual ~ScVbaControlListener(); - virtual void SAL_CALL disposing( const lang::EventObject& rEventObject ) throw( uno::RuntimeException ); -}; - -ScVbaControlListener::ScVbaControlListener( ScVbaControl *pTmpControl ): pControl( pTmpControl ) -{ -} - -ScVbaControlListener::~ScVbaControlListener() -{ -} - -void SAL_CALL -ScVbaControlListener::disposing( const lang::EventObject& ) throw( uno::RuntimeException ) -{ - if( pControl ) - { - pControl->removeResouce(); - pControl = NULL; - } -} - -//ScVbaControl - -ScVbaControl::ScVbaControl( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< ::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : ControlImpl_BASE( xParent, xContext ), m_xControl( xControl ), m_xModel( xModel ) -{ - //add listener - m_xEventListener.set( new ScVbaControlListener( this ) ); - setGeometryHelper( pGeomHelper ); - uno::Reference< lang::XComponent > xComponent( m_xControl, uno::UNO_QUERY_THROW ); - xComponent->addEventListener( m_xEventListener ); - - //init m_xProps - uno::Reference< drawing::XControlShape > xControlShape( m_xControl, uno::UNO_QUERY ) ; - uno::Reference< awt::XControl> xUserFormControl( m_xControl, uno::UNO_QUERY ) ; - if ( xControlShape.is() ) // form control - m_xProps.set( xControlShape->getControl(), uno::UNO_QUERY_THROW ); - else if ( xUserFormControl.is() ) // userform control - m_xProps.set( xUserFormControl->getModel(), uno::UNO_QUERY_THROW ); -} - -ScVbaControl::~ScVbaControl() -{ - if( m_xControl.is() ) -{ - uno::Reference< lang::XComponent > xComponent( m_xControl, uno::UNO_QUERY_THROW ); - xComponent->removeEventListener( m_xEventListener ); -} -} - -void -ScVbaControl::setGeometryHelper( AbstractGeometryAttributes* pHelper ) -{ - mpGeometryHelper.reset( pHelper ); -} - -void ScVbaControl::removeResouce() throw( uno::RuntimeException ) -{ - uno::Reference< lang::XComponent > xComponent( m_xControl, uno::UNO_QUERY_THROW ); - xComponent->removeEventListener( m_xEventListener ); - m_xControl= NULL; - m_xProps = NULL; -} - -//In design model has different behavior -sal_Bool SAL_CALL ScVbaControl::getEnabled() throw (uno::RuntimeException) -{ - uno::Any aValue = m_xProps->getPropertyValue - (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Enabled" ) ) ); - sal_Bool bRet = false; - aValue >>= bRet; - return bRet; -} - -void SAL_CALL ScVbaControl::setEnabled( sal_Bool bVisible ) throw (uno::RuntimeException) -{ - uno::Any aValue( bVisible ); - m_xProps->setPropertyValue - (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Enabled" ) ), aValue); - -} - -sal_Bool SAL_CALL ScVbaControl::getVisible() throw (uno::RuntimeException) -{ - sal_Bool bVisible = sal_False; - m_xProps->getPropertyValue(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EnableVisible" ) ) ) >>= bVisible; - return bVisible; -} - -void SAL_CALL ScVbaControl::setVisible( sal_Bool bVisible ) throw (uno::RuntimeException) -{ - m_xProps->setPropertyValue - (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EnableVisible" ) ), uno::makeAny( bVisible ) ); -} -double SAL_CALL ScVbaControl::getHeight() throw (uno::RuntimeException) -{ - return mpGeometryHelper->getHeight(); -} -void SAL_CALL ScVbaControl::setHeight( double _height ) throw (uno::RuntimeException) -{ - mpGeometryHelper->setHeight( _height ); -} - -double SAL_CALL ScVbaControl::getWidth() throw (uno::RuntimeException) -{ - return mpGeometryHelper->getWidth(); -} -void SAL_CALL ScVbaControl::setWidth( double _width ) throw (uno::RuntimeException) -{ - mpGeometryHelper->setWidth( _width ); -} - -double SAL_CALL -ScVbaControl::getLeft() throw (uno::RuntimeException) -{ - return mpGeometryHelper->getLeft(); -} - -void SAL_CALL -ScVbaControl::setLeft( double _left ) throw (uno::RuntimeException) -{ - mpGeometryHelper->setLeft( _left ); - -} - -double SAL_CALL -ScVbaControl::getTop() throw (uno::RuntimeException) -{ - return mpGeometryHelper->getTop(); -} - -void SAL_CALL -ScVbaControl::setTop( double _top ) throw (uno::RuntimeException) -{ - mpGeometryHelper->setTop( _top ); -} - -uno::Reference< uno::XInterface > SAL_CALL -ScVbaControl::getObject() throw (uno::RuntimeException) -{ - uno::Reference< msforms::XControl > xRet( this ); - return xRet; -} - -void SAL_CALL ScVbaControl::SetFocus() throw (uno::RuntimeException) -{ - uno::Reference< awt::XWindow > xWin( m_xControl, uno::UNO_QUERY_THROW ); - xWin->setFocus(); -} - -rtl::OUString SAL_CALL -ScVbaControl::getControlSource() throw (uno::RuntimeException) -{ -// #FIXME I *hate* having these upstream differences -// but this is necessary until I manage to upstream other -// dependant parts -#ifdef VBA_OOBUILD_HACK - rtl::OUString sControlSource; - uno::Reference< form::binding::XBindableValue > xBindable( m_xProps, uno::UNO_QUERY ); - if ( xBindable.is() ) - { - try - { - uno::Reference< lang::XMultiServiceFactory > xFac( m_xModel, uno::UNO_QUERY_THROW ); - uno::Reference< beans::XPropertySet > xConvertor( xFac->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.table.CellAddressConversion" ))), uno::UNO_QUERY ); - uno::Reference< beans::XPropertySet > xProps( xBindable->getValueBinding(), uno::UNO_QUERY_THROW ); - table::CellAddress aAddress; - xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BoundCell") ) ) >>= aAddress; - xConvertor->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Address") ), uno::makeAny( aAddress ) ); - xConvertor->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("XL_A1_Representation") ) ) >>= sControlSource; - } - catch( uno::Exception& ) - { - } - } - return sControlSource; -#else - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("getControlSource not supported") ), uno::Reference< uno::XInterface >()); // not supported -#endif -} - -void SAL_CALL -ScVbaControl::setControlSource( const rtl::OUString& _controlsource ) throw (uno::RuntimeException) -{ -#ifdef VBA_OOBUILD_HACK - rtl::OUString sEmpty; - svt::BindableControlHelper::ApplyListSourceAndBindableData( m_xModel, m_xProps, _controlsource, sEmpty ); -#else - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("setControlSource not supported ") ).concat( _controlsource ), uno::Reference< uno::XInterface >()); // not supported -#endif -} - -rtl::OUString SAL_CALL -ScVbaControl::getRowSource() throw (uno::RuntimeException) -{ -#ifdef VBA_OOBUILD_HACK - rtl::OUString sRowSource; - uno::Reference< form::binding::XListEntrySink > xListSink( m_xProps, uno::UNO_QUERY ); - if ( xListSink.is() ) - { - try - { - uno::Reference< lang::XMultiServiceFactory > xFac( m_xModel, uno::UNO_QUERY_THROW ); - uno::Reference< beans::XPropertySet > xConvertor( xFac->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.table.CellRangeAddressConversion" ))), uno::UNO_QUERY ); - - uno::Reference< beans::XPropertySet > xProps( xListSink->getListEntrySource(), uno::UNO_QUERY_THROW ); - table::CellRangeAddress aAddress; - xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CellRange") ) ) >>= aAddress; - xConvertor->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Address")), uno::makeAny( aAddress ) ); - xConvertor->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("XL_A1_Representation") ) ) >>= sRowSource; - } - catch( uno::Exception& ) - { - } - } - return sRowSource; -#else - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("getRowSource not supported") ), uno::Reference< uno::XInterface >()); // not supported -#endif -} - -void SAL_CALL -ScVbaControl::setRowSource( const rtl::OUString& _rowsource ) throw (uno::RuntimeException) -{ -#ifdef VBA_OOBUILD_HACK - rtl::OUString sEmpty; - svt::BindableControlHelper::ApplyListSourceAndBindableData( m_xModel, m_xProps, sEmpty, _rowsource ); -#else - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("setRowSource not supported ") ).concat( _rowsource ), uno::Reference< uno::XInterface >()); // not supported -#endif -} - -rtl::OUString SAL_CALL -ScVbaControl::getName() throw (uno::RuntimeException) -{ - rtl::OUString sName; - m_xProps->getPropertyValue - (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ) ) ) >>= sName; - return sName; - -} - -void SAL_CALL -ScVbaControl::setName( const rtl::OUString& _name ) throw (uno::RuntimeException) -{ - m_xProps->setPropertyValue - (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ) ), uno::makeAny( _name ) ); - } -//ScVbaControlFactory - -ScVbaControlFactory::ScVbaControlFactory( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel ): m_xContext( xContext ), m_xControl( xControl ), m_xModel( xModel ) -{ -} - -ScVbaControl* ScVbaControlFactory::createControl() throw (uno::RuntimeException) -{ - return createControl( m_xModel ); -} -ScVbaControl* ScVbaControlFactory::createControl( const uno::Reference< uno::XInterface >& xParent ) throw (uno::RuntimeException) -{ - uno::Reference< drawing::XControlShape > xControlShape( m_xControl, uno::UNO_QUERY ); - if ( xControlShape.is() ) // form controls - return createControl( xControlShape, xParent ); - uno::Reference< awt::XControl > xControl( m_xControl, uno::UNO_QUERY ); - if ( !xControl.is() ) - throw uno::RuntimeException(); // really we should be more informative - return createControl( xControl, xParent ); - -} - -ScVbaControl* ScVbaControlFactory::createControl(const uno::Reference< drawing::XControlShape >& xControlShape, const uno::Reference< uno::XInterface >& /*xParent*/ ) throw (uno::RuntimeException) -{ - uno::Reference< beans::XPropertySet > xProps( xControlShape->getControl(), uno::UNO_QUERY_THROW ); - sal_Int32 nClassId = -1; - const static rtl::OUString sClassId( RTL_CONSTASCII_USTRINGPARAM("ClassId") ); - xProps->getPropertyValue( sClassId ) >>= nClassId; - uno::Reference< XHelperInterface > xVbaParent; // #FIXME - should be worksheet I guess - switch( nClassId ) - { - case form::FormComponentType::COMBOBOX: - return new ScVbaComboBox( xVbaParent, m_xContext, xControlShape, m_xModel, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) ); - case form::FormComponentType::COMMANDBUTTON: - return new ScVbaButton( xVbaParent, m_xContext, xControlShape, m_xModel, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) ); - case form::FormComponentType::FIXEDTEXT: - return new ScVbaLabel( xVbaParent, m_xContext, xControlShape, m_xModel, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) ); - case form::FormComponentType::TEXTFIELD: - return new ScVbaTextBox( xVbaParent, m_xContext, xControlShape, m_xModel, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) ); - case form::FormComponentType::RADIOBUTTON: - return new ScVbaRadioButton( xVbaParent, m_xContext, xControlShape, m_xModel, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) ); - case form::FormComponentType::LISTBOX: - return new ScVbaListBox( xVbaParent, m_xContext, xControlShape, m_xModel, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) ); - case form::FormComponentType::SPINBUTTON: - return new ScVbaSpinButton( xVbaParent, m_xContext, xControlShape, m_xModel, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) ); - case form::FormComponentType::IMAGECONTROL: - return new ScVbaImage( xVbaParent, m_xContext, xControlShape, m_xModel, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) ); - default: - throw uno::RuntimeException( rtl::OUString::createFromAscii( - "Donot support this Control Type." ), uno::Reference< uno::XInterface >() ); - } -} - -ScVbaControl* ScVbaControlFactory::createControl( const uno::Reference< awt::XControl >& xControl, const uno::Reference< uno::XInterface >& xParent ) throw (uno::RuntimeException) -{ - uno::Reference< beans::XPropertySet > xProps( xControl->getModel(), uno::UNO_QUERY_THROW ); - uno::Reference< lang::XServiceInfo > xServiceInfo( xProps, uno::UNO_QUERY_THROW ); - ScVbaControl* pControl = NULL; - uno::Reference< XHelperInterface > xVbaParent; // #FIXME - should be worksheet I guess - if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlCheckBoxModel") ) ) ) - pControl = new ScVbaCheckbox( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) ); - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlRadioButtonModel") ) ) ) - pControl = new ScVbaRadioButton( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) ); - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlEditModel") ) ) ) - pControl = new ScVbaTextBox( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ), true ); - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlButtonModel") ) ) ) - { - sal_Bool bToggle = sal_False; - xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Toggle") ) ) >>= bToggle; - if ( bToggle ) - pControl = new ScVbaToggleButton( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) ); - else - pControl = new ScVbaButton( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) ); - } - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlComboBoxModel") ) ) ) - pControl = new ScVbaComboBox( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ), true ); - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlListBoxModel") ) ) ) - pControl = new ScVbaListBox( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) ); - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFixedTextModel") ) ) ) - pControl = new ScVbaLabel( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) ); - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlImageControlModel") ) ) ) - pControl = new ScVbaImage( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) ); - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlProgressBarModel") ) ) ) - pControl = new ScVbaProgressBar( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) ); - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlGroupBoxModel") ) ) ) - pControl = new ScVbaFrame( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) ); - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlScrollBarModel") ) ) ) - pControl = new ScVbaScrollBar( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) ); - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoMultiPageModel") ) ) ) - pControl = new ScVbaMultiPage( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ), xParent ); - else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlSpinButtonModel") ) ) ) - pControl = new ScVbaSpinButton( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) ); - else - throw uno::RuntimeException( rtl::OUString::createFromAscii("Unsupported control " ), uno::Reference< uno::XInterface >() ); - return pControl; -} - -rtl::OUString& -ScVbaControl::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaControl") ); - return sImplName; -} - -uno::Sequence< rtl::OUString > -ScVbaControl::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Control" ) ); - } - return aServiceNames; -} - - diff --git a/sc/source/ui/vba/vbadialog.cxx b/sc/source/ui/vba/vbadialog.cxx index eb0cdfa6386e..06faebc3a37b 100644 --- a/sc/source/ui/vba/vbadialog.cxx +++ b/sc/source/ui/vba/vbadialog.cxx @@ -27,39 +27,11 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#include - -#include -#include -#include - -#include - -#include "vbahelper.hxx" #include "vbadialog.hxx" -#include "vbaglobals.hxx" using namespace ::ooo::vba; using namespace ::com::sun::star; -// fails silently -void -ScVbaDialog::Show() throw(uno::RuntimeException) -{ - rtl::OUString aURL; - uno::Reference< frame::XModel > xModel = getCurrentDocument(); - if ( xModel.is() ) - { - aURL = mapIndexToName( mnIndex ); - if( aURL.getLength() ) - throw uno::RuntimeException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " Unable to open the specified dialog " ) ), - uno::Reference< XInterface > () ); - dispatchRequests( xModel, aURL ); - } -} - - static const rtl::OUString aStringList[]= { rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Open" ) ), @@ -102,7 +74,7 @@ ScVbaDialog::mapIndexToName( sal_Int32 nIndex ) rtl::OUString& ScVbaDialog::getServiceImplName() { - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaPivotTable") ); + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaDialog") ); return sImplName; } @@ -113,7 +85,7 @@ ScVbaDialog::getServiceNames() if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.PivotTable" ) ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Dialog" ) ); } return aServiceNames; } diff --git a/sc/source/ui/vba/vbadialog.hxx b/sc/source/ui/vba/vbadialog.hxx index 8b488abebb19..77be9341f7f3 100644 --- a/sc/source/ui/vba/vbadialog.hxx +++ b/sc/source/ui/vba/vbadialog.hxx @@ -31,27 +31,20 @@ #define SC_VBA_DIALOG_HXX #include - -#include -#include -#include #include +#include +#include -#include "vbahelperinterface.hxx" -#include "vbadialog.hxx" - -typedef InheritedHelperInterfaceImpl1< ov::excel::XDialog > ScVbaDialog_BASE; +typedef cppu::ImplInheritanceHelper1< VbaDialogBase, ov::excel::XDialog > ScVbaDialog_BASE; class ScVbaDialog : public ScVbaDialog_BASE { - sal_Int32 mnIndex; public: - ScVbaDialog( const css::uno::Reference< ov::XHelperInterface >& xParent, sal_Int32 nIndex, const css::uno::Reference< css::uno::XComponentContext > xContext ):ScVbaDialog_BASE( xParent, xContext ), mnIndex( nIndex ) {} + ScVbaDialog( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, const css::uno::Reference< css::frame::XModel >& xModel, sal_Int32 nIndex ):ScVbaDialog_BASE( xParent, xContext, xModel, nIndex ) {} virtual ~ScVbaDialog() {} // Methods - virtual void SAL_CALL Show() throw (css::uno::RuntimeException); - rtl::OUString mapIndexToName( sal_Int32 nIndex ); + virtual rtl::OUString mapIndexToName( sal_Int32 nIndex ); // XHelperInterface virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence getServiceNames(); diff --git a/sc/source/ui/vba/vbadialogs.cxx b/sc/source/ui/vba/vbadialogs.cxx index 1dca41d5d1e1..aa2161f33c21 100644 --- a/sc/source/ui/vba/vbadialogs.cxx +++ b/sc/source/ui/vba/vbadialogs.cxx @@ -27,18 +27,8 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#include - -#include -#include -#include #include - -#include - -#include "vbahelper.hxx" #include "vbadialogs.hxx" -#include "vbaglobals.hxx" #include "vbadialog.hxx" using namespace ::ooo::vba; @@ -49,26 +39,19 @@ ScVbaDialogs::Dummy() throw (uno::RuntimeException) { } -::sal_Int32 -ScVbaDialogs::getCount() throw (uno::RuntimeException) -{ - //#TODO #FIXEME - //SC_VBA_STUB(); - return 0; -} - uno::Any ScVbaDialogs::Item( const uno::Any &aItem ) throw (uno::RuntimeException) { sal_Int32 nIndex = 0; aItem >>= nIndex; - uno::Reference< excel::XDialog > aDialog( new ScVbaDialog( uno::Reference< XHelperInterface >( ScVbaGlobals::getGlobalsImpl( mxContext )->getApplication(), uno::UNO_QUERY_THROW ), nIndex, mxContext ) ); + uno::Reference< excel::XDialog > aDialog( new ScVbaDialog( uno::Reference< XHelperInterface >( Application(),uno::UNO_QUERY_THROW ), mxContext, m_xModel, nIndex ) ); return uno::Any( aDialog ); } + rtl::OUString& ScVbaDialogs::getServiceImplName() { - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaWorksheet") ); + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaDialogs") ); return sImplName; } @@ -79,7 +62,7 @@ ScVbaDialogs::getServiceNames() if ( aServiceNames.getLength() == 0 ) { aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Worksheet" ) ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Dialogs" ) ); } return aServiceNames; } diff --git a/sc/source/ui/vba/vbadialogs.hxx b/sc/source/ui/vba/vbadialogs.hxx index 40eeb78663a2..a1785defc255 100644 --- a/sc/source/ui/vba/vbadialogs.hxx +++ b/sc/source/ui/vba/vbadialogs.hxx @@ -30,25 +30,22 @@ #ifndef SC_VBA_DIALOGS_HXX #define SC_VBA_DIALOGS_HXX -#include - #include #include #include -#include "vbahelperinterface.hxx" - -class ScModelObj; +#include +#include +#include -typedef InheritedHelperInterfaceImpl1< ov::excel::XDialogs > ScVbaDialogs_BASE; +typedef cppu::ImplInheritanceHelper1< VbaDialogsBase, ov::excel::XDialogs > ScVbaDialogs_BASE; class ScVbaDialogs : public ScVbaDialogs_BASE { public: - ScVbaDialogs( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext ): ScVbaDialogs_BASE( xParent, xContext ) {} + ScVbaDialogs( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::frame::XModel >& xModel ): ScVbaDialogs_BASE( xParent, xContext, xModel ) {} virtual ~ScVbaDialogs() {} // XCollection - virtual ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index ) throw (css::uno::RuntimeException); // XDialogs diff --git a/sc/source/ui/vba/vbafont.cxx b/sc/source/ui/vba/vbafont.cxx index 9855d5e056af..7f85f71e76bf 100644 --- a/sc/source/ui/vba/vbafont.cxx +++ b/sc/source/ui/vba/vbafont.cxx @@ -46,37 +46,14 @@ using namespace ::ooo::vba; using namespace ::com::sun::star; -// use local constants there is no need to expose these constants -// externally. Looking at the Format->Character dialog it seem that -// these may infact be even be calculated. Leave hardcoded for now -// #FIXEME #TBD investigate the code for dialog mentioned above - -// The font baseline is not specified. -const short NORMAL = 0; - -// specifies a superscripted. -const short SUPERSCRIPT = 33; - -// specifies a subscripted. -const short SUBSCRIPT = -33; - -// specifies a hight of superscripted font - const sal_Int8 SUPERSCRIPTHEIGHT = 58; - -// specifies a hight of subscripted font -const sal_Int8 SUBSCRIPTHEIGHT = 58; - -// specifies a hight of normal font -const short NORMALHEIGHT = 100; - -ScVbaFont::ScVbaFont( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const ScVbaPalette& dPalette, uno::Reference< beans::XPropertySet > xPropertySet, ScCellRangeObj* pRangeObj ) throw ( uno::RuntimeException ) : ScVbaFont_BASE( xParent, xContext ), mxFont( xPropertySet, css::uno::UNO_QUERY_THROW ), mPalette( dPalette ), mpRangeObj( pRangeObj ) +ScVbaFont::ScVbaFont( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const ScVbaPalette& dPalette, uno::Reference< beans::XPropertySet > xPropertySet, ScCellRangeObj* pRangeObj ) throw ( uno::RuntimeException ) : ScVbaFont_BASE( xParent, xContext, dPalette.getPalette(), xPropertySet ), mPalette( dPalette ), mpRangeObj( pRangeObj ) { } SfxItemSet* ScVbaFont::GetDataSet() { - SfxItemSet* pDataSet = ScVbaCellRangeAccess::GetDataSet( mpRangeObj ); + SfxItemSet* pDataSet = excel::ScVbaCellRangeAccess::GetDataSet( mpRangeObj ); return pDataSet; } @@ -243,19 +220,13 @@ ScVbaFont::getSubscript() throw ( uno::RuntimeException ) return uno::makeAny( ( nValue == SUBSCRIPT ) ); } -void SAL_CALL -ScVbaFont::setSize( const uno::Any& aValue ) throw( uno::RuntimeException ) -{ - mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharHeight" ) ), aValue ); -} - uno::Any SAL_CALL ScVbaFont::getSize() throw ( uno::RuntimeException ) { if ( GetDataSet() ) if ( GetDataSet()->GetItemState( ATTR_FONT_HEIGHT, TRUE, NULL) == SFX_ITEM_DONTCARE ) return aNULL(); - return mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharHeight" ) ) ); + return ScVbaFont_BASE::getSize(); } void SAL_CALL @@ -267,13 +238,12 @@ ScVbaFont::setColorIndex( const uno::Any& _colorindex ) throw( uno::RuntimeExcep // handled properly here if ( !nIndex || ( nIndex == excel::XlColorIndex::xlColorIndexAutomatic ) ) + { nIndex = 1; // check defualt ( assume black ) - --nIndex; // OOo indices are zero bases - uno::Reference< container::XIndexAccess > xIndex = mPalette.getPalette(); - // setColor expects colors in XL RGB values - // #FIXME this is daft we convert OO RGB val to XL RGB val and - // then back again to OO RGB value - setColor( OORGBToXLRGB(xIndex->getByIndex( nIndex )) ); + ScVbaFont_BASE::setColorIndex( uno::makeAny( nIndex ) ); + } + else + ScVbaFont_BASE::setColorIndex( _colorindex ); } @@ -284,26 +254,7 @@ ScVbaFont::getColorIndex() throw ( uno::RuntimeException ) if ( GetDataSet() ) if ( GetDataSet()->GetItemState( ATTR_FONT_COLOR, TRUE, NULL) == SFX_ITEM_DONTCARE ) return aNULL(); - - // getColor returns Xl ColorValue, need to convert it to OO val - // as the palette deals with OO RGB values - // #FIXME this is daft in getColor we convert OO RGB val to XL RGB val - // and then back again to OO RGB value - XLRGBToOORGB( getColor() ) >>= nColor; - uno::Reference< container::XIndexAccess > xIndex = mPalette.getPalette(); - sal_Int32 nElems = xIndex->getCount(); - sal_Int32 nIndex = -1; - for ( sal_Int32 count=0; countgetByIndex( count ) >>= nPaletteColor; - if ( nPaletteColor == nColor ) - { - nIndex = count + 1; // 1 based - break; - } - } - return uno::makeAny( nIndex ); + return ScVbaFont_BASE::getColorIndex(); } ////////////////////////////////////////////////////////////////////////////////////////// @@ -396,28 +347,13 @@ ScVbaFont::getFontStyle() throw ( uno::RuntimeException ) return uno::makeAny( aStyles.makeStringAndClear() ); } -void SAL_CALL -ScVbaFont::setBold( const uno::Any& aValue ) throw( uno::RuntimeException ) -{ - sal_Bool bValue = sal_False; - aValue >>= bValue; - double fBoldValue = awt::FontWeight::NORMAL; - if( bValue ) - fBoldValue = awt::FontWeight::BOLD; - mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharWeight" ) ), ( uno::Any )fBoldValue ); - -} - uno::Any SAL_CALL ScVbaFont::getBold() throw ( uno::RuntimeException ) { if ( GetDataSet() ) if ( GetDataSet()->GetItemState( ATTR_FONT_WEIGHT, TRUE, NULL) == SFX_ITEM_DONTCARE ) return aNULL(); - - double fValue = 0.0; - mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharWeight" ) ) ) >>= fValue; - return uno::makeAny( fValue == awt::FontWeight::BOLD ); + return ScVbaFont_BASE::getBold(); } void SAL_CALL @@ -481,32 +417,13 @@ ScVbaFont::getUnderline() throw ( uno::RuntimeException ) return uno::makeAny( nValue ); } -void SAL_CALL -ScVbaFont::setStrikethrough( const uno::Any& aValue ) throw ( uno::RuntimeException ) -{ - sal_Bool bValue = sal_False; - aValue >>= bValue; - short nValue = awt::FontStrikeout::NONE; - if( bValue ) - nValue = awt::FontStrikeout::SINGLE; - mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharStrikeout" ) ), ( uno::Any )nValue ); -} - uno::Any SAL_CALL ScVbaFont::getStrikethrough() throw ( uno::RuntimeException ) { if ( GetDataSet() ) if ( GetDataSet()->GetItemState( ATTR_FONT_CROSSEDOUT, TRUE, NULL) == SFX_ITEM_DONTCARE ) return aNULL(); - short nValue = 0; - mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharStrikeout" ) ) ) >>= nValue; - return uno::Any( nValue == awt::FontStrikeout::SINGLE ); -} - -void SAL_CALL -ScVbaFont::setShadow( const uno::Any& aValue ) throw ( uno::RuntimeException ) -{ - mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharShadowed" ) ), aValue ); + return ScVbaFont_BASE::getStrikethrough(); } uno::Any SAL_CALL @@ -515,18 +432,7 @@ ScVbaFont::getShadow() throw (uno::RuntimeException) if ( GetDataSet() ) if ( GetDataSet()->GetItemState( ATTR_FONT_SHADOWED, TRUE, NULL) == SFX_ITEM_DONTCARE ) return aNULL(); - return mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharShadowed" ) ) ); -} - -void SAL_CALL -ScVbaFont::setItalic( const uno::Any& aValue ) throw ( uno::RuntimeException ) -{ - sal_Bool bValue = sal_False; - aValue >>= bValue; - short nValue = awt::FontSlant_NONE; - if( bValue ) - nValue = awt::FontSlant_ITALIC; - mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharPosture" ) ), ( uno::Any )nValue ); + return ScVbaFont_BASE::getShadow(); } uno::Any SAL_CALL @@ -536,17 +442,7 @@ ScVbaFont::getItalic() throw ( uno::RuntimeException ) if ( GetDataSet()->GetItemState( ATTR_FONT_POSTURE, TRUE, NULL) == SFX_ITEM_DONTCARE ) return aNULL(); - awt::FontSlant aFS; - mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharPosture" ) ) ) >>= aFS; - return uno::makeAny( aFS == awt::FontSlant_ITALIC ); -} - -void SAL_CALL -ScVbaFont::setName( const uno::Any& aValue ) throw ( uno::RuntimeException ) -{ - rtl::OUString sString; - aValue >>= sString; - mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharFontName" ) ), aValue); + return ScVbaFont_BASE::getItalic(); } uno::Any SAL_CALL @@ -555,22 +451,17 @@ ScVbaFont::getName() throw ( uno::RuntimeException ) if ( GetDataSet() ) if ( GetDataSet()->GetItemState( ATTR_FONT, TRUE, NULL) == SFX_ITEM_DONTCARE ) return aNULL(); - return mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharFontName" ) ) ); + return ScVbaFont_BASE::getName(); } uno::Any ScVbaFont::getColor() throw (uno::RuntimeException) { + // #TODO #FIXME - behave like getXXX above ( wrt. GetDataSet ) uno::Any aAny; aAny = OORGBToXLRGB( mxFont->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharColor" ) ) ) ); return aAny; } -void -ScVbaFont::setColor( const uno::Any& _color ) throw (uno::RuntimeException) -{ - mxFont->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharColor" ) ) , XLRGBToOORGB(_color)); -} - void SAL_CALL ScVbaFont::setOutlineFont( const uno::Any& aValue ) throw ( uno::RuntimeException ) { diff --git a/sc/source/ui/vba/vbafont.hxx b/sc/source/ui/vba/vbafont.hxx index a0b9b2ebf140..625985564cda 100644 --- a/sc/source/ui/vba/vbafont.hxx +++ b/sc/source/ui/vba/vbafont.hxx @@ -32,19 +32,19 @@ #include -#include #include -#include "vbahelperinterface.hxx" +#include +#include +#include #include "vbapalette.hxx" class ScTableSheetsObj; class ScCellRangeObj; -typedef InheritedHelperInterfaceImpl1< ov::excel::XFont > ScVbaFont_BASE; +typedef cppu::ImplInheritanceHelper1< VbaFontBase, ov::excel::XFont > ScVbaFont_BASE; class ScVbaFont : public ScVbaFont_BASE { - css::uno::Reference< css::beans::XPropertySet > mxFont; ScVbaPalette mPalette; ScCellRangeObj* mpRangeObj; SfxItemSet* GetDataSet(); @@ -54,7 +54,6 @@ public: // Attributes virtual css::uno::Any SAL_CALL getSize() throw (css::uno::RuntimeException); - virtual void SAL_CALL setSize( const css::uno::Any& _size ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getStandardFontSize() throw (css::uno::RuntimeException); virtual void SAL_CALL setStandardFontSize( const css::uno::Any& _standardfontsize ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getStandardFont() throw (css::uno::RuntimeException); @@ -64,23 +63,17 @@ public: virtual css::uno::Any SAL_CALL getColorIndex() throw (css::uno::RuntimeException); virtual void SAL_CALL setColorIndex( const css::uno::Any& _colorindex ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getBold() throw (css::uno::RuntimeException); - virtual void SAL_CALL setBold( const css::uno::Any& _bold ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getUnderline() throw (css::uno::RuntimeException); virtual void SAL_CALL setUnderline( const css::uno::Any& _underline ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getStrikethrough() throw (css::uno::RuntimeException); - virtual void SAL_CALL setStrikethrough( const css::uno::Any& _strikethrough ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getShadow() throw (css::uno::RuntimeException); - virtual void SAL_CALL setShadow( const css::uno::Any& _shadow ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getItalic() throw (css::uno::RuntimeException); - virtual void SAL_CALL setItalic( const css::uno::Any& _italic ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getSubscript() throw (css::uno::RuntimeException); virtual void SAL_CALL setSubscript( const css::uno::Any& _subscript ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getSuperscript() throw (css::uno::RuntimeException); virtual void SAL_CALL setSuperscript( const css::uno::Any& _superscript ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getName() throw (css::uno::RuntimeException); - virtual void SAL_CALL setName( const css::uno::Any& _name ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getColor() throw (css::uno::RuntimeException) ; - virtual void SAL_CALL setColor( const css::uno::Any& _color ) throw (css::uno::RuntimeException) ; virtual css::uno::Any SAL_CALL getOutlineFont() throw (css::uno::RuntimeException) ; virtual void SAL_CALL setOutlineFont( const css::uno::Any& _outlinefont ) throw (css::uno::RuntimeException) ; // XHelperInterface diff --git a/sc/source/ui/vba/vbaformat.cxx b/sc/source/ui/vba/vbaformat.cxx index a627ed3a4d92..1d30f92e1c6c 100644 --- a/sc/source/ui/vba/vbaformat.cxx +++ b/sc/source/ui/vba/vbaformat.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -341,7 +342,7 @@ template< typename Ifc1 > uno::Any SAL_CALL ScVbaFormat::Borders( const uno::Any& Index ) throw (script::BasicErrorException, uno::RuntimeException ) { - ScVbaPalette aPalette( getDocShell( mxModel ) ); + ScVbaPalette aPalette( excel::getDocShell( mxModel ) ); uno::Reference< XCollection > xColl = new ScVbaBorders( thisHelperIface(), ScVbaFormat_BASE::mxContext, uno::Reference< table::XCellRange >( mxPropertySet, uno::UNO_QUERY_THROW ), aPalette ); if ( Index.hasValue() ) @@ -355,7 +356,7 @@ template< typename Ifc1 > uno::Reference< excel::XFont > SAL_CALL ScVbaFormat::Font( ) throw (script::BasicErrorException, uno::RuntimeException) { - ScVbaPalette aPalette( getDocShell( mxModel ) ); + ScVbaPalette aPalette( excel::getDocShell( mxModel ) ); return new ScVbaFont( thisHelperIface(), ScVbaFormat_BASE::mxContext, aPalette, mxPropertySet ); } diff --git a/sc/source/ui/vba/vbaformat.hxx b/sc/source/ui/vba/vbaformat.hxx index afb5e5a45c29..cb33ad818f59 100644 --- a/sc/source/ui/vba/vbaformat.hxx +++ b/sc/source/ui/vba/vbaformat.hxx @@ -39,7 +39,7 @@ #include #include #include -#include "vbahelperinterface.hxx" +#include template< typename Ifc1 > class ScVbaFormat : public InheritedHelperInterfaceImpl1< Ifc1 > diff --git a/sc/source/ui/vba/vbaformatconditions.cxx b/sc/source/ui/vba/vbaformatconditions.cxx index 06067d470177..1048cd91d2d3 100644 --- a/sc/source/ui/vba/vbaformatconditions.cxx +++ b/sc/source/ui/vba/vbaformatconditions.cxx @@ -36,6 +36,7 @@ #include "vbaformatcondition.hxx" #include "vbaworkbook.hxx" #include "vbastyles.hxx" +#include "vbaglobals.hxx" using namespace ::ooo::vba; using namespace ::com::sun::star; @@ -50,7 +51,7 @@ static rtl::OUString sStyleNamePrefix( RTL_CONSTASCII_USTRINGPARAM("Excel_CondFo ScVbaFormatConditions::ScVbaFormatConditions( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< sheet::XSheetConditionalEntries >& _xSheetConditionalEntries, const uno::Reference< frame::XModel >& xModel ) : ScVbaFormatConditions_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( _xSheetConditionalEntries, uno::UNO_QUERY_THROW ) ), mxSheetConditionalEntries( _xSheetConditionalEntries ) { mxRangeParent.set( xParent, uno::UNO_QUERY_THROW ); - uno::Reference< excel::XWorkbook > xWorkbook = new ScVbaWorkbook( uno::Reference< XHelperInterface >( ScVbaGlobals::getGlobalsImpl( xContext )->getApplication(), uno::UNO_QUERY_THROW ), xContext, xModel ); + uno::Reference< excel::XWorkbook > xWorkbook = new ScVbaWorkbook( uno::Reference< XHelperInterface >( Application(), uno::UNO_QUERY_THROW ), xContext, xModel ); mxStyles.set( xWorkbook->Styles( uno::Any() ), uno::UNO_QUERY_THROW ); uno::Reference< sheet::XCellRangeAddressable > xCellRange( mxRangeParent->getCellRange(), uno::UNO_QUERY_THROW ); mxParentRangePropertySet.set( xCellRange, uno::UNO_QUERY_THROW ); diff --git a/sc/source/ui/vba/vbaformatconditions.hxx b/sc/source/ui/vba/vbaformatconditions.hxx index e5524a746638..177ddd168f35 100644 --- a/sc/source/ui/vba/vbaformatconditions.hxx +++ b/sc/source/ui/vba/vbaformatconditions.hxx @@ -35,7 +35,7 @@ #include #include #include -#include "vbacollectionimpl.hxx" +#include typedef CollTestImplHelper< ov::excel::XFormatConditions > ScVbaFormatConditions_BASE; class ScVbaFormatConditions: public ScVbaFormatConditions_BASE diff --git a/sc/source/ui/vba/vbaglobals.cxx b/sc/source/ui/vba/vbaglobals.cxx index 216a8a3d1f70..982289f0002e 100644 --- a/sc/source/ui/vba/vbaglobals.cxx +++ b/sc/source/ui/vba/vbaglobals.cxx @@ -27,13 +27,14 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#include "helperdecl.hxx" +#include #include "vbaglobals.hxx" #include #include #include +#include #include "vbaapplication.hxx" #include "vbaworksheet.hxx" @@ -49,11 +50,20 @@ using namespace ::ooo::vba; // ScVbaGlobals // ============================================================================= -ScVbaGlobals::ScVbaGlobals( css::uno::Reference< css::uno::XComponentContext >const& rxContext ) - :m_xContext( rxContext ) +//ScVbaGlobals::ScVbaGlobals( css::uno::Reference< css::uno::XComponentContext >const& rxContext, ) : ScVbaGlobals_BASE( uno::Reference< XHelperInterface >(), rxContext ) +rtl::OUString sDocCtxName( RTL_CONSTASCII_USTRINGPARAM("ExcelDocumentContext") ); + +ScVbaGlobals::ScVbaGlobals( uno::Sequence< uno::Any > const& aArgs, uno::Reference< uno::XComponentContext >const& rxContext ) : ScVbaGlobals_BASE( uno::Reference< XHelperInterface >(), rxContext, sDocCtxName ) { OSL_TRACE("ScVbaGlobals::ScVbaGlobals()"); - mxApplication = uno::Reference< excel::XApplication > ( new ScVbaApplication( m_xContext) ); + + uno::Sequence< beans::PropertyValue > aInitArgs( 2 ); + aInitArgs[ 0 ].Name = rtl::OUString::createFromAscii("Application"); + aInitArgs[ 0 ].Value = uno::makeAny( getApplication() ); + aInitArgs[ 1 ].Name = sDocCtxName; + aInitArgs[ 1 ].Value = uno::makeAny( getXSomethingFromArgs< frame::XModel >( aArgs, 0 ) ); + + init( aInitArgs ); } ScVbaGlobals::~ScVbaGlobals() @@ -61,23 +71,6 @@ ScVbaGlobals::~ScVbaGlobals() OSL_TRACE("ScVbaGlobals::~ScVbaGlobals"); } -// Will throw if singleton can't be accessed -uno::Reference< XGlobals > -ScVbaGlobals::getGlobalsImpl( const uno::Reference< uno::XComponentContext >& xContext ) throw ( uno::RuntimeException ) -{ - uno::Reference< XGlobals > xGlobals( - xContext->getValueByName( ::rtl::OUString::createFromAscii( - "/singletons/ooo.vba.theGlobals") ), uno::UNO_QUERY); - - if ( !xGlobals.is() ) - { - throw uno::RuntimeException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ": Couldn't access Globals" ) ), - uno::Reference< XInterface >() ); - } - return xGlobals; -} - // ============================================================================= // XGlobals // ============================================================================= @@ -85,14 +78,16 @@ uno::Reference ScVbaGlobals::getApplication() throw (uno::RuntimeException) { // OSL_TRACE("In ScVbaGlobals::getApplication"); - return mxApplication; + if ( !mxApplication.is() ) + mxApplication.set( new ScVbaApplication( mxContext) ); + return mxApplication; } uno::Reference< excel::XWorkbook > SAL_CALL ScVbaGlobals::getActiveWorkbook() throw (uno::RuntimeException) { // OSL_TRACE("In ScVbaGlobals::getActiveWorkbook"); - uno::Reference< excel::XWorkbook > xWorkbook( mxApplication->getActiveWorkbook(), uno::UNO_QUERY); + uno::Reference< excel::XWorkbook > xWorkbook( getApplication()->getActiveWorkbook(), uno::UNO_QUERY); if ( xWorkbook.is() ) { return xWorkbook; @@ -103,22 +98,28 @@ ScVbaGlobals::getActiveWorkbook() throw (uno::RuntimeException) } +uno::Reference< excel::XWindow > SAL_CALL +ScVbaGlobals::getActiveWindow() throw (uno::RuntimeException) +{ + return getApplication()->getActiveWindow(); +} + uno::Reference< excel::XWorksheet > SAL_CALL ScVbaGlobals::getActiveSheet() throw (uno::RuntimeException) { - return mxApplication->getActiveSheet(); + return getApplication()->getActiveSheet(); } uno::Any SAL_CALL ScVbaGlobals::WorkBooks( const uno::Any& aIndex ) throw (uno::RuntimeException) { - return uno::Any( mxApplication->Workbooks(aIndex) ); + return uno::Any( getApplication()->Workbooks(aIndex) ); } uno::Any SAL_CALL ScVbaGlobals::WorkSheets(const uno::Any& aIndex) throw (uno::RuntimeException) { - return mxApplication->Worksheets( aIndex ); + return getApplication()->Worksheets( aIndex ); } uno::Any SAL_CALL ScVbaGlobals::Sheets( const uno::Any& aIndex ) throw (uno::RuntimeException) @@ -126,26 +127,6 @@ ScVbaGlobals::Sheets( const uno::Any& aIndex ) throw (uno::RuntimeException) return WorkSheets( aIndex ); } -::uno::Sequence< ::uno::Any > SAL_CALL -ScVbaGlobals::getGlobals( ) throw (::uno::RuntimeException) -{ - sal_uInt32 nMax = 0; - uno::Sequence< uno::Any > maGlobals(4); - maGlobals[ nMax++ ] <<= ScVbaGlobals::getGlobalsImpl(m_xContext); - maGlobals[ nMax++ ] <<= mxApplication; - - uno::Reference< excel::XWorkbook > xWorkbook = mxApplication->getActiveWorkbook(); - if( xWorkbook.is() ) - { - maGlobals[ nMax++ ] <<= xWorkbook; - uno::Reference< excel::XWorksheet > xWorksheet = xWorkbook->getActiveSheet(); - if( xWorksheet.is() ) - maGlobals[ nMax++ ] <<= xWorksheet; - } - maGlobals.realloc( nMax ); - return maGlobals; -} - uno::Any SAL_CALL ScVbaGlobals::Range( const uno::Any& Cell1, const uno::Any& Cell2 ) throw (uno::RuntimeException) { @@ -158,13 +139,140 @@ ScVbaGlobals::Names( const css::uno::Any& aIndex ) throw ( uno::RuntimeException return getApplication()->Names( aIndex ); } +uno::Reference< excel::XRange > SAL_CALL +ScVbaGlobals::getActiveCell() throw (uno::RuntimeException) +{ + return getApplication()->getActiveCell(); +} + +uno::Reference< XAssistant > SAL_CALL +ScVbaGlobals::getAssistant() throw (uno::RuntimeException) +{ + return getApplication()->getAssistant(); +} + +uno::Any SAL_CALL +ScVbaGlobals::getSelection() throw (uno::RuntimeException) +{ + return getApplication()->getSelection(); +} + +uno::Reference< excel::XWorkbook > SAL_CALL +ScVbaGlobals::getThisWorkbook() throw (uno::RuntimeException) +{ + return getApplication()->getThisWorkbook(); +} +void SAL_CALL +ScVbaGlobals::Calculate() throw (::com::sun::star::script::BasicErrorException, ::com::sun::star::uno::RuntimeException) +{ + return getApplication()->Calculate(); +} + +uno::Reference< excel::XRange > SAL_CALL +ScVbaGlobals::Cells( const uno::Any& RowIndex, const uno::Any& ColumnIndex ) throw (uno::RuntimeException) +{ + return getApplication()->getActiveSheet()->Cells( RowIndex, ColumnIndex ); +} +uno::Reference< excel::XRange > SAL_CALL +ScVbaGlobals::Columns( const uno::Any& aIndex ) throw (uno::RuntimeException) +{ + return getApplication()->getActiveSheet()->Columns( aIndex ); +} + +uno::Any SAL_CALL +ScVbaGlobals::CommandBars( const uno::Any& aIndex ) throw (uno::RuntimeException) +{ + uno::Reference< XApplicationBase > xBase( getApplication(), uno::UNO_QUERY_THROW ); + return xBase->CommandBars( aIndex ); +} + +css::uno::Reference< ov::excel::XRange > SAL_CALL +ScVbaGlobals::Union( const css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< ov::excel::XRange >& Arg2, const css::uno::Any& Arg3, const css::uno::Any& Arg4, const css::uno::Any& Arg5, const css::uno::Any& Arg6, const css::uno::Any& Arg7, const css::uno::Any& Arg8, const css::uno::Any& Arg9, const css::uno::Any& Arg10, const css::uno::Any& Arg11, const css::uno::Any& Arg12, const css::uno::Any& Arg13, const css::uno::Any& Arg14, const css::uno::Any& Arg15, const css::uno::Any& Arg16, const css::uno::Any& Arg17, const css::uno::Any& Arg18, const css::uno::Any& Arg19, const css::uno::Any& Arg20, const css::uno::Any& Arg21, const css::uno::Any& Arg22, const css::uno::Any& Arg23, const css::uno::Any& Arg24, const css::uno::Any& Arg25, const css::uno::Any& Arg26, const css::uno::Any& Arg27, const css::uno::Any& Arg28, const css::uno::Any& Arg29, const css::uno::Any& Arg30 ) throw (css::script::BasicErrorException, css::uno::RuntimeException) +{ + return getApplication()->Union( Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9, Arg10, Arg11, Arg12, Arg13, Arg14, Arg15, Arg16, Arg17, Arg18, Arg19, Arg20, Arg21, Arg22, Arg23, Arg24, Arg25, Arg26, Arg27, Arg28, Arg29, Arg30 ); +} +css::uno::Reference< ov::excel::XRange > SAL_CALL +ScVbaGlobals::Intersect( const css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< ov::excel::XRange >& Arg2, const css::uno::Any& Arg3, const css::uno::Any& Arg4, const css::uno::Any& Arg5, const css::uno::Any& Arg6, const css::uno::Any& Arg7, const css::uno::Any& Arg8, const css::uno::Any& Arg9, const css::uno::Any& Arg10, const css::uno::Any& Arg11, const css::uno::Any& Arg12, const css::uno::Any& Arg13, const css::uno::Any& Arg14, const css::uno::Any& Arg15, const css::uno::Any& Arg16, const css::uno::Any& Arg17, const css::uno::Any& Arg18, const css::uno::Any& Arg19, const css::uno::Any& Arg20, const css::uno::Any& Arg21, const css::uno::Any& Arg22, const css::uno::Any& Arg23, const css::uno::Any& Arg24, const css::uno::Any& Arg25, const css::uno::Any& Arg26, const css::uno::Any& Arg27, const css::uno::Any& Arg28, const css::uno::Any& Arg29, const css::uno::Any& Arg30 ) throw (css::script::BasicErrorException, css::uno::RuntimeException) +{ + return getApplication()->Intersect( Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9, Arg10, Arg11, Arg12, Arg13, Arg14, Arg15, Arg16, Arg17, Arg18, Arg19, Arg20, Arg21, Arg22, Arg23, Arg24, Arg25, Arg26, Arg27, Arg28, Arg29, Arg30 ); +} + +uno::Any SAL_CALL +ScVbaGlobals::Evaluate( const ::rtl::OUString& Name ) throw (uno::RuntimeException) +{ + return getApplication()->Evaluate( Name ); +} + +css::uno::Any SAL_CALL +ScVbaGlobals::WorksheetFunction( ) throw (css::uno::RuntimeException) +{ + return getApplication()->WorksheetFunction(); +} + +uno::Any SAL_CALL +ScVbaGlobals::Windows( const uno::Any& aIndex ) throw (uno::RuntimeException) +{ + return getApplication()->Windows( aIndex ); +} + +uno::Reference< excel::XRange > SAL_CALL +ScVbaGlobals::Rows( const uno::Any& aIndex ) throw (uno::RuntimeException) +{ + return getApplication()->getActiveSheet()->Rows( aIndex ); + +} + +uno::Sequence< ::rtl::OUString > SAL_CALL +ScVbaGlobals::getAvailableServiceNames( ) throw (uno::RuntimeException) +{ + static bool bInit = false; + static uno::Sequence< rtl::OUString > serviceNames( ScVbaGlobals_BASE::getAvailableServiceNames() ); + if ( !bInit ) + { + rtl::OUString names[] = { + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "ooo.vba.excel.Range" ) ), + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "ooo.vba.excel.Workbook" ) ), + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "ooo.vba.excel.Window" ) ), + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "ooo.vba.excel.Worksheet" ) ), + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "ooo.vba.excel.Application" ) ), + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "ooo.vba.excel.Hyperlink" ) ), + }; + sal_Int32 nExcelServices = ( sizeof( names )/ sizeof( names[0] ) ); + sal_Int32 startIndex = serviceNames.getLength(); + serviceNames.realloc( serviceNames.getLength() + nExcelServices ); + for ( sal_Int32 index = 0; index < nExcelServices; ++index ) + serviceNames[ startIndex + index ] = names[ index ]; + bInit = true; + } + return serviceNames; +} + +rtl::OUString& +ScVbaGlobals::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaGlobals") ); + return sImplName; +} + +uno::Sequence< rtl::OUString > +ScVbaGlobals::getServiceNames() +{ + static uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Globals" ) ); + } + return aServiceNames; +} + namespace globals { namespace sdecl = comphelper::service_decl; -sdecl::class_ > serviceImpl; +sdecl::vba_service_class_ > serviceImpl; extern sdecl::ServiceDecl const serviceDecl( serviceImpl, "ScVbaGlobals", - "ooo.vba.Globals" ); + "ooo.vba.excel.Globals" ); } diff --git a/sc/source/ui/vba/vbaglobals.hxx b/sc/source/ui/vba/vbaglobals.hxx index f24032d14ad9..25d36af55c8d 100644 --- a/sc/source/ui/vba/vbaglobals.hxx +++ b/sc/source/ui/vba/vbaglobals.hxx @@ -33,43 +33,65 @@ #include #include #include -#include +#include +#include #include -#include "vbahelper.hxx" +#include "excelvbahelper.hxx" +#include // ============================================================================= // class ScVbaGlobals // ============================================================================= - typedef ::cppu::WeakImplHelper1< - ov::XGlobals > ScVbaGlobals_BASE; - +typedef ::cppu::ImplInheritanceHelper1< VbaGlobalsBase, ov::excel::XGlobals > ScVbaGlobals_BASE; class ScVbaGlobals : public ScVbaGlobals_BASE { - private: - css::uno::Reference< css::uno::XComponentContext > m_xContext; - css::uno::Reference< ov::excel::XApplication > mxApplication; + css::uno::Reference< ov::excel::XApplication > mxApplication; + virtual css::uno::Reference< + ov::excel::XApplication > SAL_CALL getApplication() + throw (css::uno::RuntimeException); public: - ScVbaGlobals( + ScVbaGlobals( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext >const& rxContext ); + //ScVbaGlobals( + // css::uno::Reference< css::uno::XComponentContext >const& rxContext, ); virtual ~ScVbaGlobals(); - static css::uno::Reference< ov::XGlobals > getGlobalsImpl(const css::uno::Reference< css::uno::XComponentContext >& ) throw (css::uno::RuntimeException); - // XGlobals - virtual css::uno::Reference< - ov::excel::XApplication > SAL_CALL getApplication() - throw (css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XWorkbook > SAL_CALL getActiveWorkbook() throw (css::uno::RuntimeException); + virtual css::uno::Reference< ov::excel::XWindow > SAL_CALL getActiveWindow() throw (css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL getActiveSheet() throw (css::uno::RuntimeException); + virtual css::uno::Reference< ov::XAssistant > SAL_CALL getAssistant() throw (css::uno::RuntimeException); + virtual void SAL_CALL Calculate( ) throw (::com::sun::star::script::BasicErrorException, ::com::sun::star::uno::RuntimeException); + + virtual css::uno::Any SAL_CALL getSelection() throw (css::uno::RuntimeException); + virtual css::uno::Reference< ov::excel::XRange > SAL_CALL getActiveCell() throw (css::uno::RuntimeException); + virtual css::uno::Reference< ov::excel::XWorkbook > SAL_CALL getThisWorkbook() throw (css::uno::RuntimeException); + virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Cells( const css::uno::Any& RowIndex, const css::uno::Any& ColumnIndex ) throw (css::uno::RuntimeException); + virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Columns( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL CommandBars( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Evaluate( const ::rtl::OUString& Name ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL WorkSheets(const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL WorkBooks(const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL WorksheetFunction( ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Windows( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Sheets( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); - virtual css::uno::Sequence< css::uno::Any > SAL_CALL getGlobals( ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Range( const css::uno::Any& Cell1, const css::uno::Any& Cell2 ) throw (css::uno::RuntimeException); + virtual css::uno::Reference< ::ooo::vba::excel::XRange > SAL_CALL Rows( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Names( const css::uno::Any& aIndex ) throw ( css::uno::RuntimeException ); + virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Intersect( const css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< ov::excel::XRange >& Arg2, const css::uno::Any& Arg3, const css::uno::Any& Arg4, const css::uno::Any& Arg5, const css::uno::Any& Arg6, const css::uno::Any& Arg7, const css::uno::Any& Arg8, const css::uno::Any& Arg9, const css::uno::Any& Arg10, const css::uno::Any& Arg11, const css::uno::Any& Arg12, const css::uno::Any& Arg13, const css::uno::Any& Arg14, const css::uno::Any& Arg15, const css::uno::Any& Arg16, const css::uno::Any& Arg17, const css::uno::Any& Arg18, const css::uno::Any& Arg19, const css::uno::Any& Arg20, const css::uno::Any& Arg21, const css::uno::Any& Arg22, const css::uno::Any& Arg23, const css::uno::Any& Arg24, const css::uno::Any& Arg25, const css::uno::Any& Arg26, const css::uno::Any& Arg27, const css::uno::Any& Arg28, const css::uno::Any& Arg29, const css::uno::Any& Arg30 ) throw (css::script::BasicErrorException, css::uno::RuntimeException); + virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Union( const css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< ov::excel::XRange >& Arg2, const css::uno::Any& Arg3, const css::uno::Any& Arg4, const css::uno::Any& Arg5, const css::uno::Any& Arg6, const css::uno::Any& Arg7, const css::uno::Any& Arg8, const css::uno::Any& Arg9, const css::uno::Any& Arg10, const css::uno::Any& Arg11, const css::uno::Any& Arg12, const css::uno::Any& Arg13, const css::uno::Any& Arg14, const css::uno::Any& Arg15, const css::uno::Any& Arg16, const css::uno::Any& Arg17, const css::uno::Any& Arg18, const css::uno::Any& Arg19, const css::uno::Any& Arg20, const css::uno::Any& Arg21, const css::uno::Any& Arg22, const css::uno::Any& Arg23, const css::uno::Any& Arg24, const css::uno::Any& Arg25, const css::uno::Any& Arg26, const css::uno::Any& Arg27, const css::uno::Any& Arg28, const css::uno::Any& Arg29, const css::uno::Any& Arg30 ) throw (css::script::BasicErrorException, css::uno::RuntimeException); + + + + // XMultiServiceFactory + virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames( ) throw (css::uno::RuntimeException); + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence getServiceNames(); }; #endif // diff --git a/sc/source/ui/vba/vbahelper.cxx b/sc/source/ui/vba/vbahelper.cxx index 353c036393c2..e69de29bb2d1 100644 --- a/sc/source/ui/vba/vbahelper.cxx +++ b/sc/source/ui/vba/vbahelper.cxx @@ -1,828 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbahelper.cxx,v $ - * $Revision: 1.5.32.1 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include -#include "vbahelper.hxx" -#include "tabvwsh.hxx" -#include "transobj.hxx" -#include "scmod.hxx" -#include "vbashape.hxx" -#include "unonames.hxx" -#include "cellsuno.hxx" -using namespace ::com::sun::star; -using namespace ::ooo::vba; - -#define POINTTO100THMILLIMETERFACTOR 35.27778 -void unoToSbxValue( SbxVariable* pVar, const uno::Any& aValue ); - -uno::Any sbxToUnoValue( SbxVariable* pVar ); - - -namespace ooo -{ -namespace vba -{ - -const double Millimeter::factor = 35.27778; - -uno::Reference< beans::XIntrospectionAccess > -getIntrospectionAccess( const uno::Any& aObject ) throw (uno::RuntimeException) -{ - static uno::Reference< beans::XIntrospection > xIntrospection; - if( !xIntrospection.is() ) - { - uno::Reference< lang::XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); - xIntrospection.set( xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.beans.Introspection") ), uno::UNO_QUERY_THROW ); - } - return xIntrospection->inspect( aObject ); -} - -uno::Reference< script::XTypeConverter > -getTypeConverter( const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException) -{ - static uno::Reference< script::XTypeConverter > xTypeConv( xContext->getServiceManager()->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter") ), xContext ), uno::UNO_QUERY_THROW ); - return xTypeConv; -} -// helper method to determine if the view ( calc ) is in print-preview mode -bool isInPrintPreview( SfxViewFrame* pView ) -{ - sal_uInt16 nViewNo = SID_VIEWSHELL1 - SID_VIEWSHELL0; - if ( pView->GetObjectShell()->GetFactory().GetViewFactoryCount() > -nViewNo && !pView->GetObjectShell()->IsInPlaceActive() ) - { - SfxViewFactory &rViewFactory = - pView->GetObjectShell()->GetFactory().GetViewFactory(nViewNo); - if ( pView->GetCurViewId() == rViewFactory.GetOrdinal() ) - return true; - } - return false; -} -const ::rtl::OUString REPLACE_CELLS_WARNING( RTL_CONSTASCII_USTRINGPARAM( "ReplaceCellsWarning")); -const uno::Any& -aNULL() -{ - static uno::Any aNULLL = uno::makeAny( uno::Reference< uno::XInterface >() ); - return aNULLL; -} - -class PasteCellsWarningReseter -{ -private: - bool bInitialWarningState; - static uno::Reference< beans::XPropertySet > getGlobalSheetSettings() throw ( uno::RuntimeException ) - { - static uno::Reference< beans::XPropertySet > xTmpProps( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); - static uno::Reference xContext( xTmpProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY_THROW ); - static uno::Reference xServiceManager( - xContext->getServiceManager(), uno::UNO_QUERY_THROW ); - static uno::Reference< beans::XPropertySet > xProps( xServiceManager->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.GlobalSheetSettings" ) ) ,xContext ), uno::UNO_QUERY_THROW ); - return xProps; - } - - bool getReplaceCellsWarning() throw ( uno::RuntimeException ) - { - sal_Bool res = sal_False; - getGlobalSheetSettings()->getPropertyValue( REPLACE_CELLS_WARNING ) >>= res; - return ( res == sal_True ); - } - - void setReplaceCellsWarning( bool bState ) throw ( uno::RuntimeException ) - { - getGlobalSheetSettings()->setPropertyValue( REPLACE_CELLS_WARNING, uno::makeAny( bState ) ); - } -public: - PasteCellsWarningReseter() throw ( uno::RuntimeException ) - { - bInitialWarningState = getReplaceCellsWarning(); - if ( bInitialWarningState ) - setReplaceCellsWarning( false ); - } - ~PasteCellsWarningReseter() - { - if ( bInitialWarningState ) - { - // don't allow dtor to throw - try - { - setReplaceCellsWarning( true ); - } - catch ( uno::Exception& /*e*/ ){} - } - } -}; - -void -dispatchRequests (uno::Reference< frame::XModel>& xModel,rtl::OUString & aUrl, uno::Sequence< beans::PropertyValue >& sProps ) -{ - - util::URL url ; - url.Complete = aUrl; - rtl::OUString emptyString = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "" )); - uno::Reference xController = xModel->getCurrentController(); - uno::Reference xFrame = xController->getFrame(); - uno::Reference xDispatchProvider (xFrame,uno::UNO_QUERY_THROW); - try - { - uno::Reference< beans::XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); - uno::Reference xContext( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY_THROW ); - if ( !xContext.is() ) - { - return ; - } - - uno::Reference xServiceManager( - xContext->getServiceManager() ); - if ( !xServiceManager.is() ) - { - return ; - } - uno::Reference xParser( xServiceManager->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ) ) - ,xContext), uno::UNO_QUERY_THROW ); - if (!xParser.is()) - return; - xParser->parseStrict (url); - } - catch ( uno::Exception & /*e*/ ) - { - return ; - } - - uno::Reference xDispatcher = xDispatchProvider->queryDispatch(url,emptyString,0); - - uno::Sequence dispatchProps(1); - - sal_Int32 nProps = sProps.getLength(); - beans::PropertyValue* pDest = dispatchProps.getArray(); - if ( nProps ) - { - dispatchProps.realloc( nProps + 1 ); - // need to reaccquire pDest after realloc - pDest = dispatchProps.getArray(); - beans::PropertyValue* pSrc = sProps.getArray(); - for ( sal_Int32 index=0; indexdispatch( url, dispatchProps ); -} - -void -dispatchRequests (uno::Reference< frame::XModel>& xModel,rtl::OUString & aUrl) -{ - uno::Sequence dispatchProps; - dispatchRequests( xModel, aUrl, dispatchProps ); -} - - -void dispatchExecute(css::uno::Reference< css::frame::XModel>& xModel, USHORT nSlot, SfxCallMode nCall) -{ - ScTabViewShell* pViewShell = getBestViewShell( xModel ); - SfxViewFrame* pViewFrame = NULL; - if ( pViewShell ) - pViewFrame = pViewShell->GetViewFrame(); - if ( pViewFrame ) - { - SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher(); - if( pDispatcher ) - { - pDispatcher->Execute( nSlot , nCall ); - } - } -} - -void -implnPaste() -{ - PasteCellsWarningReseter resetWarningBox; - ScTabViewShell* pViewShell = getCurrentBestViewShell(); - if ( pViewShell ) - { - pViewShell->PasteFromSystem(); - pViewShell->CellContentChanged(); - } -} - - -void -implnCopy() -{ - ScTabViewShell* pViewShell = getCurrentBestViewShell(); - if ( pViewShell ) - pViewShell->CopyToClip(NULL,false,false,true); -} - -void -implnCut() -{ - ScTabViewShell* pViewShell = getCurrentBestViewShell(); - if ( pViewShell ) - pViewShell->CutToClip( NULL, TRUE ); -} - -void implnPasteSpecial(USHORT nFlags,USHORT nFunction,sal_Bool bSkipEmpty, sal_Bool bTranspose) -{ - PasteCellsWarningReseter resetWarningBox; - sal_Bool bAsLink(sal_False), bOtherDoc(sal_False); - InsCellCmd eMoveMode = INS_NONE; - - ScTabViewShell* pTabViewShell = ScTabViewShell::GetActiveViewShell(); - if ( !pTabViewShell ) - // none active, try next best - pTabViewShell = getCurrentBestViewShell(); - if ( pTabViewShell ) - { - ScViewData* pView = pTabViewShell->GetViewData(); - Window* pWin = ( pView != NULL ) ? pView->GetActiveWin() : NULL; - if ( pView && pWin ) - { - if ( bAsLink && bOtherDoc ) - pTabViewShell->PasteFromSystem(0);//SOT_FORMATSTR_ID_LINK - else - { - ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pWin ); - ScDocument* pDoc = NULL; - if ( pOwnClip ) - pDoc = pOwnClip->GetDocument(); - pTabViewShell->PasteFromClip( nFlags, pDoc, - nFunction, bSkipEmpty, bTranspose, bAsLink, - eMoveMode, IDF_NONE, TRUE ); - pTabViewShell->CellContentChanged(); - } - } - } - -} - - uno::Reference< frame::XModel > -getCurrentDocument() throw (uno::RuntimeException) -{ - uno::Reference< frame::XModel > xModel; - SbxObject* pBasic = dynamic_cast< SbxObject* > ( SFX_APP()->GetBasic() ); - SbxObject* basicChosen = pBasic ; - if ( basicChosen == NULL) - { - OSL_TRACE("getModelFromBasic() StarBASIC* is NULL" ); - return xModel; - } - SbxObject* p = pBasic; - SbxObject* pParent = p->GetParent(); - SbxObject* pParentParent = pParent ? pParent->GetParent() : NULL; - - if( pParentParent ) - { - basicChosen = pParentParent; - } - else if( pParent ) - { - basicChosen = pParent; - } - - - uno::Any aModel; - SbxVariable *pCompVar = basicChosen->Find( UniString(RTL_CONSTASCII_USTRINGPARAM("ThisComponent")), SbxCLASS_OBJECT ); - - if ( pCompVar ) - { - aModel = sbxToUnoValue( pCompVar ); - if ( sal_False == ( aModel >>= xModel ) || - !xModel.is() ) - { - // trying last gasp try the current component - uno::Reference< beans::XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); - // test if vba service is present - uno::Reference< uno::XComponentContext > xCtx( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY_THROW ); - uno::Reference xSMgr( xCtx->getServiceManager(), uno::UNO_QUERY_THROW ); - uno::Reference< frame::XDesktop > xDesktop (xSMgr->createInstanceWithContext(::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop"), xCtx), uno::UNO_QUERY_THROW ); - xModel.set( xDesktop->getCurrentComponent(), uno::UNO_QUERY ); - if ( !xModel.is() ) - { - throw uno::RuntimeException( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can't extract model from basic ( its obviously not set yet ) therefore don't know the currently selected document") ), uno::Reference< uno::XInterface >() ); - } - return xModel; - } - else - { - OSL_TRACE("Have model ThisComponent points to url %s", - ::rtl::OUStringToOString( xModel->getURL(), - RTL_TEXTENCODING_ASCII_US ).pData->buffer ); - } - } - else - { - OSL_TRACE("Failed to get ThisComponent"); - throw uno::RuntimeException( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "Can't determine the currently selected document") ), - uno::Reference< uno::XInterface >() ); - } - return xModel; -} - -ScDocShell* -getDocShell( css::uno::Reference< css::frame::XModel>& xModel ) -{ - uno::Reference< uno::XInterface > xIf( xModel, uno::UNO_QUERY_THROW ); - ScModelObj* pModel = dynamic_cast< ScModelObj* >( xIf.get() ); - ScDocShell* pDocShell = NULL; - if ( pModel ) - pDocShell = (ScDocShell*)pModel->GetEmbeddedObject(); - return pDocShell; - -} - -ScTabViewShell* -getBestViewShell( css::uno::Reference< css::frame::XModel>& xModel ) -{ - ScDocShell* pDocShell = getDocShell( xModel ); - if ( pDocShell ) - return pDocShell->GetBestViewShell(); - return NULL; -} - -ScTabViewShell* -getCurrentBestViewShell() -{ - uno::Reference< frame::XModel > xModel = getCurrentDocument(); - return getBestViewShell( xModel ); -} - -SfxViewFrame* -getCurrentViewFrame() -{ - ScTabViewShell* pViewShell = getCurrentBestViewShell(); - if ( pViewShell ) - return pViewShell->GetViewFrame(); - return NULL; -} - -sal_Int32 -OORGBToXLRGB( sal_Int32 nCol ) -{ - sal_Int32 nRed = nCol; - nRed &= 0x00FF0000; - nRed >>= 16; - sal_Int32 nGreen = nCol; - nGreen &= 0x0000FF00; - nGreen >>= 8; - sal_Int32 nBlue = nCol; - nBlue &= 0x000000FF; - sal_Int32 nRGB = ( (nBlue << 16) | (nGreen << 8) | nRed ); - return nRGB; -} -sal_Int32 -XLRGBToOORGB( sal_Int32 nCol ) -{ - sal_Int32 nBlue = nCol; - nBlue &= 0x00FF0000; - nBlue >>= 16; - sal_Int32 nGreen = nCol; - nGreen &= 0x0000FF00; - nGreen >>= 8; - sal_Int32 nRed = nCol; - nRed &= 0x000000FF; - sal_Int32 nRGB = ( (nRed << 16) | (nGreen << 8) | nBlue ); - return nRGB; -} -uno::Any -OORGBToXLRGB( const uno::Any& aCol ) -{ - sal_Int32 nCol=0; - aCol >>= nCol; - nCol = OORGBToXLRGB( nCol ); - return uno::makeAny( nCol ); -} -uno::Any -XLRGBToOORGB( const uno::Any& aCol ) -{ - sal_Int32 nCol=0; - aCol >>= nCol; - nCol = XLRGBToOORGB( nCol ); - return uno::makeAny( nCol ); -} - -void PrintOutHelper( const uno::Any& From, const uno::Any& To, const uno::Any& Copies, const uno::Any& Preview, const uno::Any& /*ActivePrinter*/, const uno::Any& /*PrintToFile*/, const uno::Any& Collate, const uno::Any& PrToFileName, css::uno::Reference< frame::XModel >& xModel, sal_Bool bUseSelection ) -{ - sal_Int32 nTo = 0; - sal_Int32 nFrom = 0; - sal_Int16 nCopies = 1; - sal_Bool bPreview = sal_False; - sal_Bool bCollate = sal_False; - sal_Bool bSelection = bUseSelection; - From >>= nFrom; - To >>= nTo; - Copies >>= nCopies; - Preview >>= bPreview; - if ( nCopies > 1 ) // Collate only useful when more that 1 copy - Collate >>= bCollate; - - rtl::OUString sRange( RTL_CONSTASCII_USTRINGPARAM( "-" ) ); - rtl::OUString sFileName; - - if (( nFrom || nTo ) ) - { - if ( nFrom ) - sRange = ( ::rtl::OUString::valueOf( nFrom ) + sRange ); - if ( nTo ) - sRange += ::rtl::OUString::valueOf( nTo ); - } - - if ( PrToFileName.getValue() ) - { - PrToFileName >>= sFileName; - } - ScTabViewShell* pViewShell = getBestViewShell( xModel ); - SfxViewFrame* pViewFrame = NULL; - if ( pViewShell ) - pViewFrame = pViewShell->GetViewFrame(); - if ( pViewFrame ) - { - SfxAllItemSet aArgs( SFX_APP()->GetPool() ); - - SfxBoolItem sfxCollate( SID_PRINT_COLLATE, bCollate ); - aArgs.Put( sfxCollate, sfxCollate.Which() ); - SfxInt16Item sfxCopies( SID_PRINT_COPIES, nCopies ); - aArgs.Put( sfxCopies, sfxCopies.Which() ); - if ( sFileName.getLength() ) - { - SfxStringItem sfxFileName( SID_FILE_NAME, sFileName); - aArgs.Put( sfxFileName, sfxFileName.Which() ); - - } - if ( sRange.getLength() ) - { - SfxStringItem sfxRange( SID_PRINT_PAGES, sRange ); - aArgs.Put( sfxRange, sfxRange.Which() ); - } - SfxBoolItem sfxSelection( SID_SELECTION, bSelection ); - aArgs.Put( sfxSelection, sfxSelection.Which() ); - SfxBoolItem sfxAsync( SID_ASYNCHRON, sal_False ); - aArgs.Put( sfxAsync, sfxAsync.Which() ); - SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher(); - - if ( pDispatcher ) - { - if ( bPreview ) - { - if ( !pViewFrame->GetFrame()->IsInPlace() ) - { - SC_MOD()->InputEnterHandler(); - pViewFrame->GetDispatcher()->Execute( SID_VIEWSHELL1, SFX_CALLMODE_SYNCHRON ); - while ( isInPrintPreview( pViewFrame ) ) - Application::Yield(); - } - } - else - pDispatcher->Execute( (USHORT)SID_PRINTDOC, (SfxCallMode)SFX_CALLMODE_SYNCHRON, aArgs ); - } - - } - - // #FIXME #TODO - // 1 ActivePrinter ( how/can we switch a printer via API? ) - // 2 PrintToFile ( ms behaviour if this option is specified but no - // filename supplied 'PrToFileName' then the user will be prompted ) - // 3 Need to check behaviour of Selected sheets with range ( e.g. From & To - // values ) in oOO these options are mutually exclusive - // 4 There is a pop up to do with transparent objects in the print source - // should be able to disable that via configuration for the duration - // of this method -} - - void PrintPreviewHelper( const css::uno::Any& /*EnableChanges*/, css::uno::Reference< css::frame::XModel >& xModel ) -{ - dispatchExecute( xModel, SID_VIEWSHELL1 ); -} - -rtl::OUString getAnyAsString( const uno::Any& pvargItem ) throw ( uno::RuntimeException ) -{ - uno::Type aType = pvargItem.getValueType(); - uno::TypeClass eTypeClass = aType.getTypeClass(); - rtl::OUString sString; - switch ( eTypeClass ) - { - case uno::TypeClass_BOOLEAN: - { - sal_Bool bBool = sal_False; - pvargItem >>= bBool; - sString = rtl::OUString::valueOf( bBool ); - break; - } - case uno::TypeClass_STRING: - pvargItem >>= sString; - break; - case uno::TypeClass_FLOAT: - { - float aFloat = 0; - pvargItem >>= aFloat; - sString = rtl::OUString::valueOf( aFloat ); - break; - } - case uno::TypeClass_DOUBLE: - { - double aDouble = 0; - pvargItem >>= aDouble; - sString = rtl::OUString::valueOf( aDouble ); - break; - } - case uno::TypeClass_SHORT: - case uno::TypeClass_LONG: - case uno::TypeClass_BYTE: - { - sal_Int32 aNum = 0; - pvargItem >>= aNum; - sString = rtl::OUString::valueOf( aNum ); - break; - } - - case uno::TypeClass_HYPER: - { - sal_Int64 aHyper = 0; - pvargItem >>= aHyper; - sString = rtl::OUString::valueOf( aHyper ); - break; - } - default: - throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid type, can't convert" ), uno::Reference< uno::XInterface >() ); - } - return sString; -} - - -rtl::OUString -ContainerUtilities::getUniqueName( const uno::Sequence< ::rtl::OUString >& _slist, const rtl::OUString& _sElementName, const ::rtl::OUString& _sSuffixSeparator) -{ - return getUniqueName(_slist, _sElementName, _sSuffixSeparator, sal_Int32(2)); -} - -rtl::OUString -ContainerUtilities::getUniqueName( const uno::Sequence< rtl::OUString >& _slist, const rtl::OUString _sElementName, const rtl::OUString& _sSuffixSeparator, sal_Int32 _nStartSuffix) -{ - sal_Int32 a = _nStartSuffix; - rtl::OUString scompname = _sElementName; - bool bElementexists = true; - sal_Int32 nLen = _slist.getLength(); - if ( nLen == 0 ) - return _sElementName; - - while (bElementexists == true) - { - for (sal_Int32 i = 0; i < nLen; i++) - { - if (FieldInList(_slist, scompname) == -1) - { - return scompname; - } - } - scompname = _sElementName + _sSuffixSeparator + rtl::OUString::valueOf( a++ ); - } - return rtl::OUString(); -} - -sal_Int32 -ContainerUtilities::FieldInList( const uno::Sequence< rtl::OUString >& SearchList, const rtl::OUString& SearchString ) -{ - sal_Int32 FieldLen = SearchList.getLength(); - sal_Int32 retvalue = -1; - for (sal_Int32 i = 0; i < FieldLen; i++) - { - // I wonder why comparing lexicographically is done - // when its a match is whats interesting? - //if (SearchList[i].compareTo(SearchString) == 0) - if ( SearchList[i].equals( SearchString ) ) - { - retvalue = i; - break; - } - } - return retvalue; - -} -bool NeedEsc(sal_Unicode cCode) -{ - String sEsc(RTL_CONSTASCII_USTRINGPARAM(".^$+\\|{}()")); - return (STRING_NOTFOUND != sEsc.Search(cCode)); -} - -rtl::OUString VBAToRegexp(const rtl::OUString &rIn, bool bForLike ) -{ - rtl::OUStringBuffer sResult; - const sal_Unicode *start = rIn.getStr(); - const sal_Unicode *end = start + rIn.getLength(); - - int seenright = 0; - if ( bForLike ) - sResult.append(static_cast('^')); - - while (start < end) - { - switch (*start) - { - case '?': - sResult.append(static_cast('.')); - start++; - break; - case '*': - sResult.append(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".*"))); - start++; - break; - case '#': - sResult.append(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[0-9]"))); - start++; - break; - case '~': - sResult.append(static_cast('\\')); - sResult.append(*(++start)); - start++; - break; - // dump the ~ and escape the next characture - case ']': - sResult.append(static_cast('\\')); - sResult.append(*start++); - break; - case '[': - sResult.append(*start++); - seenright = 0; - while (start < end && !seenright) - { - switch (*start) - { - case '[': - case '?': - case '*': - sResult.append(static_cast('\\')); - sResult.append(*start); - break; - case ']': - sResult.append(*start); - seenright = 1; - break; - case '!': - sResult.append(static_cast('^')); - break; - default: - if (NeedEsc(*start)) - sResult.append(static_cast('\\')); - sResult.append(*start); - break; - } - start++; - } - break; - default: - if (NeedEsc(*start)) - sResult.append(static_cast('\\')); - sResult.append(*start++); - } - } - - if ( bForLike ) - sResult.append(static_cast('$')); - - return sResult.makeStringAndClear( ); -} - -double getPixelTo100thMillimeterConversionFactor( css::uno::Reference< css::awt::XDevice >& xDevice, sal_Bool bVertical) -{ - double fConvertFactor = 1.0; - if( bVertical ) - { - fConvertFactor = xDevice->getInfo().PixelPerMeterY/100000; - } - else - { - fConvertFactor = xDevice->getInfo().PixelPerMeterX/100000; - } - return fConvertFactor; -} - -double PointsToPixels( css::uno::Reference< css::awt::XDevice >& xDevice, double fPoints, sal_Bool bVertical) -{ - double fConvertFactor = getPixelTo100thMillimeterConversionFactor( xDevice, bVertical ); - return fPoints * POINTTO100THMILLIMETERFACTOR * fConvertFactor; -} -double PixelsToPoints( css::uno::Reference< css::awt::XDevice >& xDevice, double fPixels, sal_Bool bVertical) -{ - double fConvertFactor = getPixelTo100thMillimeterConversionFactor( xDevice, bVertical ); - return (fPixels/fConvertFactor)/POINTTO100THMILLIMETERFACTOR; -} - -ConcreteXShapeGeometryAttributes::ConcreteXShapeGeometryAttributes( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape >& xShape ) -{ - m_xShape = new ScVbaShape( xContext, xShape ); -} - -#define VBA_LEFT "PositionX" -#define VBA_TOP "PositionY" -UserFormGeometryHelper::UserFormGeometryHelper( const uno::Reference< uno::XComponentContext >& /*xContext*/, const uno::Reference< awt::XControl >& xControl ) -{ - mxModel.set( xControl->getModel(), uno::UNO_QUERY_THROW ); -} - double UserFormGeometryHelper::getLeft() - { - sal_Int32 nLeft = 0; - mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_LEFT ) ) ) >>= nLeft; - return Millimeter::getInPoints( nLeft ); - } - void UserFormGeometryHelper::setLeft( double nLeft ) - { - mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_LEFT ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nLeft ) ) ); - } - double UserFormGeometryHelper::getTop() - { - sal_Int32 nTop = 0; - mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_TOP ) ) ) >>= nTop; - return Millimeter::getInPoints( nTop ); - } - void UserFormGeometryHelper::setTop( double nTop ) - { - mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_TOP ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nTop ) ) ); - } - double UserFormGeometryHelper::getHeight() - { - sal_Int32 nHeight = 0; - mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLHGT ) ) ) >>= nHeight; - return Millimeter::getInPoints( nHeight ); - } - void UserFormGeometryHelper::setHeight( double nHeight ) - { - mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLHGT ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nHeight ) ) ); - } - double UserFormGeometryHelper::getWidth() - { - sal_Int32 nWidth = 0; - mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLWID ) ) ) >>= nWidth; - return Millimeter::getInPoints( nWidth ); - } - void UserFormGeometryHelper::setWidth( double nWidth) - { - mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLWID ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nWidth ) ) ); - } - -SfxItemSet* -ScVbaCellRangeAccess::GetDataSet( ScCellRangeObj* pRangeObj ) -{ - SfxItemSet* pDataSet = pRangeObj ? pRangeObj->GetCurrentDataSet( true ) : NULL ; - return pDataSet; - -} - -} // openoffice -} //org diff --git a/sc/source/ui/vba/vbahyperlink.cxx b/sc/source/ui/vba/vbahyperlink.cxx index 27bcfaa28145..f6aa8cf8c4cb 100644 --- a/sc/source/ui/vba/vbahyperlink.cxx +++ b/sc/source/ui/vba/vbahyperlink.cxx @@ -32,7 +32,7 @@ * MA 02111-1307 USA * ************************************************************************/ -#include "helperdecl.hxx" +#include #include "vbahyperlink.hxx" #include #include diff --git a/sc/source/ui/vba/vbahyperlink.hxx b/sc/source/ui/vba/vbahyperlink.hxx index 2789b4d133b2..a72eeb325ac6 100644 --- a/sc/source/ui/vba/vbahyperlink.hxx +++ b/sc/source/ui/vba/vbahyperlink.hxx @@ -40,7 +40,7 @@ #include #include -#include "vbahelperinterface.hxx" +#include typedef InheritedHelperInterfaceImpl1< ov::excel::XHyperlink > HyperlinkImpl_BASE; diff --git a/sc/source/ui/vba/vbainterior.cxx b/sc/source/ui/vba/vbainterior.cxx index bb85b6c21922..9c309c997ed3 100644 --- a/sc/source/ui/vba/vbainterior.cxx +++ b/sc/source/ui/vba/vbainterior.cxx @@ -163,10 +163,18 @@ ScVbaInterior::setColorIndex( const css::uno::Any& _colorindex ) throw (css::uno sal_Int32 nIndex = 0; _colorindex >>= nIndex; - // setColor expects colors in XL RGB values - // #FIXME this is daft we convert OO RGB val to XL RGB val and - // then back again to OO RGB value - setColor( OORGBToXLRGB( GetIndexColor( nIndex ) ) ); + // hackly for excel::XlColorIndex::xlColorIndexNone + if( nIndex == excel::XlColorIndex::xlColorIndexNone ) + { + m_xProps->setPropertyValue( BACKCOLOR, uno::makeAny( sal_Int32( -1 ) ) ); + } + else + { + // setColor expects colors in XL RGB values + // #FIXME this is daft we convert OO RGB val to XL RGB val and + // then back again to OO RGB value + setColor( OORGBToXLRGB( GetIndexColor( nIndex ) ) ); + } } uno::Any ScVbaInterior::GetIndexColor( const sal_Int32& nColorIndex ) @@ -204,13 +212,21 @@ uno::Any SAL_CALL ScVbaInterior::getColorIndex() throw ( css::uno::RuntimeException ) { sal_Int32 nColor = 0; + // hackly for excel::XlColorIndex::xlColorIndexNone + uno::Any aColor = m_xProps->getPropertyValue( BACKCOLOR ); + if( ( aColor >>= nColor ) && ( nColor == -1 ) ) + { + nColor = excel::XlColorIndex::xlColorIndexNone; + return uno::makeAny( nColor ); + } + // getColor returns Xl ColorValue, need to convert it to OO val // as the palette deals with OO RGB values // #FIXME this is daft in getColor we convert OO RGB val to XL RGB val // and then back again to OO RGB value XLRGBToOORGB( getColor() ) >>= nColor; - return uno::makeAny( GetIndexColor( nColor ) ); + return uno::makeAny( GetColorIndex( nColor ) ); } Color ScVbaInterior::GetPatternColor( const Color& rPattColor, const Color& rBackColor, sal_uInt32 nXclPattern ) diff --git a/sc/source/ui/vba/vbainterior.hxx b/sc/source/ui/vba/vbainterior.hxx index 1184d33e6cd9..d3ca677d4890 100644 --- a/sc/source/ui/vba/vbainterior.hxx +++ b/sc/source/ui/vba/vbainterior.hxx @@ -34,9 +34,10 @@ #include #include #include +#include #include -#include "vbahelperinterface.hxx" +#include class ScDocument; diff --git a/sc/source/ui/vba/vbaname.cxx b/sc/source/ui/vba/vbaname.cxx index 72ef5afb3b7f..0d82f4ee45f8 100644 --- a/sc/source/ui/vba/vbaname.cxx +++ b/sc/source/ui/vba/vbaname.cxx @@ -27,7 +27,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#include "helperdecl.hxx" +#include #include #include @@ -64,7 +64,8 @@ ScVbaName::~ScVbaName() css::uno::Reference< ov::excel::XWorksheet > ScVbaName::getWorkSheet() throw (css::uno::RuntimeException) { - return ScVbaGlobals::getGlobalsImpl( mxContext )->getActiveSheet(); + uno::Reference< excel::XApplication > xApplication( Application(), uno::UNO_QUERY_THROW ); + return xApplication->getActiveSheet(); } ::rtl::OUString @@ -234,7 +235,7 @@ ScVbaName::setRefersToR1C1Local( const ::rtl::OUString & rRefersTo ) throw (css: css::uno::Reference< ov::excel::XRange > ScVbaName::getRefersToRange() throw (css::uno::RuntimeException) { - uno::Reference< ov::excel::XRange > xRange = ScVbaRange::getRangeObjectForName( mxContext, mxNamedRange->getName(), getDocShell( mxModel ), formula::FormulaGrammar::CONV_XL_R1C1 ); + uno::Reference< ov::excel::XRange > xRange = ScVbaRange::getRangeObjectForName( mxContext, mxNamedRange->getName(), excel::getDocShell( mxModel ), formula::FormulaGrammar::CONV_XL_R1C1 ); return xRange; } diff --git a/sc/source/ui/vba/vbaname.hxx b/sc/source/ui/vba/vbaname.hxx index 691a882cb3e1..6fb585100d4c 100644 --- a/sc/source/ui/vba/vbaname.hxx +++ b/sc/source/ui/vba/vbaname.hxx @@ -34,7 +34,9 @@ #include #include -#include "vbahelperinterface.hxx" +#include + +class ScDocument; typedef InheritedHelperInterfaceImpl1< ov::excel::XName > NameImpl_BASE; diff --git a/sc/source/ui/vba/vbanames.cxx b/sc/source/ui/vba/vbanames.cxx index 1bd3a2359377..043e7d386f15 100644 --- a/sc/source/ui/vba/vbanames.cxx +++ b/sc/source/ui/vba/vbanames.cxx @@ -27,7 +27,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#include "helperdecl.hxx" +#include #include #include @@ -81,7 +81,7 @@ ScDocument * ScVbaNames::getScDocument() { uno::Reference< frame::XModel > xModel( getModel() , uno::UNO_QUERY_THROW ); - ScTabViewShell * pTabViewShell = getBestViewShell( xModel ); + ScTabViewShell * pTabViewShell = excel::getBestViewShell( xModel ); if ( !pTabViewShell ) throw uno::RuntimeException( rtl::OUString::createFromAscii("No ViewShell available"), uno::Reference< uno::XInterface >() ); ScViewData* pViewData = pTabViewShell->GetViewData(); diff --git a/sc/source/ui/vba/vbanames.hxx b/sc/source/ui/vba/vbanames.hxx index 02a86da325b5..524277bdc0bd 100644 --- a/sc/source/ui/vba/vbanames.hxx +++ b/sc/source/ui/vba/vbanames.hxx @@ -34,7 +34,10 @@ #include #include #include -#include "vbacollectionimpl.hxx" +#include + +class ScDocument; +class ScDocShell; typedef CollTestImplHelper< ov::excel::XNames > ScVbaNames_BASE; diff --git a/sc/source/ui/vba/vbaoleobject.cxx b/sc/source/ui/vba/vbaoleobject.cxx index 455141cf03fd..64e5f05f90e1 100644 --- a/sc/source/ui/vba/vbaoleobject.cxx +++ b/sc/source/ui/vba/vbaoleobject.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #include "vbaoleobject.hxx" @@ -61,8 +62,9 @@ ScVbaOLEObject::ScVbaOLEObject( const uno::Reference< XHelperInterface >& xParen xChild.set( xChild->getParent(), uno::UNO_QUERY_THROW ); xChild.set( xChild->getParent(), uno::UNO_QUERY_THROW ); css::uno::Reference< css::frame::XModel > xModel( xChild->getParent(), uno::UNO_QUERY_THROW ); - css::uno::Reference< css::view::XControlAccess > xControlAccess( xModel->getCurrentController(), css::uno::UNO_QUERY_THROW ); - m_xWindowPeer = xControlAccess->getControl( xControlModel )->getPeer(); + uno::Reference xServiceManager( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); + uno::Reference< XControlProvider > xControlProvider( xServiceManager->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.ControlProvider" ) ), mxContext ), uno::UNO_QUERY_THROW ); + m_xControl.set( xControlProvider->createControl( xControlShape, xModel ) ); } uno::Reference< uno::XInterface > SAL_CALL @@ -74,98 +76,76 @@ ScVbaOLEObject::getObject() throw (uno::RuntimeException) sal_Bool SAL_CALL ScVbaOLEObject::getEnabled() throw (uno::RuntimeException) { - uno::Reference< css::awt::XWindow2 > xWindow2( m_xWindowPeer, css::uno::UNO_QUERY_THROW ); - return xWindow2->isEnabled(); + return m_xControl->getEnabled(); } void SAL_CALL ScVbaOLEObject::setEnabled( sal_Bool _enabled ) throw (uno::RuntimeException) { - uno::Reference< css::awt::XWindow2 > xWindow2( m_xWindowPeer, css::uno::UNO_QUERY_THROW ); - xWindow2->setEnable( _enabled ); + m_xControl->setEnabled( _enabled ); } sal_Bool SAL_CALL ScVbaOLEObject::getVisible() throw (uno::RuntimeException) { - uno::Reference< css::awt::XWindow2 > xWindow2( m_xWindowPeer, css::uno::UNO_QUERY_THROW ); - return xWindow2->isVisible(); + OSL_TRACE("OleObject %s returning visible %s", rtl::OUStringToOString( m_xControl->getName(), RTL_TEXTENCODING_UTF8 ).getStr(), m_xControl->getVisible() ? "true" : "false" ); + return m_xControl->getVisible(); } void SAL_CALL ScVbaOLEObject::setVisible( sal_Bool _visible ) throw (uno::RuntimeException) { - uno::Reference< css::awt::XWindow2 > xWindow2( m_xWindowPeer, css::uno::UNO_QUERY_THROW ); - xWindow2->setVisible( _visible ); + OSL_TRACE("OleObject %s set visible %s", rtl::OUStringToOString( m_xControl->getName(), RTL_TEXTENCODING_UTF8 ).getStr(), _visible ? "true" : "false" ); + m_xControl->setVisible( _visible ); } double SAL_CALL ScVbaOLEObject::getLeft() throw (uno::RuntimeException) { - uno::Reference< drawing::XShape > xShape( m_xControlShape, uno::UNO_QUERY_THROW ); - return mm2pt( xShape->getPosition().X / 100 ); + return m_xControl->getLeft(); } void SAL_CALL ScVbaOLEObject::setLeft( double _left ) throw (uno::RuntimeException) { - awt::Point oldPosition; - uno::Reference< drawing::XShape > xShape( m_xControlShape, uno::UNO_QUERY_THROW ); - oldPosition = xShape->getPosition(); - oldPosition.X = pt2mm( _left ) * 100; - xShape->setPosition( oldPosition ); + m_xControl->setLeft( _left ); } double SAL_CALL ScVbaOLEObject::getTop() throw (uno::RuntimeException) { - uno::Reference< drawing::XShape > xShape( m_xControlShape, uno::UNO_QUERY_THROW ); - return mm2pt( xShape->getPosition().Y / 100 ); + return m_xControl->getTop(); } void SAL_CALL ScVbaOLEObject::setTop( double _top ) throw (uno::RuntimeException) { - awt::Point oldPosition; - uno::Reference< drawing::XShape > xShape( m_xControlShape, uno::UNO_QUERY_THROW ); - oldPosition = xShape->getPosition(); - oldPosition.Y = pt2mm( _top ) * 100;; - xShape->setPosition( oldPosition ); + m_xControl->setTop( _top ); } double SAL_CALL ScVbaOLEObject::getHeight() throw (uno::RuntimeException) { - uno::Reference< drawing::XShape > xShape( m_xControlShape, uno::UNO_QUERY_THROW ); - return mm2pt( xShape->getSize().Height / 100 );//1pt = 1/72in + return m_xControl->getHeight(); } void SAL_CALL ScVbaOLEObject::setHeight( double _height ) throw (uno::RuntimeException) { - awt::Size oldSize; - uno::Reference< drawing::XShape > xShape( m_xControlShape, uno::UNO_QUERY_THROW ); - oldSize = xShape->getSize(); - oldSize.Height = pt2mm( _height ) * 100; - xShape->setSize( oldSize ); + m_xControl->setHeight( _height ); } double SAL_CALL ScVbaOLEObject::getWidth() throw (uno::RuntimeException) { - uno::Reference< drawing::XShape > xShape( m_xControlShape, uno::UNO_QUERY_THROW ); - return mm2pt ( xShape->getSize().Width / 100 ); + return m_xControl->getWidth(); } void SAL_CALL ScVbaOLEObject::setWidth( double _width ) throw (uno::RuntimeException) { - awt::Size oldSize; - uno::Reference< drawing::XShape > xShape( m_xControlShape, uno::UNO_QUERY_THROW ); - oldSize = xShape->getSize(); - oldSize.Width = pt2mm( _width ) * 100; - xShape->setSize( oldSize ); + m_xControl->setWidth( _width ); } rtl::OUString& ScVbaOLEObject::getServiceImplName() diff --git a/sc/source/ui/vba/vbaoleobject.hxx b/sc/source/ui/vba/vbaoleobject.hxx index 1b900aacf916..9ad6d6acc2b6 100644 --- a/sc/source/ui/vba/vbaoleobject.hxx +++ b/sc/source/ui/vba/vbaoleobject.hxx @@ -32,20 +32,20 @@ #include #include -#include #include +#include -#include "vbahelperinterface.hxx" +#include typedef InheritedHelperInterfaceImpl1< ov::excel::XOLEObject > OLEObjectImpl_BASE; class ScVbaOLEObject : public OLEObjectImpl_BASE { - css::uno::Reference< css::awt::XWindowPeer > m_xWindowPeer; protected: css::uno::Reference< css::drawing::XControlShape > m_xControlShape; virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence getServiceNames(); + css::uno::Reference< ov::msforms::XControl> m_xControl; public: ScVbaOLEObject( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, css::uno::Reference< css::drawing::XControlShape > xControlShape ); diff --git a/sc/source/ui/vba/vbaoleobjects.hxx b/sc/source/ui/vba/vbaoleobjects.hxx index 3d2c1b82c6a5..6372a1d2acf3 100644 --- a/sc/source/ui/vba/vbaoleobjects.hxx +++ b/sc/source/ui/vba/vbaoleobjects.hxx @@ -33,8 +33,8 @@ #include #include -#include "vbacollectionimpl.hxx" -#include "vbahelper.hxx" +#include +#include "excelvbahelper.hxx" typedef CollTestImplHelper< ov::excel::XOLEObjects > OLEObjectsImpl_BASE; diff --git a/sc/source/ui/vba/vbaoutline.hxx b/sc/source/ui/vba/vbaoutline.hxx index 346ca973f021..423b97a34671 100644 --- a/sc/source/ui/vba/vbaoutline.hxx +++ b/sc/source/ui/vba/vbaoutline.hxx @@ -34,7 +34,7 @@ #include #include #include -#include "vbahelperinterface.hxx" +#include typedef InheritedHelperInterfaceImpl1< ov::excel::XOutline > ScVbaOutline_BASE; diff --git a/sc/source/ui/vba/vbapagebreak.cxx b/sc/source/ui/vba/vbapagebreak.cxx index 83fd0687c4c7..6e8357be7a8c 100644 --- a/sc/source/ui/vba/vbapagebreak.cxx +++ b/sc/source/ui/vba/vbapagebreak.cxx @@ -139,3 +139,37 @@ ScVbaHPageBreak::getServiceNames() return aServiceNames; } +template class ScVbaPageBreak< excel::XVPageBreak >; + +/* class ScVbaVPageBreak */ +ScVbaVPageBreak::ScVbaVPageBreak( const css::uno::Reference< ov::XHelperInterface >& xParent, + const css::uno::Reference< css::uno::XComponentContext >& xContext, + css::uno::Reference< css::beans::XPropertySet >& xProps, + css::sheet::TablePageBreakData aTablePageBreakData ) throw ( css::uno::RuntimeException ) +: ScVbaVPageBreak_BASE( xParent, xContext, xProps, aTablePageBreakData ) +{ +} + +ScVbaVPageBreak::~ScVbaVPageBreak() +{ +} + +rtl::OUString& +ScVbaVPageBreak::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaVPageBreak") ); + return sImplName; +} + +uno::Sequence< rtl::OUString > +ScVbaVPageBreak::getServiceNames() +{ + static uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.excel.VPageBreak" ) ); + } + return aServiceNames; +} + diff --git a/sc/source/ui/vba/vbapagebreak.hxx b/sc/source/ui/vba/vbapagebreak.hxx index 0b05c8895711..2e83d3d9b6d6 100644 --- a/sc/source/ui/vba/vbapagebreak.hxx +++ b/sc/source/ui/vba/vbapagebreak.hxx @@ -33,12 +33,13 @@ #include #include #include +#include #include #include #include #include #include -#include "vbahelperinterface.hxx" +#include template< typename Ifc1 > class ScVbaPageBreak : public InheritedHelperInterfaceImpl1< Ifc1 > @@ -84,4 +85,22 @@ public: virtual css::uno::Sequence getServiceNames(); }; +//VPageBreak +typedef ScVbaPageBreak < ov::excel::XVPageBreak > ScVbaVPageBreak_BASE; + +class ScVbaVPageBreak : public ScVbaVPageBreak_BASE +{ +public: + ScVbaVPageBreak( const css::uno::Reference< ov::XHelperInterface >& xParent, + const css::uno::Reference< css::uno::XComponentContext >& xContext, + css::uno::Reference< css::beans::XPropertySet >& xProps, + css::sheet::TablePageBreakData aTablePageBreakData) throw (css::uno::RuntimeException); + + virtual ~ScVbaVPageBreak(); + + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence getServiceNames(); +}; + #endif diff --git a/sc/source/ui/vba/vbapagebreaks.cxx b/sc/source/ui/vba/vbapagebreaks.cxx index 7e04b982b530..c3b86b77d0bd 100644 --- a/sc/source/ui/vba/vbapagebreaks.cxx +++ b/sc/source/ui/vba/vbapagebreaks.cxx @@ -90,8 +90,8 @@ public: virtual uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException); virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException) { - //if( m_bColumn ) - // return excel::XVPageBreak::static_type(0); + if( m_bColumn ) + return excel::XVPageBreak::static_type(0); return excel::XHPageBreak::static_type(0); } virtual sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException) @@ -137,8 +137,8 @@ uno::Any SAL_CALL RangePageBreaks::getByIndex( sal_Int32 Index ) throw (lang::In if( (nPos < xIndexAccess->getCount()) && (nPos > -1) ) { uno::Reference< beans::XPropertySet > xRowColPropertySet( xIndexAccess->getByIndex(nPos), uno::UNO_QUERY_THROW ); - //if( m_bColumn ) - // return uno::makeAny( uno::Reference< excel::XVPageBreak >( new ScVbaVPageBreak( mxParent, mxContext, xRowColPropertySet, aTablePageBreakData) )); + if( m_bColumn ) + return uno::makeAny( uno::Reference< excel::XVPageBreak >( new ScVbaVPageBreak( mxParent, mxContext, xRowColPropertySet, aTablePageBreakData) )); return uno::makeAny( uno::Reference< excel::XHPageBreak >( new ScVbaHPageBreak( mxParent, mxContext, xRowColPropertySet, aTablePageBreakData) )); } } @@ -187,8 +187,8 @@ uno::Any RangePageBreaks::Add( const css::uno::Any& Before ) throw ( css::script sheet::TablePageBreakData aTablePageBreakData; aTablePageBreakData.ManualBreak = sal_True; aTablePageBreakData.Position = nAPIRowColIndex; - //if( m_bColumn ) - // return uno::makeAny( uno::Reference< excel::XVPageBreak >( new ScVbaVPageBreak( mxParent, mxContext, xRowColPropertySet, aTablePageBreakData) )); + if( m_bColumn ) + return uno::makeAny( uno::Reference< excel::XVPageBreak >( new ScVbaVPageBreak( mxParent, mxContext, xRowColPropertySet, aTablePageBreakData) )); return uno::makeAny( uno::Reference< excel::XHPageBreak >( new ScVbaHPageBreak( mxParent, mxContext, xRowColPropertySet, aTablePageBreakData) )); } @@ -267,3 +267,64 @@ ScVbaHPageBreaks::getServiceNames() return aServiceNames; } +//VPageBreak +ScVbaVPageBreaks::ScVbaVPageBreaks( const uno::Reference< XHelperInterface >& xParent, + const uno::Reference< uno::XComponentContext >& xContext, + uno::Reference< sheet::XSheetPageBreak >& xSheetPageBreak ) throw ( uno::RuntimeException ) +: ScVbaVPageBreaks_BASE( xParent, xContext, new RangePageBreaks( xParent, xContext, xSheetPageBreak, sal_True ) ), + mxSheetPageBreak( xSheetPageBreak ) +{ +} + +ScVbaVPageBreaks::~ScVbaVPageBreaks() +{ +} + +uno::Any SAL_CALL +ScVbaVPageBreaks::Add( const uno::Any& Before ) throw ( script::BasicErrorException, uno::RuntimeException ) +{ + RangePageBreaks* pPageBreaks = dynamic_cast< RangePageBreaks* >( m_xIndexAccess.get() ); + if( pPageBreaks ) + { + return pPageBreaks->Add( Before ); + } + return uno::Any(); +} + +uno::Reference< container::XEnumeration > +ScVbaVPageBreaks::createEnumeration() throw ( uno::RuntimeException ) +{ + return new RangePageBreaksEnumWrapper( m_xIndexAccess ); +} + +uno::Any +ScVbaVPageBreaks::createCollectionObject( const css::uno::Any& aSource ) +{ + return aSource; // its already a pagebreak object +} + +uno::Type +ScVbaVPageBreaks::getElementType() throw ( uno::RuntimeException ) +{ + return excel::XVPageBreak::static_type( 0 ); +} + +rtl::OUString& +ScVbaVPageBreaks::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM( "ScVbaVPageBreaks" ) ); + return sImplName; +} + +uno::Sequence< rtl::OUString > +ScVbaVPageBreaks::getServiceNames() +{ + static uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.excel.VPageBreaks" ) ); + } + return aServiceNames; +} + diff --git a/sc/source/ui/vba/vbapagebreaks.hxx b/sc/source/ui/vba/vbapagebreaks.hxx index 26d3e6961297..5c90745d61ff 100644 --- a/sc/source/ui/vba/vbapagebreaks.hxx +++ b/sc/source/ui/vba/vbapagebreaks.hxx @@ -33,6 +33,8 @@ #include #include #include +#include +#include #include #include #include @@ -41,8 +43,8 @@ #include #include #include -#include "vbahelperinterface.hxx" -#include "vbacollectionimpl.hxx" +#include +#include typedef CollTestImplHelper< ov::excel::XHPageBreaks > ScVbaHPageBreaks_BASE; @@ -68,4 +70,31 @@ public: virtual css::uno::Sequence getServiceNames(); }; +//VPageBreaks +typedef CollTestImplHelper< ov::excel::XVPageBreaks > ScVbaVPageBreaks_BASE; + +class ScVbaVPageBreaks : public ScVbaVPageBreaks_BASE +{ + css::uno::Reference< css::sheet::XSheetPageBreak > mxSheetPageBreak; + +public: + ScVbaVPageBreaks( const css::uno::Reference< ov::XHelperInterface >& xParent, + const css::uno::Reference< css::uno::XComponentContext >& xContext, + css::uno::Reference< css::sheet::XSheetPageBreak >& xSheetPageBreak ) throw ( css::uno::RuntimeException ); + + virtual ~ScVbaVPageBreaks(); + + // XVPageBreaks + virtual css::uno::Any SAL_CALL Add( const css::uno::Any& Before ) throw ( css::script::BasicErrorException, css::uno::RuntimeException ); + + // XEnumerationAccess + virtual css::uno::Type SAL_CALL getElementType() throw ( css::uno::RuntimeException ); + virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw ( css::uno::RuntimeException ); + virtual css::uno::Any createCollectionObject( const css::uno::Any& ); + + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence getServiceNames(); +}; + #endif diff --git a/sc/source/ui/vba/vbapagesetup.cxx b/sc/source/ui/vba/vbapagesetup.cxx index 2e7dd57a7afd..cbc9360db523 100644 --- a/sc/source/ui/vba/vbapagesetup.cxx +++ b/sc/source/ui/vba/vbapagesetup.cxx @@ -31,6 +31,7 @@ #include "cellsuno.hxx" #include "convuno.hxx" #include "rangelst.hxx" +#include "excelvbahelper.hxx" #include #include #include @@ -52,10 +53,10 @@ ScVbaPageSetup::ScVbaPageSetup(const uno::Reference< XHelperInterface >& xParent const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< sheet::XSpreadsheet >& xSheet, const uno::Reference< frame::XModel >& xModel) throw (uno::RuntimeException): - ScVbaPageSetup_BASE( xParent, xContext ), - mxSheet( xSheet ), mxModel( xModel ) + ScVbaPageSetup_BASE( xParent, xContext ), mxSheet( xSheet ) { // query for current page style + mxModel.set( xModel, uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySet > xSheetProps( mxSheet, uno::UNO_QUERY_THROW ); uno::Any aValue = xSheetProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageStyle" ))); rtl::OUString aStyleName; @@ -65,6 +66,8 @@ ScVbaPageSetup::ScVbaPageSetup(const uno::Reference< XHelperInterface >& xParent uno::Reference< container::XNameAccess > xStyleFamilies = xStyleFamiliesSup->getStyleFamilies(); uno::Reference< container::XNameAccess > xPageStyle( xStyleFamilies->getByName(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PageStyles"))), uno::UNO_QUERY_THROW ); mxPageProps.set( xPageStyle->getByName(aStyleName), uno::UNO_QUERY_THROW ); + mnOrientLandscape = excel::XlPageOrientation::xlLandscape; + mnOrientPortrait = excel::XlPageOrientation::xlPortrait; } rtl::OUString SAL_CALL ScVbaPageSetup::getPrintArea() throw (css::uno::RuntimeException) @@ -85,7 +88,7 @@ rtl::OUString SAL_CALL ScVbaPageSetup::getPrintArea() throw (css::uno::RuntimeEx ScUnoConversion::FillScRange( aRange, aSeq[i] ); aRangeList.Append( aRange ); } - ScDocument* pDoc = getDocShell( mxModel )->GetDocument(); + ScDocument* pDoc = excel::getDocShell( mxModel )->GetDocument(); aRangeList.Format( aPrintArea, nFlags, pDoc, formula::FormulaGrammar::CONV_XL_A1, ',' ); } @@ -106,7 +109,7 @@ void SAL_CALL ScVbaPageSetup::setPrintArea( const rtl::OUString& rAreas ) throw { ScRangeList aCellRanges; ScRange aRange; - if( getScRangeListForAddress( rAreas, getDocShell( mxModel ) , aRange, aCellRanges ) ) + if( getScRangeListForAddress( rAreas, excel::getDocShell( mxModel ) , aRange, aCellRanges ) ) { uno::Sequence< table::CellRangeAddress > aSeq( aCellRanges.Count() ); USHORT i=0; @@ -121,290 +124,24 @@ void SAL_CALL ScVbaPageSetup::setPrintArea( const rtl::OUString& rAreas ) throw } } -double SAL_CALL ScVbaPageSetup::getTopMargin() throw (css::uno::RuntimeException) -{ - sal_Bool headerOn = sal_False; - sal_Int32 topMargin = 0; - sal_Int32 headerHeight = 0; - - try - { - uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderIsOn"))); - aValue >>= headerOn; - - aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TopMargin"))); - aValue >>= topMargin; - - if( headerOn ) - { - aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderHeight"))); - aValue >>= headerHeight; - topMargin += headerHeight; - } - } - catch( uno::Exception& ) - { - } - - return Millimeter::getInPoints( topMargin ); -} - -void SAL_CALL ScVbaPageSetup::setTopMargin( double margin ) throw (css::uno::RuntimeException) -{ - sal_Int32 topMargin = Millimeter::getInHundredthsOfOneMillimeter( margin ); - sal_Bool headerOn = sal_False; - sal_Int32 headerHeight = 0; - - try - { - uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderIsOn"))); - aValue >>= headerOn; - - if( headerOn ) - { - aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderHeight"))); - aValue >>= headerHeight; - topMargin -= headerHeight; - } - - aValue <<= topMargin; - mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TopMargin")), aValue ); - } - catch( uno::Exception& ) - { - } -} - -double SAL_CALL ScVbaPageSetup::getBottomMargin() throw (css::uno::RuntimeException) -{ - sal_Bool footerOn = sal_False; - sal_Int32 bottomMargin = 0; - sal_Int32 footerHeight = 0; - - try - { - uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterIsOn"))); - aValue >>= footerOn; - - aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BottomMargin"))); - aValue >>= bottomMargin; - - if( footerOn ) - { - aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterHeight"))); - aValue >>= footerHeight; - bottomMargin += footerHeight; - } - } - catch( uno::Exception& ) - { - } - - return Millimeter::getInPoints( bottomMargin ); -} - -void SAL_CALL ScVbaPageSetup::setBottomMargin( double margin ) throw (css::uno::RuntimeException) -{ - sal_Int32 bottomMargin = Millimeter::getInHundredthsOfOneMillimeter( margin ); - sal_Bool footerOn = sal_False; - sal_Int32 footerHeight = 0; - - try - { - uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterIsOn"))); - aValue >>= footerOn; - - if( footerOn ) - { - aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterHeight"))); - aValue >>= footerHeight; - bottomMargin -= footerHeight; - } - - aValue <<= bottomMargin; - mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BottomMargin")), aValue ); - } - catch( uno::Exception& ) - { - } -} - -double SAL_CALL ScVbaPageSetup::getRightMargin() throw (css::uno::RuntimeException) -{ - sal_Int32 rightMargin = 0; - try - { - uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightMargin"))); - aValue >>= rightMargin; - } - catch( uno::Exception& ) - { - } - - return Millimeter::getInPoints( rightMargin );; -} - -void SAL_CALL ScVbaPageSetup::setRightMargin( double margin ) throw (css::uno::RuntimeException) -{ - sal_Int32 rightMargin = Millimeter::getInHundredthsOfOneMillimeter( margin ); - try - { - uno::Any aValue; - aValue <<= rightMargin; - mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightMargin")), aValue ); - } - catch( uno::Exception& ) - { - } - -} - -double SAL_CALL ScVbaPageSetup::getLeftMargin() throw (css::uno::RuntimeException) -{ - sal_Int32 leftMargin = 0; - try - { - uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LeftMargin"))); - aValue >>= leftMargin; - } - catch( uno::Exception& ) - { - } - - return Millimeter::getInPoints( leftMargin );; -} - -void SAL_CALL ScVbaPageSetup::setLeftMargin( double margin ) throw (css::uno::RuntimeException) -{ - sal_Int32 leftMargin = Millimeter::getInHundredthsOfOneMillimeter( margin ); - try - { - uno::Any aValue; - aValue <<= leftMargin; - mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LeftMargin")), aValue ); - } - catch( uno::Exception& ) - { - } -} - double SAL_CALL ScVbaPageSetup::getHeaderMargin() throw (css::uno::RuntimeException) { - sal_Int32 headerMargin = 0; - try - { - uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TopMargin"))); - aValue >>= headerMargin; - } - catch( uno::Exception& ) - { - } - - return Millimeter::getInPoints( headerMargin );; + return VbaPageSetupBase::getHeaderMargin(); } void SAL_CALL ScVbaPageSetup::setHeaderMargin( double margin ) throw (css::uno::RuntimeException) { - sal_Int32 headerMargin = Millimeter::getInHundredthsOfOneMillimeter( margin ); - try - { - uno::Any aValue; - aValue <<= headerMargin; - mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TopMargin")), aValue ); - } - catch( uno::Exception& ) - { - } + VbaPageSetupBase::setHeaderMargin( margin ); } double SAL_CALL ScVbaPageSetup::getFooterMargin() throw (css::uno::RuntimeException) { - sal_Int32 footerMargin = 0; - try - { - uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BottomMargin"))); - aValue >>= footerMargin; - } - catch( uno::Exception& ) - { - } - - return Millimeter::getInPoints( footerMargin );; + return VbaPageSetupBase::getFooterMargin(); } void SAL_CALL ScVbaPageSetup::setFooterMargin( double margin ) throw (css::uno::RuntimeException) { - sal_Int32 footerMargin = Millimeter::getInHundredthsOfOneMillimeter( margin ); - try - { - uno::Any aValue; - aValue <<= footerMargin; - mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BottomMargin")), aValue ); - } - catch( uno::Exception& ) - { - } -} - -sal_Int32 SAL_CALL ScVbaPageSetup::getOrientation() throw (css::uno::RuntimeException) -{ - sal_Int32 orientation = excel::XlPageOrientation::xlPortrait; - try - { - sal_Bool isLandscape = sal_False; - uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsLandscape"))); - aValue >>= isLandscape; - - if( isLandscape ) - { - orientation = excel::XlPageOrientation::xlLandscape; - } - } - catch( uno::Exception& ) - { - } - return orientation; -} - -void SAL_CALL ScVbaPageSetup::setOrientation( sal_Int32 orientation ) throw (css::uno::RuntimeException) -{ - if( ( orientation != excel::XlPageOrientation::xlPortrait ) && - ( orientation != excel::XlPageOrientation::xlLandscape ) ) - { - DebugHelper::exception(SbERR_BAD_PARAMETER, rtl::OUString() ); - } - - try - { - sal_Bool isLandscape = sal_False; - uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsLandscape"))); - aValue >>= isLandscape; - - sal_Bool switchOrientation = sal_False; - if(( isLandscape && orientation != excel::XlPageOrientation::xlLandscape ) || - ( !isLandscape && orientation != excel::XlPageOrientation::xlPortrait )) - { - switchOrientation = sal_True; - } - - if( switchOrientation ) - { - aValue <<= !isLandscape; - uno::Any aHeight = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Height"))); - uno::Any aWidth = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width"))); - mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsLandscape")), aValue ); - mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width")), aHeight ); - mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Height")), aWidth ); - } - - if( isLandscape ) - { - orientation = excel::XlPageOrientation::xlLandscape; - } - } - catch( uno::Exception& ) - { - } + VbaPageSetupBase::setFooterMargin( margin ); } uno::Any SAL_CALL ScVbaPageSetup::getFitToPagesTall() throw (css::uno::RuntimeException) diff --git a/sc/source/ui/vba/vbapagesetup.hxx b/sc/source/ui/vba/vbapagesetup.hxx index e3cafc9fb78d..2b8b1fffde43 100644 --- a/sc/source/ui/vba/vbapagesetup.hxx +++ b/sc/source/ui/vba/vbapagesetup.hxx @@ -35,39 +35,28 @@ #include #include #include -#include "vbahelperinterface.hxx" +#include +#include -typedef InheritedHelperInterfaceImpl1< ov::excel::XPageSetup > ScVbaPageSetup_BASE; +typedef cppu::ImplInheritanceHelper1< VbaPageSetupBase, ov::excel::XPageSetup > ScVbaPageSetup_BASE; class ScVbaPageSetup : public ScVbaPageSetup_BASE { css::uno::Reference< css::sheet::XSpreadsheet > mxSheet; - css::uno::Reference< css::beans::XPropertySet > mxPageProps; - css::uno::Reference< css::frame::XModel > mxModel; public: ScVbaPageSetup( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::sheet::XSpreadsheet>& xSheet, - const css::uno::Reference< css::frame::XModel >& xModlel) throw (css::uno::RuntimeException); + const css::uno::Reference< css::frame::XModel >& xModel) throw (css::uno::RuntimeException); virtual ~ScVbaPageSetup(){} // Attribute virtual rtl::OUString SAL_CALL getPrintArea() throw (css::uno::RuntimeException); virtual void SAL_CALL setPrintArea( const rtl::OUString& rAreas ) throw (css::uno::RuntimeException); - virtual double SAL_CALL getTopMargin() throw (css::uno::RuntimeException); - virtual void SAL_CALL setTopMargin( double margin ) throw (css::uno::RuntimeException); - virtual double SAL_CALL getBottomMargin() throw (css::uno::RuntimeException); - virtual void SAL_CALL setBottomMargin( double margin ) throw (css::uno::RuntimeException); - virtual double SAL_CALL getRightMargin() throw (css::uno::RuntimeException); - virtual void SAL_CALL setRightMargin( double margin ) throw (css::uno::RuntimeException); - virtual double SAL_CALL getLeftMargin() throw (css::uno::RuntimeException); - virtual void SAL_CALL setLeftMargin( double margin ) throw (css::uno::RuntimeException); virtual double SAL_CALL getHeaderMargin() throw (css::uno::RuntimeException); - virtual void SAL_CALL setHeaderMargin( double margin ) throw (css::uno::RuntimeException); - virtual double SAL_CALL getFooterMargin() throw (css::uno::RuntimeException); - virtual void SAL_CALL setFooterMargin( double margin ) throw (css::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getOrientation() throw (css::uno::RuntimeException); - virtual void SAL_CALL setOrientation( sal_Int32 orientation ) throw (css::uno::RuntimeException); + void SAL_CALL setHeaderMargin( double margin ) throw (css::uno::RuntimeException); + double SAL_CALL getFooterMargin() throw (css::uno::RuntimeException); + void SAL_CALL setFooterMargin( double margin ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getFitToPagesTall() throw (css::uno::RuntimeException); virtual void SAL_CALL setFitToPagesTall( const css::uno::Any& fitToPagesTall ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getFitToPagesWide() throw (css::uno::RuntimeException); diff --git a/sc/source/ui/vba/vbapalette.cxx b/sc/source/ui/vba/vbapalette.cxx index d3bbbd6ae121..f9afaa00c191 100644 --- a/sc/source/ui/vba/vbapalette.cxx +++ b/sc/source/ui/vba/vbapalette.cxx @@ -92,7 +92,7 @@ ScVbaPalette::getDefaultPalette() } uno::Reference< container::XIndexAccess > -ScVbaPalette::getPalette() +ScVbaPalette::getPalette() const { uno::Reference< container::XIndexAccess > xIndex; uno::Reference< beans::XPropertySet > xProps; diff --git a/sc/source/ui/vba/vbapalette.hxx b/sc/source/ui/vba/vbapalette.hxx index aa1c8eb27d6c..388fd5908b6b 100644 --- a/sc/source/ui/vba/vbapalette.hxx +++ b/sc/source/ui/vba/vbapalette.hxx @@ -30,7 +30,7 @@ #ifndef SC_VBAPALETTE_HXX #define SC_VBAPALETTE_HXX -#include "vbahelper.hxx" +#include "excelvbahelper.hxx" #include #include @@ -42,7 +42,7 @@ public: ScVbaPalette( SfxObjectShell* pShell = NULL ) : m_pShell( pShell ){} // if no palette available e.g. because the document doesn't have a // palette defined then a default palette will be returned. - css::uno::Reference< css::container::XIndexAccess > getPalette(); + css::uno::Reference< css::container::XIndexAccess > getPalette() const; static css::uno::Reference< css::container::XIndexAccess > getDefaultPalette(); }; diff --git a/sc/source/ui/vba/vbapane.hxx b/sc/source/ui/vba/vbapane.hxx index 0f67bbf6038c..97eb3e8f366c 100644 --- a/sc/source/ui/vba/vbapane.hxx +++ b/sc/source/ui/vba/vbapane.hxx @@ -34,7 +34,7 @@ #include #include -#include"vbahelper.hxx" +#include"excelvbahelper.hxx" typedef cppu::WeakImplHelper1< ov::excel::XPane > PaneImpl_Base; diff --git a/sc/source/ui/vba/vbapivotcache.hxx b/sc/source/ui/vba/vbapivotcache.hxx index 8a57401d2ff9..6e98344d115e 100644 --- a/sc/source/ui/vba/vbapivotcache.hxx +++ b/sc/source/ui/vba/vbapivotcache.hxx @@ -34,7 +34,7 @@ #include #include -#include "vbahelperinterface.hxx" +#include typedef InheritedHelperInterfaceImpl1 PivotCacheImpl_BASE; diff --git a/sc/source/ui/vba/vbapivottable.hxx b/sc/source/ui/vba/vbapivottable.hxx index 55f32a36e60d..7fccada818fc 100644 --- a/sc/source/ui/vba/vbapivottable.hxx +++ b/sc/source/ui/vba/vbapivottable.hxx @@ -33,8 +33,8 @@ #include #include #include -#include "vbahelper.hxx" -#include "vbahelperinterface.hxx" +#include "excelvbahelper.hxx" +#include typedef InheritedHelperInterfaceImpl1< ov::excel::XPivotTable > PivotTableImpl_BASE; diff --git a/sc/source/ui/vba/vbapivottables.hxx b/sc/source/ui/vba/vbapivottables.hxx index 6a6d5afb67a5..b2f71cdc3ff0 100644 --- a/sc/source/ui/vba/vbapivottables.hxx +++ b/sc/source/ui/vba/vbapivottables.hxx @@ -36,9 +36,9 @@ #include #include -#include "vbahelper.hxx" -#include "vbahelperinterface.hxx" -#include "vbacollectionimpl.hxx" +#include "excelvbahelper.hxx" +#include +#include typedef CollTestImplHelper< ov::excel::XPivotTables > ScVbaPivotTables_BASE; diff --git a/sc/source/ui/vba/vbapropvalue.hxx b/sc/source/ui/vba/vbapropvalue.hxx index d6ddb33505e1..f521212f2ceb 100644 --- a/sc/source/ui/vba/vbapropvalue.hxx +++ b/sc/source/ui/vba/vbapropvalue.hxx @@ -32,7 +32,7 @@ #include #include -#include "vbahelper.hxx" +#include "excelvbahelper.hxx" typedef ::cppu::WeakImplHelper1< ov::XPropValue > PropValueImpl_BASE; diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index d1ac4504ce96..f6c58c23f79a 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -27,7 +27,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#include "helperdecl.hxx" +#include #include #include @@ -149,7 +149,6 @@ #include "rangelst.hxx" #include "convuno.hxx" #include "compiler.hxx" -#include "formula/grammar.hxx" #include "attrib.hxx" #include "undodat.hxx" #include "dbdocfun.hxx" @@ -162,7 +161,7 @@ #include "vbaglobals.hxx" #include "vbastyle.hxx" #include -#include +#include // begin test includes #include // end test includes @@ -256,7 +255,7 @@ ScCellRangeObj* ScVbaRange::getCellRangeObj() throw ( uno::RuntimeException ) SfxItemSet* ScVbaRange::getCurrentDataSet( ) throw ( uno::RuntimeException ) { ScCellRangeObj* pUnoCellRange = getCellRangeObj(); - SfxItemSet* pDataSet = ScVbaCellRangeAccess::GetDataSet( pUnoCellRange ); + SfxItemSet* pDataSet = excel::ScVbaCellRangeAccess::GetDataSet( pUnoCellRange ); if ( !pDataSet ) throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can't access Itemset for range" ) ), uno::Reference< uno::XInterface >() ); return pDataSet; @@ -473,7 +472,7 @@ public: if ( pUnoCellRange ) { - SfxItemSet* pDataSet = ScVbaCellRangeAccess::GetDataSet( pUnoCellRange ); + SfxItemSet* pDataSet = excel::ScVbaCellRangeAccess::GetDataSet( pUnoCellRange ); SfxItemState eState = pDataSet->GetItemState( ATTR_VALUE_FORMAT, TRUE, NULL); // one of the cells in the range is not like the other ;-) // so return a zero length format to indicate that @@ -1979,7 +1978,7 @@ ScVbaRange::Select() throw (uno::RuntimeException) // ThisComponent.CurrentController.Frame.getContainerWindow.SetFocus try { - uno::Reference< frame::XController > xController( getCurrentDocument()->getCurrentController(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XController > xController( xModel->getCurrentController(), uno::UNO_QUERY_THROW ); uno::Reference< frame::XFrame > xFrame( xController->getFrame(), uno::UNO_QUERY_THROW ); uno::Reference< awt::XWindow > xWin( xFrame->getContainerWindow(), uno::UNO_QUERY_THROW ); xWin->setFocus(); @@ -1999,9 +1998,9 @@ bool cellInRange( const table::CellRangeAddress& rAddr, const sal_Int32& nCol, c return false; } -void setCursor( const SCCOL& nCol, const SCROW& nRow, bool bInSel = true ) +void setCursor( const SCCOL& nCol, const SCROW& nRow, const uno::Reference< frame::XModel >& xModel, bool bInSel = true ) { - ScTabViewShell* pShell = getCurrentBestViewShell(); + ScTabViewShell* pShell = excel::getBestViewShell( xModel ); if ( pShell ) { if ( bInSel ) @@ -2027,11 +2026,19 @@ ScVbaRange::Activate() throw (uno::RuntimeException) RangeHelper thisRange( xCellRange ); uno::Reference< sheet::XCellRangeAddressable > xThisRangeAddress = thisRange.getCellRangeAddressable(); table::CellRangeAddress thisRangeAddress = xThisRangeAddress->getRangeAddress(); + uno::Reference< frame::XModel > xModel; + ScDocShell* pShell = getScDocShell(); + + if ( pShell ) + xModel = pShell->GetModel(); + + if ( !xModel.is() ) + throw uno::RuntimeException(); // get current selection - uno::Reference< sheet::XCellRangeAddressable > xRange( getCurrentDocument()->getCurrentSelection(), ::uno::UNO_QUERY); + uno::Reference< sheet::XCellRangeAddressable > xRange( xModel->getCurrentSelection(), ::uno::UNO_QUERY); - uno::Reference< sheet::XSheetCellRanges > xRanges( getCurrentDocument()->getCurrentSelection(), ::uno::UNO_QUERY); + uno::Reference< sheet::XSheetCellRanges > xRanges( xModel->getCurrentSelection(), ::uno::UNO_QUERY); if ( xRanges.is() ) { @@ -2040,7 +2047,7 @@ ScVbaRange::Activate() throw (uno::RuntimeException) { if ( cellInRange( nAddrs[index], thisRangeAddress.StartColumn, thisRangeAddress.StartRow ) ) { - setCursor( static_cast< SCCOL >( thisRangeAddress.StartColumn ), static_cast< SCROW >( thisRangeAddress.StartRow ) ); + setCursor( static_cast< SCCOL >( thisRangeAddress.StartColumn ), static_cast< SCROW >( thisRangeAddress.StartRow ), xModel ); return; } @@ -2048,7 +2055,7 @@ ScVbaRange::Activate() throw (uno::RuntimeException) } if ( xRange.is() && cellInRange( xRange->getRangeAddress(), thisRangeAddress.StartColumn, thisRangeAddress.StartRow ) ) - setCursor( static_cast< SCCOL >( thisRangeAddress.StartColumn ), static_cast< SCROW >( thisRangeAddress.StartRow ) ); + setCursor( static_cast< SCCOL >( thisRangeAddress.StartColumn ), static_cast< SCROW >( thisRangeAddress.StartRow ), xModel ); else { // if this range is multi cell select the range other @@ -2056,7 +2063,7 @@ ScVbaRange::Activate() throw (uno::RuntimeException) if ( isSingleCellRange() ) // This top-leftmost cell of this Range is not in the current // selection so just select this range - setCursor( static_cast< SCCOL >( thisRangeAddress.StartColumn ), static_cast< SCROW >( thisRangeAddress.StartRow ), false ); + setCursor( static_cast< SCCOL >( thisRangeAddress.StartColumn ), static_cast< SCROW >( thisRangeAddress.StartRow ), xModel, false ); else Select(); } @@ -2211,8 +2218,9 @@ ScVbaRange::Copy(const ::uno::Any& Destination) throw (uno::RuntimeException) } else { + uno::Reference< frame::XModel > xModel = getModelFromRange( mxRange ); Select(); - implnCopy(); + excel::implnCopy( xModel ); } } @@ -2235,8 +2243,9 @@ ScVbaRange::Cut(const ::uno::Any& Destination) throw (uno::RuntimeException) xMover->moveRange( xDestination->getCellAddress(), xSource->getRangeAddress() ); } { + uno::Reference< frame::XModel > xModel = getModelFromRange( mxRange ); Select(); - implnCut(); + excel::implnCut( xModel ); } } @@ -2544,9 +2553,12 @@ ScVbaRange::PasteSpecial( const uno::Any& Paste, const uno::Any& Operation, cons { if ( m_Areas->getCount() > 1 ) throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("That command cannot be used on multiple selections" ) ), uno::Reference< uno::XInterface >() ); - uno::Reference< view::XSelectionSupplier > xSelection( getCurrentDocument()->getCurrentController(), uno::UNO_QUERY_THROW ); + ScDocShell* pShell = getScDocShell(); + + uno::Reference< frame::XModel > xModel( ( pShell ? pShell->GetModel() : NULL ), uno::UNO_QUERY_THROW ); + uno::Reference< view::XSelectionSupplier > xSelection( xModel->getCurrentController(), uno::UNO_QUERY_THROW ); // save old selection - uno::Reference< uno::XInterface > xSel( getCurrentDocument()->getCurrentSelection() ); + uno::Reference< uno::XInterface > xSel( xModel->getCurrentSelection() ); // select this range xSelection->select( uno::makeAny( mxRange ) ); // set up defaults @@ -2566,7 +2578,7 @@ ScVbaRange::PasteSpecial( const uno::Any& Paste, const uno::Any& Operation, cons USHORT nFlags = getPasteFlags(nPaste); USHORT nFormulaBits = getPasteFormulaBits(nOperation); - implnPasteSpecial(nFlags,nFormulaBits,bSkipBlanks,bTranspose); + excel::implnPasteSpecial(pShell->GetModel(), nFlags,nFormulaBits,bSkipBlanks,bTranspose); // restore selection xSelection->select( uno::makeAny( xSel ) ); } @@ -3235,13 +3247,15 @@ ScVbaRange::End( ::sal_Int32 Direction ) throw (uno::RuntimeException) // Save ActiveCell pos ( to restore later ) uno::Any aDft; - rtl::OUString sActiveCell = ScVbaGlobals::getGlobalsImpl( - mxContext )->getApplication()->getActiveCell()->Address(aDft, aDft, aDft, aDft, aDft ); + uno::Reference< excel::XApplication > xApplication( Application(), uno::UNO_QUERY_THROW ); + rtl::OUString sActiveCell = xApplication->getActiveCell()->Address(aDft, aDft, aDft, aDft, aDft ); // position current cell upper left of this range Cells( uno::makeAny( (sal_Int32) 1 ), uno::makeAny( (sal_Int32) 1 ) )->Select(); - SfxViewFrame* pViewFrame = getCurrentViewFrame(); + uno::Reference< frame::XModel > xModel = getModelFromRange( mxRange ); + + SfxViewFrame* pViewFrame = excel::getViewFrame( xModel ); if ( pViewFrame ) { SfxAllItemSet aArgs( SFX_APP()->GetPool() ); @@ -3277,18 +3291,17 @@ ScVbaRange::End( ::sal_Int32 Direction ) throw (uno::RuntimeException) } // result is the ActiveCell - rtl::OUString sMoved = ScVbaGlobals::getGlobalsImpl( - mxContext )->getApplication()->getActiveCell()->Address(aDft, aDft, aDft, aDft, aDft ); + rtl::OUString sMoved = xApplication->getActiveCell()->Address(aDft, aDft, aDft, aDft, aDft ); // restore old ActiveCell uno::Any aVoid; - uno::Reference< excel::XRange > xOldActiveCell( ScVbaGlobals::getGlobalsImpl( - mxContext )->getActiveSheet()->Range( uno::makeAny( sActiveCell ), aVoid ), uno::UNO_QUERY_THROW ); + + uno::Reference< excel::XRange > xOldActiveCell( xApplication->getActiveSheet()->Range( uno::makeAny( sActiveCell ), aVoid ), uno::UNO_QUERY_THROW ); xOldActiveCell->Select(); uno::Reference< excel::XRange > resultCell; - resultCell.set( ScVbaGlobals::getGlobalsImpl( - mxContext )->getActiveSheet()->Range( uno::makeAny( sMoved ), aVoid ), uno::UNO_QUERY_THROW ); + + resultCell.set( xApplication->getActiveSheet()->Range( uno::makeAny( sMoved ), aVoid ), uno::UNO_QUERY_THROW ); // return result @@ -3321,7 +3334,6 @@ ScVbaRange::characters( const uno::Any& Start, const uno::Any& Length ) throw (u void SAL_CALL ScVbaRange::Delete( const uno::Any& Shift ) throw (uno::RuntimeException) { - if ( m_Areas->getCount() > 1 ) { sal_Int32 nItems = m_Areas->getCount(); @@ -3333,6 +3345,8 @@ ScVbaRange::Delete( const uno::Any& Shift ) throw (uno::RuntimeException) return; } sheet::CellDeleteMode mode = sheet::CellDeleteMode_NONE ; + RangeHelper thisRange( mxRange ); + table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress(); if ( Shift.hasValue() ) { sal_Int32 nShift = 0; @@ -3350,13 +3364,17 @@ ScVbaRange::Delete( const uno::Any& Shift ) throw (uno::RuntimeException) } } else - if ( getRow() > getColumn() ) + { + bool bFullRow = ( thisAddress.StartColumn == 0 && thisAddress.EndColumn == MAXCOL ); + sal_Int32 nCols = thisAddress.EndColumn - thisAddress.StartColumn; + sal_Int32 nRows = thisAddress.EndRow - thisAddress.StartRow; + if ( mbIsRows || bFullRow || ( nCols >= nRows ) ) mode = sheet::CellDeleteMode_UP; else mode = sheet::CellDeleteMode_LEFT; - RangeHelper thisRange( mxRange ); + } uno::Reference< sheet::XCellRangeMovement > xCellRangeMove( thisRange.getSpreadSheet(), uno::UNO_QUERY_THROW ); - xCellRangeMove->removeRange( thisRange.getCellRangeAddressable()->getRangeAddress(), mode ); + xCellRangeMove->removeRange( thisAddress, mode ); } @@ -3394,7 +3412,7 @@ ScVbaRange::createEnumeration() throw (uno::RuntimeException) ::rtl::OUString SAL_CALL ScVbaRange::getDefaultMethodName( ) throw (uno::RuntimeException) { - const static rtl::OUString sName( RTL_CONSTASCII_USTRINGPARAM("Cells") ); + const static rtl::OUString sName( RTL_CONSTASCII_USTRINGPARAM("Item") ); return sName; } @@ -3751,7 +3769,7 @@ ScVbaRange::setPageBreak( const uno::Any& _pagebreak) throw (uno::RuntimeExcepti uno::Reference< frame::XModel > xModel = pShell->GetModel(); if ( xModel.is() ) { - ScTabViewShell* pViewShell = getBestViewShell( xModel ); + ScTabViewShell* pViewShell = excel::getBestViewShell( xModel ); if ( nPageBreak == excel::XlPageBreak::xlPageBreakManual ) pViewShell->InsertPageBreak( bColumn, TRUE, &aAddr); else if ( nPageBreak == excel::XlPageBreak::xlPageBreakNone ) @@ -3881,7 +3899,7 @@ ScVbaRange::ApplicationRange( const uno::Reference< uno::XComponentContext >& xC if ( Cell1.hasValue() && !Cell2.hasValue() && sRangeName.getLength() ) { const static rtl::OUString sNamedRanges( RTL_CONSTASCII_USTRINGPARAM("NamedRanges")); - uno::Reference< beans::XPropertySet > xPropSet( getCurrentDocument(), uno::UNO_QUERY_THROW ); + uno::Reference< beans::XPropertySet > xPropSet( getCurrentExcelDoc(xContext), uno::UNO_QUERY_THROW ); uno::Reference< container::XNameAccess > xNamed( xPropSet->getPropertyValue( sNamedRanges ), uno::UNO_QUERY_THROW ); uno::Reference< sheet::XCellRangeReferrer > xReferrer; @@ -3904,7 +3922,7 @@ ScVbaRange::ApplicationRange( const uno::Reference< uno::XComponentContext >& xC } } } - uno::Reference< sheet::XSpreadsheetView > xView( getCurrentDocument()->getCurrentController(), uno::UNO_QUERY ); + uno::Reference< sheet::XSpreadsheetView > xView( getCurrentExcelDoc(xContext)->getCurrentController(), uno::UNO_QUERY ); uno::Reference< table::XCellRange > xSheetRange( xView->getActiveSheet(), uno::UNO_QUERY_THROW ); ScVbaRange* pRange = new ScVbaRange( uno::Reference< XHelperInterface >(), xContext, xSheetRange ); uno::Reference< excel::XRange > xVbSheetRange( pRange ); @@ -4351,8 +4369,10 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const } void SAL_CALL -ScVbaRange::Insert( const uno::Any& Shift, const uno::Any& /*CopyOrigin*/ ) throw (uno::RuntimeException) +ScVbaRange::Insert( const uno::Any& Shift, const uno::Any& CopyOrigin ) throw (uno::RuntimeException) { + sal_Bool bCopyOrigin = sal_True; + CopyOrigin >>= bCopyOrigin; // It appears ( from the web ) that the undocumented CopyOrigin // param should contain member of enum XlInsertFormatOrigin // which can have values xlFormatFromLeftOrAbove or xlFormatFromRightOrBelow @@ -4384,8 +4404,17 @@ ScVbaRange::Insert( const uno::Any& Shift, const uno::Any& /*CopyOrigin*/ ) thro mode = sheet::CellInsertMode_RIGHT; } RangeHelper thisRange( mxRange ); + table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress(); uno::Reference< sheet::XCellRangeMovement > xCellRangeMove( thisRange.getSpreadSheet(), uno::UNO_QUERY_THROW ); - xCellRangeMove->insertCells( thisRange.getCellRangeAddressable()->getRangeAddress(), mode ); + xCellRangeMove->insertCells( thisAddress, mode ); + if ( bCopyOrigin ) + { + // After the insert ( this range ) actually has moved + ScRange aRange( static_cast< SCCOL >( thisAddress.StartColumn ), static_cast< SCROW >( thisAddress.StartRow ), static_cast< SCTAB >( thisAddress.Sheet ), static_cast< SCCOL >( thisAddress.EndColumn ), static_cast< SCROW >( thisAddress.EndRow ), static_cast< SCTAB >( thisAddress.Sheet ) ); + uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( getDocShellFromRange( mxRange ) , aRange ) ); + uno::Reference< excel::XRange > xVbaRange( new ScVbaRange( getParent(), mxContext, xRange, mbIsRows, mbIsColumns ) ); + xVbaRange->PasteSpecial( uno::Any(), uno::Any(), uno::Any(), uno::Any() ); + } } void SAL_CALL @@ -4720,7 +4749,7 @@ ScVbaRange::PrintOut( const uno::Any& From, const uno::Any& To, const uno::Any& { xPrintAreas->setPrintAreas( printAreas ); uno::Reference< frame::XModel > xModel = pShell->GetModel(); - PrintOutHelper( From, To, Copies, Preview, ActivePrinter, PrintToFile, Collate, PrToFileName, xModel, sal_True ); + PrintOutHelper( excel::getBestViewShell( xModel ), From, To, Copies, Preview, ActivePrinter, PrintToFile, Collate, PrToFileName, sal_True ); } } } @@ -5034,6 +5063,7 @@ ScVbaRange::getStyle() throw (uno::RuntimeException) } uno::Reference< beans::XPropertySet > xProps( mxRange, uno::UNO_QUERY_THROW ); rtl::OUString sStyleName; + xProps->getPropertyValue(CELLSTYLE) >>= sStyleName; ScDocShell* pShell = getScDocShell(); uno::Reference< frame::XModel > xModel( pShell->GetModel() ); uno::Reference< excel::XStyle > xStyle = new ScVbaStyle( this, mxContext, sStyleName, xModel ); diff --git a/sc/source/ui/vba/vbarange.hxx b/sc/source/ui/vba/vbarange.hxx index abc2f608bb62..1d2d82442be3 100644 --- a/sc/source/ui/vba/vbarange.hxx +++ b/sc/source/ui/vba/vbarange.hxx @@ -53,12 +53,15 @@ #include #include -//#include "vbahelperinterface.hxx" +//#include #include "vbaformat.hxx" +#include class ScTableSheetsObj; class ScCellRangesBase; class ScCellRangeObj; +class ScDocShell; +class ScDocument; //typedef InheritedHelperInterfaceImpl1< ov::excel::XRange > ScVbaRange_BASE; typedef ScVbaFormat< ov::excel::XRange > ScVbaRange_BASE; diff --git a/sc/source/ui/vba/vbaseriescollection.hxx b/sc/source/ui/vba/vbaseriescollection.hxx index ccd544fe4f26..48ec78025d79 100644 --- a/sc/source/ui/vba/vbaseriescollection.hxx +++ b/sc/source/ui/vba/vbaseriescollection.hxx @@ -31,9 +31,9 @@ #define SC_VBA_SERIESCOLLECTION_HXX #include -#include "vbahelperinterface.hxx" -#include "vbacollectionimpl.hxx" -#include "vbahelper.hxx" +#include +#include +#include "excelvbahelper.hxx" typedef CollTestImplHelper< ov::excel::XSeriesCollection > SeriesCollection_BASE; diff --git a/sc/source/ui/vba/vbastyle.cxx b/sc/source/ui/vba/vbastyle.cxx index fbcfb0b97f65..8b7731c2d358 100644 --- a/sc/source/ui/vba/vbastyle.cxx +++ b/sc/source/ui/vba/vbastyle.cxx @@ -71,7 +71,7 @@ void ScVbaStyle::initialise() throw ( uno::RuntimeException ) } -ScVbaStyle::ScVbaStyle( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const rtl::OUString& sStyleName, const uno::Reference< frame::XModel >& _xModel ) throw ( script::BasicErrorException, uno::RuntimeException ) : ScVbaStyle_BASE( xParent, xContext, lcl_getStyleProps( sStyleName, _xModel ), _xModel, false ) +ScVbaStyle::ScVbaStyle( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const rtl::OUString& sStyleName, const uno::Reference< frame::XModel >& _xModel ) throw ( script::BasicErrorException, uno::RuntimeException ) : ScVbaStyle_BASE( xParent, xContext, lcl_getStyleProps( sStyleName, _xModel ), _xModel, false ), mxModel( _xModel ) { try { @@ -83,7 +83,7 @@ ScVbaStyle::ScVbaStyle( const uno::Reference< ov::XHelperInterface >& xParent, c } } -ScVbaStyle::ScVbaStyle( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< beans::XPropertySet >& _xPropertySet, const uno::Reference< frame::XModel >& _xModel ) throw ( script::BasicErrorException, uno::RuntimeException ) : ScVbaStyle_BASE( xParent, xContext, _xPropertySet, _xModel, false ) +ScVbaStyle::ScVbaStyle( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< beans::XPropertySet >& _xPropertySet, const uno::Reference< frame::XModel >& _xModel ) throw ( script::BasicErrorException, uno::RuntimeException ) : ScVbaStyle_BASE( xParent, xContext, _xPropertySet, _xModel, false ), mxModel( _xModel ) { try { diff --git a/sc/source/ui/vba/vbastyles.cxx b/sc/source/ui/vba/vbastyles.cxx index 18111fc5eae7..6cb35d19a67e 100644 --- a/sc/source/ui/vba/vbastyles.cxx +++ b/sc/source/ui/vba/vbastyles.cxx @@ -29,6 +29,7 @@ ************************************************************************/ #include "vbastyles.hxx" #include "vbastyle.hxx" +#include using namespace ::ooo::vba; using namespace ::com::sun::star; diff --git a/sc/source/ui/vba/vbastyles.hxx b/sc/source/ui/vba/vbastyles.hxx index 4ad8980fe201..1e238a9d1c13 100644 --- a/sc/source/ui/vba/vbastyles.hxx +++ b/sc/source/ui/vba/vbastyles.hxx @@ -31,7 +31,7 @@ #define SC_VBA_STYLES_HXX #include #include -#include "vbacollectionimpl.hxx" +#include typedef CollTestImplHelper< ov::excel::XStyles > ScVbaStyles_BASE; class ScVbaStyles: public ScVbaStyles_BASE diff --git a/sc/source/ui/vba/vbatextboxshape.cxx b/sc/source/ui/vba/vbatextboxshape.cxx index 82af63e5754e..b8148e129220 100644 --- a/sc/source/ui/vba/vbatextboxshape.cxx +++ b/sc/source/ui/vba/vbatextboxshape.cxx @@ -41,7 +41,7 @@ using namespace com::sun::star; using namespace ooo::vba; -ScVbaTextBoxShape::ScVbaTextBoxShape( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< drawing::XShape >& xShape, const uno::Reference< drawing::XShapes >& xShapes, const uno::Reference< frame::XModel >& xModel ) : TextBoxShapeImpl_BASE( uno::Reference< XHelperInterface >(), xContext, xShape, xShapes, ScVbaShape::getType( xShape ) ) +ScVbaTextBoxShape::ScVbaTextBoxShape( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< drawing::XShape >& xShape, const uno::Reference< drawing::XShapes >& xShapes, const uno::Reference< frame::XModel >& xModel ) : TextBoxShapeImpl_BASE( uno::Reference< XHelperInterface >(), xContext, xShape, xShapes, xModel, ScVbaShape::getType( xShape ) ) { m_xTextRange.set( xShape , uno::UNO_QUERY_THROW ); m_xModel.set( xModel ); @@ -62,7 +62,7 @@ ScVbaTextBoxShape::setText( const rtl::OUString& _text ) throw (css::uno::Runtim uno::Reference< excel::XCharacters > SAL_CALL ScVbaTextBoxShape::characters( const uno::Any& Start, const uno::Any& Length ) throw (uno::RuntimeException) { - ScDocShell* pDocShell = getDocShell( m_xModel ); + ScDocShell* pDocShell = excel::getDocShell( m_xModel ); ScDocument* pDoc = pDocShell ? pDocShell->GetDocument() : NULL; if ( !pDoc ) diff --git a/sc/source/ui/vba/vbatextboxshape.hxx b/sc/source/ui/vba/vbatextboxshape.hxx index c8c79b626069..733849e6be12 100644 --- a/sc/source/ui/vba/vbatextboxshape.hxx +++ b/sc/source/ui/vba/vbatextboxshape.hxx @@ -37,8 +37,8 @@ #include #include #include -#include "vbashape.hxx" -#include "vbahelper.hxx" +#include +#include "excelvbahelper.hxx" #include "vbacharacters.hxx" typedef cppu::ImplInheritanceHelper1< ScVbaShape, ov::msforms::XTextBoxShape > TextBoxShapeImpl_BASE; diff --git a/sc/source/ui/vba/vbatextframe.cxx b/sc/source/ui/vba/vbatextframe.cxx index f66d83c22c2d..81a8f0b5654c 100644 --- a/sc/source/ui/vba/vbatextframe.cxx +++ b/sc/source/ui/vba/vbatextframe.cxx @@ -27,6 +27,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ +#include #include #include #include "vbatextframe.hxx" @@ -35,121 +36,19 @@ using namespace ::ooo::vba; using namespace ::com::sun::star; -ScVbaTextFrame::ScVbaTextFrame( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, uno::Reference< drawing::XShape > xShape ) : ScVbaTextFrame_BASE( xParent, xContext ), m_xShape( xShape ) +ScVbaTextFrame::ScVbaTextFrame( uno::Sequence< uno::Any> const & args, uno::Reference< uno::XComponentContext> const & xContext ) throw ( lang::IllegalArgumentException ) : ScVbaTextFrame_BASE( getXSomethingFromArgs< XHelperInterface >( args, 0 ), xContext, getXSomethingFromArgs< drawing::XShape >( args, 1, false ) ) { - m_xPropertySet.set( m_xShape, uno::UNO_QUERY_THROW ); } -void -ScVbaTextFrame::setAsMSObehavior() -{ - //set property TextWordWrap default as False. - // TextFitToSize control the text content. it seems we should set the default as False. - // com.sun.star.drawing.TextFitToSizeType.NONE - m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "TextWordWrap" ), uno::makeAny( sal_False ) ); - m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "TextFitToSize" ), uno::makeAny( drawing::TextFitToSizeType_NONE ) ); -} - -sal_Int32 ScVbaTextFrame::getMargin( rtl::OUString sMarginType ) -{ - sal_Int32 nMargin = 0; - uno::Any aMargin = m_xPropertySet->getPropertyValue( sMarginType ); - aMargin >>= nMargin; - return nMargin; -} - -void ScVbaTextFrame::setMargin( rtl::OUString sMarginType, float fMargin ) -{ - sal_Int32 nMargin = Millimeter::getInHundredthsOfOneMillimeter( fMargin ); - m_xPropertySet->setPropertyValue( sMarginType, uno::makeAny( nMargin ) ); -} - -// Attributes -sal_Bool SAL_CALL -ScVbaTextFrame::getAutoSize() throw (uno::RuntimeException) -{ - // I don't know why, but in OOo, TextAutoGrowHeight is the property control autosize. not TextFitToSize. - // TextFitToSize control the text content. - // and in mso, there isnot option TextWordWrap which means auto wrap. the default is False. - sal_Bool bAutosize = sal_False; - uno::Any aTextAutoGrowHeight = m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "TextAutoGrowHeight" ) ); - aTextAutoGrowHeight >>= bAutosize; - return bAutosize; -} - -void SAL_CALL -ScVbaTextFrame::setAutoSize( sal_Bool _autosize ) throw (uno::RuntimeException) -{ - setAsMSObehavior(); - m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "TextAutoGrowHeight" ), uno::makeAny( _autosize ) ); -} - -float SAL_CALL -ScVbaTextFrame::getMarginBottom() throw (uno::RuntimeException) -{ - sal_Int32 nMargin = getMargin( rtl::OUString::createFromAscii( "TextLowerDistance" ) ); - float fMargin = (float)Millimeter::getInPoints( nMargin ); - return fMargin; -} - -void SAL_CALL -ScVbaTextFrame::setMarginBottom( float _marginbottom ) throw (uno::RuntimeException) -{ - setMargin( rtl::OUString::createFromAscii( "TextLowerDistance" ), _marginbottom ); -} - -float SAL_CALL -ScVbaTextFrame::getMarginTop() throw (uno::RuntimeException) -{ - sal_Int32 nMargin = getMargin( rtl::OUString::createFromAscii( "TextUpperDistance" ) ); - float fMargin = (float)Millimeter::getInPoints( nMargin ); - return fMargin; -} - -void SAL_CALL -ScVbaTextFrame::setMarginTop( float _margintop ) throw (uno::RuntimeException) -{ - setMargin( rtl::OUString::createFromAscii( "TextUpperDistance" ), _margintop ); -} - -float SAL_CALL -ScVbaTextFrame::getMarginLeft() throw (uno::RuntimeException) -{ - sal_Int32 nMargin = getMargin( rtl::OUString::createFromAscii( "TextLeftDistance" ) ); - float fMargin = (float)Millimeter::getInPoints( nMargin ); - return fMargin; -} - -void SAL_CALL -ScVbaTextFrame::setMarginLeft( float _marginleft ) throw (uno::RuntimeException) -{ - setMargin( rtl::OUString::createFromAscii( "TextLeftDistance" ), _marginleft ); -} - -float SAL_CALL -ScVbaTextFrame::getMarginRight() throw (uno::RuntimeException) -{ - sal_Int32 nMargin = getMargin( rtl::OUString::createFromAscii( "TextRightDistance" ) ); - float fMargin = (float)Millimeter::getInPoints( nMargin ); - return fMargin; -} - -void SAL_CALL -ScVbaTextFrame::setMarginRight( float _marginright ) throw (uno::RuntimeException) -{ - setMargin( rtl::OUString::createFromAscii( "TextRightDistance" ), _marginright ); -} - - // Methods -uno::Reference< ov::excel::XCharacters > SAL_CALL +uno::Any SAL_CALL ScVbaTextFrame::Characters() throw (uno::RuntimeException) { uno::Reference< text::XSimpleText > xSimpleText( m_xShape, uno::UNO_QUERY_THROW ); ScVbaPalette aPalette( SfxObjectShell::Current() ); uno::Any aStart( sal_Int32( 1 ) ); uno::Any aLength(sal_Int32( -1 ) ); - return uno::Reference< ov::excel::XCharacters >( new ScVbaCharacters( this, mxContext, aPalette, xSimpleText, aStart, aLength, sal_True ) ); + return uno::makeAny( uno::Reference< ov::excel::XCharacters >( new ScVbaCharacters( this, mxContext, aPalette, xSimpleText, aStart, aLength, sal_True ) ) ); } rtl::OUString& @@ -171,3 +70,12 @@ ScVbaTextFrame::getServiceNames() return aServiceNames; } +namespace textframe +{ +namespace sdecl = comphelper::service_decl; +sdecl::vba_service_class_ > serviceImpl; +extern sdecl::ServiceDecl const serviceDecl( + serviceImpl, + "ScVbaTextFrame", + "ooo.vba.excel.TextFrame" ); +} diff --git a/sc/source/ui/vba/vbatextframe.hxx b/sc/source/ui/vba/vbatextframe.hxx index 6bb75551c00c..8aa85f34be09 100644 --- a/sc/source/ui/vba/vbatextframe.hxx +++ b/sc/source/ui/vba/vbatextframe.hxx @@ -29,45 +29,23 @@ ************************************************************************/ #ifndef SC_VBA_TEXTFRAME_HXX #define SC_VBA_TEXTFRAME_HXX -#include -#include -#include #include +#include +#include -#include "vbahelperinterface.hxx" -#include "vbapalette.hxx" - -typedef InheritedHelperInterfaceImpl1< ov::excel::XTextFrame > ScVbaTextFrame_BASE; +//typedef InheritedHelperInterfaceImpl1< ov::excel::XTextFrame > ScVbaTextFrame_BASE; +typedef cppu::ImplInheritanceHelper1< VbaTextFrame, ov::excel::XTextFrame > ScVbaTextFrame_BASE; class ScVbaTextFrame : public ScVbaTextFrame_BASE { -private: - css::uno::Reference< ov::excel::XCharacters > m_xCharacters; - css::uno::Reference< css::drawing::XShape > m_xShape; - css::uno::Reference< css::beans::XPropertySet > m_xPropertySet; -protected: - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); - virtual void setAsMSObehavior(); - sal_Int32 getMargin( rtl::OUString sMarginType ); - void setMargin( rtl::OUString sMarginType, float fMargin ); public: - ScVbaTextFrame( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext , css::uno::Reference< css::drawing::XShape > xShape); + ScVbaTextFrame( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext > const& xContext ) throw ( css::lang::IllegalArgumentException ); virtual ~ScVbaTextFrame() {} - // Attributes - virtual sal_Bool SAL_CALL getAutoSize() throw (css::uno::RuntimeException); - virtual void SAL_CALL setAutoSize( sal_Bool _autosize ) throw (css::uno::RuntimeException); - virtual float SAL_CALL getMarginBottom() throw (css::uno::RuntimeException); - virtual void SAL_CALL setMarginBottom( float _marginbottom ) throw (css::uno::RuntimeException); - virtual float SAL_CALL getMarginTop() throw (css::uno::RuntimeException); - virtual void SAL_CALL setMarginTop( float _margintop ) throw (css::uno::RuntimeException); - virtual float SAL_CALL getMarginLeft() throw (css::uno::RuntimeException); - virtual void SAL_CALL setMarginLeft( float _marginleft ) throw (css::uno::RuntimeException); - virtual float SAL_CALL getMarginRight() throw (css::uno::RuntimeException); - virtual void SAL_CALL setMarginRight( float _marginright ) throw (css::uno::RuntimeException); - // Methods - virtual css::uno::Reference< ov::excel::XCharacters > SAL_CALL Characters( ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Characters( ) throw (css::uno::RuntimeException); + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence getServiceNames(); }; diff --git a/sc/source/ui/vba/vbatitle.hxx b/sc/source/ui/vba/vbatitle.hxx index 3d6c597bc67a..e696640d757f 100644 --- a/sc/source/ui/vba/vbatitle.hxx +++ b/sc/source/ui/vba/vbatitle.hxx @@ -30,14 +30,15 @@ #ifndef SC_VBA_TITLE_HXX #define SC_VBA_TITLE_HXX -#include "vbahelperinterface.hxx" -#include "vbahelper.hxx" +#include +#include "excelvbahelper.hxx" #include "vbainterior.hxx" #include "vbafont.hxx" #include "vbapalette.hxx" #include #include #include +#include #include #include diff --git a/sc/source/ui/vba/vbavalidation.hxx b/sc/source/ui/vba/vbavalidation.hxx index 60d24ac0c6c5..cef989aa3cea 100644 --- a/sc/source/ui/vba/vbavalidation.hxx +++ b/sc/source/ui/vba/vbavalidation.hxx @@ -33,7 +33,7 @@ #include #include #include -#include "vbahelperinterface.hxx" +#include typedef InheritedHelperInterfaceImpl1 ValidationImpl_BASE; diff --git a/sc/source/ui/vba/vbawindow.cxx b/sc/source/ui/vba/vbawindow.cxx index a38ba7c9ed46..d782fb95dc70 100644 --- a/sc/source/ui/vba/vbawindow.cxx +++ b/sc/source/ui/vba/vbawindow.cxx @@ -27,10 +27,11 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#include "helperdecl.hxx" +#include #include "vbawindow.hxx" #include "vbaworksheets.hxx" #include "vbaworksheet.hxx" +#include "vbaglobals.hxx" #include "vbapane.hxx" #include #include @@ -57,6 +58,9 @@ using namespace ::com::sun::star; using namespace ::ooo::vba; using namespace ::ooo::vba::excel::XlWindowState; +// nameExists defined in vbaworksheet.cxx +bool nameExists( uno::Reference & xSpreadDoc, ::rtl::OUString & name, SCTAB& nTab ) throw ( lang::IllegalArgumentException ); + typedef std::hash_map< rtl::OUString, SCTAB, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > NameIndexHash; @@ -118,7 +122,7 @@ public: ScDocShell* pDocShell = (ScDocShell*)pModel->GetEmbeddedObject(); if ( !pDocShell ) throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cannot obtain docshell" ) ), uno::Reference< uno::XInterface >() ); - ScTabViewShell* pViewShell = getBestViewShell( m_xModel ); + ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel ); if ( !pViewShell ) throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cannot obtain view shell" ) ), uno::Reference< uno::XInterface >() ); @@ -202,14 +206,13 @@ public: }; -ScVbaWindow::ScVbaWindow( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< frame::XModel >& xModel ) : WindowImpl_BASE( xParent, xContext ), m_xModel( xModel ) +ScVbaWindow::ScVbaWindow( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< frame::XModel >& xModel ) : WindowImpl_BASE( xParent, xContext, xModel ) { init(); } ScVbaWindow::ScVbaWindow( uno::Sequence< uno::Any > const & args, uno::Reference< uno::XComponentContext > const & xContext ) - : WindowImpl_BASE( getXSomethingFromArgs< XHelperInterface >( args, 0 ), xContext ), - m_xModel( getXSomethingFromArgs< frame::XModel >( args, 1 ) ) + : WindowImpl_BASE( args, xContext ) { init(); } @@ -306,8 +309,7 @@ ScVbaWindow::getCaption() throw (uno::RuntimeException) if ( ( nCrudLen + nCrudIndex ) == sTitle.getLength() ) { sTitle = sTitle.copy( 0, nCrudIndex ); - uno::Reference< ov::XGlobals > xTemp( ScVbaGlobals::getGlobalsImpl( mxContext )); // temporary needed for g++ 3.3.5 - ScVbaWorkbook workbook( uno::Reference< XHelperInterface >( xTemp->getApplication(), uno::UNO_QUERY_THROW ), mxContext, m_xModel ); + ScVbaWorkbook workbook( uno::Reference< XHelperInterface >( Application(), uno::UNO_QUERY_THROW ), mxContext, m_xModel ); rtl::OUString sName = workbook.getName(); // rather bizare hack to make sure the name behavior // is like XL @@ -343,7 +345,7 @@ uno::Any SAL_CALL ScVbaWindow::getScrollRow() throw (uno::RuntimeException) { sal_Int32 nValue = 0; - ScTabViewShell* pViewShell = getBestViewShell( m_xModel ); + ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel ); if ( pViewShell ) { ScSplitPos eWhich = pViewShell->GetViewData()->GetActivePart(); @@ -356,7 +358,7 @@ ScVbaWindow::getScrollRow() throw (uno::RuntimeException) void SAL_CALL ScVbaWindow::setScrollRow( const uno::Any& _scrollrow ) throw (uno::RuntimeException) { - ScTabViewShell* pViewShell = getBestViewShell( m_xModel ); + ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel ); if ( pViewShell ) { sal_Int32 scrollRow = 0; @@ -371,7 +373,7 @@ uno::Any SAL_CALL ScVbaWindow::getScrollColumn() throw (uno::RuntimeException) { sal_Int32 nValue = 0; - ScTabViewShell* pViewShell = getBestViewShell( m_xModel ); + ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel ); if ( pViewShell ) { ScSplitPos eWhich = pViewShell->GetViewData()->GetActivePart(); @@ -384,7 +386,7 @@ ScVbaWindow::getScrollColumn() throw (uno::RuntimeException) void SAL_CALL ScVbaWindow::setScrollColumn( const uno::Any& _scrollcolumn ) throw (uno::RuntimeException) { - ScTabViewShell* pViewShell = getBestViewShell( m_xModel ); + ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel ); if ( pViewShell ) { sal_Int32 scrollColumn = 0; @@ -399,7 +401,7 @@ uno::Any SAL_CALL ScVbaWindow::getWindowState() throw (uno::RuntimeException) { sal_Int32 nwindowState = xlNormal; - ScTabViewShell* pViewShell = getBestViewShell( m_xModel ); + ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel ); SfxViewFrame* pViewFrame = pViewShell -> GetViewFrame(); SfxTopViewFrame *pTop= PTR_CAST( SfxTopViewFrame, pViewFrame -> GetTopViewFrame() ); if ( pTop ) @@ -421,7 +423,7 @@ ScVbaWindow::setWindowState( const uno::Any& _windowstate ) throw (uno::RuntimeE { sal_Int32 nwindowState = xlMaximized; _windowstate >>= nwindowState; - ScTabViewShell* pViewShell = getBestViewShell( m_xModel ); + ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel ); SfxViewFrame* pViewFrame = pViewShell -> GetViewFrame(); SfxTopViewFrame *pTop= PTR_CAST( SfxTopViewFrame, pViewFrame -> GetTopViewFrame() ); if ( pTop ) @@ -444,8 +446,7 @@ ScVbaWindow::setWindowState( const uno::Any& _windowstate ) throw (uno::RuntimeE void ScVbaWindow::Activate() throw (css::uno::RuntimeException) { - uno::Reference< ov::XGlobals > xTemp( ScVbaGlobals::getGlobalsImpl( mxContext )); // temporary needed for g++ 3.3.5 - ScVbaWorkbook workbook( uno::Reference< XHelperInterface >( xTemp->getApplication(), uno::UNO_QUERY_THROW ), mxContext, m_xModel ); + ScVbaWorkbook workbook( uno::Reference< XHelperInterface >( Application(), uno::UNO_QUERY_THROW ), mxContext, m_xModel ); workbook.Activate(); } @@ -453,8 +454,7 @@ ScVbaWindow::Activate() throw (css::uno::RuntimeException) void ScVbaWindow::Close( const uno::Any& SaveChanges, const uno::Any& FileName, const uno::Any& RouteWorkBook ) throw (uno::RuntimeException) { - uno::Reference< ov::XGlobals > xTemp( ScVbaGlobals::getGlobalsImpl( mxContext )); // temporary needed for g++ 3.3.5 - ScVbaWorkbook workbook( uno::Reference< XHelperInterface >( xTemp->getApplication(), uno::UNO_QUERY_THROW ), mxContext, m_xModel ); + ScVbaWorkbook workbook( uno::Reference< XHelperInterface >( Application(), uno::UNO_QUERY_THROW ), mxContext, m_xModel ); workbook.Close(SaveChanges, FileName, RouteWorkBook ); } @@ -467,13 +467,15 @@ ScVbaWindow::ActivePane() throw (script::BasicErrorException, uno::RuntimeExcept uno::Reference< excel::XRange > SAL_CALL ScVbaWindow::ActiveCell( ) throw (script::BasicErrorException, uno::RuntimeException) { - return ScVbaGlobals::getGlobalsImpl( mxContext )->getApplication()->getActiveCell(); + uno::Reference< excel::XApplication > xApplication( Application(), uno::UNO_QUERY_THROW ); + return xApplication->getActiveCell(); } uno::Any SAL_CALL ScVbaWindow::Selection( ) throw (script::BasicErrorException, uno::RuntimeException) { - return ScVbaGlobals::getGlobalsImpl( mxContext )->getApplication()->getSelection(); + uno::Reference< excel::XApplication > xApplication( Application(), uno::UNO_QUERY_THROW ); + return xApplication->getSelection(); } ::sal_Bool SAL_CALL @@ -736,30 +738,25 @@ ScVbaWindow::getZoom() throw (uno::RuntimeException) void SAL_CALL ScVbaWindow::setZoom( const uno::Any& _zoom ) throw (uno::RuntimeException) { - uno::Reference< beans::XPropertySet > xProps( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW ); - rtl::OUString sZoomType( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_ZOOMTYPE ) ); - sal_Int16 nZoomType = view::DocumentZoomType::PAGE_WIDTH; - if( _zoom.getValueTypeClass() == uno::TypeClass_BOOLEAN ) - { - //zoom type is PAGE_WIDTH_EXACT in helperapi, it seems that there is a issue for this zoom type in current OOo. - // so PAGE_WIDTH is used. - xProps->setPropertyValue(sZoomType, uno::makeAny( nZoomType )); - } - else - { - nZoomType = view::DocumentZoomType::BY_VALUE; - rtl::OUString sZoomValue( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_ZOOMVALUE )); - sal_Int16 nZoomValue = 100; - _zoom >>= nZoomValue; - xProps->setPropertyValue( sZoomType, uno::makeAny( nZoomType )); - xProps->setPropertyValue( sZoomValue, uno::makeAny( nZoomValue )); - } + sal_Int16 nZoom = 100; + _zoom >>= nZoom; + uno::Reference xSpreadDoc( m_xModel, uno::UNO_QUERY_THROW ); + uno::Reference< excel::XWorksheet > xActiveSheet = ActiveSheet(); + SCTAB nTab = 0; + rtl::OUString sName = xActiveSheet->getName(); + bool bSheetExists = nameExists (xSpreadDoc, sName, nTab); + if ( !bSheetExists ) + throw uno::RuntimeException(); + std::vector< SCTAB > vTabs; + vTabs.push_back( nTab ); + excel::implSetZoom( m_xModel, nZoom, vTabs ); } uno::Reference< excel::XWorksheet > SAL_CALL ScVbaWindow::ActiveSheet( ) throw (script::BasicErrorException, uno::RuntimeException) { - return ScVbaGlobals::getGlobalsImpl(mxContext)->getApplication()->getActiveSheet(); + uno::Reference< excel::XApplication > xApplication( Application(), uno::UNO_QUERY_THROW ); + return xApplication->getActiveSheet(); } uno::Any SAL_CALL @@ -787,121 +784,9 @@ ScVbaWindow::setView( const uno::Any& _view) throw (uno::RuntimeException) default: DebugHelper::exception(SbERR_BAD_PARAMETER, rtl::OUString() ); } - dispatchExecute( m_xModel, nSlot ); -} - -sal_Bool SAL_CALL -ScVbaWindow::getVisible() throw (uno::RuntimeException) -{ - sal_Bool bVisible = sal_True; - uno::Reference< frame::XController > xController( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW ); - uno::Reference< css::awt::XWindow > xWindow (xController->getFrame()->getContainerWindow(), uno::UNO_QUERY_THROW ); - uno::Reference< css::awt::XWindow2 > xWindow2 (xWindow, uno::UNO_QUERY_THROW ); - if( xWindow2.is() ) - { - bVisible = xWindow2->isVisible(); - } - return bVisible; -} - -void SAL_CALL -ScVbaWindow::setVisible(sal_Bool _visible) throw (uno::RuntimeException) -{ - uno::Reference< frame::XController > xController( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW ); - uno::Reference< css::awt::XWindow > xWindow (xController->getFrame()->getContainerWindow(), uno::UNO_QUERY_THROW ); - if( xWindow.is() ) - { - xWindow->setVisible( _visible ); - } -} - -css::awt::Rectangle getPosSize( const uno::Reference< frame::XModel >& xModel ) -{ - css::awt::Rectangle aRect; - uno::Reference< frame::XController > xController( xModel->getCurrentController(), uno::UNO_QUERY_THROW ); - uno::Reference< css::awt::XWindow > xWindow (xController->getFrame()->getContainerWindow(), uno::UNO_QUERY_THROW ); - if( xWindow.is() ) - { - aRect = xWindow->getPosSize(); - } - return aRect; -} - -void setPosSize( const uno::Reference< frame::XModel >& xModel, sal_Int32 nValue, USHORT nFlag ) -{ - uno::Reference< frame::XController > xController( xModel->getCurrentController(), uno::UNO_QUERY_THROW ); - uno::Reference< css::awt::XWindow > xWindow (xController->getFrame()->getContainerWindow(), uno::UNO_QUERY_THROW ); - if( xWindow.is() ) - { - css::awt::Rectangle aRect = xWindow->getPosSize(); - switch( nFlag ) - { - case css::awt::PosSize::X: - xWindow->setPosSize( nValue, aRect.Y, 0, 0, css::awt::PosSize::X ); - break; - case css::awt::PosSize::Y: - xWindow->setPosSize( aRect.X, nValue, 0, 0, css::awt::PosSize::Y ); - break; - case css::awt::PosSize::WIDTH: - xWindow->setPosSize( 0, 0, nValue, aRect.Height, css::awt::PosSize::WIDTH ); - break; - case css::awt::PosSize::HEIGHT: - xWindow->setPosSize( 0, 0, aRect.Width, nValue, css::awt::PosSize::HEIGHT ); - break; - default: - break; - } - } -} - -sal_Int32 SAL_CALL -ScVbaWindow::getHeight() throw (uno::RuntimeException) -{ - css::awt::Rectangle aRect = getPosSize(m_xModel); - return aRect.Height; -} - -void SAL_CALL -ScVbaWindow::setHeight( sal_Int32 _height ) throw (uno::RuntimeException) -{ - setPosSize(m_xModel, _height, css::awt::PosSize::HEIGHT); -} - -sal_Int32 SAL_CALL -ScVbaWindow::getLeft() throw (uno::RuntimeException) -{ - css::awt::Rectangle aRect = getPosSize(m_xModel); - return aRect.X; -} - -void SAL_CALL -ScVbaWindow::setLeft( sal_Int32 _left ) throw (uno::RuntimeException) -{ - setPosSize(m_xModel, _left, css::awt::PosSize::X); -} -sal_Int32 SAL_CALL -ScVbaWindow::getTop() throw (uno::RuntimeException) -{ - css::awt::Rectangle aRect = getPosSize(m_xModel); - return aRect.Y; -} - -void SAL_CALL -ScVbaWindow::setTop( sal_Int32 _top ) throw (uno::RuntimeException) -{ - setPosSize(m_xModel, _top, css::awt::PosSize::Y); -} -sal_Int32 SAL_CALL -ScVbaWindow::getWidth() throw (uno::RuntimeException) -{ - css::awt::Rectangle aRect = getPosSize(m_xModel); - return aRect.Width; -} - -void SAL_CALL -ScVbaWindow::setWidth( sal_Int32 _width ) throw (uno::RuntimeException) -{ - setPosSize(m_xModel, _width, css::awt::PosSize::WIDTH); + ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel ); + if ( pViewShell ) + dispatchExecute( pViewShell, nSlot ); } sal_Int32 SAL_CALL @@ -924,14 +809,14 @@ void SAL_CALL ScVbaWindow::PrintOut( const css::uno::Any& From, const css::uno::Any&To, const css::uno::Any& Copies, const css::uno::Any& Preview, const css::uno::Any& ActivePrinter, const css::uno::Any& PrintToFile, const css::uno::Any& Collate, const css::uno::Any& PrToFileName ) throw (css::script::BasicErrorException, css::uno::RuntimeException) { // need test, print current active sheet - PrintOutHelper( From, To, Copies, Preview, ActivePrinter, PrintToFile, Collate, PrToFileName, m_xModel, sal_True ); + PrintOutHelper( excel::getBestViewShell( m_xModel ), From, To, Copies, Preview, ActivePrinter, PrintToFile, Collate, PrToFileName, sal_True ); } void SAL_CALL ScVbaWindow::PrintPreview( const css::uno::Any& EnableChanges ) throw (css::script::BasicErrorException, css::uno::RuntimeException) { // need test, print preview current active sheet - PrintPreviewHelper( EnableChanges, m_xModel ); + PrintPreviewHelper( EnableChanges, excel::getBestViewShell( m_xModel ) ); } rtl::OUString& diff --git a/sc/source/ui/vba/vbawindow.hxx b/sc/source/ui/vba/vbawindow.hxx index b32f3b99398a..968d258961c8 100644 --- a/sc/source/ui/vba/vbawindow.hxx +++ b/sc/source/ui/vba/vbawindow.hxx @@ -39,15 +39,16 @@ #include #include -#include "vbahelperinterface.hxx" +#include +#include #include "vbaworkbook.hxx" -typedef InheritedHelperInterfaceImpl1 WindowImpl_BASE; +//typedef InheritedHelperInterfaceImpl1 WindowImpl_BASE; +typedef cppu::ImplInheritanceHelper1< VbaWindowBase, ov::excel::XWindow > WindowImpl_BASE; class ScVbaWindow : public WindowImpl_BASE { private: - css::uno::Reference< css::frame::XModel > m_xModel; css::uno::Reference< css::sheet::XViewPane > m_xViewPane; css::uno::Reference< css::sheet::XViewFreezable > m_xViewFreezable; css::uno::Reference< css::sheet::XViewSplitable > m_xViewSplitable; @@ -82,10 +83,6 @@ public: virtual void SAL_CALL setDisplayWorkbookTabs( ::sal_Bool _bDisplayWorkbookTabs ) throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL getFreezePanes() throw (css::uno::RuntimeException); virtual void SAL_CALL setFreezePanes( ::sal_Bool _bFreezePanes ) throw (css::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getHeight() throw (css::uno::RuntimeException) ; - virtual void SAL_CALL setHeight( sal_Int32 _height ) throw (css::uno::RuntimeException) ; - virtual sal_Int32 SAL_CALL getLeft() throw (css::uno::RuntimeException) ; - virtual void SAL_CALL setLeft( sal_Int32 _left ) throw (css::uno::RuntimeException) ; virtual ::sal_Bool SAL_CALL getSplit() throw (css::uno::RuntimeException); virtual void SAL_CALL setSplit( ::sal_Bool _bSplit ) throw (css::uno::RuntimeException); virtual sal_Int32 SAL_CALL getSplitColumn() throw (css::uno::RuntimeException) ; @@ -100,14 +97,8 @@ public: virtual void SAL_CALL setScrollRow( const css::uno::Any& _scrollrow ) throw (css::uno::RuntimeException) ; virtual css::uno::Any SAL_CALL getScrollColumn() throw (css::uno::RuntimeException) ; virtual void SAL_CALL setScrollColumn( const css::uno::Any& _scrollcolumn ) throw (css::uno::RuntimeException) ; - virtual sal_Int32 SAL_CALL getTop() throw (css::uno::RuntimeException) ; - virtual void SAL_CALL setTop( sal_Int32 _top ) throw (css::uno::RuntimeException) ; virtual css::uno::Any SAL_CALL getView() throw (css::uno::RuntimeException); virtual void SAL_CALL setView( const css::uno::Any& _view ) throw (css::uno::RuntimeException); - virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException); - virtual void SAL_CALL setVisible( sal_Bool _visible ) throw (css::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getWidth() throw (css::uno::RuntimeException) ; - virtual void SAL_CALL setWidth( sal_Int32 _width ) throw (css::uno::RuntimeException) ; virtual css::uno::Any SAL_CALL getWindowState() throw (css::uno::RuntimeException); virtual void SAL_CALL setWindowState( const css::uno::Any& _windowstate ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getZoom() throw (css::uno::RuntimeException); diff --git a/sc/source/ui/vba/vbawindows.cxx b/sc/source/ui/vba/vbawindows.cxx index b14a31c7c42c..ae16efdebcf4 100644 --- a/sc/source/ui/vba/vbawindows.cxx +++ b/sc/source/ui/vba/vbawindows.cxx @@ -37,6 +37,7 @@ #include #include "vbawindow.hxx" +#include "vbaglobals.hxx" //#include "vbaworkbook.hxx" using namespace ::com::sun::star; @@ -47,15 +48,15 @@ sal_Int32, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > NameIndexHash; -uno::Reference< XHelperInterface > lcl_createWorkbookHIParent( const uno::Reference< frame::XModel >& xModel, const uno::Reference< uno::XComponentContext >& xContext ) +uno::Reference< XHelperInterface > lcl_createWorkbookHIParent( const uno::Reference< frame::XModel >& xModel, const uno::Reference< uno::XComponentContext >& xContext, const uno::Any& aApplication ) { - return new ScVbaWorkbook( uno::Reference< XHelperInterface >( ScVbaGlobals::getGlobalsImpl( xContext )->getApplication(), uno::UNO_QUERY_THROW ), xContext, xModel ); + return new ScVbaWorkbook( uno::Reference< XHelperInterface >( aApplication, uno::UNO_QUERY_THROW ), xContext, xModel ); } -uno::Any ComponentToWindow( const uno::Any& aSource, uno::Reference< uno::XComponentContext > & xContext ) +uno::Any ComponentToWindow( const uno::Any& aSource, uno::Reference< uno::XComponentContext > & xContext, const uno::Any& aApplication ) { uno::Reference< frame::XModel > xModel( aSource, uno::UNO_QUERY_THROW ); - uno::Reference< excel::XWindow > xWin( new ScVbaWindow( lcl_createWorkbookHIParent( xModel, xContext ), xContext,xModel ) ); + uno::Reference< excel::XWindow > xWin( new ScVbaWindow( lcl_createWorkbookHIParent( xModel, xContext, aApplication ), xContext,xModel ) ); return uno::makeAny( xWin ); } @@ -108,12 +109,13 @@ public: class WindowEnumImpl : public WindowComponentEnumImpl { + uno::Any m_aApplication; public: - WindowEnumImpl(const uno::Reference< uno::XComponentContext >& xContext, const Components& components ):WindowComponentEnumImpl( xContext, components ) {} - WindowEnumImpl( const uno::Reference< uno::XComponentContext >& xContext ): WindowComponentEnumImpl( xContext ) {} + WindowEnumImpl(const uno::Reference< uno::XComponentContext >& xContext, const Components& components, const uno::Any& aApplication ):WindowComponentEnumImpl( xContext, components ), m_aApplication( aApplication ){} + WindowEnumImpl( const uno::Reference< uno::XComponentContext >& xContext, const uno::Any& aApplication ): WindowComponentEnumImpl( xContext ), m_aApplication( aApplication ) {} virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) { - return ComponentToWindow( WindowComponentEnumImpl::nextElement(), m_xContext ); + return ComponentToWindow( WindowComponentEnumImpl::nextElement(), m_xContext, m_aApplication ); } }; @@ -212,16 +214,19 @@ ScVbaWindows::ScVbaWindows( const uno::Reference< ov::XHelperInterface >& xParen { } +ScVbaWindows::ScVbaWindows( const uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : ScVbaWindows_BASE( xParent, xContext, uno::Reference< container::XIndexAccess > ( new WindowsAccessImpl( xContext ) ) ) +{ +} uno::Reference< container::XEnumeration > ScVbaWindows::createEnumeration() throw (uno::RuntimeException) { - return new WindowEnumImpl( mxContext ); + return new WindowEnumImpl( mxContext, Application() ); } uno::Any ScVbaWindows::createCollectionObject( const css::uno::Any& aSource ) { - return ComponentToWindow( aSource, mxContext ); + return ComponentToWindow( aSource, mxContext, Application() ); } uno::Type @@ -230,12 +235,6 @@ ScVbaWindows::getElementType() throw (uno::RuntimeException) return excel::XWindows::static_type(0); } -uno::Reference< XCollection > -ScVbaWindows::Windows( const css::uno::Reference< css::uno::XComponentContext >& xContext ) -{ - uno::Reference< container::XIndexAccess > xIndex( new WindowsAccessImpl( xContext ) ); - return new ScVbaWindows( uno::Reference< XHelperInterface >( ScVbaGlobals::getGlobalsImpl( xContext )->getApplication(), uno::UNO_QUERY_THROW ), xContext , xIndex ); -} void SAL_CALL ScVbaWindows::Arrange( ::sal_Int32 /*ArrangeStyle*/, const uno::Any& /*ActiveWorkbook*/, const uno::Any& /*SyncHorizontal*/, const uno::Any& /*SyncVertical*/ ) throw (uno::RuntimeException) diff --git a/sc/source/ui/vba/vbawindows.hxx b/sc/source/ui/vba/vbawindows.hxx index 3c828d4e3355..5aff0094ebf3 100644 --- a/sc/source/ui/vba/vbawindows.hxx +++ b/sc/source/ui/vba/vbawindows.hxx @@ -35,8 +35,8 @@ #include -#include "vbahelper.hxx" -#include "vbacollectionimpl.hxx" +#include "excelvbahelper.hxx" +#include typedef CollTestImplHelper< ov::excel::XWindows > ScVbaWindows_BASE; @@ -45,6 +45,7 @@ class ScVbaWindows : public ScVbaWindows_BASE { public: ScVbaWindows( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess ); + ScVbaWindows( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext ); virtual ~ScVbaWindows() {} // XEnumerationAccess @@ -57,8 +58,6 @@ public: // ScVbaCollectionBaseImpl virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); - static css::uno::Reference< ov::XCollection > Windows( const css::uno::Reference< css::uno::XComponentContext >& xContext ); - // XHelperInterface virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence getServiceNames(); diff --git a/sc/source/ui/vba/vbaworkbook.cxx b/sc/source/ui/vba/vbaworkbook.cxx index c89de4c2a10a..498d77e79a14 100644 --- a/sc/source/ui/vba/vbaworkbook.cxx +++ b/sc/source/ui/vba/vbaworkbook.cxx @@ -27,7 +27,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#include "helperdecl.hxx" +#include #include #include @@ -46,12 +46,13 @@ #include "vbaworkbook.hxx" #include "vbawindows.hxx" #include "vbastyles.hxx" -#include "vbahelper.hxx" +#include "excelvbahelper.hxx" #include "vbapalette.hxx" #include #include #include "vbanames.hxx" // Amelia Wang #include "nameuno.hxx" +#include "docoptio.hxx" // Much of the impl. for the equivalend UNO module is // sc/source/ui/unoobj/docuno.cxx, viewuno.cxx @@ -64,7 +65,7 @@ class ActiveSheet : public ScVbaWorksheet protected: virtual uno::Reference< frame::XModel > getModel() { - return getCurrentDocument(); + return getCurrentExcelDoc( mxContext ); } virtual uno::Reference< sheet::XSpreadsheet > getSheet() { @@ -192,7 +193,7 @@ ScVbaWorkbook::init() if ( !ColorData.getLength() ) ResetColors(); } -ScVbaWorkbook::ScVbaWorkbook( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext) :ScVbaWorkbook_BASE( xParent, xContext ), mxModel(NULL) +ScVbaWorkbook::ScVbaWorkbook( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext) :ScVbaWorkbook_BASE( xParent, xContext ) { //#FIXME this persists the color data per office instance and // not per workbook instance, need to hook the data into XModel @@ -203,58 +204,27 @@ ScVbaWorkbook::ScVbaWorkbook( const css::uno::Reference< ov::XHelperInterface init(); } -ScVbaWorkbook::ScVbaWorkbook( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, css::uno::Reference< css::frame::XModel > xModel ) : ScVbaWorkbook_BASE( xParent, xContext ), mxModel( xModel ) +ScVbaWorkbook::ScVbaWorkbook( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, css::uno::Reference< css::frame::XModel > xModel ) : ScVbaWorkbook_BASE( xParent, xContext, xModel ) { init(); } ScVbaWorkbook::ScVbaWorkbook( uno::Sequence< uno::Any> const & args, - uno::Reference< uno::XComponentContext> const & xContext ) : ScVbaWorkbook_BASE( getXSomethingFromArgs< XHelperInterface >( args, 0 ), xContext ), mxModel( getXSomethingFromArgs< frame::XModel >( args, 1 ) ) + uno::Reference< uno::XComponentContext> const & xContext ) : ScVbaWorkbook_BASE( args, xContext ) { init(); } -::rtl::OUString -ScVbaWorkbook::getName() throw (uno::RuntimeException) -{ - rtl::OUString sName = getModel()->getURL(); - if ( sName.getLength() ) - { - - INetURLObject aURL( getModel()->getURL() ); - ::osl::File::getSystemPathFromFileURL( aURL.GetLastName(), sName ); - } - else - { - const static rtl::OUString sTitle( RTL_CONSTASCII_USTRINGPARAM("Title" ) ); - // process "UntitledX - $(PRODUCTNAME)" - uno::Reference< frame::XFrame > xFrame( getModel()->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW ); - uno::Reference< beans::XPropertySet > xProps( xFrame, uno::UNO_QUERY_THROW ); - xProps->getPropertyValue(sTitle ) >>= sName; - sal_Int32 pos = 0; - sName = sName.getToken(0,' ',pos); - } - return sName; -} -::rtl::OUString -ScVbaWorkbook::getPath() throw (uno::RuntimeException) -{ - INetURLObject aURL( getModel()->getURL() ); - aURL.CutLastName(); - return aURL.GetURLPath(); -} - -::rtl::OUString -ScVbaWorkbook::getFullName() throw (uno::RuntimeException) -{ - INetURLObject aURL( getModel()->getURL() ); - return aURL.GetURLPath(); -} uno::Reference< excel::XWorksheet > ScVbaWorkbook::getActiveSheet() throw (uno::RuntimeException) { - return new ActiveSheet( this, mxContext ); + uno::Reference< frame::XModel > xModel( getCurrentExcelDoc( mxContext ) ); + uno::Reference< sheet::XSpreadsheet > xSheet; + uno::Reference< sheet::XSpreadsheetView > xView( xModel->getCurrentController(), uno::UNO_QUERY_THROW ); + if ( xView.is() ) + xSheet = xView->getActiveSheet(); + return new ScVbaWorksheet( this, mxContext, xSheet, xModel ); } uno::Any SAL_CALL ScVbaWorkbook::Sheets( const uno::Any& aIndex ) throw (uno::RuntimeException) @@ -281,89 +251,17 @@ ScVbaWorkbook::Worksheets( const uno::Any& aIndex ) throw (uno::RuntimeException uno::Any SAL_CALL ScVbaWorkbook::Windows( const uno::Any& aIndex ) throw (uno::RuntimeException) { - uno::Reference< XCollection > xWindows = ScVbaWindows::Windows( mxContext ); + + uno::Reference< excel::XWindows > xWindows( new ScVbaWindows( getParent(), mxContext ) ); if ( aIndex.getValueTypeClass() == uno::TypeClass_VOID ) return uno::Any( xWindows ); return uno::Any( xWindows->Item( aIndex, uno::Any() ) ); } -void -ScVbaWorkbook::Close( const uno::Any &rSaveArg, const uno::Any &rFileArg, - const uno::Any &rRouteArg ) throw (uno::RuntimeException) -{ - sal_Bool bSaveChanges = sal_False; - rtl::OUString aFileName; - sal_Bool bRouteWorkbook = sal_True; - - rSaveArg >>= bSaveChanges; - sal_Bool bFileName = ( rFileArg >>= aFileName ); - rRouteArg >>= bRouteWorkbook; - uno::Reference< frame::XStorable > xStorable( getModel(), uno::UNO_QUERY_THROW ); - uno::Reference< util::XModifiable > xModifiable( getModel(), uno::UNO_QUERY_THROW ); - - if( bSaveChanges ) - { - if( xStorable->isReadonly() ) - { - throw uno::RuntimeException(::rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "Unable to save to a read only file ") ), - uno::Reference< XInterface >() ); - } - if( bFileName ) - xStorable->storeAsURL( aFileName, uno::Sequence< beans::PropertyValue >(0) ); - else - xStorable->store(); - } - else - xModifiable->setModified( false ); - - uno::Reference< util::XCloseable > xCloseable( getModel(), uno::UNO_QUERY ); - - if( xCloseable.is() ) - // use close(boolean DeliverOwnership) - // The boolean parameter DeliverOwnership tells objects vetoing the close process that they may - // assume ownership if they object the closure by throwing a CloseVetoException - // Here we give up ownership. To be on the safe side, catch possible veto exception anyway. - xCloseable->close(sal_True); - // If close is not supported by this model - try to dispose it. - // But if the model disagree with a reset request for the modify state - // we shouldn't do so. Otherwhise some strange things can happen. - else - { - uno::Reference< lang::XComponent > xDisposable ( getCurrentDocument(), uno::UNO_QUERY ); - if ( xDisposable.is() ) - xDisposable->dispose(); - } -} - -void -ScVbaWorkbook::Protect( const uno::Any &aPassword ) throw (uno::RuntimeException) +void SAL_CALL +ScVbaWorkbook::Activate() throw (uno::RuntimeException) { - rtl::OUString rPassword; - uno::Reference< util::XProtectable > xProt( getModel(), uno::UNO_QUERY_THROW ); - SC_VBA_FIXME(("Workbook::Protect stub")); - if( aPassword >>= rPassword ) - xProt->protect( rPassword ); - else - xProt->protect( rtl::OUString() ); -} - -void -ScVbaWorkbook::Unprotect( const uno::Any &aPassword ) throw (uno::RuntimeException) -{ - rtl::OUString rPassword; - uno::Reference< util::XProtectable > xProt( getModel(), uno::UNO_QUERY_THROW ); - if( !getProtectStructure() ) - throw uno::RuntimeException(::rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "File is already unprotected" ) ), - uno::Reference< XInterface >() ); - else - { - if( aPassword >>= rPassword ) - xProt->unprotect( rPassword ); - else - xProt->unprotect( rtl::OUString() ); - } + VbaDocumentBase::Activate(); } ::sal_Bool @@ -373,26 +271,20 @@ ScVbaWorkbook::getProtectStructure() throw (uno::RuntimeException) return xProt->isProtected(); } -void -ScVbaWorkbook::setSaved( sal_Bool bSave ) throw (uno::RuntimeException) +::sal_Bool SAL_CALL ScVbaWorkbook::getPrecisionAsDisplayed() throw (uno::RuntimeException) { - uno::Reference< util::XModifiable > xModifiable( getModel(), uno::UNO_QUERY_THROW ); - xModifiable->setModified( bSave ); -} - -sal_Bool -ScVbaWorkbook::getSaved() throw (uno::RuntimeException) -{ - uno::Reference< util::XModifiable > xModifiable( getModel(), uno::UNO_QUERY_THROW ); - return xModifiable->isModified(); + uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW ); + ScDocument* pDoc = excel::getDocShell( xModel )->GetDocument(); + return pDoc->GetDocOptions().IsCalcAsShown(); } -void -ScVbaWorkbook::Save() throw (uno::RuntimeException) +void SAL_CALL ScVbaWorkbook::setPrecisionAsDisplayed( sal_Bool _precisionAsDisplayed ) throw (uno::RuntimeException) { - rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".uno:Save")); - uno::Reference< frame::XModel > xModel = getModel(); - dispatchRequests(xModel,url); + uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW ); + ScDocument* pDoc = excel::getDocShell( xModel )->GetDocument(); + ScDocOptions aOpt = pDoc->GetDocOptions(); + aOpt.SetCalcAsShown( _precisionAsDisplayed ); + pDoc->SetDocOptions( aOpt ); } void @@ -407,13 +299,6 @@ ScVbaWorkbook::SaveCopyAs( const rtl::OUString& sFileName ) throw ( uno::Runtime xStor->storeToURL( aURL, storeProps ); } -void -ScVbaWorkbook::Activate() throw (uno::RuntimeException) -{ - uno::Reference< frame::XFrame > xFrame( getModel()->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW ); - xFrame->activate(); -} - css::uno::Any SAL_CALL ScVbaWorkbook::Styles( const::uno::Any& Item ) throw (uno::RuntimeException) { @@ -465,7 +350,7 @@ ScVbaWorkbook::getCodeName() throw (css::uno::RuntimeException) { #ifdef VBA_OOBUILD_HACK uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW ); - ScDocument* pDoc = getDocShell( xModel )->GetDocument(); + ScDocument* pDoc = excel::getDocShell( xModel )->GetDocument(); ScExtDocOptions* pExtOptions = pDoc->GetExtDocOptions(); ScExtDocSettings pExtSettings = pExtOptions->GetDocSettings(); ::rtl::OUString sGlobCodeName = pExtSettings.maGlobCodeName; @@ -479,7 +364,7 @@ void SAL_CALL ScVbaWorkbook::setCodeName( const ::rtl::OUString& sGlobCodeName ) throw (css::uno::RuntimeException) { uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW ); - ScDocument* pDoc = getDocShell( xModel )->GetDocument(); + ScDocument* pDoc = excel::getDocShell( xModel )->GetDocument(); ScExtDocOptions* pExtOptions = pDoc->GetExtDocOptions(); ScExtDocSettings pExtSettings = pExtOptions->GetDocSettings(); pExtSettings.maGlobCodeName = sGlobCodeName; diff --git a/sc/source/ui/vba/vbaworkbook.hxx b/sc/source/ui/vba/vbaworkbook.hxx index 67d14dac148c..cf221fd934a0 100644 --- a/sc/source/ui/vba/vbaworkbook.hxx +++ b/sc/source/ui/vba/vbaworkbook.hxx @@ -32,21 +32,20 @@ #include #include -#include "vbahelperinterface.hxx" +#include +#include class ScModelObj; -typedef InheritedHelperInterfaceImpl1< ov::excel::XWorkbook > ScVbaWorkbook_BASE; +typedef cppu::ImplInheritanceHelper1< VbaDocumentBase, ov::excel::XWorkbook > ScVbaWorkbook_BASE; class ScVbaWorkbook : public ScVbaWorkbook_BASE { - css::uno::Reference< css::frame::XModel > mxModel; static css::uno::Sequence< sal_Int32 > ColorData; void initColorData( const css::uno::Sequence< sal_Int32 >& sColors ); void init(); protected: - virtual css::uno::Reference< css::frame::XModel > getModel() { return mxModel; } ScVbaWorkbook( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext); public: ScVbaWorkbook( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, @@ -55,24 +54,15 @@ public: virtual ~ScVbaWorkbook() {} // Attributes - virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getPath() throw (css::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getFullName() throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL getProtectStructure() throw (css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL getActiveSheet() throw (css::uno::RuntimeException); - virtual sal_Bool SAL_CALL getSaved() throw (css::uno::RuntimeException); - virtual void SAL_CALL setSaved( sal_Bool bSave ) throw (css::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL getPrecisionAsDisplayed() throw (css::uno::RuntimeException); + virtual void SAL_CALL setPrecisionAsDisplayed( sal_Bool _precisionAsDisplayed ) throw (css::uno::RuntimeException); // Methods virtual css::uno::Any SAL_CALL Worksheets( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Sheets( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Windows( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); - virtual void SAL_CALL Close( const css::uno::Any &bSaveChanges, - const css::uno::Any &aFileName, - const css::uno::Any &bRouteWorkbook ) throw (css::uno::RuntimeException); - virtual void SAL_CALL Protect( const css::uno::Any & aPassword ) throw (css::uno::RuntimeException); - virtual void SAL_CALL Unprotect( const css::uno::Any &aPassword ) throw (css::uno::RuntimeException); - virtual void SAL_CALL Save() throw (css::uno::RuntimeException); virtual void SAL_CALL Activate() throw (css::uno::RuntimeException); // Amelia Wang virtual css::uno::Any SAL_CALL Names( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); diff --git a/sc/source/ui/vba/vbaworkbooks.cxx b/sc/source/ui/vba/vbaworkbooks.cxx index 40c8370f4aec..1686144b4841 100644 --- a/sc/source/ui/vba/vbaworkbooks.cxx +++ b/sc/source/ui/vba/vbaworkbooks.cxx @@ -56,7 +56,7 @@ #include "vbaglobals.hxx" #include "vbaworkbook.hxx" #include "vbaworkbooks.hxx" -#include "vbahelper.hxx" +#include #include #include @@ -65,180 +65,33 @@ using namespace ::com::sun::star; const sal_Int16 CUSTOM_CHAR = 5; -typedef std::hash_map< rtl::OUString, -sal_Int32, ::rtl::OUStringHash, -::std::equal_to< ::rtl::OUString > > NameIndexHash; - -typedef std::vector < uno::Reference< sheet::XSpreadsheetDocument > > WorkBooks; - -typedef ::cppu::WeakImplHelper1< container::XEnumeration > SpreadSheetDocEnumImpl_BASE; - static uno::Any -getWorkbook( uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< sheet::XSpreadsheetDocument > &xDoc ) +getWorkbook( uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< sheet::XSpreadsheetDocument > &xDoc, const uno::Any& aApplication ) { // FIXME: fine as long as ScVbaWorkbook is stateless ... uno::Reference< frame::XModel > xModel( xDoc, uno::UNO_QUERY ); if( !xModel.is() ) return uno::Any(); - ScVbaWorkbook *pWb = new ScVbaWorkbook( uno::Reference< XHelperInterface >( ScVbaGlobals::getGlobalsImpl( xContext )->getApplication(), uno::UNO_QUERY_THROW ), xContext, xModel ); + ScVbaWorkbook *pWb = new ScVbaWorkbook( uno::Reference< XHelperInterface >( aApplication, uno::UNO_QUERY_THROW ), xContext, xModel ); return uno::Any( uno::Reference< excel::XWorkbook > (pWb) ); } - -// #FIXME clearly this is a candidate for some sort of helper base class as -// this is a copy of SelectedSheetsEnum ( vbawindow.cxx ) - -class SpreadSheetDocEnumImpl : public SpreadSheetDocEnumImpl_BASE -{ - uno::Reference< uno::XComponentContext > m_xContext; - WorkBooks m_books; - WorkBooks::const_iterator m_it; - -public: - SpreadSheetDocEnumImpl( const uno::Reference< uno::XComponentContext >& xContext, const WorkBooks& books ) throw ( uno::RuntimeException ) : m_xContext( xContext ), m_books( books ) - { - m_it = m_books.begin(); - } - SpreadSheetDocEnumImpl( const uno::Reference< uno::XComponentContext >& xContext ) throw ( uno::RuntimeException ) : m_xContext( xContext ) - { - uno::Reference< lang::XMultiComponentFactory > xSMgr( - m_xContext->getServiceManager(), uno::UNO_QUERY_THROW ); - - uno::Reference< frame::XDesktop > xDesktop - (xSMgr->createInstanceWithContext(::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop"), m_xContext), uno::UNO_QUERY_THROW ); - uno::Reference< container::XEnumeration > mxComponents = xDesktop->getComponents()->createEnumeration(); - while( mxComponents->hasMoreElements() ) - { - uno::Reference< sheet::XSpreadsheetDocument > xNext( mxComponents->nextElement(), uno::UNO_QUERY ); - if ( xNext.is() ) - m_books.push_back( xNext ); - } - m_it = m_books.begin(); - } - // XEnumeration - virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException) - { - return m_it != m_books.end(); - } - - virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) - { - if ( !hasMoreElements() ) - { - throw container::NoSuchElementException(); - } - return makeAny( *(m_it++) ); - } -}; - class WorkBookEnumImpl : public EnumerationHelperImpl { + uno::Any m_aApplication; public: - WorkBookEnumImpl( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XEnumeration >& xEnumeration ) throw ( uno::RuntimeException ) : EnumerationHelperImpl( xContext, xEnumeration ){} + WorkBookEnumImpl( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XEnumeration >& xEnumeration, const uno::Any& aApplication ) throw ( uno::RuntimeException ) : EnumerationHelperImpl( xContext, xEnumeration ), m_aApplication( aApplication ) {} virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) { uno::Reference< sheet::XSpreadsheetDocument > xDoc( m_xEnumeration->nextElement(), uno::UNO_QUERY_THROW ); - return getWorkbook( m_xContext, xDoc ); - } - -}; - -// #FIXME clearly this is also a candidate for some sort of helper base class as -// a very similar one is used in vbawindow ( SelectedSheetsEnumAccess ) -// Maybe a template base class that does all of the operations on the hashmap -// and vector only, and the sub-class does everything else -// => ctor, createEnumeration & factory method need be defined ( to be called -// by getByIndex, getByName ) -typedef ::cppu::WeakImplHelper3< container::XEnumerationAccess - , com::sun::star::container::XIndexAccess - , com::sun::star::container::XNameAccess - > WorkBooksAccessImpl_BASE; - -class WorkBooksAccessImpl : public WorkBooksAccessImpl_BASE -{ - uno::Reference< uno::XComponentContext > m_xContext; - WorkBooks m_books; - NameIndexHash namesToIndices; -public: - WorkBooksAccessImpl( const uno::Reference< uno::XComponentContext >& xContext ):m_xContext( xContext ) - { - uno::Reference< container::XEnumeration > xEnum = new SpreadSheetDocEnumImpl( m_xContext ); - sal_Int32 nIndex=0; - while( xEnum->hasMoreElements() ) - { - uno::Reference< sheet::XSpreadsheetDocument > xNext( xEnum->nextElement(), uno::UNO_QUERY ); - if ( xNext.is() ) - { - m_books.push_back( xNext ); - uno::Reference< frame::XModel > xModel( xNext, uno::UNO_QUERY_THROW ); // that the spreadsheetdocument is a xmodel is a given - INetURLObject aURL( xModel->getURL() ); - namesToIndices[ aURL.GetLastName() ] = nIndex++; - } - } - - } - - //XEnumerationAccess - virtual uno::Reference< container::XEnumeration > SAL_CALL createEnumeration( ) throw (uno::RuntimeException) - { - return new SpreadSheetDocEnumImpl( m_xContext, m_books ); - } - // XIndexAccess - virtual ::sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException) - { - return m_books.size(); - } - virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw ( lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException) - { - if ( Index < 0 - || static_cast< WorkBooks::size_type >(Index) >= m_books.size() ) - throw lang::IndexOutOfBoundsException(); - return makeAny( m_books[ Index ] ); // returns xspreadsheetdoc - } - - //XElementAccess - virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException) - { - return sheet::XSpreadsheetDocument::static_type(0); - } - - virtual ::sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException) - { - return (m_books.size() > 0); - } - - //XNameAccess - virtual uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) - { - NameIndexHash::const_iterator it = namesToIndices.find( aName ); - if ( it == namesToIndices.end() ) - throw container::NoSuchElementException(); - return makeAny( m_books[ it->second ] ); - - } - - virtual uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw (uno::RuntimeException) - { - uno::Sequence< ::rtl::OUString > names( namesToIndices.size() ); - ::rtl::OUString* pString = names.getArray(); - NameIndexHash::const_iterator it = namesToIndices.begin(); - NameIndexHash::const_iterator it_end = namesToIndices.end(); - for ( ; it != it_end; ++it, ++pString ) - *pString = it->first; - return names; - } - - virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (uno::RuntimeException) - { - NameIndexHash::const_iterator it = namesToIndices.find( aName ); - return (it != namesToIndices.end()); + return getWorkbook( m_xContext, xDoc, m_aApplication ); } }; -ScVbaWorkbooks::ScVbaWorkbooks( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< css::uno::XComponentContext >& xContext ) : ScVbaWorkbooks_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( new WorkBooksAccessImpl( xContext ) ) ) +ScVbaWorkbooks::ScVbaWorkbooks( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< css::uno::XComponentContext >& xContext ) : ScVbaWorkbooks_BASE( xParent, xContext, VbaDocumentsBase::EXCEL_DOCUMENT ) { } // XEnumerationAccess @@ -254,46 +107,32 @@ ScVbaWorkbooks::createEnumeration() throw (uno::RuntimeException) // the state of this object ( although it should ) would be // safer to create an enumeration based on this objects state // rather than one effectively based of the desktop component - return new WorkBookEnumImpl( mxContext, uno::Reference< container::XEnumeration >( new SpreadSheetDocEnumImpl(mxContext) ) ); + uno::Reference< container::XEnumerationAccess > xEnumerationAccess( m_xIndexAccess, uno::UNO_QUERY_THROW ); + return new WorkBookEnumImpl( mxContext, xEnumerationAccess->createEnumeration(), Application() ); } uno::Any ScVbaWorkbooks::createCollectionObject( const css::uno::Any& aSource ) { - uno::Reference< sheet::XSpreadsheetDocument > xDoc( aSource, uno::UNO_QUERY ); - return getWorkbook( mxContext, xDoc ); + uno::Reference< sheet::XSpreadsheetDocument > xDoc( aSource, uno::UNO_QUERY_THROW ); + return getWorkbook( mxContext, xDoc, Application() ); } uno::Any SAL_CALL ScVbaWorkbooks::Add() throw (uno::RuntimeException) { - uno::Reference< lang::XMultiComponentFactory > xSMgr( - mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); - - uno::Reference< frame::XComponentLoader > xLoader( - xSMgr->createInstanceWithContext( - ::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop"), - mxContext), uno::UNO_QUERY_THROW ); - uno::Reference< lang::XComponent > xComponent = xLoader->loadComponentFromURL( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("private:factory/scalc") ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("_blank") ), 0, - uno::Sequence< beans::PropertyValue >(0) ); - uno::Reference xSpreadDoc( xComponent, uno::UNO_QUERY_THROW ); + uno::Reference xSpreadDoc( VbaDocumentsBase::Add() , uno::UNO_QUERY_THROW ); if( xSpreadDoc.is() ) - return getWorkbook( mxContext, xSpreadDoc ); + return getWorkbook( mxContext, xSpreadDoc, Application() ); return uno::Any(); } void ScVbaWorkbooks::Close() throw (uno::RuntimeException) { - uno::Reference< lang::XMultiComponentFactory > xSMgr( - mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); - rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CloseDoc")); - dispatchRequests(xModel,url); + VbaDocumentsBase::Close(); } bool @@ -337,24 +176,15 @@ uno::Any ScVbaWorkbooks::Open( const rtl::OUString& rFileName, const uno::Any& /*UpdateLinks*/, const uno::Any& ReadOnly, const uno::Any& Format, const uno::Any& /*Password*/, const uno::Any& /*WriteResPassword*/, const uno::Any& /*IgnoreReadOnlyRecommended*/, const uno::Any& /*Origin*/, const uno::Any& Delimiter, const uno::Any& /*Editable*/, const uno::Any& /*Notify*/, const uno::Any& /*Converter*/, const uno::Any& /*AddToMru*/ ) throw (uno::RuntimeException) { // we need to detect if this is a URL, if not then assume its a file path - rtl::OUString aURL; - INetURLObject aObj; + rtl::OUString aURL; + INetURLObject aObj; aObj.SetURL( rFileName ); bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID; if ( bIsURL ) aURL = rFileName; else osl::FileBase::getFileURLFromSystemPath( rFileName, aURL ); - uno::Reference< lang::XMultiComponentFactory > xSMgr( - mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); - uno::Reference< frame::XDesktop > xDesktop - (xSMgr->createInstanceWithContext(::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop") , mxContext), - uno::UNO_QUERY_THROW ); - uno::Reference< frame::XComponentLoader > xLoader( - xSMgr->createInstanceWithContext( - ::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop"), - mxContext), - uno::UNO_QUERY_THROW ); + uno::Sequence< beans::PropertyValue > sProps(0); sal_Int32 nIndex = 0; @@ -421,24 +251,8 @@ ScVbaWorkbooks::Open( const rtl::OUString& rFileName, const uno::Any& /*UpdateLi else if ( !isSpreadSheetFile( sType ) ) throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Bad Format")), uno::Reference< uno::XInterface >() ); - if ( ReadOnly.hasValue() ) - { - sal_Bool bIsReadOnly = sal_False; ReadOnly >>= bIsReadOnly; - if ( bIsReadOnly ) - { - static const rtl::OUString sReadOnly( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ); - sProps.realloc( sProps.getLength() + 1 ); - sProps[ nIndex ].Name = sReadOnly; - sProps[ nIndex++ ].Value = uno::makeAny( (sal_Bool)sal_True ); - } - } - - uno::Reference< lang::XComponent > xComponent = xLoader->loadComponentFromURL( aURL, - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("_default") ), - frame::FrameSearchFlag::CREATE, - sProps); - uno::Reference xSpreadDoc( xComponent, uno::UNO_QUERY_THROW ); - uno::Any aRet = getWorkbook( mxContext, xSpreadDoc ); + uno::Reference xSpreadDoc( VbaDocumentsBase::Open( rFileName, ReadOnly, sProps ), uno::UNO_QUERY_THROW ); + uno::Any aRet = getWorkbook( mxContext, xSpreadDoc, Application() ); uno::Reference< excel::XWorkbook > xWBook( aRet, uno::UNO_QUERY ); if ( xWBook.is() ) xWBook->Activate(); diff --git a/sc/source/ui/vba/vbaworkbooks.hxx b/sc/source/ui/vba/vbaworkbooks.hxx index cf766b04e688..9bca55f77999 100644 --- a/sc/source/ui/vba/vbaworkbooks.hxx +++ b/sc/source/ui/vba/vbaworkbooks.hxx @@ -31,21 +31,20 @@ #define SC_VBA_WORKBOOKS_HXX -#include "vbacollectionimpl.hxx" -#include +#include #include #include -#include "vbahelper.hxx" +#include +#include "excelvbahelper.hxx" class ScModelObj; -typedef CollTestImplHelper< ov::excel::XWorkbooks > ScVbaWorkbooks_BASE; +typedef cppu::ImplInheritanceHelper1< VbaDocumentsBase, ov::excel::XWorkbooks > ScVbaWorkbooks_BASE; class ScVbaWorkbooks : public ScVbaWorkbooks_BASE { private: - css::uno::Reference< ov::XGlobals > getGlobals() throw (css::uno::RuntimeException); rtl::OUString getFileFilterType( const rtl::OUString& rString ); bool isTextFile( const rtl::OUString& rString ); bool isSpreadSheetFile( const rtl::OUString& rString ); diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx index cd75ebd9af40..c382ffeb8afe 100644 --- a/sc/source/ui/vba/vbaworksheet.cxx +++ b/sc/source/ui/vba/vbaworksheet.cxx @@ -27,11 +27,12 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#include "helperdecl.hxx" +#include #include #include #include +#include #include #include #include @@ -58,6 +59,8 @@ #include #include #include +#include +#include #include @@ -82,10 +85,9 @@ #include "vbaworksheet.hxx" #include "vbachartobjects.hxx" #include "vbapivottables.hxx" -#include "vbacombobox.hxx" #include "vbaoleobject.hxx" #include "vbaoleobjects.hxx" -#include "vbashapes.hxx" +#include #include "vbapagesetup.hxx" #include "vbapagebreaks.hxx" @@ -94,7 +96,7 @@ #define DOESNOTEXIST -1 using namespace com::sun::star; using namespace ooo::vba; -static bool +bool nameExists( uno::Reference & xSpreadDoc, ::rtl::OUString & name, SCTAB& nTab ) throw ( lang::IllegalArgumentException ) { if (!xSpreadDoc.is()) @@ -257,6 +259,83 @@ ScVbaWorksheet::getIndex() throw (uno::RuntimeException) return getSheetID() + 1; } +sal_Int32 +ScVbaWorksheet::getEnableSelection() throw (uno::RuntimeException) +{ + uno::Reference xSpreadDoc( getModel(), uno::UNO_QUERY_THROW ); + SCTAB nTab = 0; + rtl::OUString aSheetName = getName(); + bool bSheetExists = nameExists (xSpreadDoc, aSheetName, nTab); + if ( bSheetExists ) + { + uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW ); + ScDocument* pDoc = excel::getDocShell( xModel )->GetDocument(); + ScTableProtection* pProtect = pDoc->GetTabProtection(nTab); + sal_Bool bLockedCells = sal_False; + sal_Bool bUnlockedCells = sal_False; + if( pProtect ) + { + bLockedCells = pProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS); + bUnlockedCells = pProtect->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS); + } + if( bLockedCells ) + return excel::XlEnableSelection::xlNoRestrictions; + if( bUnlockedCells ) + return excel::XlEnableSelection::xlUnlockedCells; + return excel::XlEnableSelection::xlNoSelection; + } + else + throw uno::RuntimeException(::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "Sheet Name does not exist. ") ), + uno::Reference< XInterface >() ); + return excel::XlEnableSelection::xlNoSelection; +} + + +void +ScVbaWorksheet::setEnableSelection( sal_Int32 nSelection ) throw (uno::RuntimeException) +{ + if( (nSelection != excel::XlEnableSelection::xlNoRestrictions) && + (nSelection != excel::XlEnableSelection::xlUnlockedCells) && + (nSelection != excel::XlEnableSelection::xlNoSelection) ) + { + DebugHelper::exception(SbERR_BAD_PARAMETER, rtl::OUString() ); + } + + uno::Reference xSpreadDoc( getModel(), uno::UNO_QUERY_THROW ); + SCTAB nTab = 0; + rtl::OUString aSheetName = getName(); + bool bSheetExists = nameExists (xSpreadDoc, aSheetName, nTab); + if ( bSheetExists ) + { + uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW ); + ScDocument* pDoc = excel::getDocShell( xModel )->GetDocument(); + ScTableProtection* pProtect = pDoc->GetTabProtection(nTab); + // default is xlNoSelection + sal_Bool bLockedCells = sal_False; + sal_Bool bUnlockedCells = sal_False; + if( nSelection == excel::XlEnableSelection::xlNoRestrictions ) + { + bLockedCells = sal_True; + bUnlockedCells = sal_True; + } + else if( nSelection == excel::XlEnableSelection::xlUnlockedCells ) + { + bUnlockedCells = sal_True; + } + if( pProtect ) + { + pProtect->setOption( ScTableProtection::SELECT_LOCKED_CELLS, bLockedCells ); + pProtect->setOption( ScTableProtection::SELECT_UNLOCKED_CELLS, bUnlockedCells ); + } + } + else + throw uno::RuntimeException(::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "Sheet Name does not exist. ") ), + uno::Reference< XInterface >() ); + +} + uno::Reference< excel::XRange > ScVbaWorksheet::getUsedRange() throw (uno::RuntimeException) { @@ -292,6 +371,16 @@ ScVbaWorksheet::HPageBreaks( const uno::Any& aIndex ) throw (uno::RuntimeExcepti return uno::makeAny( xHPageBreaks ); } +uno::Any +ScVbaWorksheet::VPageBreaks( const uno::Any& aIndex ) throw ( uno::RuntimeException ) +{ + uno::Reference< sheet::XSheetPageBreak > xSheetPageBreak( getSheet(), uno::UNO_QUERY_THROW ); + uno::Reference< excel::XVPageBreaks > xVPageBreaks( new ScVbaVPageBreaks( this, mxContext, xSheetPageBreak ) ); + if( aIndex.hasValue() ) + return xVPageBreaks->Item( aIndex, uno::Any()); + return uno::makeAny( xVPageBreaks ); +} + sal_Int32 ScVbaWorksheet::getStandardWidth() throw (uno::RuntimeException) { @@ -353,11 +442,11 @@ ScVbaWorksheet::Move( const uno::Any& Before, const uno::Any& After ) throw (uno uno::Reference xRange = new ScVbaRange( this, mxContext, xRange1); if (xRange.is()) xRange->Select(); - implnCopy(); + excel::implnCopy(mxModel); uno::Reference xModel = openNewDoc(aCurrSheetName); if (xModel.is()) { - implnPaste(); + excel::implnPaste(xModel); Delete(); } return ; @@ -391,11 +480,11 @@ ScVbaWorksheet::Copy( const uno::Any& Before, const uno::Any& After ) throw (uno uno::Reference xRange = new ScVbaRange( this, mxContext, xRange1); if (xRange.is()) xRange->Select(); - implnCopy(); + excel::implnCopy(mxModel); uno::Reference xModel = openNewDoc(aCurrSheetName); if (xModel.is()) { - implnPaste(); + excel::implnPaste(xModel); } return; } @@ -424,7 +513,7 @@ ScVbaWorksheet::Paste( const uno::Any& Destination, const uno::Any& /*Link*/ ) t uno::Reference xRange( Destination, uno::UNO_QUERY ); if ( xRange.is() ) xRange->Select(); - implnPaste(); + excel::implnPaste( mxModel ); } void @@ -624,7 +713,7 @@ ScVbaWorksheet::Shapes( const uno::Any& aIndex ) throw (uno::RuntimeException) uno::Reference< drawing::XShapes > xShapes( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW ); uno::Reference< container::XIndexAccess > xIndexAccess( xShapes, uno::UNO_QUERY_THROW ); - uno::Reference< msforms::XShapes> xVbaShapes( new ScVbaShapes( this, mxContext, xIndexAccess ) ); + uno::Reference< msforms::XShapes> xVbaShapes( new ScVbaShapes( this, mxContext, xIndexAccess, getModel() ) ); if ( aIndex.hasValue() ) return xVbaShapes->Item( aIndex, uno::Any() ); return uno::makeAny( xVbaShapes ); @@ -635,7 +724,7 @@ ScVbaWorksheet::ShowDataForm( ) throw (uno::RuntimeException) { #ifdef VBA_OOBUILD_HACK uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW ); - ScTabViewShell* pTabViewShell = getBestViewShell( xModel ); + ScTabViewShell* pTabViewShell = excel::getBestViewShell( xModel ); ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001 @@ -676,16 +765,18 @@ ScVbaWorksheet::invoke( const ::rtl::OUString& aFunctionName, const uno::Sequenc } void SAL_CALL -ScVbaWorksheet::setValue( const ::rtl::OUString& /*aPropertyName*/, const uno::Any& /*aValue*/ ) throw (beans::UnknownPropertyException, script::CannotConvertException, reflection::InvocationTargetException, uno::RuntimeException) +ScVbaWorksheet::setValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, script::CannotConvertException, reflection::InvocationTargetException, uno::RuntimeException) { - throw uno::RuntimeException(); // unsupported operation + setDefaultPropByIntrospection( uno::makeAny( getValue( aPropertyName ) ), aValue ); } uno::Any SAL_CALL ScVbaWorksheet::getValue( const ::rtl::OUString& aPropertyName ) throw (beans::UnknownPropertyException, uno::RuntimeException) { uno::Reference< drawing::XControlShape > xControlShape( getControlShape( aPropertyName ), uno::UNO_QUERY_THROW ); - ScVbaControlFactory controlFactory( mxContext, xControlShape, getModel() ); - uno::Reference< msforms::XControl > xControl( controlFactory.createControl( getModel() ) ); + + uno::Reference xServiceManager( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); + uno::Reference< XControlProvider > xControlProvider( xServiceManager->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.ControlProvider" ) ), mxContext ), uno::UNO_QUERY_THROW ); + uno::Reference< msforms::XControl > xControl( xControlProvider->createControl( xControlShape, getModel() ) ); return uno::makeAny( xControl ); } @@ -869,10 +960,9 @@ ScVbaWorksheet::PrintOut( const uno::Any& From, const uno::Any& To, const uno::A bSelection = sal_True; uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW ); - PrintOutHelper( From, To, Copies, Preview, ActivePrinter, PrintToFile, Collate, PrToFileName, xModel, bSelection ); + PrintOutHelper( excel::getBestViewShell( xModel ), From, To, Copies, Preview, ActivePrinter, PrintToFile, Collate, PrToFileName, bSelection ); } - namespace worksheet { namespace sdecl = comphelper::service_decl; diff --git a/sc/source/ui/vba/vbaworksheet.hxx b/sc/source/ui/vba/vbaworksheet.hxx index 8fdee639c7c1..da88e1c4b06f 100644 --- a/sc/source/ui/vba/vbaworksheet.hxx +++ b/sc/source/ui/vba/vbaworksheet.hxx @@ -44,9 +44,11 @@ #include #include #include +#include #include -#include "vbahelperinterface.hxx" +#include +#include "address.hxx" typedef InheritedHelperInterfaceImpl1< ov::excel::XWorksheet > WorksheetImpl_BASE; @@ -93,9 +95,12 @@ public: virtual css::uno::Reference< ov::excel::XOutline > SAL_CALL Outline( ) throw (css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XPageSetup > SAL_CALL PageSetup( ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL HPageBreaks( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL VPageBreaks( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL getNext() throw (css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL getPrevious() throw (css::uno::RuntimeException); virtual sal_Int16 SAL_CALL getIndex() throw (css::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getEnableSelection() throw (css::uno::RuntimeException); + virtual void SAL_CALL setEnableSelection( sal_Int32 nSelection ) throw (css::uno::RuntimeException); // Methods virtual void SAL_CALL Activate() throw (css::uno::RuntimeException); diff --git a/sc/source/ui/vba/vbaworksheets.cxx b/sc/source/ui/vba/vbaworksheets.cxx index 546eda854056..4f0607e430f6 100644 --- a/sc/source/ui/vba/vbaworksheets.cxx +++ b/sc/source/ui/vba/vbaworksheets.cxx @@ -209,16 +209,29 @@ ScVbaWorksheets::Add( const uno::Any& Before, const uno::Any& After, Count >>= nNewSheets; Type >>= nType; SCTAB nCount = 0; - Before >>= aStringSheet; - if (!aStringSheet.getLength()) + + uno::Reference< excel::XWorksheet > xBeforeAfterSheet; + + if ( Before.hasValue() ) { - After >>= aStringSheet; + if ( Before >>= xBeforeAfterSheet ) + aStringSheet = xBeforeAfterSheet->getName(); + else + Before >>= aStringSheet; + } + + if (!aStringSheet.getLength() && After.hasValue() ) + { + if ( After >>= xBeforeAfterSheet ) + aStringSheet = xBeforeAfterSheet->getName(); + else + After >>= aStringSheet; bBefore = sal_False; } if (!aStringSheet.getLength()) { - aStringSheet = ScVbaGlobals::getGlobalsImpl( - mxContext )->getApplication()->getActiveWorkbook()->getActiveSheet()->getName(); + uno::Reference< excel::XApplication > xApplication( Application(), uno::UNO_QUERY_THROW ); + aStringSheet = xApplication->getActiveWorkbook()->getActiveSheet()->getName(); bBefore = sal_True; } nCount = static_cast< SCTAB >( m_xIndexAccess->getCount() ); @@ -252,7 +265,9 @@ ScVbaWorksheets::Add( const uno::Any& Before, const uno::Any& After, m_xSheets->insertNewByName(aStringName, nSheetIndex + i); result = getItemByStringIndex( aStringName ); } - + uno::Reference< excel::XWorksheet > xNewSheet( result, uno::UNO_QUERY ); + if ( xNewSheet.is() ) + xNewSheet->Activate(); return result; } @@ -295,7 +310,7 @@ ScVbaWorksheets::PrintOut( const uno::Any& From, const uno::Any& To, const uno:: if ( isSelectedSheets() ) bSelection = sal_True; - PrintOutHelper( From, To, Copies, Preview, ActivePrinter, PrintToFile, Collate, PrToFileName, mxModel, bSelection ); + PrintOutHelper( excel::getBestViewShell( mxModel ), From, To, Copies, Preview, ActivePrinter, PrintToFile, Collate, PrToFileName, bSelection ); } uno::Any SAL_CALL @@ -336,7 +351,7 @@ ScVbaWorksheets::setVisible( const uno::Any& _visible ) throw (uno::RuntimeExcep void SAL_CALL ScVbaWorksheets::Select( const uno::Any& Replace ) throw (uno::RuntimeException) { - ScTabViewShell* pViewShell = getBestViewShell( mxModel ); + ScTabViewShell* pViewShell = excel::getBestViewShell( mxModel ); if ( !pViewShell ) throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cannot obtain view shell" ) ), uno::Reference< uno::XInterface >() ); diff --git a/sc/source/ui/vba/vbaworksheets.hxx b/sc/source/ui/vba/vbaworksheets.hxx index 0cb2a4f33971..e816e8ecf212 100644 --- a/sc/source/ui/vba/vbaworksheets.hxx +++ b/sc/source/ui/vba/vbaworksheets.hxx @@ -36,9 +36,8 @@ #include #include #include -#include -#include "vbacollectionimpl.hxx" +#include class ScModelObj; diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index c3848b76b92b..c3c096a6a666 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -597,68 +597,105 @@ void ScViewData::SetViewShell( ScTabViewShell* pViewSh ) pView = NULL; } } +void ScViewData::CreateTabData( std::vector< SCTAB >& rvTabs ) +{ + std::vector< SCTAB >::iterator it_end = rvTabs.end(); + for ( std::vector< SCTAB >::iterator it = rvTabs.begin(); it != it_end; ++it ) + if ( !pTabData[*it] ) + CreateTabData( *it ); +} -void ScViewData::SetZoomType( SvxZoomType eNew, BOOL bAll ) +void ScViewData::SetZoomType( SvxZoomType eNew, std::vector< SCTAB >& tabs ) { - if ( !bAll ) - CreateSelectedTabData(); // if zoom is set for a table, it must be stored + BOOL bAll = ( tabs.size() == 0 ); - for ( SCTAB i = 0; i <= MAXTAB; i++ ) - if ( pTabData[i] && ( bAll || aMarkData.GetTableSelect(i) ) ) + if ( !bAll ) // create associated table data + CreateTabData( tabs ); + + std::vector< SCTAB >::iterator it_end = tabs.end(); + std::vector< SCTAB >::iterator it = tabs.begin(); + for ( SCTAB i = ( bAll ? 0 : *it ); ( bAll ? i <= MAXTAB : it != it_end ); ++i , ++it ) + { + if ( pTabData[i] ) pTabData[i]->eZoomType = eNew; + } if ( bAll ) eDefZoomType = eNew; } -void ScViewData::SetZoom( const Fraction& rNewX, const Fraction& rNewY, BOOL bAll ) +void ScViewData::SetZoomType( SvxZoomType eNew, BOOL bAll ) { - if ( !bAll ) - CreateSelectedTabData(); // if zoom is set for a table, it must be stored + std::vector< SCTAB > vTabs; // Empty for all tabs + if ( !bAll ) // get selected tabs + { + SCTAB nTabCount = pDoc->GetTableCount(); + for (SCTAB i=0; i& tabs ) +{ + BOOL bAll = ( tabs.size() == 0 ); + if ( !bAll ) // create associated table data + CreateTabData( tabs ); Fraction aFrac20( 1,5 ); Fraction aFrac400( 4,1 ); Fraction aValidX = rNewX; - if (aValidXaFrac400) aValidX = aFrac400; + if (aValidXaFrac400) + aValidX = aFrac400; Fraction aValidY = rNewY; - if (aValidYaFrac400) aValidY = aFrac400; + if (aValidYaFrac400) + aValidY = aFrac400; - if ( bPagebreak ) + std::vector< SCTAB >::iterator it_end = tabs.end(); + std::vector< SCTAB >::iterator it = tabs.begin(); + + for ( SCTAB i = ( bAll ? 0 : *it ); ( bAll ? i <= MAXTAB : it != it_end ); ++i , ++it ) { - for ( SCTAB i = 0; i <= MAXTAB; i++ ) - if ( pTabData[i] && ( bAll || aMarkData.GetTableSelect(i) ) ) + if ( pTabData[i] ) + { + if ( bPagebreak ) { pTabData[i]->aPageZoomX = aValidX; pTabData[i]->aPageZoomY = aValidY; } - if ( bAll ) - { - aDefPageZoomX = aValidX; - aDefPageZoomY = aValidY; - } - } - else - { - for ( SCTAB i = 0; i <= MAXTAB; i++ ) - if ( pTabData[i] && ( bAll || aMarkData.GetTableSelect(i) ) ) + else { pTabData[i]->aZoomX = aValidX; pTabData[i]->aZoomY = aValidY; } - if ( bAll ) - { - aDefZoomX = aValidX; - aDefZoomY = aValidY; } } - RefreshZoom(); } +void ScViewData::SetZoom( const Fraction& rNewX, const Fraction& rNewY, BOOL bAll ) +{ + std::vector< SCTAB > vTabs; + if ( !bAll ) // get selected tabs + { + SCTAB nTabCount = pDoc->GetTableCount(); + for (SCTAB i=0; i Date: Fri, 18 Sep 2009 15:35:47 +0000 Subject: new and removed files --- sc/source/ui/vba/excelvbahelper.cxx | 222 ++++++++++ sc/source/ui/vba/excelvbahelper.hxx | 62 +++ sc/source/ui/vba/testvba/Logs/AutoFilter.log | 20 + sc/source/ui/vba/testvba/Logs/CalcFont.log | 17 + sc/source/ui/vba/testvba/Logs/MiscRangeTests.log | 45 ++ sc/source/ui/vba/testvba/Logs/PageBreaks.log | 10 + sc/source/ui/vba/testvba/Logs/Ranges-2.log | 68 +++ sc/source/ui/vba/testvba/Logs/Ranges-3.log | 8 + sc/source/ui/vba/testvba/Logs/Ranges.log | 280 ++++++++++++ sc/source/ui/vba/testvba/Logs/Shapes.log | 77 ++++ sc/source/ui/vba/testvba/Logs/StrConv-test.log | 9 + sc/source/ui/vba/testvba/Logs/Template.log | 14 + sc/source/ui/vba/testvba/Logs/TestAddress.log | 67 +++ .../ui/vba/testvba/Logs/TestCalc_Rangetest.log | 60 +++ .../ui/vba/testvba/Logs/TestCalc_Rangetest2.log | 65 +++ sc/source/ui/vba/testvba/Logs/TestIntersection.log | 26 ++ sc/source/ui/vba/testvba/Logs/TestUnion.log | 17 + sc/source/ui/vba/testvba/Logs/Window.log | 46 ++ sc/source/ui/vba/testvba/Logs/bytearraystring.log | 8 + sc/source/ui/vba/testvba/Logs/dateserial.log | 9 + sc/source/ui/vba/testvba/Logs/datevalue.log | 8 + sc/source/ui/vba/testvba/Logs/format.log | 36 ++ sc/source/ui/vba/testvba/Logs/pagesetup.log | 77 ++++ sc/source/ui/vba/testvba/Logs/partition.log | 11 + sc/source/ui/vba/testvba/Logs/range-4.log | 16 + sc/source/ui/vba/testvba/Logs/replace.log | 14 + sc/source/ui/vba/testvba/Logs/stringplusdouble.log | 62 +++ sc/source/ui/vba/testvba/Logs/window2.log | 41 ++ .../TestDocuments-ooo-build/ApplicationRunTest.xls | Bin 0 -> 25088 bytes .../testvba/TestDocuments-ooo-build/AutoFilter.xls | Bin 0 -> 54272 bytes .../testvba/TestDocuments-ooo-build/CalcFont.xls | Bin 0 -> 73728 bytes .../testvba/TestDocuments-ooo-build/CalcZoom.xls | Bin 0 -> 62976 bytes .../TestDocuments-ooo-build/FinancialFuncTests.xls | Bin 0 -> 71168 bytes .../TestDocuments-ooo-build/FinancialFuncs.xls | Bin 0 -> 47104 bytes .../TestDocuments-ooo-build/MiscOperatorTests.xls | Bin 0 -> 66048 bytes .../TestDocuments-ooo-build/MiscRangeTests.xls | Bin 0 -> 126976 bytes .../testvba/TestDocuments-ooo-build/PageBreaks.xls | Bin 0 -> 63488 bytes .../testvba/TestDocuments-ooo-build/Ranges-2.xls | Bin 0 -> 2209280 bytes .../testvba/TestDocuments-ooo-build/Ranges-3.xls | Bin 0 -> 54784 bytes .../vba/testvba/TestDocuments-ooo-build/Ranges.xls | Bin 0 -> 2236416 bytes .../vba/testvba/TestDocuments-ooo-build/Shapes.xls | Bin 0 -> 74240 bytes .../TestDocuments-ooo-build/StrConv-test.xls | Bin 0 -> 65024 bytes .../testvba/TestDocuments-ooo-build/Template.xls | Bin 0 -> 65024 bytes .../TestDocuments-ooo-build/TestAddress.xls | Bin 0 -> 84480 bytes .../TestDocuments-ooo-build/TestCalc_Rangetest.xls | Bin 0 -> 67584 bytes .../TestCalc_Rangetest2.xls | Bin 0 -> 71680 bytes .../TestDocuments-ooo-build/TestIntersection.xls | Bin 0 -> 81408 bytes .../testvba/TestDocuments-ooo-build/TestUnion.xls | Bin 0 -> 72192 bytes .../TestDocuments-ooo-build/VariantTest.xls | Bin 0 -> 68608 bytes .../vba/testvba/TestDocuments-ooo-build/Window.xls | Bin 0 -> 87040 bytes .../TestDocuments-ooo-build/bytearraystring.xls | Bin 0 -> 58880 bytes .../testvba/TestDocuments-ooo-build/dateserial.xls | Bin 0 -> 57344 bytes .../testvba/TestDocuments-ooo-build/datevalue.xls | Bin 0 -> 61952 bytes .../vba/testvba/TestDocuments-ooo-build/format.xls | Bin 0 -> 102400 bytes .../logs/excel/AutoFilter.log | 20 + .../logs/excel/MiscRangeTests.log | 45 ++ .../logs/excel/Ranges-2.log | 68 +++ .../logs/excel/Ranges-3.log | 8 + .../TestDocuments-ooo-build/logs/excel/Ranges.log | 280 ++++++++++++ .../logs/excel/TestAddress.log | 62 +++ .../logs/excel/TestCalc_Rangetest.log | 60 +++ .../logs/excel/TestCalc_Rangetest2.log | 64 +++ .../TestDocuments-ooo-build/logs/format.log | 36 ++ .../logs/unix/AutoFilter.log | 20 + .../TestDocuments-ooo-build/logs/unix/CalcFont.log | 17 + .../TestDocuments-ooo-build/logs/unix/CalcZoom.log | 18 + .../logs/unix/FinancialFuncTests.log | 31 ++ .../logs/unix/MiscOperatorTests.log | 30 ++ .../logs/unix/MiscRangeTests.log | 45 ++ .../logs/unix/PageBreaks.log | 10 + .../TestDocuments-ooo-build/logs/unix/Ranges-2.log | 68 +++ .../TestDocuments-ooo-build/logs/unix/Ranges-3.log | 8 + .../TestDocuments-ooo-build/logs/unix/Ranges.log | 280 ++++++++++++ .../TestDocuments-ooo-build/logs/unix/Shapes.log | 77 ++++ .../logs/unix/StrConv-test.log | 9 + .../TestDocuments-ooo-build/logs/unix/Template.log | 14 + .../logs/unix/TestAddress.log | 67 +++ .../logs/unix/TestCalc_Rangetest.log | 60 +++ .../logs/unix/TestCalc_Rangetest2.log | 65 +++ .../logs/unix/TestIntersection.log | 26 ++ .../logs/unix/TestUnion.log | 17 + .../logs/unix/VariantTest.log | 47 ++ .../TestDocuments-ooo-build/logs/unix/Window.log | 46 ++ .../logs/unix/bytearraystring.log | 8 + .../logs/unix/dateserial.log | 9 + .../logs/unix/datevalue.log | 8 + .../TestDocuments-ooo-build/logs/unix/format.log | 36 ++ .../logs/unix/pagesetup.log | 77 ++++ .../logs/unix/partition.log | 11 + .../TestDocuments-ooo-build/logs/unix/range-4.log | 16 + .../TestDocuments-ooo-build/logs/unix/replace.log | 14 + .../logs/unix/stringplusdouble.log | 62 +++ .../TestDocuments-ooo-build/logs/unix/window2.log | 41 ++ .../logs/win/AutoFilter.log | 20 + .../TestDocuments-ooo-build/logs/win/CalcFont.log | 17 + .../logs/win/MiscOperatorTests.log | 29 ++ .../logs/win/MiscRangeTests.log | 45 ++ .../logs/win/PageBreaks.log | 10 + .../TestDocuments-ooo-build/logs/win/Ranges-2.log | 68 +++ .../TestDocuments-ooo-build/logs/win/Ranges-3.log | 8 + .../TestDocuments-ooo-build/logs/win/Ranges.log | 280 ++++++++++++ .../TestDocuments-ooo-build/logs/win/Shapes.log | 77 ++++ .../logs/win/StrConv-test.log | 9 + .../TestDocuments-ooo-build/logs/win/Template.log | 14 + .../logs/win/TestAddress.log | 67 +++ .../logs/win/TestCalc_Rangetest.log | 60 +++ .../logs/win/TestCalc_Rangetest2.log | 65 +++ .../logs/win/TestIntersection.log | 26 ++ .../TestDocuments-ooo-build/logs/win/TestUnion.log | 17 + .../logs/win/VariantTest.log | 47 ++ .../TestDocuments-ooo-build/logs/win/Window.log | 46 ++ .../logs/win/bytearraystring.log | 8 + .../logs/win/dateserial.log | 9 + .../TestDocuments-ooo-build/logs/win/datevalue.log | 8 + .../TestDocuments-ooo-build/logs/win/format.log | 36 ++ .../TestDocuments-ooo-build/logs/win/pagesetup.log | 87 ++++ .../TestDocuments-ooo-build/logs/win/partition.log | 11 + .../TestDocuments-ooo-build/logs/win/range-4.log | 16 + .../TestDocuments-ooo-build/logs/win/replace.log | 14 + .../logs/win/stringplusdouble.log | 62 +++ .../TestDocuments-ooo-build/logs/win/window2.log | 41 ++ .../TestDocuments-ooo-build/notwork/error.xls | Bin 0 -> 38400 bytes .../notwork/imagecontrols.xls | Bin 0 -> 2415104 bytes .../TestDocuments-ooo-build/notwork/keyword.xls | Bin 0 -> 50688 bytes .../notwork/objectmodule.xls | Bin 0 -> 62464 bytes .../notwork/stringtodouble.ods | Bin 0 -> 13260 bytes .../testvba/TestDocuments-ooo-build/partition.xls | Bin 0 -> 65536 bytes .../testvba/TestDocuments-ooo-build/range-4.xls | Bin 0 -> 2192384 bytes .../testvba/TestDocuments-ooo-build/replace.xls | Bin 0 -> 64512 bytes .../TestDocuments-ooo-build/stringplusdouble.xls | Bin 0 -> 75264 bytes .../testvba/TestDocuments-ooo-build/window2.xls | Bin 0 -> 72192 bytes .../testvba/TestDocuments/ApplicationRunTest.xls | Bin 0 -> 25088 bytes .../ui/vba/testvba/TestDocuments/CalcFont.xls | Bin 0 -> 73728 bytes .../vba/testvba/TestDocuments/FinancialFuncs.xls | Bin 0 -> 47104 bytes .../ui/vba/testvba/TestDocuments/PageSetup.xls | Bin 72704 -> 0 bytes .../vba/testvba/TestDocuments/TestIntersection.xls | Bin 0 -> 81408 bytes .../ui/vba/testvba/TestDocuments/TestUnion.xls | Bin 0 -> 72192 bytes .../testvba/TestDocuments/logs/unix/CalcFont.log | 17 + .../TestDocuments/logs/unix/TestIntersection.log | 26 ++ .../testvba/TestDocuments/logs/unix/TestUnion.log | 17 + .../ui/vba/testvba/TestDocuments/pagesetup.xls | Bin 0 -> 72704 bytes sc/source/ui/vba/testvba/testclient | Bin 0 -> 39390 bytes sc/source/ui/vba/vbabutton.cxx | 74 ---- sc/source/ui/vba/vbabutton.hxx | 51 --- sc/source/ui/vba/vbacheckbox.cxx | 110 ----- sc/source/ui/vba/vbacheckbox.hxx | 60 --- sc/source/ui/vba/vbacollectionimpl.cxx | 136 ------ sc/source/ui/vba/vbacollectionimpl.hxx | 259 ----------- sc/source/ui/vba/vbacolorformat.cxx | 190 -------- sc/source/ui/vba/vbacolorformat.hxx | 128 ------ sc/source/ui/vba/vbacombobox.cxx | 175 -------- sc/source/ui/vba/vbacombobox.hxx | 80 ---- sc/source/ui/vba/vbacommandbar.cxx | 329 -------------- sc/source/ui/vba/vbacommandbar.hxx | 105 ----- sc/source/ui/vba/vbacommandbarcontrol.cxx | 403 ----------------- sc/source/ui/vba/vbacommandbarcontrol.hxx | 90 ---- sc/source/ui/vba/vbacommandbarcontrols.cxx | 246 ----------- sc/source/ui/vba/vbacommandbarcontrols.hxx | 90 ---- sc/source/ui/vba/vbacommandbars.cxx | 247 ----------- sc/source/ui/vba/vbacommandbars.hxx | 79 ---- sc/source/ui/vba/vbacontrol.hxx | 111 ----- sc/source/ui/vba/vbacontrols.cxx | 227 ---------- sc/source/ui/vba/vbacontrols.hxx | 62 --- sc/source/ui/vba/vbafillformat.cxx | 202 --------- sc/source/ui/vba/vbafillformat.hxx | 74 ---- sc/source/ui/vba/vbaframe.cxx | 93 ---- sc/source/ui/vba/vbaframe.hxx | 58 --- sc/source/ui/vba/vbahelper.hxx | 352 --------------- sc/source/ui/vba/vbahelperinterface.hxx | 116 ----- sc/source/ui/vba/vbaimage.cxx | 59 --- sc/source/ui/vba/vbaimage.hxx | 48 --- sc/source/ui/vba/vbalabel.cxx | 88 ---- sc/source/ui/vba/vbalabel.hxx | 56 --- sc/source/ui/vba/vbalineformat.cxx | 458 -------------------- sc/source/ui/vba/vbalineformat.hxx | 85 ---- sc/source/ui/vba/vbalistbox.cxx | 289 ------------- sc/source/ui/vba/vbalistbox.hxx | 90 ---- sc/source/ui/vba/vbalistcontrolhelper.cxx | 145 ------- sc/source/ui/vba/vbalistcontrolhelper.hxx | 20 - sc/source/ui/vba/vbamultipage.cxx | 132 ------ sc/source/ui/vba/vbamultipage.hxx | 65 --- sc/source/ui/vba/vbapages.cxx | 81 ---- sc/source/ui/vba/vbapages.hxx | 64 --- sc/source/ui/vba/vbapictureformat.cxx | 147 ------- sc/source/ui/vba/vbapictureformat.hxx | 64 --- sc/source/ui/vba/vbaprogressbar.cxx | 78 ---- sc/source/ui/vba/vbaprogressbar.hxx | 59 --- sc/source/ui/vba/vbaradiobutton.cxx | 107 ----- sc/source/ui/vba/vbaradiobutton.hxx | 55 --- sc/source/ui/vba/vbascrollbar.cxx | 139 ------ sc/source/ui/vba/vbascrollbar.hxx | 66 --- sc/source/ui/vba/vbashape.cxx | 480 --------------------- sc/source/ui/vba/vbashape.hxx | 108 ----- sc/source/ui/vba/vbashaperange.cxx | 170 -------- sc/source/ui/vba/vbashaperange.hxx | 66 --- sc/source/ui/vba/vbashapes.cxx | 394 ----------------- sc/source/ui/vba/vbashapes.hxx | 80 ---- sc/source/ui/vba/vbaspinbutton.cxx | 109 ----- sc/source/ui/vba/vbaspinbutton.hxx | 61 --- sc/source/ui/vba/vbatextbox.cxx | 137 ------ sc/source/ui/vba/vbatextbox.hxx | 57 --- sc/source/ui/vba/vbatogglebutton.cxx | 108 ----- sc/source/ui/vba/vbatogglebutton.hxx | 63 --- sc/source/ui/vba/vbauserform.cxx | 228 ---------- sc/source/ui/vba/vbauserform.hxx | 78 ---- 205 files changed, 4532 insertions(+), 8681 deletions(-) create mode 100644 sc/source/ui/vba/excelvbahelper.cxx create mode 100644 sc/source/ui/vba/excelvbahelper.hxx create mode 100644 sc/source/ui/vba/testvba/Logs/AutoFilter.log create mode 100644 sc/source/ui/vba/testvba/Logs/CalcFont.log create mode 100644 sc/source/ui/vba/testvba/Logs/MiscRangeTests.log create mode 100644 sc/source/ui/vba/testvba/Logs/PageBreaks.log create mode 100644 sc/source/ui/vba/testvba/Logs/Ranges-2.log create mode 100644 sc/source/ui/vba/testvba/Logs/Ranges-3.log create mode 100644 sc/source/ui/vba/testvba/Logs/Ranges.log create mode 100644 sc/source/ui/vba/testvba/Logs/Shapes.log create mode 100644 sc/source/ui/vba/testvba/Logs/StrConv-test.log create mode 100644 sc/source/ui/vba/testvba/Logs/Template.log create mode 100644 sc/source/ui/vba/testvba/Logs/TestAddress.log create mode 100644 sc/source/ui/vba/testvba/Logs/TestCalc_Rangetest.log create mode 100644 sc/source/ui/vba/testvba/Logs/TestCalc_Rangetest2.log create mode 100644 sc/source/ui/vba/testvba/Logs/TestIntersection.log create mode 100644 sc/source/ui/vba/testvba/Logs/TestUnion.log create mode 100644 sc/source/ui/vba/testvba/Logs/Window.log create mode 100644 sc/source/ui/vba/testvba/Logs/bytearraystring.log create mode 100644 sc/source/ui/vba/testvba/Logs/dateserial.log create mode 100644 sc/source/ui/vba/testvba/Logs/datevalue.log create mode 100644 sc/source/ui/vba/testvba/Logs/format.log create mode 100644 sc/source/ui/vba/testvba/Logs/pagesetup.log create mode 100644 sc/source/ui/vba/testvba/Logs/partition.log create mode 100644 sc/source/ui/vba/testvba/Logs/range-4.log create mode 100644 sc/source/ui/vba/testvba/Logs/replace.log create mode 100644 sc/source/ui/vba/testvba/Logs/stringplusdouble.log create mode 100644 sc/source/ui/vba/testvba/Logs/window2.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/ApplicationRunTest.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/AutoFilter.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/CalcFont.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/CalcZoom.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/FinancialFuncTests.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/FinancialFuncs.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/MiscOperatorTests.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/MiscRangeTests.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/PageBreaks.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/Ranges-2.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/Ranges-3.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/Ranges.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/Shapes.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/StrConv-test.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/Template.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/TestAddress.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/TestCalc_Rangetest.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/TestCalc_Rangetest2.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/TestIntersection.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/TestUnion.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/VariantTest.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/Window.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/bytearraystring.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/dateserial.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/datevalue.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/format.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/AutoFilter.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/MiscRangeTests.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/Ranges-2.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/Ranges-3.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/Ranges.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/TestAddress.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/TestCalc_Rangetest.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/TestCalc_Rangetest2.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/format.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/AutoFilter.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/CalcFont.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/CalcZoom.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/FinancialFuncTests.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/MiscOperatorTests.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/MiscRangeTests.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/PageBreaks.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Ranges-2.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Ranges-3.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Ranges.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Shapes.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/StrConv-test.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Template.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/TestAddress.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/TestCalc_Rangetest.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/TestCalc_Rangetest2.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/TestIntersection.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/TestUnion.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/VariantTest.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Window.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/bytearraystring.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/dateserial.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/datevalue.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/format.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/pagesetup.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/partition.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/range-4.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/replace.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/stringplusdouble.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/window2.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/AutoFilter.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/CalcFont.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/MiscOperatorTests.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/MiscRangeTests.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/PageBreaks.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Ranges-2.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Ranges-3.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Ranges.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Shapes.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/StrConv-test.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Template.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/TestAddress.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/TestCalc_Rangetest.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/TestCalc_Rangetest2.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/TestIntersection.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/TestUnion.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/VariantTest.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Window.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/bytearraystring.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/dateserial.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/datevalue.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/format.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/pagesetup.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/partition.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/range-4.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/replace.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/stringplusdouble.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/window2.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/notwork/error.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/notwork/imagecontrols.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/notwork/keyword.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/notwork/objectmodule.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/notwork/stringtodouble.ods create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/partition.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/range-4.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/replace.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/stringplusdouble.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments-ooo-build/window2.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments/ApplicationRunTest.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments/CalcFont.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments/FinancialFuncs.xls delete mode 100755 sc/source/ui/vba/testvba/TestDocuments/PageSetup.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments/TestIntersection.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments/TestUnion.xls create mode 100644 sc/source/ui/vba/testvba/TestDocuments/logs/unix/CalcFont.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestIntersection.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestUnion.log create mode 100755 sc/source/ui/vba/testvba/TestDocuments/pagesetup.xls create mode 100755 sc/source/ui/vba/testvba/testclient delete mode 100644 sc/source/ui/vba/vbabutton.cxx delete mode 100644 sc/source/ui/vba/vbabutton.hxx delete mode 100644 sc/source/ui/vba/vbacheckbox.cxx delete mode 100644 sc/source/ui/vba/vbacheckbox.hxx delete mode 100644 sc/source/ui/vba/vbacollectionimpl.cxx delete mode 100644 sc/source/ui/vba/vbacollectionimpl.hxx delete mode 100644 sc/source/ui/vba/vbacolorformat.cxx delete mode 100644 sc/source/ui/vba/vbacolorformat.hxx delete mode 100644 sc/source/ui/vba/vbacombobox.cxx delete mode 100644 sc/source/ui/vba/vbacombobox.hxx delete mode 100644 sc/source/ui/vba/vbacommandbar.cxx delete mode 100644 sc/source/ui/vba/vbacommandbar.hxx delete mode 100644 sc/source/ui/vba/vbacommandbarcontrol.cxx delete mode 100644 sc/source/ui/vba/vbacommandbarcontrol.hxx delete mode 100644 sc/source/ui/vba/vbacommandbarcontrols.cxx delete mode 100644 sc/source/ui/vba/vbacommandbarcontrols.hxx delete mode 100644 sc/source/ui/vba/vbacommandbars.cxx delete mode 100644 sc/source/ui/vba/vbacommandbars.hxx delete mode 100644 sc/source/ui/vba/vbacontrol.hxx delete mode 100644 sc/source/ui/vba/vbacontrols.cxx delete mode 100644 sc/source/ui/vba/vbacontrols.hxx delete mode 100644 sc/source/ui/vba/vbafillformat.cxx delete mode 100644 sc/source/ui/vba/vbafillformat.hxx delete mode 100644 sc/source/ui/vba/vbaframe.cxx delete mode 100644 sc/source/ui/vba/vbaframe.hxx delete mode 100644 sc/source/ui/vba/vbahelper.hxx delete mode 100644 sc/source/ui/vba/vbahelperinterface.hxx delete mode 100644 sc/source/ui/vba/vbaimage.cxx delete mode 100644 sc/source/ui/vba/vbaimage.hxx delete mode 100644 sc/source/ui/vba/vbalabel.cxx delete mode 100644 sc/source/ui/vba/vbalabel.hxx delete mode 100644 sc/source/ui/vba/vbalineformat.cxx delete mode 100644 sc/source/ui/vba/vbalineformat.hxx delete mode 100644 sc/source/ui/vba/vbalistbox.cxx delete mode 100644 sc/source/ui/vba/vbalistbox.hxx delete mode 100644 sc/source/ui/vba/vbalistcontrolhelper.cxx delete mode 100644 sc/source/ui/vba/vbalistcontrolhelper.hxx delete mode 100644 sc/source/ui/vba/vbamultipage.cxx delete mode 100644 sc/source/ui/vba/vbamultipage.hxx delete mode 100644 sc/source/ui/vba/vbapages.cxx delete mode 100644 sc/source/ui/vba/vbapages.hxx delete mode 100644 sc/source/ui/vba/vbapictureformat.cxx delete mode 100644 sc/source/ui/vba/vbapictureformat.hxx delete mode 100644 sc/source/ui/vba/vbaprogressbar.cxx delete mode 100644 sc/source/ui/vba/vbaprogressbar.hxx delete mode 100644 sc/source/ui/vba/vbaradiobutton.cxx delete mode 100644 sc/source/ui/vba/vbaradiobutton.hxx delete mode 100644 sc/source/ui/vba/vbascrollbar.cxx delete mode 100644 sc/source/ui/vba/vbascrollbar.hxx delete mode 100644 sc/source/ui/vba/vbashape.cxx delete mode 100644 sc/source/ui/vba/vbashape.hxx delete mode 100644 sc/source/ui/vba/vbashaperange.cxx delete mode 100644 sc/source/ui/vba/vbashaperange.hxx delete mode 100644 sc/source/ui/vba/vbashapes.cxx delete mode 100644 sc/source/ui/vba/vbashapes.hxx delete mode 100644 sc/source/ui/vba/vbaspinbutton.cxx delete mode 100644 sc/source/ui/vba/vbaspinbutton.hxx delete mode 100644 sc/source/ui/vba/vbatextbox.cxx delete mode 100644 sc/source/ui/vba/vbatextbox.hxx delete mode 100644 sc/source/ui/vba/vbatogglebutton.cxx delete mode 100644 sc/source/ui/vba/vbatogglebutton.hxx delete mode 100644 sc/source/ui/vba/vbauserform.cxx delete mode 100644 sc/source/ui/vba/vbauserform.hxx diff --git a/sc/source/ui/vba/excelvbahelper.cxx b/sc/source/ui/vba/excelvbahelper.cxx new file mode 100644 index 000000000000..dd0550709b96 --- /dev/null +++ b/sc/source/ui/vba/excelvbahelper.cxx @@ -0,0 +1,222 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vbahelper.cxx,v $ + * $Revision: 1.5.32.1 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#include +#include "excelvbahelper.hxx" +#include "tabvwsh.hxx" +#include "transobj.hxx" +#include "scmod.hxx" +#include "cellsuno.hxx" +#include + +using namespace ::com::sun::star; +using namespace ::ooo::vba; + +namespace ooo +{ +namespace vba +{ +namespace excel +{ +void implSetZoom( const uno::Reference< frame::XModel >& xModel, sal_Int16 nZoom, std::vector< SCTAB >& nTabs ) +{ + ScTabViewShell* pViewSh = excel::getBestViewShell( xModel ); + Fraction aFract( nZoom, 100 ); + pViewSh->GetViewData()->SetZoom( aFract, aFract, nTabs ); + pViewSh->RefreshZoom(); +} +bool isInPrintPreview( SfxViewFrame* pView ) +{ + sal_uInt16 nViewNo = SID_VIEWSHELL1 - SID_VIEWSHELL0; + if ( pView->GetObjectShell()->GetFactory().GetViewFactoryCount() > +nViewNo && !pView->GetObjectShell()->IsInPlaceActive() ) + { + SfxViewFactory &rViewFactory = + pView->GetObjectShell()->GetFactory().GetViewFactory(nViewNo); + if ( pView->GetCurViewId() == rViewFactory.GetOrdinal() ) + return true; + } + return false; +} + +const ::rtl::OUString REPLACE_CELLS_WARNING( RTL_CONSTASCII_USTRINGPARAM( "ReplaceCellsWarning")); + +class PasteCellsWarningReseter +{ +private: + bool bInitialWarningState; + static uno::Reference< beans::XPropertySet > getGlobalSheetSettings() throw ( uno::RuntimeException ) + { + static uno::Reference< beans::XPropertySet > xTmpProps( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); + static uno::Reference xContext( xTmpProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY_THROW ); + static uno::Reference xServiceManager( + xContext->getServiceManager(), uno::UNO_QUERY_THROW ); + static uno::Reference< beans::XPropertySet > xProps( xServiceManager->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.GlobalSheetSettings" ) ) ,xContext ), uno::UNO_QUERY_THROW ); + return xProps; + } + + bool getReplaceCellsWarning() throw ( uno::RuntimeException ) + { + sal_Bool res = sal_False; + getGlobalSheetSettings()->getPropertyValue( REPLACE_CELLS_WARNING ) >>= res; + return ( res == sal_True ); + } + + void setReplaceCellsWarning( bool bState ) throw ( uno::RuntimeException ) + { + getGlobalSheetSettings()->setPropertyValue( REPLACE_CELLS_WARNING, uno::makeAny( bState ) ); + } +public: + PasteCellsWarningReseter() throw ( uno::RuntimeException ) + { + bInitialWarningState = getReplaceCellsWarning(); + if ( bInitialWarningState ) + setReplaceCellsWarning( false ); + } + ~PasteCellsWarningReseter() + { + if ( bInitialWarningState ) + { + // don't allow dtor to throw + try + { + setReplaceCellsWarning( true ); + } + catch ( uno::Exception& /*e*/ ){} + } + } +}; + +void +implnPaste( const uno::Reference< frame::XModel>& xModel ) +{ + PasteCellsWarningReseter resetWarningBox; + ScTabViewShell* pViewShell = getBestViewShell( xModel ); + if ( pViewShell ) + { + pViewShell->PasteFromSystem(); + pViewShell->CellContentChanged(); + } +} + + +void +implnCopy( const uno::Reference< frame::XModel>& xModel ) +{ + ScTabViewShell* pViewShell = getBestViewShell( xModel ); + if ( pViewShell ) + pViewShell->CopyToClip(NULL,false,false,true); +} + +void +implnCut( const uno::Reference< frame::XModel>& xModel ) +{ + ScTabViewShell* pViewShell = getBestViewShell( xModel ); + if ( pViewShell ) + pViewShell->CutToClip( NULL, TRUE ); +} + +void implnPasteSpecial( const uno::Reference< frame::XModel>& xModel, USHORT nFlags,USHORT nFunction,sal_Bool bSkipEmpty, sal_Bool bTranspose) +{ + PasteCellsWarningReseter resetWarningBox; + sal_Bool bAsLink(sal_False), bOtherDoc(sal_False); + InsCellCmd eMoveMode = INS_NONE; + + ScTabViewShell* pTabViewShell = getBestViewShell( xModel ); + if ( pTabViewShell ) + { + ScViewData* pView = pTabViewShell->GetViewData(); + Window* pWin = ( pView != NULL ) ? pView->GetActiveWin() : NULL; + if ( pView && pWin ) + { + if ( bAsLink && bOtherDoc ) + pTabViewShell->PasteFromSystem(0);//SOT_FORMATSTR_ID_LINK + else + { + ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pWin ); + ScDocument* pDoc = NULL; + if ( pOwnClip ) + pDoc = pOwnClip->GetDocument(); + pTabViewShell->PasteFromClip( nFlags, pDoc, + nFunction, bSkipEmpty, bTranspose, bAsLink, + eMoveMode, IDF_NONE, TRUE ); + pTabViewShell->CellContentChanged(); + } + } + } + +} + +ScDocShell* +getDocShell( const css::uno::Reference< css::frame::XModel>& xModel ) +{ + uno::Reference< uno::XInterface > xIf( xModel, uno::UNO_QUERY_THROW ); + ScModelObj* pModel = dynamic_cast< ScModelObj* >( xIf.get() ); + ScDocShell* pDocShell = NULL; + if ( pModel ) + pDocShell = (ScDocShell*)pModel->GetEmbeddedObject(); + return pDocShell; + +} + +ScTabViewShell* +getBestViewShell( const css::uno::Reference< css::frame::XModel>& xModel ) +{ + ScDocShell* pDocShell = getDocShell( xModel ); + if ( pDocShell ) + return pDocShell->GetBestViewShell(); + return NULL; +} + +ScTabViewShell* +getCurrentBestViewShell( const uno::Reference< uno::XComponentContext >& xContext ) +{ + uno::Reference< frame::XModel > xModel = getCurrentExcelDoc( xContext ); + return getBestViewShell( xModel ); +} + +SfxViewFrame* +getViewFrame( const uno::Reference< frame::XModel >& xModel ) +{ + ScTabViewShell* pViewShell = getBestViewShell( xModel ); + if ( pViewShell ) + return pViewShell->GetViewFrame(); + return NULL; +} + +SfxItemSet* +ScVbaCellRangeAccess::GetDataSet( ScCellRangeObj* pRangeObj ) +{ + SfxItemSet* pDataSet = pRangeObj ? pRangeObj->GetCurrentDataSet( true ) : NULL ; + return pDataSet; + +} +} //excel +} //vba +} //ooo diff --git a/sc/source/ui/vba/excelvbahelper.hxx b/sc/source/ui/vba/excelvbahelper.hxx new file mode 100644 index 000000000000..9306327568f3 --- /dev/null +++ b/sc/source/ui/vba/excelvbahelper.hxx @@ -0,0 +1,62 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vbahelper.hxx,v $ + * $Revision: 1.5.32.1 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef SC_EXCEL_VBA_HELPER_HXX +#define SC_EXCEL_VBA_HELPER_HXX + +#include +#include + +class ScCellRangeObj; + +namespace ooo +{ + namespace vba + { + namespace excel + { + // nTabs empty means apply zoom to all sheets + void implSetZoom( const css::uno::Reference< css::frame::XModel >& xModel, sal_Int16 nZoom, std::vector< SCTAB >& nTabs ); + void implnCopy( const css::uno::Reference< css::frame::XModel>& xModel ); + void implnPaste ( const css::uno::Reference< css::frame::XModel>& xModel ); + void implnCut( const css::uno::Reference< css::frame::XModel>& xModel ); + void implnPasteSpecial( const css::uno::Reference< css::frame::XModel>& xModel, sal_uInt16 nFlags,sal_uInt16 nFunction,sal_Bool bSkipEmpty, sal_Bool bTranspose); + ScTabViewShell* getBestViewShell( const css::uno::Reference< css::frame::XModel>& xModel ) ; + ScDocShell* getDocShell( const css::uno::Reference< css::frame::XModel>& xModel ) ; + ScTabViewShell* getCurrentBestViewShell( const css::uno::Reference< css::uno::XComponentContext >& xContext ); + SfxViewFrame* getViewFrame( const css::uno::Reference< css::frame::XModel >& xModel ); + class ScVbaCellRangeAccess + { + public: + static SfxItemSet* GetDataSet( ScCellRangeObj* pRangeObj ); + }; +}; +}; +}; +#endif diff --git a/sc/source/ui/vba/testvba/Logs/AutoFilter.log b/sc/source/ui/vba/testvba/Logs/AutoFilter.log new file mode 100644 index 000000000000..b98f5c5882b4 --- /dev/null +++ b/sc/source/ui/vba/testvba/Logs/AutoFilter.log @@ -0,0 +1,20 @@ +Test run started : 18/09/2009 16:02:14 +---------------------------------------------------------------- +TestAddress + TEST START : TestAddress + ITEM Assertion OK : test1 'starts with' string criteria + ITEM Assertion OK : test2 'not equal to' string criteria + ITEM Assertion OK : test3 'ends with' string criteria + ITEM Assertion OK : test4 field 'all' + ITEM Assertion OK : test5 numeric '<15' + ITEM Assertion OK : test6 numeric '>=15' + ITEM Assertion OK : test7 numeric '<=12' +Test Results +============ + +Tests passed: 7 +Tests failed: 0 + +END 'TestAddress + TEST OK : TestAddress +Test run finished : 18/09/2009 16:02:14 diff --git a/sc/source/ui/vba/testvba/Logs/CalcFont.log b/sc/source/ui/vba/testvba/Logs/CalcFont.log new file mode 100644 index 000000000000..bcc07f40d629 --- /dev/null +++ b/sc/source/ui/vba/testvba/Logs/CalcFont.log @@ -0,0 +1,17 @@ +Test run started : 18/09/2009 16:02:01 +CalcFont_Format + TEST START : Font_Format + ITEM Assertion OK : correctly set font to Bold + ITEM Assertion OK : correctly set font to Italic + ITEM Assertion OK : correctly read FontStyle + ITEM Assertion OK : correctly set font to Shadow + ITEM Assertion OK : correctly set font color + ITEM Assertion OK : correctly set font color index + ITEM Assertion OK : correctly set font name + ITEM Assertion OK : correctly set font outline + ITEM Assertion OK : correctly set font size + ITEM Assertion OK : correctly set font strikethrough + ITEM Assertion OK : correctly set font underline + TEST Success. : Font_Format +CalcFont_Format +Test run finished : 18/09/2009 16:02:01 diff --git a/sc/source/ui/vba/testvba/Logs/MiscRangeTests.log b/sc/source/ui/vba/testvba/Logs/MiscRangeTests.log new file mode 100644 index 000000000000..47fd4b566f74 --- /dev/null +++ b/sc/source/ui/vba/testvba/Logs/MiscRangeTests.log @@ -0,0 +1,45 @@ +Test run started : 18/09/2009 16:01:58 +---------------------------------------------------------------- +MiscRangeTests + TEST START : MiscRangeTests + ITEM Assertion OK : test 1 + ITEM Assertion OK : test 2 + ITEM Assertion OK : test 3 + ITEM Assertion OK : test 4 + ITEM Assertion OK : test 5 + ITEM Assertion OK : test 6 + ITEM Assertion OK : test 7 + ITEM Assertion OK : test 8 + ITEM Assertion OK : test 9 + ITEM Assertion OK : test 10 + ITEM Assertion OK : test 11 + ITEM Assertion OK : test 12 + ITEM Assertion OK : test 13 + ITEM Assertion OK : test 14 + ITEM Assertion OK : test 15 + ITEM Assertion OK : test 16 + ITEM Assertion OK : test 17 + ITEM Assertion OK : test 18 + ITEM Assertion OK : test 19 + ITEM Assertion OK : test 20 + ITEM Assertion OK : test 21 + ITEM Assertion OK : test 22 + ITEM Assertion OK : test 23 + ITEM Assertion OK : test 24 + ITEM Assertion OK : test 25 + ITEM Assertion OK : test 26 + ITEM Assertion OK : test 27 + ITEM Assertion OK : test 28 + ITEM Assertion OK : test 29 + ITEM Assertion OK : test 30 + ITEM Assertion OK : test 31 +No. tests: 31 +Summary +======= +Run: 31 +Passed: 31 +Failed: 0 + +END 'MiscRangeTests + TEST OK : MiscRangeTests +Test run finished : 18/09/2009 16:01:58 diff --git a/sc/source/ui/vba/testvba/Logs/PageBreaks.log b/sc/source/ui/vba/testvba/Logs/PageBreaks.log new file mode 100644 index 000000000000..89f304fee822 --- /dev/null +++ b/sc/source/ui/vba/testvba/Logs/PageBreaks.log @@ -0,0 +1,10 @@ +Test run started : 18/09/2009 16:02:17 +---------------------------------------------------------------- + TEST START : PageBreaks-Issue + ITEM Assertion OK : HPageBreaks.Count is 2 + ITEM Assertion OK : HPageBreak.Type is -4135 + ITEM Assertion OK : HPageBreak.Location: Range.Row is 5 + ITEM Assertion OK : HPageBreak.Delete: HPageBreaks.Count is 2 +END 'PageBreaks-Issue' Symbol + TEST OK : PageBreaks-Issue +Test run finished : 18/09/2009 16:02:17 diff --git a/sc/source/ui/vba/testvba/Logs/Ranges-2.log b/sc/source/ui/vba/testvba/Logs/Ranges-2.log new file mode 100644 index 000000000000..aa00bcdfdb56 --- /dev/null +++ b/sc/source/ui/vba/testvba/Logs/Ranges-2.log @@ -0,0 +1,68 @@ +Test run started : 18/09/2009 16:02:12 +---------------------------------------------------------------- +ClearFormtsIssue + TEST START : ClearFormtsIssue + ITEM Assertion OK : Range.Font.Bold is: True + ITEM Assertion OK : Range.Font.Bold is: False +END 'ClearFormtsIssue' Symbol + TEST OK : ClearFormtsIssue +---------------------------------------------------------------- +VerticalAlignment-Issue + TEST START : VerticalAlignment-Issue + ITEM Assertion OK : - Range.VerticalAlignment (get) + ITEM Assertion OK : - Range.VerticalAlignment (set) + ITEM Assertion OK : - Range.VerticalAlignment (get) + ITEM Assertion OK : - Range.VerticalAlignment (get) + ITEM Assertion OK : - Range.VerticalAlignment (set) + ITEM Assertion OK : - Range.VerticalAlignment (get) + ITEM Assertion OK : - Range.VerticalAlignment (set) + ITEM Assertion OK : Range.VeritcalAlignment is Null +END 'VerticalAlignment-Issue' Symbol + TEST OK : VerticalAlignment-Issue +---------------------------------------------------------------- +HorizontalAlignment-Issue + TEST START : HorizontalAlignment-Issue + ITEM Assertion OK : - Range.HorizontalAlignment (get) + ITEM Assertion OK : - Range.HorizontalAlignment (set) + ITEM Assertion OK : - Range.HorizontalAlignment (get) + ITEM Assertion OK : - Range.HorizontalAlignment (set) + ITEM Assertion OK : - Range.HorizontalAlignment (get) + ITEM Assertion OK : - Range.HorizontalAlignment (set) + ITEM Assertion OK : - Range.HorizontalAlignment (get) + ITEM Assertion OK : - Range.HorizontalAlignment (set) + ITEM Assertion OK : Range.HorizontalAlignment is Null +END 'HorizontalAlignment-Issue' Symbol + TEST OK : HorizontalAlignment-Issue +---------------------------------------------------------------- +WrapText-Issue + TEST START : WrapText-Issue + ITEM Assertion OK : - Range.WrapText (get) + ITEM Assertion OK : - Range.WrapText (get) + ITEM Assertion OK : Range.WrapText is Null +END 'WrapText-Issue' Symbol + TEST OK : WrapText-Issue +---------------------------------------------------------------- +FontBorderIssues + TEST START : FontBorderIssues + ITEM Assertion OK : - = Borders.Color (getColor) + ITEM Assertion OK : - = Font.Color (getColor) +END 'FontBorderIssues' Symbol + TEST OK : FontBorderIssues +---------------------------------------------------------------- +RangeSizeIssues + TEST START : RangeSizeIssues + ITEM Assertion OK : Range.Left is: 120.06225 + ITEM Assertion OK : Range.Top is: 93.29985 + ITEM Assertion OK : Range.Width is: 228.3 + ITEM Assertion OK : Range.Height is: 271.5 +END 'RangeSizeIssues' Symbol + TEST OK : RangeSizeIssues +---------------------------------------------------------------- +ApplicationIssues + TEST START : ApplicationIssues + ITEM Assertion OK : Range.Address is: $E$8:$G$13,$G$13:$K$19 + ITEM Assertion OK : Range.Address is: $E$8:$G$13,$G$13:$K$19 + ITEM Assertion OK : Application.ActiveSheet.Name: Sheet1 +END 'ApplicationIssues' Symbol + TEST OK : ApplicationIssues +Test run finished : 18/09/2009 16:02:13 diff --git a/sc/source/ui/vba/testvba/Logs/Ranges-3.log b/sc/source/ui/vba/testvba/Logs/Ranges-3.log new file mode 100644 index 000000000000..97750c869f2b --- /dev/null +++ b/sc/source/ui/vba/testvba/Logs/Ranges-3.log @@ -0,0 +1,8 @@ +Test run started : 18/09/2009 16:02:14 +---------------------------------------------------------------- +MyGoalseek-Issue + TEST START : MyGoalseek-Issue + ITEM Assertion OK : Variable Range value: 15 +END 'MyGoalseek-Issue' Symbol + TEST OK : MyGoalseek-Issue +Test run finished : 18/09/2009 16:02:14 diff --git a/sc/source/ui/vba/testvba/Logs/Ranges.log b/sc/source/ui/vba/testvba/Logs/Ranges.log new file mode 100644 index 000000000000..e5d282dcb379 --- /dev/null +++ b/sc/source/ui/vba/testvba/Logs/Ranges.log @@ -0,0 +1,280 @@ +Test run started : 18/09/2009 16:02:02 +---------------------------------------------------------------- +ApplicationMethods + TEST START : ApplicationMethods + ITEM Assertion OK : Name of Workbook is: Ranges.xls + ITEM Assertion OK : Address of Application.Columns is: $A:$A + ITEM Assertion OK : Address of Application.Rows is: $1:$1 + ITEM Assertion OK : Address of Application.Range is: $1:$1,$5:$7 + ITEM Assertion OK : Please check manually: DefaultFilePath is: /data4/home/npower/Documents + ITEM Assertion OK : Please check manually: Library Path is: /data4/CWS/INSTALL_TEST/opt/UserInstallation/user/basic + ITEM Assertion OK : Please check manually: Template Path is: /data4/CWS/INSTALL_TEST/opt/UserInstallation/user/template + ITEM Assertion OK : FileSeparator is / + ITEM Assertion OK : Name of ActiveWorkbook is: Ranges.xls +END 'ApplicationMethods' Symbol + TEST OK : ApplicationMethods +---------------------------------------------------------------- +Insert-Issue + TEST START : Insert-Issue + ITEM Assertion OK : Insert with xlShiftToRight: 10 +END 'Insert-Issue' Symbol + TEST OK : Insert-Issue +---------------------------------------------------------------- +MergeCells-Issue + TEST START : MergeCells-Issue + ITEM Assertion OK : Range.MergeCells is True + ITEM Assertion FAIL : MergeCells is null: False + ITEM Assertion OK : RowCount after Merge: 13 + ITEM Assertion OK : Range.MergeCells is False + ITEM Assertion OK : MergeCells is null: False + ITEM Assertion FAIL : MergeCells of Second Area is null : False + ITEM Assertion FAIL : MergeCells of Ranges is Null: False + ITEM Assertion OK : RowCount after Merge: 7 + ITEM Assertion OK : Range.MergeCells is False + ITEM Assertion OK : MergeCells is null: False + ITEM Assertion OK : RowCount after Merge: 7 +END 'MergeCells-Issue' Symbol + TEST OK : MergeCells-Issue +---------------------------------------------------------------- +Areas-Issue + TEST START : Areas-Issue + ITEM Assertion OK : Range Areas Count is2 + ITEM Assertion OK : First Range Address is: $E$8:$G$13 + ITEM Assertion OK : First Row is: 8 + ITEM Assertion OK : First Column is: 5 + ITEM Assertion OK : EntireRow Address is: $8:$13,$13:$19 + ITEM Assertion OK : EntireColumn Address is: $E:$G,$G:$K + ITEM Assertion OK : Range Count:53 +END 'Areas-Issue' Symbol + TEST OK : Areas-Issue +---------------------------------------------------------------- +Fill-Methods-Issue + TEST START : Fill-Methods-Issue + ITEM Assertion OK : Range Value after FillDown: MyFillValue + ITEM Assertion OK : Range Value after FillDown: MyFillValue + ITEM Assertion OK : Range Value after FillDown: MyRightFillValue + ITEM Assertion OK : Range Value after FillDown: MyBottomFillValue +END 'Fill-Methods-Issue' Symbol + TEST OK : Fill-Methods-Issue +---------------------------------------------------------------- +Range/Item-Method-Issue + TEST START : Range/Item-Method-Issue + ITEM Assertion OK : Range of multiple columns is: $A:$A,$C:$C + ITEM Assertion OK : Range of multiple rows is: $1:$1,$5:$7 + ITEM Assertion OK : Range of several columns is: $C:$E,$D:$D + ITEM Assertion OK : Range of several rows is: $5:$8,$6:$10 + ITEM Assertion OK : Range of several single cells is: $C$5,$E$8 + ITEM Assertion OK : Range of several named ranges is: $L$1:$M$6,$E$8:$G$13,$G$13:$K$19 + ITEM Assertion OK : Range of a single Item Cell is: $E$21 + ITEM Assertion OK : Range of a single Item Cell is: $F$21 + ITEM Assertion OK : Range of a single Item Cell is: $F$10 +END 'Range/Item-Method-Issue' Symbol + TEST OK : Range/Item-Method-Issue +---------------------------------------------------------------- +R1C1-Formulas-Issue + TEST START : R1C1-Formulas-Issue + ITEM Assertion OK : R1C1 Range.Formula is: =IF(OR(R[-2]C[1]=0,RC[2]="YES"),"") + ITEM Assertion OK : Range.Formula is: =IF(OR(J8=0,K10="YES"),"") +END 'R1C1-Formulas-Issue' Symbol + TEST OK : R1C1-Formulas-Issue +---------------------------------------------------------------- +Verify_Delete + TEST START : Verify_Delete + ITEM Assertion OK : Ranges are intersecting: $G$13 + ITEM Assertion OK : Delete with Default: $AJ$4 + ITEM Assertion OK : Delete with ShifttoLeft: $AJ$4 + ITEM Assertion OK : Delete with ShiftUp: $M$22 +END 'Verify_Delete' Symbol + TEST OK : Verify_Delete +---------------------------------------------------------------- +Value-Issue + TEST START : Value-Issue + ITEM Assertion OK : Value of Range is: 12.3 + ITEM Assertion OK : Text of Range is: 12.3 + ITEM Assertion OK : Range has Formula: False + ITEM Assertion OK : Cell has Formula: False + ITEM Assertion FAIL : Text of Range is null: False + ITEM Assertion OK : Range has Formula: True + ITEM Assertion OK : Cell has Formula: True + ITEM Assertion OK : Value of Cell is: 12 + ITEM Assertion OK : Application.Calculation is : -4135 + ITEM Assertion OK : Calculation is automated: True + ITEM Assertion OK : Range has Formula: True + ITEM Assertion OK : Value of Cell is: 16 + ITEM Assertion OK : Text of Cell is: 16 + ITEM Assertion OK : Text of Cell is: 16 + ITEM Assertion OK : Range has Formula after 'ClearContents: False + ITEM Assertion OK : Text of Cell is: + ITEM Assertion OK : Text of Cell is: +END 'Value-Issue' Symbol + TEST OK : Value-Issue +---------------------------------------------------------------- +AutoFit issue + TEST START : AutoFit issue + ITEM Assertion OK : Columns.AutoFit: CurrentWidth is 679 + ITEM Assertion OK : Rows.AutoFit: CurrentHeight is 546 +END 'AutoFit issue' Symbol + TEST OK : AutoFit issue +---------------------------------------------------------------- +Selections + TEST START : Selections + ITEM Assertion OK : ActiveCell is : $E$8 + ITEM Assertion OK : Active Cell is : $E$8 + ITEM Assertion OK : Number of Cells in Range: 52 + ITEM Assertion OK : Number of Cells in Range: 52 + ITEM Assertion OK : Number of Cells in Range: 52 +END 'Selections' Symbol + TEST OK : Selections +---------------------------------------------------------------- +Offset-Resize + TEST START : Offset-Resize + ITEM Assertion OK : Offset is : $G$10:$I$15,$I$15:$M$21 + ITEM Assertion OK : Offset is : $G$7:$I$12,$I$12:$M$18 + ITEM Assertion OK : Resized Range is : $A$20:$D$23 +END 'Offset-Resize' Symbol + TEST OK : Offset-Resize +---------------------------------------------------------------- +Ranges-Address + TEST START : Ranges-Address + ITEM Assertion OK : Range Address is: $E$8:$G$13,$G$13:$K$19 + ITEM Assertion OK : Range Address is: $E8:$G13,$G13:$K19 + ITEM Assertion OK : Range Address is: E$8:G$13,G$13:K$19 + ITEM Assertion OK : Range Address is: R8C5:R13C7,R13C7:R19C11 + ITEM Assertion FAIL : Range Address is: R8C5:R13C7,R13C7:R19C11 + ITEM Assertion OK : Range Address is: R8C5:R13C7,R13C7:R19C11 + ITEM Assertion OK : Range Address is: R[6]C[3]:R[11]C[5],R[11]C[5]:R[17]C[9] + ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$E$8:$G$13,$G$13:$K$19 +END 'Ranges-Address' Symbol + TEST OK : Ranges-Address +---------------------------------------------------------------- +Range-Address + TEST START : Range-Address + ITEM Assertion OK : Range Address is: $E$8:$G$13 + ITEM Assertion OK : Range Address is: $E8:$G13 + ITEM Assertion OK : Range Address is: E$8:G$13 + ITEM Assertion OK : Range Address is: R8C5:R13C7 + ITEM Assertion FAIL : Range Address is: R8C5:R13C7 + ITEM Assertion OK : Range Address is: R8C5:R13C7 + ITEM Assertion OK : Range Address is: R[6]C[3]:R[11]C[5] + ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$E$8:$G$13 +END 'Range-Address' Symbol + TEST OK : Range-Address +---------------------------------------------------------------- +Column-Address + TEST START : Column-Address + ITEM Assertion OK : Range Address is: $F$8:$F$13 + ITEM Assertion OK : Range Address is: $F8:$F13 + ITEM Assertion OK : Range Address is: F$8:F$13 + ITEM Assertion OK : Range Address is: R8C6:R13C6 + ITEM Assertion FAIL : Range Address is: R8C6:R13C6 + ITEM Assertion OK : Range Address is: R8C6:R13C6 + ITEM Assertion OK : Range Address is: R[6]C[4]:R[11]C[4] + ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$F$8:$F$13 +END 'Column-Address' Symbol + TEST OK : Column-Address +---------------------------------------------------------------- +Row-Address + TEST START : Row-Address + ITEM Assertion OK : Range Address is: $E$9:$G$9 + ITEM Assertion OK : Range Address is: $E9:$G9 + ITEM Assertion OK : Range Address is: E$9:G$9 + ITEM Assertion OK : Range Address is: R9C5:R9C7 + ITEM Assertion FAIL : Range Address is: R9C5:R9C7 + ITEM Assertion OK : Range Address is: R9C5:R9C7 + ITEM Assertion OK : Range Address is: R[7]C[3]:R[7]C[5] + ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$E$9:$G$9 +END 'Row-Address' Symbol + TEST OK : Row-Address +---------------------------------------------------------------- +SingleCell-Address + TEST START : SingleCell-Address + ITEM Assertion OK : Range Address is: $F$9 + ITEM Assertion OK : Range Address is: $F9 + ITEM Assertion OK : Range Address is: F$9 + ITEM Assertion OK : Range Address is: R9C6 + ITEM Assertion FAIL : Range Address is: R9C6 + ITEM Assertion OK : Range Address is: R9C6 + ITEM Assertion OK : Range Address is: R[7]C[4] + ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$F$9 +END 'SingleCell-Address' Symbol + TEST OK : SingleCell-Address +---------------------------------------------------------------- +Heights and Widths + TEST START : Heights and Widths + ITEM Assertion OK : Range RowHeight is 40 + ITEM Assertion OK : Range ColumnWidth is 50 + ITEM Assertion OK : Range Height is 240 + ITEM Assertion OK : Range Width is 787.5 + ITEM Assertion OK : Range RowHeight is 50 + ITEM Assertion OK : Range ColumnWidth is 50 + ITEM Assertion OK : Range Height is 300 + ITEM Assertion OK : Range Width is 787.5 + ITEM Assertion OK : RowHeight is null: True + ITEM Assertion OK : ColumnWidth is null: True +END 'Heights and Widths' Symbol + TEST OK : Heights and Widths +---------------------------------------------------------------- +RangeRowColumn-Issue + TEST START : RangeRowColumn-Issue + ITEM Assertion OK : Row is: 8 + ITEM Assertion OK : Column is: 5 + ITEM Assertion OK : EntireRow.Columns.Count = 1024 + ITEM Assertion OK : EntireColumn.Rows.Count = 131072 +END 'RangeRowColumn-Issue' Symbol + TEST OK : RangeRowColumn-Issue +---------------------------------------------------------------- +Replace-Issue + TEST START : Replace-Issue + ITEM Assertion OK : Value after Replace: YourValue + ITEM Assertion OK : Value after Replace: YourValue + ITEM Assertion OK : Value after Replace: ReplaceValue + ITEM Assertion OK : Value after Replace: New ReplaceValue + ITEM Assertion OK : Value after Replace: New ReplaceValue + ITEM Assertion OK : Value after Replace: New Replace + ITEM Assertion OK : Value after Replace: +END 'Replace-Issue' Symbol + TEST OK : Replace-Issue +---------------------------------------------------------------- +Hidden-Issue + TEST START : Hidden-Issue + ITEM Assertion OK : - Range.Rows.Hidden (set) + ITEM Assertion OK : - Range.Rows.Hidden (get) + ITEM Assertion OK : - Range.Rows.Item(1).Hidden (set) + ITEM Assertion OK : - Range.Rows.Item(1).Hidden (get) + ITEM Assertion OK : - Range.Columns.Hidden (set) + ITEM Assertion OK : - Range.Columns.Hidden (get) + ITEM Assertion OK : - Range.Columns.Item(1).Hidden (set) + ITEM Assertion OK : - Range.Columns.Item(1).Hidden (get) +END 'Hidden-Issue' Symbol + TEST OK : Hidden-Issue +---------------------------------------------------------------- +End issue + TEST START : End issue + ITEM Assertion OK : - = $E$48 + ITEM Assertion OK : - = $E$1 + ITEM Assertion OK : - = $E$3 + ITEM Assertion OK : - = $A$8 + ITEM Assertion OK : - = $B$8 + ITEM Assertion OK : - = $AMJ$8 + ITEM Assertion OK : - = $Z$8 +END 'End issue' Symbol + TEST OK : End issue +---------------------------------------------------------------- +Outline issue + TEST START : Outline issue + ITEM Assertion OK : - Range.clearOutline - please check visually + ITEM Assertion OK : - Range.AutoOutline - please check visually + ITEM Assertion OK : - Range.AutoOutline - please check visually +END 'Outline issue' Symbol + TEST OK : Outline issue +---------------------------------------------------------------- +Validation + TEST START : Validation + ITEM Assertion OK : Validation Input Message is : Attention! + ITEM Assertion OK : Validation Input Message is : Enter an integer from five to ten + ITEM Assertion OK : Validation Error Title is : You must enter a number from five to ten + ITEM Assertion OK : Validation Error Message is : An Error occured + ITEM Assertion OK : Validation Error Title is : Microsoft Excel +END 'Validation' Symbol + TEST OK : Validation +Test run finished : 18/09/2009 16:02:06 diff --git a/sc/source/ui/vba/testvba/Logs/Shapes.log b/sc/source/ui/vba/testvba/Logs/Shapes.log new file mode 100644 index 000000000000..94b6ef29f02b --- /dev/null +++ b/sc/source/ui/vba/testvba/Logs/Shapes.log @@ -0,0 +1,77 @@ +Test run started : 18/09/2009 16:01:55 +BEGIN Shapes_Collection_Behaviour + TEST START : Shapes_Collection_Behaviour + ITEM Assertion OK : Name of indexed shape should be 'Sheet2Shape1' + ITEM Assertion OK : Name of indexed shape should be 'Sheet2Shape2' + TEST Success. : Shapes_Collection_Behaviour +END Shapes_Collection_Behaviour +BEGIN Shapes_Select_Item + TEST START : Shapes_Select_Item + ITEM Assertion OK : Correctly selected shape through Range + ITEM Assertion OK : Correctly selected shape through Item + ITEM Assertion OK : Needs to be visually checked. Is there a line on the document? + ITEM Assertion OK : Needs to be visually checked. Are All Shapes Selected? + TEST Success. : Shapes_Select_Item +END Shapes_Select_Item +BEGIN Shapes_Fill + TEST START : Shapes_Fill + ITEM Assertion OK : correctly set visibility of shape fill + ITEM Assertion OK : correctly set transparency of shape line + ITEM Assertion OK : correctly set forecolor of shape fill + ITEM Assertion FAIL : correctly set backcolor of shape fill + ITEM Assertion OK : the success of the TwoColorGradient method needs to be verified visually! + ITEM Assertion OK : correctly set forecolor of shape fill + ITEM Assertion FAIL : correctly set forecolor of shape fill + TEST Success. : Shapes_Fill +END Shapes_Fill +BEGIN Shapes_Line + TEST START : Shapes_Line + ITEM Assertion FAIL : correctly set weight of shape line + ITEM Assertion OK : correctly set visibility of shape line + ITEM Assertion OK : correctly set transparency of shape line + ITEM Assertion OK : correctly set dash style of shape line + ITEM Assertion OK : correctly set dash style of shape line + ITEM Assertion OK : correctly set forecolor of shape line + ITEM Assertion FAIL : correctly set backcolor of shape line + TEST Success. : Shapes_Line +END Shapes_Line +BEGIN Shapes_TextFrame + TEST START : Shapes_TextFrame + ITEM Assertion OK : correctly set Autosize of Shape TextFrame + TEST Success. : Shapes_TextFrame +END Shapes_TextFrame +BEGIN Shapes_SimpleGeometry + TEST START : Shapes_SimpleGeometery + ITEM Assertion OK : shape height should be 46.7023593888278 and got 46.6866112323395 + ITEM Assertion OK : shape width should be 101.496056724658 and got 101.48030856817 + ITEM Assertion OK : shape left should be 68.5574761223637 and got 68.5417279658754 + ITEM Assertion OK : shape top should be 41.6850368702339 and got 41.6692887137456 + ITEM Assertion OK : shape rotation should be 0 and got 0 + ITEM Assertion OK : shape rotation should be 25 and got 25 + ITEM Assertion OK : shape incrementrotation should be 50 and got 50 + ITEM Assertion OK : shape incrementleft should be 70.7968460600412 and got 70.7810979035529 + ITEM Assertion OK : shape incrementtop should be 90.8944825893239 and got 90.8787344328356 + TEST Success. : Shapes_SimpleGeometery +END Shapes_SimpleGeometry +BEGIN Shapes_Range + TEST START : Shapes_Range + ITEM Assertion OK : expected Sheets(2).Shapes.Range(1) to contain 1 element, it contains 1 + ITEM Assertion OK : expected Sheets(2).Shapes.Range(1) to return Sheet2Shape1 got Sheet2Shape1 + ITEM Assertion OK : expected Sheets(2).Shapes.Range(Sheet2Shape3) to contain 1 element, it contains 1 + ITEM Assertion OK : expected Sheets(2).Shapes.Range(Sheet2Shape3) to return Sheet2Shape3 got Sheet2Shape3 + ITEM Assertion OK : expected Sheets(2).Shapes.Range(Array(3, 1) to contain 2 elements, it contains 2 + ITEM Assertion OK : expected Sheets(2).Shapes.Range(Array(3, 1) to return concated element/shape names Sheet2Shape3Sheet2Shape1 and got Sheet2Shape3Sheet2Shape1 + ITEM Assertion OK : expected Sheets(2).Shapes.Range(Array('Sheet2Shape3', 1, 'Sheet2Shape2')) to contain 3 elements, it contains 3 + ITEM Assertion OK : expected Sheets(2).Shapes.Range(Array('Sheet2Shape3', 1, 'Sheet2Shape2')) to return concated element/shape names Sheet2Shape3Sheet2Shape1Sheet2Shape2 and got Sheet2Shape3Sheet2Shape1Sheet2Shape2 + TEST Success. : Shapes_Range +END Shapes_Range +BEGIN Shapes_ShapeRange + TEST START : Shapes_ShapeRange + ITEM Assertion OK : ShapeRange.IncrementLeft shp1.left should be 90.7810979035529 and got 90.7653486132064 + ITEM Assertion OK : ShapeRange.IncrementLeft shp2.left should be 240.02518299054 and got 240.009433700193 + ITEM Assertion OK : ShapeRange.IncrementTop shp1.Top should be 110.878734432836 and got 110.862985142489 + ITEM Assertion OK : ShapeRange.IncrementTop shp2.Top should be 64.6740129339204 and got 64.6582636435739 + ITEM Assertion OK : ShapeRange.IncrementRotation shp1.Rotation should be 70 and got 70 + ITEM Assertion OK : ShapeRange.IncrementRotation shp2.Rotation should be 20 and got 20 +END Shapes_ShapeRange +Test run finished : 18/09/2009 16:01:55 diff --git a/sc/source/ui/vba/testvba/Logs/StrConv-test.log b/sc/source/ui/vba/testvba/Logs/StrConv-test.log new file mode 100644 index 000000000000..78526d4c3fe3 --- /dev/null +++ b/sc/source/ui/vba/testvba/Logs/StrConv-test.log @@ -0,0 +1,9 @@ +Test run started : 18/09/2009 16:02:09 +BEGIN StrConv + TEST START : Test StrConv function + ITEM Assertion OK : Converts the string to uppercase characters:ABC EFG HIJ + ITEM Assertion OK : Converts the string to lowercase characters:abc efg hij + ITEM Assertion OK : Converts the first letter of every word in string to uppercase:Abc Efg Hij + TEST OK : Test StrConv function +END StrConv +Test run finished : 18/09/2009 16:02:09 diff --git a/sc/source/ui/vba/testvba/Logs/Template.log b/sc/source/ui/vba/testvba/Logs/Template.log new file mode 100644 index 000000000000..db96c7fef904 --- /dev/null +++ b/sc/source/ui/vba/testvba/Logs/Template.log @@ -0,0 +1,14 @@ +Test run started : 18/09/2009 16:02:00 +---------------------------------------------------------------- +TestCaseName + TEST START : TestCaseName + ITEM Assertion OK : Something has been done. +Test Results +============ + +Tests passed: 1 +Tests failed: 0 + +END 'TestCaseName + TEST OK : TestCaseName +Test run finished : 18/09/2009 16:02:00 diff --git a/sc/source/ui/vba/testvba/Logs/TestAddress.log b/sc/source/ui/vba/testvba/Logs/TestAddress.log new file mode 100644 index 000000000000..0f942fd347a3 --- /dev/null +++ b/sc/source/ui/vba/testvba/Logs/TestAddress.log @@ -0,0 +1,67 @@ +Test run started : 18/09/2009 16:02:09 +---------------------------------------------------------------- +TestAddress + TEST START : TestAddress + ITEM Assertion OK : test1 Range('e3:f3') A1 style addressing + ITEM Assertion OK : test2 Range('e3:f3') R1C1 style addressing + ITEM Assertion OK : test3 Range ('e:f') A1 style addressing + ITEM Assertion OK : test4 Range ('e:f') R1C1 style addressing + ITEM Assertion OK : test5 Columns A1 style addressing + ITEM Assertion OK : test6 Columns R1C1 style addressing + ITEM Assertion OK : test7 Columns(3) A1 style addressing + ITEM Assertion OK : test8 Columns(3) R1C1 style addressing + ITEM Assertion OK : test9 Columns('e') A1 style addressing + ITEM Assertion OK : test10 Columns('e') R1C1 style addressing + ITEM Assertion OK : test11 Columns('b:d') A1 style addressing + ITEM Assertion OK : test12 Columns('b:d') R1C1 style addressing + ITEM Assertion OK : test13 Range('c1:g10').Columns A1 style addressing + ITEM Assertion OK : test14 Range('c1:g10').Columns R1C1 style addressing + ITEM Assertion OK : test15 Range('c1:g10').Columns(1) A1 style addressing + ITEM Assertion OK : test16 Range('c1:g10').Columns(1) R1C1 style addressing + ITEM Assertion OK : test17 Range('c1:g10').Columns('a') A1 style addressing + ITEM Assertion OK : test18 Range('c1:g10').Columns('a') R1C1 style addressing + ITEM Assertion OK : test19 Range('c1:g10').Columns('c') A1 style addressing + ITEM Assertion OK : test20 Range('c1:g10').Columns('c') R1C1 style addressing + ITEM Assertion OK : test21 Range('c1:g10').Columns('x:z') A1 style addressing + ITEM Assertion OK : test22 Range('c1:g10').Columns('x:z') R1C1 style addressing + ITEM Assertion OK : test23 Range('c1:g10').Columns(30) A1 style addressing + ITEM Assertion OK : test24 Range('c1:g10').Columns(30) R1C1 style addressing + ITEM Assertion OK : test25 Worksheets('Sheet2').Cells(1, 1) A1 style addressing + ITEM Assertion OK : test26 Worksheets('Sheet2').Cells(1, 1) A1 style addressing, RowAddressAbsolute is false + ITEM Assertion OK : test27 Worksheets('Sheet2').Cells(1, 1) A1 style addressing, ColAddressAbsolute is false + ITEM Assertion OK : test28 Worksheets('Sheet2').Cells(1, 1) R1C1 style addressing + ITEM Assertion OK : test29 Worksheets('Sheet2').Range('A1:E5').EntireColumn A1 style addressing + ITEM Assertion OK : test30 Worksheets('Sheet2').Range('A1').EntireColumn A1 style addressing + ITEM Assertion OK : test31 Worksheets('Sheet2').Range('A1:E5').EntireRow A1 style addressing + ITEM Assertion OK : test32 Worksheets('Sheet2').Range('A1') A1 style addressing + ITEM Assertion OK : test33 Worksheets('Sheet2').Range('IV65536').EntireRow A1 style addressing + ITEM Assertion OK : test34 Worksheets('Sheet2').Range('IU2:IV65536') A1 style addressing + ITEM Assertion OK : test35 Range('c1:g10').Columns('x:z') R1C1 style addressing + ITEM Assertion OK : test36 Worksheets('Sheet2').Range('A1') A1 style addressing + ITEM Assertion OK : test37 Worksheets('Sheet2').Range('A1:E5').EntireColumn A1 style addressing + ITEM Assertion OK : test38 Worksheets('Sheet2').Range('10:12') A1 style addressing + ITEM Assertion OK : test39 Worksheets('Sheet2').Range('10:12') R1C1 style addressing + ITEM Assertion OK : test40 Range('Sheet3!A1:B4') A1 style addressing + ITEM Assertion OK : test41 Range('Sheet3!A1,B1,D4:F20') A1 style addressing + ITEM Assertion OK : test42 Range('g20:h40').Columns('c:c') + ITEM Assertion OK : test43 Range('g20:h40').Columns('c:f') + ITEM Assertion OK : test44 Range('g20:h40').Columns(-1) + ITEM Assertion OK : test45 Range('c4:g10').Rows(-1) + ITEM Assertion OK : test46 Range('a2:b4').Rows('1:1') + ITEM Assertion OK : test47 Range('a2:b4').Rows('1:2') + ITEM Assertion OK : test48 Range('a2:b4').Rows('2:2') + ITEM Assertion OK : test49 Range('a2:b4').Rows('2:3') + ITEM Assertion OK : test50 Range(' A2:B4 ') + ITEM Assertion OK : test51 Range('A 2:B 4') + ITEM Assertion OK : test52 Range('A2 : B4 ') + ITEM Assertion OK : test53 Range('Sheet1 !A2 : B4 ') + ITEM Assertion OK : test54 Range('Sheet1! A2 : B4 ') +Test Results +============ + +Tests passed: 54 +Tests failed: 0 + +END 'TestAddress + TEST OK : TestAddress +Test run finished : 18/09/2009 16:02:09 diff --git a/sc/source/ui/vba/testvba/Logs/TestCalc_Rangetest.log b/sc/source/ui/vba/testvba/Logs/TestCalc_Rangetest.log new file mode 100644 index 000000000000..be8065f61efc --- /dev/null +++ b/sc/source/ui/vba/testvba/Logs/TestCalc_Rangetest.log @@ -0,0 +1,60 @@ +Test run started : 18/09/2009 16:02:23 +BEGIN TestCalc + TEST START : RangeTest2 + ITEM Assertion OK : - Range("D15").Row + ITEM Assertion OK : - WorkSheet("D15").Range.Row + ITEM Assertion OK : - Range("D15").Column + ITEM Assertion OK : - Worksheet.Range("D15").Column + ITEM Assertion OK : - Range("D1").EntireRow.Valuer + ITEM Assertion OK : - Range("D1").EntireRow.Valuer + ITEM Assertion OK : - Range("D1").EntireRow.Columns.Count + ITEM Assertion OK : - Range("D1").EntireColumn.Rows.Count + ITEM Assertion OK : - Range("D15").ClearContent + ITEM Assertion OK : - Range("M1:N2").Rows.Hidden (set) + ITEM Assertion OK : - Range("M1:N2").Rows.Hidden (get) + ITEM Assertion OK : - Range("M1:N2").Rows(1).Hidden (set) + ITEM Assertion OK : - Range("M1:N2").Rows(1).Hidden (get) + ITEM Assertion OK : - Range("M1:N2").Columns.Hidden (set) + ITEM Assertion OK : - Range("M1:N2").Columns.Hidden (get) + ITEM Assertion OK : - Range("M1:N2").Columns(1).Hidden (set) + ITEM Assertion OK : - Range("M1:N2").Columns(1).Hidden (get) + ITEM Assertion OK : - Range("B38").Orientation (get) + ITEM Assertion OK : - Range("B38").Orientation (set) + ITEM Assertion OK : - Range("B38").Orientation (set = xlDownward) + ITEM Assertion OK : - Range("B38").Orientation (set) + ITEM Assertion OK : - Range("B38").Orientation (set = xlUpward) + ITEM Assertion OK : - Range("B38").Orientation (set) + ITEM Assertion OK : - Range("B38").Orientation (set = xlVertical) + ITEM Assertion OK : - Range("B38").Orientation (set) + ITEM Assertion OK : - Range("B38").Orientation (set = xlVertical) + ITEM Assertion OK : - Range("B39").WrapText (get) + ITEM Assertion OK : - Range("B39").WrapText (set) + ITEM Assertion OK : - Range("B39").WrapText (set) + ITEM Assertion OK : - Range("E39").MergeCells (get) + ITEM Assertion OK : - Range("F39").MergeCells (get) + ITEM Assertion OK : - Range("E39").MergeCells (set) + ITEM Assertion FAIL : - Range("F39").MergeCells (set) + ITEM Assertion OK : - Range("E39").MergeCells (set) + ITEM Assertion OK : - Range("F39").MergeCells (set) + ITEM Assertion OK : - Range("C41:C42").Replace MatchCase:=True + ITEM Assertion OK : - Range("C41:C42").Replace MatchCase:=True + ITEM Assertion OK : - Range("D41:D42").Replace MatchCase:=False + ITEM Assertion OK : - Range("B39").VerticalAlignment (get) + ITEM Assertion OK : - Range("B39").VerticalAlignment (set) + ITEM Assertion OK : - Range("B39").VerticalAlignment (get) + ITEM Assertion OK : - Range("B39").VerticalAlignment (get) + ITEM Assertion OK : - Range("B39").VerticalAlignment (set) + ITEM Assertion OK : - Range("B39").VerticalAlignment (get) + ITEM Assertion OK : - Range("B39").VerticalAlignment (set) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (get) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (set) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (get) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (set) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (get) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (set) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (get) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (set) + ITEM FAIL (RangeTest2) + TEST Not succesfully completed : RangeTest2 +END TestCalc +Test run finished : 18/09/2009 16:02:26 diff --git a/sc/source/ui/vba/testvba/Logs/TestCalc_Rangetest2.log b/sc/source/ui/vba/testvba/Logs/TestCalc_Rangetest2.log new file mode 100644 index 000000000000..cc034b2b8226 --- /dev/null +++ b/sc/source/ui/vba/testvba/Logs/TestCalc_Rangetest2.log @@ -0,0 +1,65 @@ +Test run started : 18/09/2009 16:02:18 +BEGIN TestCalc + TEST START : RangeTest3 + ITEM Assertion OK : - setFormulaR1C1 + ITEM Assertion OK : - getFormulaR1C1 + ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial() + ITEM Assertion OK : - Range.Copy(Range("I10")) + ITEM Assertion OK : PasteSpecial Paste:=xlPasteValues + ITEM Assertion OK : PasteSpecial Paste:=xlPasteFormulas + ITEM Assertion OK : PasteSpecial Paste:=xlPasteFormats + ITEM Assertion OK : PasteSpecial + ITEM Assertion OK : PasteSpecial SkipBlanks:=True + ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationAdd + ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationSubtract + ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationMultiply + ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationDivide + ITEM Assertion OK : PasteSpecial Transpose:=True + ITEM Assertion FAIL : ActiveWorkbook.FileFormat + ITEM Assertion OK : ActiveWorkbook.Name + ITEM Assertion OK : ActiveWorkbook.FullName und ActiveWorkbook.Path + ITEM Assertion FAIL : - = ActiveWorkbook.Colors(3) set + ITEM Assertion OK : - = ActiveWorkbook.ResetColors + ITEM Assertion OK : - = ActiveWorkbook.Colors(3) get + ITEM Assertion OK : - = Range("K22").End (xlDown) + ITEM Assertion OK : - = Range("K22").End (xlUo) + ITEM Assertion OK : - = Range("K22").End (xlToLeft) + ITEM Assertion OK : - = Range("K22").End (xlRight) + ITEM Assertion OK : - ActiveSpreadsheet.Next + ITEM Assertion OK : - ActiveSpreadsheet.Next + ITEM Assertion OK : - ActiveSpreadsheet.Previous + ITEM Assertion OK : - ActiveSpreadsheet.Previous + ITEM Assertion OK : - Range("J4:J11").AutoFilter field:=1, Criteria1:="x" + ITEM Assertion OK : - Range("J4:J11").AutoFilter field:=1, Criteria1:="<>" + ITEM Assertion OK : - Range("J4:J11").AutoFilter field:=1, Criteria1:="=" + ITEM Assertion OK : - Range("J4:J11").AutoFilter + ITEM Assertion OK : - ActiveSheet.Resize.Select + ITEM Assertion OK : - Application.GoTo Reference:="R8C2" + ITEM Assertion FAIL : - Application.GoTo Reference:="R[8]C[2]" + ITEM Assertion OK : - Application.GoTo Reference:="R8C2" + ITEM Assertion OK : - Range.Group - please check visually + ITEM Assertion OK : - Range.Group - please check visually + ITEM Assertion OK : - Range.Ungroup- please check visually + ITEM Assertion OK : - Range.Ungroup - please check visually + ITEM Assertion OK : - Range.Group - please check visually + ITEM Assertion OK : - Range.Group - please check visually + ITEM Assertion OK : - Range.clearOutline - please check visually + ITEM Assertion OK : - Range.AutoOutline - please check visually + ITEM Assertion OK : - Range.AutoOutline - please check visually + ITEM Assertion OK : - ActiveSheet.UsedRange.Select + ITEM Assertion OK : - Range("A13").AddIndent + ITEM Assertion OK : - Range("A13").IndentLevel set + ITEM Assertion OK : - Range("A13").IndentLevel get + ITEM Assertion OK : - Range("A13").IndentLevel get + ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial() + ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial() + ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial() + ITEM Assertion OK : - Range.Calculate + ITEM Assertion OK : Worksheet.Calculate + ITEM Assertion OK : - Application.Calculate + ITEM Assertion OK : Global.Calculate + ITEM Assertion OK : Calculation set + ITEM FAIL (RangeTest3) + TEST Not succesfully completed : RangeTest3 +END TestCalc +Test run finished : 18/09/2009 16:02:21 diff --git a/sc/source/ui/vba/testvba/Logs/TestIntersection.log b/sc/source/ui/vba/testvba/Logs/TestIntersection.log new file mode 100644 index 000000000000..420a58697150 --- /dev/null +++ b/sc/source/ui/vba/testvba/Logs/TestIntersection.log @@ -0,0 +1,26 @@ +Test run started : 18/09/2009 16:01:56 +---------------------------------------------------------------- +TestIntersection + TEST START : TestIntersection + ITEM Assertion OK : test1 Application.Intersect( Range('A2:D10'), Range('C4:E6')) + ITEM Assertion OK : test2 Application.Intersect( Range('A2:D10'), Range('A4:G10')) + ITEM Assertion OK : test3 Application.Intersect( Range('A2:c8,d2:f8,g2:i8'), Range('A4:G10')) + ITEM Assertion OK : test4 Application.Intersect( Range('A4:G10'), Range('A2:c8,d2:f8,g2:i8')) + ITEM Assertion OK : test5 Application.Intersect( Range('A2:c8,d2:f8,g2:i8'), Range('g4:i10,A4:G10')) + ITEM Assertion OK : test6 Application.Intersect( Range('g4:i10,A4:G10'), Range('A2:c8,d2:f8,g2:i8')) + ITEM Assertion OK : test7 Application.Intersect( Range('a2:d10,b5:e10'), Range('a5:i10')) + ITEM Assertion OK : test8 Application.Intersect( Range('a2:c8,d2:f8'), Range('b6:e9,a6:f9')) + ITEM Assertion OK : test9 Application.Intersect( Range('a2:c8,e2:f8'), Range('b6:e9,a6:f9')) + ITEM Assertion OK : test10 Application.Intersect( Range('a1:a3,c1:c3'), Range('a2:c3')) + ITEM Assertion OK : test11 Application.Intersect( Range('a1:a3,b1:b3'), Range('a2:c3')) + ITEM Assertion OK : test12 Application.Intersect( Range('a2:d5,b3:f7,c1:g4'), Range('b2:e6')) + ITEM Assertion OK : test13 Range(" a2:d10,b5:e10,g13:j32 "), Range(" a5:i10,b6:e9 "), Range("b2:r5,f10:h19") +Test Results +============ + +Tests passed: 13 +Tests failed: 0 + +END 'TestIntersection + TEST OK : TestIntersection +Test run finished : 18/09/2009 16:01:56 diff --git a/sc/source/ui/vba/testvba/Logs/TestUnion.log b/sc/source/ui/vba/testvba/Logs/TestUnion.log new file mode 100644 index 000000000000..0b5e71952c4d --- /dev/null +++ b/sc/source/ui/vba/testvba/Logs/TestUnion.log @@ -0,0 +1,17 @@ +Test run started : 18/09/2009 16:02:27 +---------------------------------------------------------------- +TestUnion + TEST START : TestUnion + ITEM Assertion OK : test1Application.Range('A2:D10'), Range('C4:E6') + ITEM Assertion OK : test2Application.Range('A2:D5,a3:d4'), Range('A4:G10') + ITEM Assertion OK : test3Application.Range('A4:G10,A1:B6'), Range('A2:D5,A3:D4') + ITEM Assertion OK : test4Application.Range('A5:D10'), Range('B5:E10') +Test Results +============ + +Tests passed: 4 +Tests failed: 0 + +END 'TestUnion + TEST OK : TestUnion +Test run finished : 18/09/2009 16:02:27 diff --git a/sc/source/ui/vba/testvba/Logs/Window.log b/sc/source/ui/vba/testvba/Logs/Window.log new file mode 100644 index 000000000000..e23cb32ade89 --- /dev/null +++ b/sc/source/ui/vba/testvba/Logs/Window.log @@ -0,0 +1,46 @@ +Test run started : 18/09/2009 16:02:27 +---------------------------------------------------------------- + TEST START : Window-Issue + ITEM Assertion OK : Window.Left is: 0 (Test only applies to maximized Window) + ITEM Assertion OK : Window.Top is: 46 (Test only applies to maximized Window) + ITEM Assertion OK : Window.Width is: 1280 (Test only applies to maximized Window) + ITEM Assertion OK : Window.Height is: 753 (Test only applies to maximized Window) + ITEM Assertion OK : Window.ScrollColumn is: 100 + ITEM Assertion OK : Window.ScrollColumn is: 1 + ITEM Assertion OK : Window.ScrollRow is: 100 + ITEM Assertion OK : Window.ScrollRow is: 1 + ITEM Assertion OK : Window.LargeScroll(Down): ScrollRow is: 106 (Test may only apply to maximized Window) + ITEM Assertion OK : Window.LargeScroll(Up): ScrollRow is: 1 + ITEM Assertion OK : Window.LargeScroll(ToRight): ScrollColumn is: 58 (Test may only apply to maximized Window) + ITEM Assertion OK : Window.LargeScroll(ToLeft): ScrollColumn is: 1 + ITEM Assertion OK : Window.SmallScroll(ToRight): ScrollColumn is: 4 (Test may only apply to maximized Window) + ITEM Assertion OK : Window.SmallScroll(ToLeft): ScrollColumn is: 1 + ITEM Assertion OK : Window.DisplayWorkBookTabs is: False + ITEM Assertion OK : Window.DisplayWorkBookTabs is: True + ITEM Assertion OK : Window.DisplayVerticalScrollBar is: True + ITEM Assertion OK : Window.DisplayVerticalScrollBar is: False + ITEM Assertion OK : Window.DisplayHorizontalScrollBar is: False + ITEM Assertion OK : Window.DisplayHorizontalScrollBar is: True + ITEM Assertion OK : Window.DisplayHeadings is: False + ITEM Assertion OK : Window.DisplayHeadings is: True + ITEM Assertion OK : Window.DisplayOutline is: False + ITEM Assertion OK : Window.DisplayOutline is: True + ITEM Assertion OK : Window.Visible is: False + ITEM Assertion OK : Window.Visible is: True + ITEM Assertion OK : Window.Caption is: MyCaption + ITEM Assertion OK : Pane.ScrollColumn is: 100 + ITEM Assertion OK : Pane.ScrollColumn is: 1 + ITEM Assertion OK : Pane.ScrollRow is: 100 + ITEM Assertion OK : Pane.ScrollRow is: 1 + ITEM Assertion OK : Pane.LargeScroll(Down): ScrollRow is: 106 (Test may only apply to maximized Window) + ITEM Assertion OK : Pane.LargeScroll(Up): ScrollRow is: 1 + ITEM Assertion OK : Pane.LargeScroll(ToRight): ScrollColumn is: 58 (Test may only apply to maximized Window) + ITEM Assertion OK : Pane.LargeScroll(ToLeft): ScrollColumn is: 1 + ITEM Assertion OK : Pane.SmallScroll(ToRight): ScrollColumn is: 4 (Test may only apply to maximized Window) + ITEM Assertion OK : Pane.SmallScroll(ToLeft): ScrollColumn is: 1 + ITEM Assertion OK : Window Selection: $A$2:$D$5 + ITEM Assertion OK : ActiveSheet name of Window: Sheet1 + ITEM Assertion OK : Window ActiveCell: $A$1 +END 'Window-Issue' Symbol + TEST OK : Window-Issue +Test run finished : 18/09/2009 16:02:28 diff --git a/sc/source/ui/vba/testvba/Logs/bytearraystring.log b/sc/source/ui/vba/testvba/Logs/bytearraystring.log new file mode 100644 index 000000000000..27d4fc32b214 --- /dev/null +++ b/sc/source/ui/vba/testvba/Logs/bytearraystring.log @@ -0,0 +1,8 @@ +Test run started : 18/09/2009 16:02:11 +BEGIN Bytearray To String + TEST START : Test the conversion between bytearray and string + ITEM Assertion OK : The number of byte is:6 + ITEM Assertion OK : the return string is: abc + TEST OK : Test the conversion between bytearray and string +END Bytearray To String +Test run finished : 18/09/2009 16:02:11 diff --git a/sc/source/ui/vba/testvba/Logs/dateserial.log b/sc/source/ui/vba/testvba/Logs/dateserial.log new file mode 100644 index 000000000000..ae14372c11b8 --- /dev/null +++ b/sc/source/ui/vba/testvba/Logs/dateserial.log @@ -0,0 +1,9 @@ +Test run started : 18/09/2009 16:01:54 +BEGIN DateSerial + TEST START : Test DateSerial function + ITEM Assertion OK : the return date is: 15/06/1999 + ITEM Assertion OK : the return date is: 15/06/1999 + ITEM Assertion OK : the return date is: 15/06/1999 + TEST OK : Test DateSerial function +END DateSerial +Test run finished : 18/09/2009 16:01:54 diff --git a/sc/source/ui/vba/testvba/Logs/datevalue.log b/sc/source/ui/vba/testvba/Logs/datevalue.log new file mode 100644 index 000000000000..74dd6444617b --- /dev/null +++ b/sc/source/ui/vba/testvba/Logs/datevalue.log @@ -0,0 +1,8 @@ +Test run started : 18/09/2009 16:02:29 +BEGIN DateValue + TEST START : Test DateValue function + ITEM Assertion OK : the return date is: 12/02/1969 + ITEM Assertion OK : the return date is: 21/01/2008 + TEST OK : Test DateValue function +END DateValue +Test run finished : 18/09/2009 16:02:29 diff --git a/sc/source/ui/vba/testvba/Logs/format.log b/sc/source/ui/vba/testvba/Logs/format.log new file mode 100644 index 000000000000..0eb6c532999e --- /dev/null +++ b/sc/source/ui/vba/testvba/Logs/format.log @@ -0,0 +1,36 @@ +Test run started : 18/09/2009 16:02:15 +BEGIN Format + TEST START : Test Predefined_Number_Format_Sample function + ITEM Assertion OK : General Number: 562486.2356 + ITEM Assertion OK : Fixed: 0.20 + ITEM Assertion OK : Standard: 562,486.24 + ITEM Assertion OK : Percent: 75.21% + ITEM Assertion OK : Scientific: 5.62E+05 + ITEM Assertion OK : Scientific: -3.46E+03 + ITEM Assertion OK : Yes/No: No + ITEM Assertion OK : Yes/No: Yes + ITEM Assertion OK : True/False: False + ITEM Assertion OK : True/False: True + ITEM Assertion OK : On/Off: Off + ITEM Assertion OK : On/Off: On + TEST OK : Test Predefined_Number_Format_Sample function + TEST START : Test Custom_Number_Format_Sample function + ITEM Assertion OK : 00.0000: 23.6750 + ITEM Assertion OK : 00.00: 23.68 + ITEM Assertion OK : 00000: 02658 + ITEM Assertion OK : 00.00: 2658.00 + ITEM Assertion OK : ##.####: 23.675 + ITEM Assertion OK : ##.##: 23.68 + ITEM Assertion OK : #,###.##: 12,345.25 + ITEM Assertion OK : ##.00%: 25.00% + ITEM Assertion OK : #,###: 1,000,000 + ITEM Assertion OK : ######E-###: 109838E-5 + ITEM Assertion OK : $#,###.##: $2,345.25 + ITEM Assertion OK : ##.###\%: .25% + TEST OK : Test Custom_Number_Format_Sample function + TEST START : Test Custom_Text_Format_Sample function + ITEM Assertion OK : <: vba + ITEM Assertion OK : >: VBA + TEST OK : Test Custom_Text_Format_Sample function +END Format +Test run finished : 18/09/2009 16:02:15 diff --git a/sc/source/ui/vba/testvba/Logs/pagesetup.log b/sc/source/ui/vba/testvba/Logs/pagesetup.log new file mode 100644 index 000000000000..66201a9097e7 --- /dev/null +++ b/sc/source/ui/vba/testvba/Logs/pagesetup.log @@ -0,0 +1,77 @@ +Test run started : 18/09/2009 16:01:57 +BEGIN PageSetup + TEST START : Sheet_PrintArea + ITEM Assertion OK : PrintArea has changed as expected + TEST OK : Sheet_PrintArea + TEST START : Test margins (no headers) + ITEM Assertion OK : PageSetup.LeftMargin set/get + ITEM Assertion OK : PageSetup.RightMargin set/get + ITEM Assertion OK : PageSetup.TopMargin set/get + ITEM Assertion OK : PageSetup.BottomMargin set/get +Verify that page margins on sheet 1 are all 0.5inch + TEST OK : Test margins (no headers) + TEST START : Test margins (headers) + ITEM Assertion OK : PageSetup.HeaderMargin set/get + ITEM Assertion OK : PageSetup.FooterMargin set/get + ITEM Assertion OK : PageSetup.LeftMargin set/get + ITEM Assertion OK : PageSetup.LeftMargin set/get +Verify that top/bottom/header/footer page margins on sheet 2 are all 0.5inch + TEST OK : Test margins (headers) + TEST START : Test header/footer text + ITEM Assertion OK : PageSetup.LeftHeader set + ITEM Assertion OK : PageSetup.LeftHeader set/get + ITEM Assertion OK : PageSetup.CenterHeader set + ITEM Assertion OK : PageSetup.CenterHeader set/get + ITEM Assertion OK : PageSetup.RightHeader set + ITEM Assertion OK : PageSetup.RightHeader set/get + ITEM Assertion OK : PageSetup.LeftFooter set + ITEM Assertion OK : PageSetup.LeftFooter set/get + ITEM Assertion OK : PageSetup.CenterFooter set + ITEM Assertion OK : PageSetup.CenterFooter set/get + ITEM Assertion OK : PageSetup.RightFooter set + ITEM Assertion OK : PageSetup.RightFooter set/get +Verify that headers on sheet 2 are Ready,to,go +Verify that footers on sheet 2 are This,now,Works + TEST OK : Test header/footer text + TEST START : Test zoom + ITEM Assertion OK : PageSetup.Zoom set + ITEM Assertion OK : PageSetup.Zoom set/get +Verify that sheet 1 zoom is 10% + TEST OK : Test zoom + TEST START : Test orientation + ITEM Assertion OK : PageSetup.Zoom set + ITEM Assertion OK : PageSetup.Orientation set/get +Verify that sheet 1 orientation is now landscape + TEST OK : Test orientation + TEST START : Test order + ITEM Assertion OK : PageSetup.Order get + ITEM Assertion OK : PageSetup.Order set/get +Verify that order on sheet 1 is now over, then down. + TEST OK : Test order + TEST START : Test first page number + ITEM Assertion OK : PageSetup.FirstPageNumber get + ITEM Assertion OK : PageSetup.FirstPageNumber set/get +Verify that first page number on sheet 1 is now 2. + TEST OK : Test first page number + TEST START : Test center vertically + ITEM Assertion OK : PageSetup.CenterVertically get + ITEM Assertion OK : PageSetup.CenterVertically set/get +Verify that CenterVertically on sheet 1 is now true. + TEST OK : Test center vertically + TEST START : Test center horizontally + ITEM Assertion OK : PageSetup.CenterHorizontally get + ITEM Assertion OK : PageSetup.CenterHorizontally set/get +Verify that CenterHorizontally on sheet 1 is now true. + TEST OK : Test center horizontally + TEST START : Test FitToPagesTall + ITEM Assertion OK : PageSetup.FitToPagesTall set/get + TEST OK : Test FitToPagesTall + TEST START : Test FitToPagesWide + ITEM Assertion OK : PageSetup.FitToPagesWide set/get + TEST OK : Test FitToPagesWide + TEST START : Test PrintHeadings + ITEM Assertion OK : PageSetup.PrintHeadings set/get + ITEM Assertion OK : PageSetup.PrintHeadings set/get + TEST OK : Test PrintHeadings +END PageSetup +Test run finished : 18/09/2009 16:01:57 diff --git a/sc/source/ui/vba/testvba/Logs/partition.log b/sc/source/ui/vba/testvba/Logs/partition.log new file mode 100644 index 000000000000..73c515bcfbf2 --- /dev/null +++ b/sc/source/ui/vba/testvba/Logs/partition.log @@ -0,0 +1,11 @@ +Test run started : 18/09/2009 16:02:10 +BEGIN Partition + TEST START : Test Partition function + ITEM Assertion OK : the number 20 occurs in the range:20:24 + ITEM Assertion OK : the number 20 occurs in the range: 20: 20 + ITEM Assertion OK : the number 120 occurs in the range:100: + ITEM Assertion OK : the number -5 occurs in the range: : -1 + ITEM Assertion OK : the number 2 occurs in the range: 2: 3 + TEST OK : Test Partition function +END Partition +Test run finished : 18/09/2009 16:02:10 diff --git a/sc/source/ui/vba/testvba/Logs/range-4.log b/sc/source/ui/vba/testvba/Logs/range-4.log new file mode 100644 index 000000000000..427b3846a871 --- /dev/null +++ b/sc/source/ui/vba/testvba/Logs/range-4.log @@ -0,0 +1,16 @@ +Test run started : 18/09/2009 16:02:07 +---------------------------------------------------------------- +ShowDetail-Issue + TEST START : ShowDetail-Issue + ITEM Assertion OK : Range.ShowDetail is True + ITEM Assertion OK : Range.ShowDetail is False +END 'ShowDetail-Issue' Symbol + TEST OK : ShowDetail-Issue +---------------------------------------------------------------- +RangeMerged-Issue + TEST START : RangeMerged-Issue + ITEM Assertion OK : Range.RangeMerged is $F$2:$H$5 + ITEM Assertion OK : The first address of Range.RangeMerged is $F$2 +END 'RangeMerged-Issue' Symbol + TEST OK : RangeMerged-Issue +Test run finished : 18/09/2009 16:02:07 diff --git a/sc/source/ui/vba/testvba/Logs/replace.log b/sc/source/ui/vba/testvba/Logs/replace.log new file mode 100644 index 000000000000..557d1bdfd69c --- /dev/null +++ b/sc/source/ui/vba/testvba/Logs/replace.log @@ -0,0 +1,14 @@ +Test run started : 18/09/2009 16:02:22 +BEGIN Replace + TEST START : Test Replace function + ITEM Assertion OK : common string:aefefdBc + ITEM Assertion OK : expression string:aefefdef + ITEM Assertion OK : binanary compare:aefefdBc + ITEM Assertion OK : text compare:aefefdef + ITEM Assertion OK : text compare:aefefdef + ITEM Assertion OK : start = 3:cefdBc + ITEM Assertion OK : count = 2: aefefdBc + ITEM Assertion OK : start = 1, count = 0, not support in Unix: abcbcdBc + TEST OK : Test Replace function +END Replace +Test run finished : 18/09/2009 16:02:22 diff --git a/sc/source/ui/vba/testvba/Logs/stringplusdouble.log b/sc/source/ui/vba/testvba/Logs/stringplusdouble.log new file mode 100644 index 000000000000..6b83c91775e8 --- /dev/null +++ b/sc/source/ui/vba/testvba/Logs/stringplusdouble.log @@ -0,0 +1,62 @@ +Test run started : 18/09/2009 16:01:59 +BEGIN String Plus Double + TEST START : double = string + double +The next compute raises error: s = null, d = null, r = s + d + ITEM Assertion OK : s = null, d = null, r = s + d .The result is: -1 + ITEM Assertion OK : s = null, d = null, r = s & d .The result is: 0 +The next compute raises error: s = null, d = 20, r = s + d + ITEM Assertion OK : s = null, d = 20, r = s + d .The result is: -1 + ITEM Assertion OK : s = null, d = 20, r = s & d .The result is: 20 + ITEM Assertion OK : s = '10', d = null, r = s + d .The result is: 10 + ITEM Assertion OK : s = '10', d = null, r = s & d .The result is: 100 + ITEM Assertion OK : s = '10', d = 20, r = s + d .The result is: 30 + ITEM Assertion OK : s = '10', d = 20, r = s & d .The result is: 1020 +The next compute raises error: s = 'abc', d = null, r = s + d + ITEM Assertion OK : s = 'abc', d = null, r = s + d .The result is: -1 +The next compute raises error: s = 'abc', d = null, r = s & d + ITEM Assertion OK : s = 'abc', d = null, r = s & d .The result is: -1 +The next compute raises error: s = 'abc', d = 20, r = s + d + ITEM Assertion OK : s = 'abc', d = 20, r = s + d .The result is: -1 +The next compute raises error: s = 'abc', d = 20, r = s & d + ITEM Assertion OK : s = 'abc', d = 20, r = s & d .The result is: -1 + TEST OK : double = string + double + TEST START : string = string + double +The next compute raises error: s = null, d = null, r = s + d + ITEM Assertion OK : s = null, d = null, r = s + d .The result is: -1 + ITEM Assertion OK : s = null, d = null, r = s & d .The result is: 0 +The next compute raises error: s = null, d = 20, r = s + d + ITEM Assertion OK : s = null, d = 20, r = s + d .The result is: -1 + ITEM Assertion OK : s = null, d = 20, r = s & d .The result is: 20 + ITEM Assertion OK : s = '10', d = null, r = s + d .The result is: 10 + ITEM Assertion OK : s = '10', d = null, r = s & d .The result is: 100 + ITEM Assertion OK : s = '10', d = 20, r = s + d .The result is: 30 + ITEM Assertion OK : s = '10', d = 20, r = s & d .The result is: 1020 +The next compute raises error: s = 'abc', d = null, r = s + d + ITEM Assertion OK : s = 'abc', d = null, r = s + d .The result is: -1 + ITEM Assertion OK : s = 'abc', d = null, r = s & d .The result is: abc0 +The next compute raises error: s = 'abc', d = 20, r = s + d + ITEM Assertion OK : s = 'abc', d = 20, r = s + d .The result is: -1 + ITEM Assertion OK : s = 'abc', d = 20, r = s & d .The result is: abc20 + TEST OK : string = string + double + TEST START : double = string + string +The next compute raises error: s = null, d = null, r = s + d + ITEM Assertion OK : s = null, d = null, r = s + d .The result is: -1 +The next compute raises error: s = null, d = null, r = s & d + ITEM Assertion OK : s = null, d = null, r = s & d .The result is: -1 + ITEM Assertion OK : s = null, d = 20, r = s + d .The result is: 20 + ITEM Assertion OK : s = null, d = 20, r = s & d .The result is: 20 + ITEM Assertion OK : s = '10', d = null, r = s + d .The result is: 10 + ITEM Assertion OK : s = '10', d = null, r = s & d .The result is: 10 + ITEM Assertion OK : s = '10', d = 20, r = s + d .The result is: 1020 + ITEM Assertion OK : s = '10', d = 20, r = s & d .The result is: 1020 +The next compute raises error: s = 'abc', d = null, r = s + d + ITEM Assertion OK : s = 'abc', d = null, r = s + d .The result is: -1 +The next compute raises error: s = 'abc', d = null, r = s & d + ITEM Assertion OK : s = 'abc', d = null, r = s & d .The result is: -1 +The next compute raises error: s = 'abc', d = 20, r = s + d + ITEM Assertion OK : s = 'abc', d = 20, r = s + d .The result is: -1 +The next compute raises error: s = 'abc', d = 20, r = s & d + ITEM Assertion OK : s = 'abc', d = 20, r = s & d .The result is: -1 + TEST OK : double = string + string +END String Plus Double +Test run finished : 18/09/2009 16:01:59 diff --git a/sc/source/ui/vba/testvba/Logs/window2.log b/sc/source/ui/vba/testvba/Logs/window2.log new file mode 100644 index 000000000000..c81c9ef45191 --- /dev/null +++ b/sc/source/ui/vba/testvba/Logs/window2.log @@ -0,0 +1,41 @@ +Test run started : 18/09/2009 16:02:16 +BEGIN Window2 + TEST START : Test Window.SplitRow + ITEM Assertion OK : Test SplitColumn: 2 (Test only applies to maximized Window and at least has 800*600 solotion) + ITEM Assertion OK : Test SplitRow: 2 (Test only applies to maximized Window and at least has 800*600 solotion) + ITEM Assertion OK : Test SplitVertical: 242.283803521067 + ITEM Assertion OK : Test SplitHorizontal: 242.283803521067 + ITEM Assertion OK : Test SplitRow: 4 (Test only applies to maximized Window and at least has 800*600 solotion) + ITEM Assertion OK : Test SplitColumn: 3 (Test only applies to maximized Window and at least has 800*600 solotion) + ITEM Assertion OK : Test SplitColumn: 0 + ITEM Assertion OK : Test SplitRow: 0 + TEST OK : Test Window.SplitRow + TEST START : Test Window.DisplayGridlines + ITEM Assertion OK : Test gridlines are on + ITEM Assertion OK : Test gridlines are off + TEST OK : Test Window.DisplayGridlines + TEST START : Test Window.DisplayHeadings + ITEM Assertion OK : Test Headings are on + ITEM Assertion OK : Test Headings are off + TEST OK : Test Window.DisplayHeadings + TEST START : Test Window.Visibility + ITEM Assertion OK : Window is visible + ITEM Assertion OK : Window is not visible + TEST OK : Test Window.Visibility + TEST START : Test Window.FreezePanes + ITEM Assertion OK : Test no panes frozen + ITEM Assertion OK : Test panes frozen at center + ITEM Assertion OK : Test panes frozen at split + TEST OK : Test Window.FreezePanes + TEST START : Test Window.View + TEST OK : Test Window.View + TEST START : Test Window.Zoom + ITEM Assertion OK : Test zoom=100% + ITEM Assertion OK : Test zoom=150% + TEST OK : Test Window.Zoom + TEST START : Test Windows.Count + ITEM Assertion OK : Windows Count: 1 + ITEM Assertion OK : Application.Windows Count: 1 + TEST OK : Test Windows.Count +END Window2 +Test run finished : 18/09/2009 16:02:16 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/ApplicationRunTest.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/ApplicationRunTest.xls new file mode 100644 index 000000000000..a5a591c1f849 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/ApplicationRunTest.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/AutoFilter.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/AutoFilter.xls new file mode 100644 index 000000000000..9b3a1043c5ee Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/AutoFilter.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/CalcFont.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/CalcFont.xls new file mode 100644 index 000000000000..9ddb69600643 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/CalcFont.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/CalcZoom.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/CalcZoom.xls new file mode 100644 index 000000000000..5db47c76dbe9 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/CalcZoom.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/FinancialFuncTests.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/FinancialFuncTests.xls new file mode 100644 index 000000000000..d4776b98fe1d Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/FinancialFuncTests.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/FinancialFuncs.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/FinancialFuncs.xls new file mode 100644 index 000000000000..bb8941809947 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/FinancialFuncs.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/MiscOperatorTests.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/MiscOperatorTests.xls new file mode 100644 index 000000000000..23227ae37e24 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/MiscOperatorTests.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/MiscRangeTests.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/MiscRangeTests.xls new file mode 100644 index 000000000000..ebd9e91b5b28 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/MiscRangeTests.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/PageBreaks.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/PageBreaks.xls new file mode 100644 index 000000000000..b6651fa5d617 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/PageBreaks.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/Ranges-2.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/Ranges-2.xls new file mode 100644 index 000000000000..f6e81cf933fd Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/Ranges-2.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/Ranges-3.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/Ranges-3.xls new file mode 100644 index 000000000000..8722f6d3057e Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/Ranges-3.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/Ranges.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/Ranges.xls new file mode 100644 index 000000000000..1c1d74d37486 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/Ranges.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/Shapes.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/Shapes.xls new file mode 100644 index 000000000000..254f3c97756c Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/Shapes.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/StrConv-test.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/StrConv-test.xls new file mode 100644 index 000000000000..198abbec5871 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/StrConv-test.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/Template.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/Template.xls new file mode 100644 index 000000000000..4387231fe744 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/Template.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/TestAddress.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/TestAddress.xls new file mode 100644 index 000000000000..48d30cbe2e9e Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/TestAddress.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/TestCalc_Rangetest.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/TestCalc_Rangetest.xls new file mode 100644 index 000000000000..a497d4f10f3e Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/TestCalc_Rangetest.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/TestCalc_Rangetest2.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/TestCalc_Rangetest2.xls new file mode 100644 index 000000000000..34c606fc28f5 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/TestCalc_Rangetest2.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/TestIntersection.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/TestIntersection.xls new file mode 100644 index 000000000000..24f88db87ccc Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/TestIntersection.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/TestUnion.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/TestUnion.xls new file mode 100644 index 000000000000..5b8f0968cf38 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/TestUnion.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/VariantTest.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/VariantTest.xls new file mode 100644 index 000000000000..f604cfbe3975 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/VariantTest.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/Window.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/Window.xls new file mode 100644 index 000000000000..6fb6963c2f31 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/Window.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/bytearraystring.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/bytearraystring.xls new file mode 100644 index 000000000000..471bbc349e5b Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/bytearraystring.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/dateserial.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/dateserial.xls new file mode 100644 index 000000000000..768fb513eba4 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/dateserial.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/datevalue.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/datevalue.xls new file mode 100644 index 000000000000..852a51d100b8 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/datevalue.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/format.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/format.xls new file mode 100644 index 000000000000..99ed64d38915 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/format.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/AutoFilter.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/AutoFilter.log new file mode 100644 index 000000000000..1fe0cbd01fe5 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/AutoFilter.log @@ -0,0 +1,20 @@ +Test run started : 17/07/2007 17:36:22 +---------------------------------------------------------------- +TestAddress + TEST START : TestAddress + ITEM Assertion OK : test1 'starts with' string criteria + ITEM Assertion OK : test2 'not equal to' string criteria + ITEM Assertion OK : test3 'ends with' string criteria + ITEM Assertion OK : test4 field 'all' + ITEM Assertion OK : test5 numeric '<15' + ITEM Assertion OK : test6 numeric '>=15' + ITEM Assertion OK : test7 numeric '<=12' +Test Results +============ + +Tests passed: 7 +Tests failed: 0 + +END 'TestAddress + TEST OK : TestAddress +Test run finished : 17/07/2007 17:36:23 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/MiscRangeTests.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/MiscRangeTests.log new file mode 100644 index 000000000000..260465386d07 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/MiscRangeTests.log @@ -0,0 +1,45 @@ +Test run started : 17/07/2007 15:01:37 +---------------------------------------------------------------- +MiscRangeTests + TEST START : MiscRangeTests + ITEM Assertion OK : test 1 + ITEM Assertion OK : test 2 + ITEM Assertion OK : test 3 + ITEM Assertion OK : test 4 + ITEM Assertion OK : test 5 + ITEM Assertion OK : test 6 + ITEM Assertion OK : test 7 + ITEM Assertion OK : test 8 + ITEM Assertion OK : test 9 + ITEM Assertion OK : test 10 + ITEM Assertion OK : test 11 + ITEM Assertion OK : test 12 + ITEM Assertion OK : test 13 + ITEM Assertion OK : test 14 + ITEM Assertion OK : test 15 + ITEM Assertion OK : test 16 + ITEM Assertion OK : test 17 + ITEM Assertion OK : test 18 + ITEM Assertion OK : test 19 + ITEM Assertion OK : test 20 + ITEM Assertion OK : test 21 + ITEM Assertion OK : test 22 + ITEM Assertion OK : test 23 + ITEM Assertion OK : test 24 + ITEM Assertion OK : test 25 + ITEM Assertion OK : test 26 + ITEM Assertion OK : test 27 + ITEM Assertion OK : test 28 + ITEM Assertion OK : test 29 + ITEM Assertion OK : test 30 + ITEM Assertion OK : test 31 +No. tests: 31 +Summary +======= +Run: 31 +Passed: 31 +Failed: 0 + +END 'MiscRangeTests + TEST OK : MiscRangeTests +Test run finished : 17/07/2007 15:01:39 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/Ranges-2.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/Ranges-2.log new file mode 100644 index 000000000000..736d5bbc42d0 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/Ranges-2.log @@ -0,0 +1,68 @@ +Test run started : 18/06/2007 17:50:04 +---------------------------------------------------------------- +ClearFormtsIssue + TEST START : ClearFormtsIssue + ITEM Assertion OK : Range.Font.Bold is: True + ITEM Assertion OK : Range.Font.Bold is: False +END 'ClearFormtsIssue' Symbol + TEST OK : ClearFormtsIssue +---------------------------------------------------------------- +VerticalAlignment-Issue + TEST START : VerticalAlignment-Issue + ITEM Assertion OK : - Range.VerticalAlignment (get) + ITEM Assertion OK : - Range.VerticalAlignment (set) + ITEM Assertion OK : - Range.VerticalAlignment (get) + ITEM Assertion OK : - Range.VerticalAlignment (get) + ITEM Assertion OK : - Range.VerticalAlignment (set) + ITEM Assertion OK : - Range.VerticalAlignment (get) + ITEM Assertion OK : - Range.VerticalAlignment (set) + ITEM Assertion OK : Range.VeritcalAlignment is Null +END 'VerticalAlignment-Issue' Symbol + TEST OK : VerticalAlignment-Issue +---------------------------------------------------------------- +HorizontalAlignment-Issue + TEST START : HorizontalAlignment-Issue + ITEM Assertion OK : - Range.HorizontalAlignment (get) + ITEM Assertion OK : - Range.HorizontalAlignment (set) + ITEM Assertion OK : - Range.HorizontalAlignment (get) + ITEM Assertion OK : - Range.HorizontalAlignment (set) + ITEM Assertion OK : - Range.HorizontalAlignment (get) + ITEM Assertion OK : - Range.HorizontalAlignment (set) + ITEM Assertion OK : - Range.HorizontalAlignment (get) + ITEM Assertion OK : - Range.HorizontalAlignment (set) + ITEM Assertion OK : Range.HorizontalAlignment is Null +END 'HorizontalAlignment-Issue' Symbol + TEST OK : HorizontalAlignment-Issue +---------------------------------------------------------------- +WrapText-Issue + TEST START : WrapText-Issue + ITEM Assertion OK : - Range.WrapText (get) + ITEM Assertion OK : - Range.WrapText (get) + ITEM Assertion OK : Range.WrapText is Null +END 'WrapText-Issue' Symbol + TEST OK : WrapText-Issue +---------------------------------------------------------------- +FontBorderIssues + TEST START : FontBorderIssues + ITEM Assertion OK : - = Borders.Color (getColor) + ITEM Assertion OK : - = Font.Color (getColor) +END 'FontBorderIssues' Symbol + TEST OK : FontBorderIssues +---------------------------------------------------------------- +RangeSizeIssues + TEST START : RangeSizeIssues + ITEM Assertion OK : Range.Left is: 114 + ITEM Assertion OK : Range.Top is: 95.25 + ITEM Assertion OK : Range.Width is: 216 + ITEM Assertion OK : Range.Height is: 271.5 +END 'RangeSizeIssues' Symbol + TEST OK : RangeSizeIssues +---------------------------------------------------------------- +ApplicationIssues + TEST START : ApplicationIssues + ITEM Assertion OK : Range.Address is: $E$8:$G$13,$G$13:$K$19 + ITEM Assertion OK : Range.Address is: $E$8:$G$13,$G$13:$K$19 + ITEM Assertion OK : Application.ActiveSheet.Name: Sheet1 +END 'ApplicationIssues' Symbol + TEST OK : ApplicationIssues +Test run finished : 18/06/2007 17:50:04 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/Ranges-3.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/Ranges-3.log new file mode 100644 index 000000000000..a7de979d5e13 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/Ranges-3.log @@ -0,0 +1,8 @@ +Test run started : 19/06/2007 11:21:42 +---------------------------------------------------------------- +MyGoalseek-Issue + TEST START : MyGoalseek-Issue + ITEM Assertion OK : Variable Range value: 15 +END 'MyGoalseek-Issue' Symbol + TEST OK : MyGoalseek-Issue +Test run finished : 19/06/2007 11:21:42 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/Ranges.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/Ranges.log new file mode 100644 index 000000000000..8c9644aac155 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/Ranges.log @@ -0,0 +1,280 @@ +Test run started : 01/06/2007 11:28:58 +---------------------------------------------------------------- +ApplicationMethods + TEST START : ApplicationMethods + ITEM Assertion OK : Name of Workbook is: Ranges.xls + ITEM Assertion OK : Address of Application.Columns is: $A:$A + ITEM Assertion OK : Address of Application.Rows is: $1:$1 + ITEM Assertion OK : Address of Application.Range is: $1:$1,$5:$7 + ITEM Assertion OK : Please check manually: DefaultFilePath is: C:\Documents and Settings\vituosity\My Documents + ITEM Assertion OK : Please check manually: Library Path is: C:\Program Files\Microsoft Office\OFFICE11\LIBRARY + ITEM Assertion OK : Please check manually: Template Path is: C:\Documents and Settings\vituosity\Application Data\Microsoft\Templates\ + ITEM Assertion OK : FileSeparator is \ + ITEM Assertion OK : Name of ActiveWorkbook is: Ranges.xls +END 'ApplicationMethods' Symbol + TEST OK : ApplicationMethods +---------------------------------------------------------------- +Insert-Issue + TEST START : Insert-Issue + ITEM Assertion OK : Insert with xlShiftToRight: 10 +END 'Insert-Issue' Symbol + TEST OK : Insert-Issue +---------------------------------------------------------------- +MergeCells-Issue + TEST START : MergeCells-Issue + ITEM Assertion OK : Range.MergeCells is True + ITEM Assertion OK : MergeCells is null: True + ITEM Assertion OK : RowCount after Merge: 6 + ITEM Assertion OK : Range.MergeCells is False + ITEM Assertion OK : MergeCells is null: False + ITEM Assertion OK : MergeCells of Second Area is null : True + ITEM Assertion OK : MergeCells of Ranges is Null: True + ITEM Assertion OK : RowCount after Merge: 7 + ITEM Assertion OK : Range.MergeCells is False + ITEM Assertion OK : MergeCells is null: False + ITEM Assertion OK : RowCount after Merge: 7 +END 'MergeCells-Issue' Symbol + TEST OK : MergeCells-Issue +---------------------------------------------------------------- +Areas-Issue + TEST START : Areas-Issue + ITEM Assertion OK : Range Areas Count is2 + ITEM Assertion OK : First Range Address is: $E$8:$G$13 + ITEM Assertion OK : First Row is: 8 + ITEM Assertion OK : First Column is: 5 + ITEM Assertion OK : EntireRow Address is: $8:$13,$13:$19 + ITEM Assertion OK : EntireColumn Address is: $E:$G,$G:$K + ITEM Assertion OK : Range Count:53 +END 'Areas-Issue' Symbol + TEST OK : Areas-Issue +---------------------------------------------------------------- +Fill-Methods-Issue + TEST START : Fill-Methods-Issue + ITEM Assertion OK : Range Value after FillDown: MyFillValue + ITEM Assertion OK : Range Value after FillDown: MyFillValue + ITEM Assertion OK : Range Value after FillDown: MyRightFillValue + ITEM Assertion OK : Range Value after FillDown: MyBottomFillValue +END 'Fill-Methods-Issue' Symbol + TEST OK : Fill-Methods-Issue +---------------------------------------------------------------- +Range/Item-Method-Issue + TEST START : Range/Item-Method-Issue + ITEM Assertion OK : Range of multiple columns is: $A:$A,$C:$C + ITEM Assertion OK : Range of multiple rows is: $1:$1,$5:$7 + ITEM Assertion OK : Range of several columns is: $C:$E,$D:$D + ITEM Assertion OK : Range of several rows is: $5:$8,$6:$10 + ITEM Assertion OK : Range of several single cells is: $C$5,$E$8 + ITEM Assertion OK : Range of several named ranges is: $L$1:$M$6,$E$8:$G$13,$G$13:$K$19 + ITEM Assertion OK : Range of a single Item Cell is: $E$21 + ITEM Assertion OK : Range of a single Item Cell is: $F$21 + ITEM Assertion OK : Range of a single Item Cell is: $F$10 +END 'Range/Item-Method-Issue' Symbol + TEST OK : Range/Item-Method-Issue +---------------------------------------------------------------- +R1C1-Formulas-Issue + TEST START : R1C1-Formulas-Issue + ITEM Assertion OK : R1C1 Range.Formula is: =IF(OR(R[-2]C[1]=0,RC[2]="YES"),"") + ITEM Assertion OK : Range.Formula is: =IF(OR(J8=0,K10="YES"),"") +END 'R1C1-Formulas-Issue' Symbol + TEST OK : R1C1-Formulas-Issue +---------------------------------------------------------------- +Verify_Delete + TEST START : Verify_Delete + ITEM Assertion OK : Ranges are intersecting: $G$13 + ITEM Assertion OK : Delete with Default: $AJ$4 + ITEM Assertion OK : Delete with ShifttoLeft: $AJ$4 + ITEM Assertion OK : Delete with ShiftUp: $M$22 +END 'Verify_Delete' Symbol + TEST OK : Verify_Delete +---------------------------------------------------------------- +Value-Issue + TEST START : Value-Issue + ITEM Assertion OK : Value of Range is: 12.3 + ITEM Assertion OK : Text of Range is: 12.3 + ITEM Assertion OK : Range has Formula: False + ITEM Assertion OK : Cell has Formula: False + ITEM Assertion OK : Text of Range is null: True + ITEM Assertion OK : Range has Formula: True + ITEM Assertion OK : Cell has Formula: True + ITEM Assertion OK : Value of Cell is: 12 + ITEM Assertion OK : Application.Calculation is : -4135 + ITEM Assertion OK : Calculation is automated: True + ITEM Assertion OK : Range has Formula: True + ITEM Assertion OK : Value of Cell is: 16 + ITEM Assertion OK : Text of Cell is: 16 + ITEM Assertion OK : Text of Cell is: 16 + ITEM Assertion OK : Range has Formula after 'ClearContents: False + ITEM Assertion OK : Text of Cell is: + ITEM Assertion OK : Text of Cell is: +END 'Value-Issue' Symbol + TEST OK : Value-Issue +---------------------------------------------------------------- +AutoFit issue + TEST START : AutoFit issue + ITEM Assertion OK : Columns.AutoFit: CurrentWidth is 673 + ITEM Assertion OK : Rows.AutoFit: CurrentHeight is 612 +END 'AutoFit issue' Symbol + TEST OK : AutoFit issue +---------------------------------------------------------------- +Selections + TEST START : Selections + ITEM Assertion OK : ActiveCell is : $E$8 + ITEM Assertion OK : Active Cell is : $E$8 + ITEM Assertion OK : Number of Cells in Range: 53 + ITEM Assertion OK : Number of Cells in Range: 53 + ITEM Assertion OK : Number of Cells in Range: 53 +END 'Selections' Symbol + TEST OK : Selections +---------------------------------------------------------------- +Offset-Resize + TEST START : Offset-Resize + ITEM Assertion OK : Offset is : $G$10:$I$15,$I$15:$M$21 + ITEM Assertion OK : Offset is : $G$7:$I$12,$I$12:$M$18 + ITEM Assertion OK : Resized Range is : $A$20:$D$23 +END 'Offset-Resize' Symbol + TEST OK : Offset-Resize +---------------------------------------------------------------- +Ranges-Address + TEST START : Ranges-Address + ITEM Assertion OK : Range Address is: $E$8:$G$13,$G$13:$K$19 + ITEM Assertion OK : Range Address is: $E8:$G13,$G13:$K19 + ITEM Assertion OK : Range Address is: E$8:G$13,G$13:K$19 + ITEM Assertion OK : Range Address is: R8C5:R13C7,R13C7:R19C11 + ITEM Assertion OK : Range Address is: $E$8:$G$13,$G$13:$K$19 + ITEM Assertion OK : Range Address is: R8C5:R13C7,R13C7:R19C11 + ITEM Assertion OK : Range Address is: R[6]C[3]:R[11]C[5],R[11]C[5]:R[17]C[9] + ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$E$8:$G$13,$G$13:$K$19 +END 'Ranges-Address' Symbol + TEST OK : Ranges-Address +---------------------------------------------------------------- +Range-Address + TEST START : Range-Address + ITEM Assertion OK : Range Address is: $E$8:$G$13 + ITEM Assertion OK : Range Address is: $E8:$G13 + ITEM Assertion OK : Range Address is: E$8:G$13 + ITEM Assertion OK : Range Address is: R8C5:R13C7 + ITEM Assertion OK : Range Address is: $E$8:$G$13 + ITEM Assertion OK : Range Address is: R8C5:R13C7 + ITEM Assertion OK : Range Address is: R[6]C[3]:R[11]C[5] + ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$E$8:$G$13 +END 'Range-Address' Symbol + TEST OK : Range-Address +---------------------------------------------------------------- +Column-Address + TEST START : Column-Address + ITEM Assertion OK : Range Address is: $F$8:$F$13 + ITEM Assertion OK : Range Address is: $F8:$F13 + ITEM Assertion OK : Range Address is: F$8:F$13 + ITEM Assertion OK : Range Address is: R8C6:R13C6 + ITEM Assertion OK : Range Address is: $F$8:$F$13 + ITEM Assertion OK : Range Address is: R8C6:R13C6 + ITEM Assertion OK : Range Address is: R[6]C[4]:R[11]C[4] + ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$F$8:$F$13 +END 'Column-Address' Symbol + TEST OK : Column-Address +---------------------------------------------------------------- +Row-Address + TEST START : Row-Address + ITEM Assertion OK : Range Address is: $E$9:$G$9 + ITEM Assertion OK : Range Address is: $E9:$G9 + ITEM Assertion OK : Range Address is: E$9:G$9 + ITEM Assertion OK : Range Address is: R9C5:R9C7 + ITEM Assertion OK : Range Address is: $E$9:$G$9 + ITEM Assertion OK : Range Address is: R9C5:R9C7 + ITEM Assertion OK : Range Address is: R[7]C[3]:R[7]C[5] + ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$E$9:$G$9 +END 'Row-Address' Symbol + TEST OK : Row-Address +---------------------------------------------------------------- +SingleCell-Address + TEST START : SingleCell-Address + ITEM Assertion OK : Range Address is: $F$9 + ITEM Assertion OK : Range Address is: $F9 + ITEM Assertion OK : Range Address is: F$9 + ITEM Assertion OK : Range Address is: R9C6 + ITEM Assertion OK : Range Address is: $F$9 + ITEM Assertion OK : Range Address is: R9C6 + ITEM Assertion OK : Range Address is: R[7]C[4] + ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$F$9 +END 'SingleCell-Address' Symbol + TEST OK : SingleCell-Address +---------------------------------------------------------------- +Heights and Widths + TEST START : Heights and Widths + ITEM Assertion OK : Range RowHeight is 40 + ITEM Assertion OK : Range ColumnWidth is 50 + ITEM Assertion OK : Range Height is 238 + ITEM Assertion OK : Range Width is 798.75 + ITEM Assertion OK : Range RowHeight is 50 + ITEM Assertion OK : Range ColumnWidth is 50 + ITEM Assertion OK : Range Height is 297 + ITEM Assertion OK : Range Width is 798.75 + ITEM Assertion OK : RowHeight is null: True + ITEM Assertion OK : ColumnWidth is null: True +END 'Heights and Widths' Symbol + TEST OK : Heights and Widths +---------------------------------------------------------------- +RangeRowColumn-Issue + TEST START : RangeRowColumn-Issue + ITEM Assertion OK : Row is: 8 + ITEM Assertion OK : Column is: 5 + ITEM Assertion OK : EntireRow.Columns.Count = 256 + ITEM Assertion OK : EntireColumn.Rows.Count = 65536 +END 'RangeRowColumn-Issue' Symbol + TEST OK : RangeRowColumn-Issue +---------------------------------------------------------------- +Replace-Issue + TEST START : Replace-Issue + ITEM Assertion OK : Value after Replace: YourValue + ITEM Assertion OK : Value after Replace: YourValue + ITEM Assertion OK : Value after Replace: ReplaceValue + ITEM Assertion OK : Value after Replace: New ReplaceValue + ITEM Assertion OK : Value after Replace: New ReplaceValue + ITEM Assertion OK : Value after Replace: New Replace + ITEM Assertion OK : Value after Replace: +END 'Replace-Issue' Symbol + TEST OK : Replace-Issue +---------------------------------------------------------------- +Hidden-Issue + TEST START : Hidden-Issue + ITEM Assertion OK : - Range.Rows.Hidden (set) + ITEM Assertion OK : - Range.Rows.Hidden (get) + ITEM Assertion OK : - Range.Rows.Item(1).Hidden (set) + ITEM Assertion OK : - Range.Rows.Item(1).Hidden (get) + ITEM Assertion OK : - Range.Columns.Hidden (set) + ITEM Assertion OK : - Range.Columns.Hidden (get) + ITEM Assertion OK : - Range.Columns.Item(1).Hidden (set) + ITEM Assertion OK : - Range.Columns.Item(1).Hidden (get) +END 'Hidden-Issue' Symbol + TEST OK : Hidden-Issue +---------------------------------------------------------------- +End issue + TEST START : End issue + ITEM Assertion OK : - = $E$48 + ITEM Assertion OK : - = $E$1 + ITEM Assertion OK : - = $E$3 + ITEM Assertion OK : - = $A$8 + ITEM Assertion OK : - = $B$8 + ITEM Assertion OK : - = $IV$8 + ITEM Assertion OK : - = $Z$8 +END 'End issue' Symbol + TEST OK : End issue +---------------------------------------------------------------- +Outline issue + TEST START : Outline issue + ITEM Assertion OK : - Range.clearOutline - please check visually + ITEM Assertion OK : - Range.AutoOutline - please check visually + ITEM Assertion OK : - Range.AutoOutline - please check visually +END 'Outline issue' Symbol + TEST OK : Outline issue +---------------------------------------------------------------- +Validation + TEST START : Validation + ITEM Assertion OK : Validation Input Message is : Attention! + ITEM Assertion OK : Validation Input Message is : Enter an integer from five to ten + ITEM Assertion OK : Validation Error Title is : You must enter a number from five to ten + ITEM Assertion OK : Validation Error Message is : An Error occured + ITEM Assertion OK : Validation Error Title is : Microsoft Excel +END 'Validation' Symbol + TEST OK : Validation +Test run finished : 01/06/2007 11:29:00 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/TestAddress.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/TestAddress.log new file mode 100644 index 000000000000..01e5503a7e62 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/TestAddress.log @@ -0,0 +1,62 @@ +Test run started : 17/07/2007 15:25:17 +---------------------------------------------------------------- +TestAddress + TEST START : TestAddress + ITEM Assertion OK : test1 Range('e3:f3') A1 style addressing + ITEM Assertion OK : test2 Range('e3:f3') R1C1 style addressing + ITEM Assertion OK : test3 Range ('e:f') A1 style addressing + ITEM Assertion OK : test4 Range ('e:f') R1C1 style addressing + ITEM Assertion OK : test5 Columns A1 style addressing + ITEM Assertion OK : test6 Columns R1C1 style addressing + ITEM Assertion OK : test7 Columns(3) A1 style addressing + ITEM Assertion OK : test8 Columns(3) R1C1 style addressing + ITEM Assertion OK : test9 Columns('e') A1 style addressing + ITEM Assertion OK : test10 Columns('e') R1C1 style addressing + ITEM Assertion OK : test11 Columns('b:d') A1 style addressing + ITEM Assertion OK : test12 Columns('b:d') R1C1 style addressing + ITEM Assertion OK : test13 Range('c1:g10').Columns A1 style addressing + ITEM Assertion OK : test14 Range('c1:g10').Columns R1C1 style addressing + ITEM Assertion OK : test15 Range('c1:g10').Columns(1) A1 style addressing + ITEM Assertion OK : test16 Range('c1:g10').Columns(1) R1C1 style addressing + ITEM Assertion OK : test17 Range('c1:g10').Columns('a') A1 style addressing + ITEM Assertion OK : test18 Range('c1:g10').Columns('a') R1C1 style addressing + ITEM Assertion OK : test19 Range('c1:g10').Columns('c') A1 style addressing + ITEM Assertion OK : test20 Range('c1:g10').Columns('c') R1C1 style addressing + ITEM Assertion OK : test21 Range('c1:g10').Columns('x:z') A1 style addressing + ITEM Assertion OK : test22 Range('c1:g10').Columns('x:z') R1C1 style addressing + ITEM Assertion OK : test23 Range('c1:g10').Columns(30) A1 style addressing + ITEM Assertion OK : test24 Range('c1:g10').Columns(30) R1C1 style addressing + ITEM Assertion OK : test25 Worksheets('Sheet2').Cells(1, 1) A1 style addressing + ITEM Assertion OK : test26 Worksheets('Sheet2').Cells(1, 1) A1 style addressing, RowAddressAbsolute is false + ITEM Assertion OK : test27 Worksheets('Sheet2').Cells(1, 1) A1 style addressing, ColAddressAbsolute is false + ITEM Assertion OK : test28 Worksheets('Sheet2').Cells(1, 1) R1C1 style addressing + ITEM Assertion OK : test29 Worksheets('Sheet2').Range('A1:E5').EntireColumn A1 style addressing + ITEM Assertion OK : test30 Worksheets('Sheet2').Range('A1').EntireColumn A1 style addressing + ITEM Assertion OK : test31 Worksheets('Sheet2').Range('A1:E5').EntireRow A1 style addressing + ITEM Assertion OK : test32 Worksheets('Sheet2').Range('A1') A1 style addressing + ITEM Assertion OK : test33 Worksheets('Sheet2').Range('IV65536').EntireRow A1 style addressing + ITEM Assertion OK : test34 Worksheets('Sheet2').Range('IU2:IV65536') A1 style addressing + ITEM Assertion OK : test35 Range('c1:g10').Columns('x:z') R1C1 style addressing + ITEM Assertion OK : test36 Worksheets('Sheet2').Range('A1') A1 style addressing + ITEM Assertion OK : test37 Worksheets('Sheet2').Range('A1:E5').EntireColumn A1 style addressing + ITEM Assertion OK : test38 Worksheets('Sheet2').Range('10:12') A1 style addressing + ITEM Assertion OK : test39 Worksheets('Sheet2').Range('10:12') R1C1 style addressing + ITEM Assertion OK : test40 Range('Sheet3!A1:B4') A1 style addressing + ITEM Assertion OK : test41 Range('Sheet3!A1,B1,D4:F20') A1 style addressing + ITEM Assertion OK : test42 Range('g20:h40').Columns('c:c') + ITEM Assertion OK : test43 Range('g20:h40').Columns('c:f') + ITEM Assertion OK : test44 Range('g20:h40').Columns(-1) + ITEM Assertion OK : test45 Range('c4:g10').Rows(-1) + ITEM Assertion OK : test46 Range('a2:b4').Rows('1:1') + ITEM Assertion OK : test47 Range('a2:b4').Rows('1:2') + ITEM Assertion OK : test48 Range('a2:b4').Rows('2:2') + ITEM Assertion OK : test49 Range('a2:b4').Rows('2:3') +Test Results +============ + +Tests passed: 49 +Tests failed: 0 + +END 'TestAddress + TEST OK : TestAddress +Test run finished : 17/07/2007 15:25:19 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/TestCalc_Rangetest.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/TestCalc_Rangetest.log new file mode 100644 index 000000000000..f055279ec6f4 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/TestCalc_Rangetest.log @@ -0,0 +1,60 @@ +Test run started : 30/05/2007 11:33:13 +BEGIN TestCalc + TEST START : RangeTest2 + ITEM Assertion OK : - Range("D15").Row + ITEM Assertion OK : - WorkSheet("D15").Range.Row + ITEM Assertion OK : - Range("D15").Column + ITEM Assertion OK : - Worksheet.Range("D15").Column + ITEM Assertion OK : - Range("D1").EntireRow.Valuer + ITEM Assertion OK : - Range("D1").EntireRow.Valuer + ITEM Assertion OK : - Range("D1").EntireRow.Columns.Count + ITEM Assertion OK : - Range("D1").EntireColumn.Rows.Count + ITEM Assertion OK : - Range("D15").ClearContent + ITEM Assertion OK : - Range("M1:N2").Rows.Hidden (set) + ITEM Assertion OK : - Range("M1:N2").Rows.Hidden (get) + ITEM Assertion OK : - Range("M1:N2").Rows(1).Hidden (set) + ITEM Assertion OK : - Range("M1:N2").Rows(1).Hidden (get) + ITEM Assertion OK : - Range("M1:N2").Columns.Hidden (set) + ITEM Assertion OK : - Range("M1:N2").Columns.Hidden (get) + ITEM Assertion OK : - Range("M1:N2").Columns(1).Hidden (set) + ITEM Assertion OK : - Range("M1:N2").Columns(1).Hidden (get) + ITEM Assertion OK : - Range("B38").Orientation (get) + ITEM Assertion OK : - Range("B38").Orientation (set) + ITEM Assertion OK : - Range("B38").Orientation (set = xlDownward) + ITEM Assertion OK : - Range("B38").Orientation (set) + ITEM Assertion OK : - Range("B38").Orientation (set = xlUpward) + ITEM Assertion OK : - Range("B38").Orientation (set) + ITEM Assertion OK : - Range("B38").Orientation (set = xlVertical) + ITEM Assertion OK : - Range("B38").Orientation (set) + ITEM Assertion OK : - Range("B38").Orientation (set = xlVertical) + ITEM Assertion OK : - Range("B39").WrapText (get) + ITEM Assertion OK : - Range("B39").WrapText (set) + ITEM Assertion OK : - Range("B39").WrapText (set) + ITEM Assertion OK : - Range("E39").MergeCells (get) + ITEM Assertion OK : - Range("F39").MergeCells (get) + ITEM Assertion OK : - Range("E39").MergeCells (set) + ITEM Assertion OK : - Range("F39").MergeCells (set) + ITEM Assertion OK : - Range("E39").MergeCells (set) + ITEM Assertion OK : - Range("F39").MergeCells (set) + ITEM Assertion OK : - Range("C41:C42").Replace MatchCase:=True + ITEM Assertion OK : - Range("C41:C42").Replace MatchCase:=True + ITEM Assertion OK : - Range("D41:D42").Replace MatchCase:=False + ITEM Assertion OK : - Range("B39").VerticalAlignment (get) + ITEM Assertion OK : - Range("B39").VerticalAlignment (set) + ITEM Assertion OK : - Range("B39").VerticalAlignment (get) + ITEM Assertion OK : - Range("B39").VerticalAlignment (get) + ITEM Assertion OK : - Range("B39").VerticalAlignment (set) + ITEM Assertion OK : - Range("B39").VerticalAlignment (get) + ITEM Assertion OK : - Range("B39").VerticalAlignment (set) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (get) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (set) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (get) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (set) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (get) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (set) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (get) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (set) + ITEM OK (RangeTest2) + TEST succesfully completed : RangeTest2 +END TestCalc +Test run finished : 30/05/2007 11:33:14 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/TestCalc_Rangetest2.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/TestCalc_Rangetest2.log new file mode 100644 index 000000000000..19a5ba96b54a --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/excel/TestCalc_Rangetest2.log @@ -0,0 +1,64 @@ +Test run started : 31/05/2007 11:02:10 +BEGIN TestCalc + TEST START : RangeTest3 + ITEM Assertion OK : - setFormulaR1C1 + ITEM Assertion OK : - getFormulaR1C1 + ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial() + ITEM Assertion OK : - Range.Copy(Range("I10")) + ITEM Assertion OK : PasteSpecial Paste:=xlPasteValues + ITEM Assertion OK : PasteSpecial Paste:=xlPasteFormulas + ITEM Assertion OK : PasteSpecial Paste:=xlPasteFormats + ITEM Assertion OK : PasteSpecial + ITEM Assertion OK : PasteSpecial SkipBlanks:=True + ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationAdd + ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationSubtract + ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationMultiply + ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationDivide + ITEM Assertion OK : PasteSpecial Transpose:=True + ITEM Assertion OK : ActiveWorkbook.Name + ITEM Assertion OK : ActiveWorkbook.FullName und ActiveWorkbook.Path + ITEM Assertion OK : - = Range("K22").End (xlDown) + ITEM Assertion OK : - = Range("K22").End (xlUo) + ITEM Assertion OK : - = Range("K22").End (xlToLeft) + ITEM Assertion OK : - = Range("K22").End (xlRight) + ITEM Assertion OK : - ActiveSpreadsheet.Next + ITEM Assertion OK : - ActiveSpreadsheet.Next + ITEM Assertion OK : - ActiveSpreadsheet.Previous + ITEM Assertion OK : - ActiveSpreadsheet.Previous + ITEM Assertion OK : - Range("J4:J11").AutoFilter field:=1, Criteria1:="x" + ITEM Assertion OK : - Range("J4:J11").AutoFilter field:=1, Criteria1:="<>" + ITEM Assertion OK : - Range("J4:J11").AutoFilter field:=1, Criteria1:="=" + ITEM Assertion OK : - Range("J4:J11").AutoFilter + ITEM Assertion OK : - ActiveSheet.Resize.Select + ITEM Assertion OK : - Application.GoTo Reference:="R8C2" + ITEM Assertion OK : - Application.GoTo Reference:="R[8]C[2]" + ITEM Assertion OK : - Application.GoTo Reference:="R8C2" + ITEM Assertion OK : - Range.Group - please check visually + ITEM Assertion OK : - Range.Group - please check visually + ITEM Assertion OK : - Range.Ungroup- please check visually + ITEM Assertion OK : - Range.Ungroup - please check visually + ITEM Assertion OK : - Range.Group - please check visually + ITEM Assertion OK : - Range.Group - please check visually + ITEM Assertion OK : - Range.clearOutline - please check visually + ITEM Assertion OK : - Range.AutoOutline - please check visually + ITEM Assertion OK : - Range.AutoOutline - please check visually + ITEM Assertion OK : - ActiveSheet.UsedRange.Select + ITEM Assertion FAIL : - Range("A13").AddIndent + ITEM Assertion OK : - Range("A13").IndentLevel set + ITEM Assertion OK : - Range("A13").IndentLevel get + ITEM Assertion OK : - Range("A13").IndentLevel get + ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial() + ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial() + ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial() + ITEM Assertion OK : - Range.Calculate + ITEM Assertion OK : Worksheet.Calculate + ITEM Assertion OK : - Application.Calculate + ITEM Assertion OK : Global.Calculate + ITEM Assertion OK : Calculation set + ITEM Assertion OK : - = ActiveWorkbook.Colors(3) set + ITEM Assertion OK : - = ActiveWorkbook.ResetColors + ITEM Assertion OK : - = ActiveWorkbook.Colors(3) get + ITEM FAIL (RangeTest3) + TEST Not succesfully completed : RangeTest3 +END TestCalc +Test run finished : 31/05/2007 11:02:12 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/format.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/format.log new file mode 100644 index 000000000000..5226a161c61a --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/format.log @@ -0,0 +1,36 @@ +Test run started : 08/10/2008 13:08:40 +BEGIN Format + TEST START : Test Predefined_Number_Format_Sample function + ITEM Assertion OK : General Number: 562486.2356 + ITEM Assertion OK : Fixed: 0.20 + ITEM Assertion OK : Standard: 562,486.24 + ITEM Assertion OK : Percent: 75.21% + ITEM Assertion OK : Scientific: 5.62E+05 + ITEM Assertion OK : Scientific: -3.46E+03 + ITEM Assertion OK : Yes/No: No + ITEM Assertion OK : Yes/No: Yes + ITEM Assertion OK : True/False: False + ITEM Assertion OK : True/False: True + ITEM Assertion OK : On/Off: Off + ITEM Assertion OK : On/Off: On + TEST OK : Test Predefined_Number_Format_Sample function + TEST START : Test Custom_Number_Format_Sample function + ITEM Assertion OK : 00.0000: 23.6750 + ITEM Assertion OK : 00.00: 23.68 + ITEM Assertion OK : 00000: 02658 + ITEM Assertion OK : 00.00: 2658.00 + ITEM Assertion OK : ##.####: 23.675 + ITEM Assertion OK : ##.##: 23.68 + ITEM Assertion OK : #,###.##: 12,345.25 + ITEM Assertion OK : ##.00%: 25.00% + ITEM Assertion OK : #,###: 1,000,000 + ITEM Assertion OK : ######E-###: 109838E-5 + ITEM Assertion OK : $#,###.##: $2,345.25 + ITEM Assertion OK : ##.###\%: .25% + TEST OK : Test Custom_Number_Format_Sample function + TEST START : Test Custom_Text_Format_Sample function + ITEM Assertion OK : <: vba + ITEM Assertion OK : >: VBA + TEST OK : Test Custom_Text_Format_Sample function +END Format +Test run finished : 08/10/2008 13:08:40 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/AutoFilter.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/AutoFilter.log new file mode 100644 index 000000000000..55f5d9526618 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/AutoFilter.log @@ -0,0 +1,20 @@ +Test run started : 18/07/2007 10:56:38 +---------------------------------------------------------------- +TestAddress + TEST START : TestAddress + ITEM Assertion OK : test1 'starts with' string criteria + ITEM Assertion OK : test2 'not equal to' string criteria + ITEM Assertion OK : test3 'ends with' string criteria + ITEM Assertion OK : test4 field 'all' + ITEM Assertion OK : test5 numeric '<15' + ITEM Assertion OK : test6 numeric '>=15' + ITEM Assertion OK : test7 numeric '<=12' +Test Results +============ + +Tests passed: 7 +Tests failed: 0 + +END 'TestAddress + TEST OK : TestAddress +Test run finished : 18/07/2007 10:56:44 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/CalcFont.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/CalcFont.log new file mode 100644 index 000000000000..f3583e4cbb12 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/CalcFont.log @@ -0,0 +1,17 @@ +Test run started : 10/09/2008 02:40:17 PM +CalcFont_Format + TEST START : Font_Format + ITEM Assertion OK : correctly set font to Bold + ITEM Assertion OK : correctly set font to Italic + ITEM Assertion OK : correctly read FontStyle + ITEM Assertion OK : correctly set font to Shadow + ITEM Assertion OK : correctly set font color + ITEM Assertion OK : correctly set font color index + ITEM Assertion OK : correctly set font name + ITEM Assertion OK : correctly set font outline + ITEM Assertion OK : correctly set font size + ITEM Assertion OK : correctly set font strikethrough + ITEM Assertion OK : correctly set font underline + TEST Success. : Font_Format +CalcFont_Format +Test run finished : 10/09/2008 02:40:17 PM diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/CalcZoom.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/CalcZoom.log new file mode 100644 index 000000000000..f8c83531a8a2 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/CalcZoom.log @@ -0,0 +1,18 @@ +Test run started : 15/06/2009 12:49:35 +CalcZoom + TEST START : CalcZoom + ITEM Assertion OK : test1 read window.zoom activesheet = sheet1 + ITEM Assertion OK : test2 read window.zoom activesheet = sheet2 + ITEM Assertion OK : test3 read window.zoom activesheet = sheet3 + ITEM Assertion OK : test4 read window.zoom activesheet = sheet3 + ITEM Assertion OK : test4 read window.zoom activesheet = sheet2 + ITEM Assertion OK : test4 read window.zoom activesheet = sheet1 + TEST Success. : CalcZoom +CalcZoom +Test Results +============ + +Tests passed: 6 +Tests failed: 0 + +Test run finished : 15/06/2009 12:49:37 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/FinancialFuncTests.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/FinancialFuncTests.log new file mode 100644 index 000000000000..5633a8100e08 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/FinancialFuncTests.log @@ -0,0 +1,31 @@ +Test run started : 04/08/2009 12:42:26 +---------------------------------------------------------------- +FinancialFuncs + TEST START : FinancialFuncs + ITEM Assertion OK : DDB test + ITEM Assertion OK : FV test + ITEM Assertion OK : IPmt test + ITEM Assertion FAIL : IRR test + ITEM Assertion OK : MIRR test + ITEM Assertion FAIL : NPer test + ITEM Assertion FAIL : NPV test + ITEM Assertion FAIL : Pmt test + ITEM Assertion OK : PPmt test + ITEM Assertion OK : PV test + ITEM Assertion FAIL : Rate test + ITEM Assertion OK : SLN test + ITEM Assertion OK : SYD test +Test Results +============ + +IRR test Failed: expected 35.8625323270733 got 35.8625323273411 +NPer test Failed: expected 21.5365977313406 got 21.5365977313408 +NPV test Failed: expected 3874.42183648785 got 3874.42183648784 +Pmt test Failed: expected 20276.3942884139 got 20276.3942884138 +Rate test Failed: expected 4.67819164224935E-02 got 4.67819164225E-02 +Tests passed: 8 +Tests failed: 5 + +END 'FinancialFuncs + TEST OK : FinancialFuncs +Test run finished : 04/08/2009 12:42:36 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/MiscOperatorTests.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/MiscOperatorTests.log new file mode 100644 index 000000000000..116f9f98c7e8 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/MiscOperatorTests.log @@ -0,0 +1,30 @@ +Test run started : 12/05/2009 12:36:15 +---------------------------------------------------------------- +TestAddress + TEST START : TestAddress + ITEM Assertion OK : test1: res = Not ( A > B ) + ITEM Assertion OK : test2: res = Not ( B > A ) + ITEM Assertion OK : test3: res = Not ( D ) + ITEM Assertion OK : test4: res = Not A + ITEM Assertion OK : test5: res = ( A > D ) + ITEM Assertion OK : test6: res = ( D > A ) + ITEM Assertion OK : test7: res = ( A < D ) + ITEM Assertion OK : test8: res = ( D < A ) + ITEM Assertion OK : test9: res = ( A >= D ) + ITEM Assertion OK : test10: res = ( D >= A ) + ITEM Assertion OK : test11: res = ( A <= D ) + ITEM Assertion OK : test12: res = ( D <= A ) + ITEM Assertion OK : test13: res = ( D = A ) + ITEM Assertion OK : test14: res = ( A = D ) + ITEM Assertion OK : test15: res = ( D <> A ) + ITEM Assertion OK : test16: res = ( A <> D ) + ITEM Assertion OK : test17: ( A = D ) = True +Test Results +============ + +Tests passed: 17 +Tests failed: 0 + +END 'TestAddress + TEST OK : TestAddress +Test run finished : 12/05/2009 12:36:15 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/MiscRangeTests.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/MiscRangeTests.log new file mode 100644 index 000000000000..215842f9a7e6 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/MiscRangeTests.log @@ -0,0 +1,45 @@ +Test run started : 17/07/2007 20:54:56 +---------------------------------------------------------------- +MiscRangeTests + TEST START : MiscRangeTests + ITEM Assertion OK : test 1 + ITEM Assertion OK : test 2 + ITEM Assertion OK : test 3 + ITEM Assertion OK : test 4 + ITEM Assertion OK : test 5 + ITEM Assertion OK : test 6 + ITEM Assertion OK : test 7 + ITEM Assertion OK : test 8 + ITEM Assertion OK : test 9 + ITEM Assertion OK : test 10 + ITEM Assertion OK : test 11 + ITEM Assertion OK : test 12 + ITEM Assertion OK : test 13 + ITEM Assertion OK : test 14 + ITEM Assertion OK : test 15 + ITEM Assertion OK : test 16 + ITEM Assertion OK : test 17 + ITEM Assertion OK : test 18 + ITEM Assertion OK : test 19 + ITEM Assertion OK : test 20 + ITEM Assertion OK : test 21 + ITEM Assertion OK : test 22 + ITEM Assertion OK : test 23 + ITEM Assertion OK : test 24 + ITEM Assertion OK : test 25 + ITEM Assertion OK : test 26 + ITEM Assertion OK : test 27 + ITEM Assertion OK : test 28 + ITEM Assertion OK : test 29 + ITEM Assertion OK : test 30 + ITEM Assertion OK : test 31 +No. tests: 31 +Summary +======= +Run: 31 +Passed: 31 +Failed: 0 + +END 'MiscRangeTests + TEST OK : MiscRangeTests +Test run finished : 17/07/2007 20:55:03 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/PageBreaks.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/PageBreaks.log new file mode 100644 index 000000000000..0ff400d49e85 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/PageBreaks.log @@ -0,0 +1,10 @@ +Test run started : 07/24/2008 05:06:12 PM +---------------------------------------------------------------- + TEST START : PageBreaks-Issue + ITEM Assertion OK : HPageBreaks.Count is 3 + ITEM Assertion OK : HPageBreak.Type is -4135 + ITEM Assertion OK : HPageBreak.Location: Range.Row is 5 + ITEM Assertion OK : HPageBreak.Delete: HPageBreaks.Count is 2 +END 'PageBreaks-Issue' Symbol + TEST OK : PageBreaks-Issue +Test run finished : 07/24/2008 05:06:13 PM diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Ranges-2.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Ranges-2.log new file mode 100644 index 000000000000..8b7076efaea0 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Ranges-2.log @@ -0,0 +1,68 @@ +Test run started : 19/06/2007 11:14:01 +---------------------------------------------------------------- +ClearFormtsIssue + TEST START : ClearFormtsIssue + ITEM Assertion OK : Range.Font.Bold is: True + ITEM Assertion OK : Range.Font.Bold is: False +END 'ClearFormtsIssue' Symbol + TEST OK : ClearFormtsIssue +---------------------------------------------------------------- +VerticalAlignment-Issue + TEST START : VerticalAlignment-Issue + ITEM Assertion OK : - Range.VerticalAlignment (get) + ITEM Assertion OK : - Range.VerticalAlignment (set) + ITEM Assertion OK : - Range.VerticalAlignment (get) + ITEM Assertion OK : - Range.VerticalAlignment (get) + ITEM Assertion OK : - Range.VerticalAlignment (set) + ITEM Assertion OK : - Range.VerticalAlignment (get) + ITEM Assertion OK : - Range.VerticalAlignment (set) + ITEM Assertion OK : Range.VeritcalAlignment is Null +END 'VerticalAlignment-Issue' Symbol + TEST OK : VerticalAlignment-Issue +---------------------------------------------------------------- +HorizontalAlignment-Issue + TEST START : HorizontalAlignment-Issue + ITEM Assertion OK : - Range.HorizontalAlignment (get) + ITEM Assertion OK : - Range.HorizontalAlignment (set) + ITEM Assertion OK : - Range.HorizontalAlignment (get) + ITEM Assertion OK : - Range.HorizontalAlignment (set) + ITEM Assertion OK : - Range.HorizontalAlignment (get) + ITEM Assertion OK : - Range.HorizontalAlignment (set) + ITEM Assertion OK : - Range.HorizontalAlignment (get) + ITEM Assertion OK : - Range.HorizontalAlignment (set) + ITEM Assertion OK : Range.HorizontalAlignment is Null +END 'HorizontalAlignment-Issue' Symbol + TEST OK : HorizontalAlignment-Issue +---------------------------------------------------------------- +WrapText-Issue + TEST START : WrapText-Issue + ITEM Assertion OK : - Range.WrapText (get) + ITEM Assertion OK : - Range.WrapText (get) + ITEM Assertion OK : Range.WrapText is Null +END 'WrapText-Issue' Symbol + TEST OK : WrapText-Issue +---------------------------------------------------------------- +FontBorderIssues + TEST START : FontBorderIssues + ITEM Assertion OK : - = Borders.Color (getColor) + ITEM Assertion OK : - = Font.Color (getColor) +END 'FontBorderIssues' Symbol + TEST OK : FontBorderIssues +---------------------------------------------------------------- +RangeSizeIssues + TEST START : RangeSizeIssues + ITEM Assertion OK : Range.Left is: 118.8432 + ITEM Assertion OK : Range.Top is: 92.16585 + ITEM Assertion OK : Range.Width is: 226.2 + ITEM Assertion OK : Range.Height is: 271.5 +END 'RangeSizeIssues' Symbol + TEST OK : RangeSizeIssues +---------------------------------------------------------------- +ApplicationIssues + TEST START : ApplicationIssues + ITEM Assertion OK : Range.Address is: $E$8:$G$13,$G$13:$K$19 + ITEM Assertion OK : Range.Address is: $E$8:$G$13,$G$13:$K$19 + ITEM Assertion OK : Application.ActiveSheet.Name: Sheet1 +END 'ApplicationIssues' Symbol + TEST OK : ApplicationIssues +Test run finished : 19/06/2007 11:14:02 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Ranges-3.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Ranges-3.log new file mode 100644 index 000000000000..a130737ceb65 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Ranges-3.log @@ -0,0 +1,8 @@ +Test run started : 19/06/2007 11:26:09 +---------------------------------------------------------------- +MyGoalseek-Issue + TEST START : MyGoalseek-Issue + ITEM Assertion OK : Variable Range value: 15 +END 'MyGoalseek-Issue' Symbol + TEST OK : MyGoalseek-Issue +Test run finished : 19/06/2007 11:26:10 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Ranges.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Ranges.log new file mode 100644 index 000000000000..cdd18685e977 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Ranges.log @@ -0,0 +1,280 @@ +Test run started : 10/03/2008 15:15:11 +---------------------------------------------------------------- +ApplicationMethods + TEST START : ApplicationMethods + ITEM Assertion OK : Name of Workbook is: Ranges.xls + ITEM Assertion OK : Address of Application.Columns is: $A:$A + ITEM Assertion OK : Address of Application.Rows is: $1:$1 + ITEM Assertion OK : Address of Application.Range is: $1:$1,$5:$7 + ITEM Assertion OK : Please check manually: DefaultFilePath is: /data4/home/npower/Documents + ITEM Assertion OK : Please check manually: Library Path is: /data4/home/npower/.ooo-2.0/user/basic + ITEM Assertion OK : Please check manually: Template Path is: /data4/home/npower/.ooo-2.0/user/template + ITEM Assertion OK : FileSeparator is / + ITEM Assertion OK : Name of ActiveWorkbook is: Ranges.xls +END 'ApplicationMethods' Symbol + TEST OK : ApplicationMethods +---------------------------------------------------------------- +Insert-Issue + TEST START : Insert-Issue + ITEM Assertion OK : Insert with xlShiftToRight: 10 +END 'Insert-Issue' Symbol + TEST OK : Insert-Issue +---------------------------------------------------------------- +MergeCells-Issue + TEST START : MergeCells-Issue + ITEM Assertion OK : Range.MergeCells is True + ITEM Assertion FAIL : MergeCells is null: False + ITEM Assertion OK : RowCount after Merge: 13 + ITEM Assertion OK : Range.MergeCells is False + ITEM Assertion OK : MergeCells is null: False + ITEM Assertion FAIL : MergeCells of Second Area is null : False + ITEM Assertion FAIL : MergeCells of Ranges is Null: False + ITEM Assertion OK : RowCount after Merge: 7 + ITEM Assertion OK : Range.MergeCells is False + ITEM Assertion OK : MergeCells is null: False + ITEM Assertion OK : RowCount after Merge: 7 +END 'MergeCells-Issue' Symbol + TEST OK : MergeCells-Issue +---------------------------------------------------------------- +Areas-Issue + TEST START : Areas-Issue + ITEM Assertion OK : Range Areas Count is2 + ITEM Assertion OK : First Range Address is: $E$8:$G$13 + ITEM Assertion OK : First Row is: 8 + ITEM Assertion OK : First Column is: 5 + ITEM Assertion OK : EntireRow Address is: $8:$13,$13:$19 + ITEM Assertion OK : EntireColumn Address is: $E:$G,$G:$K + ITEM Assertion OK : Range Count:53 +END 'Areas-Issue' Symbol + TEST OK : Areas-Issue +---------------------------------------------------------------- +Fill-Methods-Issue + TEST START : Fill-Methods-Issue + ITEM Assertion OK : Range Value after FillDown: MyFillValue + ITEM Assertion OK : Range Value after FillDown: MyFillValue + ITEM Assertion OK : Range Value after FillDown: MyRightFillValue + ITEM Assertion OK : Range Value after FillDown: MyBottomFillValue +END 'Fill-Methods-Issue' Symbol + TEST OK : Fill-Methods-Issue +---------------------------------------------------------------- +Range/Item-Method-Issue + TEST START : Range/Item-Method-Issue + ITEM Assertion OK : Range of multiple columns is: $A:$A,$C:$C + ITEM Assertion OK : Range of multiple rows is: $1:$1,$5:$7 + ITEM Assertion OK : Range of several columns is: $C:$E,$D:$D + ITEM Assertion OK : Range of several rows is: $5:$8,$6:$10 + ITEM Assertion OK : Range of several single cells is: $C$5,$E$8 + ITEM Assertion OK : Range of several named ranges is: $L$1:$M$6,$E$8:$G$13,$G$13:$K$19 + ITEM Assertion OK : Range of a single Item Cell is: $E$21 + ITEM Assertion OK : Range of a single Item Cell is: $F$21 + ITEM Assertion OK : Range of a single Item Cell is: $F$10 +END 'Range/Item-Method-Issue' Symbol + TEST OK : Range/Item-Method-Issue +---------------------------------------------------------------- +R1C1-Formulas-Issue + TEST START : R1C1-Formulas-Issue + ITEM Assertion OK : R1C1 Range.Formula is: =IF(OR(R[-2]C[1]=0,RC[2]="YES"),"") + ITEM Assertion OK : Range.Formula is: =IF(OR(J8=0,K10="YES"),"") +END 'R1C1-Formulas-Issue' Symbol + TEST OK : R1C1-Formulas-Issue +---------------------------------------------------------------- +Verify_Delete + TEST START : Verify_Delete + ITEM Assertion OK : Ranges are intersecting: $G$13 + ITEM Assertion OK : Delete with Default: $AJ$4 + ITEM Assertion OK : Delete with ShifttoLeft: $AJ$4 + ITEM Assertion OK : Delete with ShiftUp: $M$22 +END 'Verify_Delete' Symbol + TEST OK : Verify_Delete +---------------------------------------------------------------- +Value-Issue + TEST START : Value-Issue + ITEM Assertion OK : Value of Range is: 12.3 + ITEM Assertion OK : Text of Range is: 12.3 + ITEM Assertion OK : Range has Formula: False + ITEM Assertion OK : Cell has Formula: False + ITEM Assertion FAIL : Text of Range is null: False + ITEM Assertion OK : Range has Formula: True + ITEM Assertion OK : Cell has Formula: True + ITEM Assertion OK : Value of Cell is: 12 + ITEM Assertion OK : Application.Calculation is : -4135 + ITEM Assertion OK : Calculation is automated: True + ITEM Assertion OK : Range has Formula: True + ITEM Assertion OK : Value of Cell is: 16 + ITEM Assertion OK : Text of Cell is: 16 + ITEM Assertion OK : Text of Cell is: 16 + ITEM Assertion OK : Range has Formula after 'ClearContents: False + ITEM Assertion OK : Text of Cell is: + ITEM Assertion OK : Text of Cell is: +END 'Value-Issue' Symbol + TEST OK : Value-Issue +---------------------------------------------------------------- +AutoFit issue + TEST START : AutoFit issue + ITEM Assertion OK : Columns.AutoFit: CurrentWidth is 680 + ITEM Assertion OK : Rows.AutoFit: CurrentHeight is 554 +END 'AutoFit issue' Symbol + TEST OK : AutoFit issue +---------------------------------------------------------------- +Selections + TEST START : Selections + ITEM Assertion OK : ActiveCell is : $E$8 + ITEM Assertion OK : Active Cell is : $E$8 + ITEM Assertion OK : Number of Cells in Range: 52 + ITEM Assertion OK : Number of Cells in Range: 52 + ITEM Assertion OK : Number of Cells in Range: 52 +END 'Selections' Symbol + TEST OK : Selections +---------------------------------------------------------------- +Offset-Resize + TEST START : Offset-Resize + ITEM Assertion OK : Offset is : $G$10:$I$15,$I$15:$M$21 + ITEM Assertion OK : Offset is : $G$7:$I$12,$I$12:$M$18 + ITEM Assertion OK : Resized Range is : $A$20:$D$23 +END 'Offset-Resize' Symbol + TEST OK : Offset-Resize +---------------------------------------------------------------- +Ranges-Address + TEST START : Ranges-Address + ITEM Assertion OK : Range Address is: $E$8:$G$13,$G$13:$K$19 + ITEM Assertion OK : Range Address is: $E8:$G13,$G13:$K19 + ITEM Assertion OK : Range Address is: E$8:G$13,G$13:K$19 + ITEM Assertion OK : Range Address is: R8C5:R13C7,R13C7:R19C11 + ITEM Assertion FAIL : Range Address is: R8C5:R13C7,R13C7:R19C11 + ITEM Assertion OK : Range Address is: R8C5:R13C7,R13C7:R19C11 + ITEM Assertion OK : Range Address is: R[6]C[3]:R[11]C[5],R[11]C[5]:R[17]C[9] + ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$E$8:$G$13,$G$13:$K$19 +END 'Ranges-Address' Symbol + TEST OK : Ranges-Address +---------------------------------------------------------------- +Range-Address + TEST START : Range-Address + ITEM Assertion OK : Range Address is: $E$8:$G$13 + ITEM Assertion OK : Range Address is: $E8:$G13 + ITEM Assertion OK : Range Address is: E$8:G$13 + ITEM Assertion OK : Range Address is: R8C5:R13C7 + ITEM Assertion FAIL : Range Address is: R8C5:R13C7 + ITEM Assertion OK : Range Address is: R8C5:R13C7 + ITEM Assertion OK : Range Address is: R[6]C[3]:R[11]C[5] + ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$E$8:$G$13 +END 'Range-Address' Symbol + TEST OK : Range-Address +---------------------------------------------------------------- +Column-Address + TEST START : Column-Address + ITEM Assertion OK : Range Address is: $F$8:$F$13 + ITEM Assertion OK : Range Address is: $F8:$F13 + ITEM Assertion OK : Range Address is: F$8:F$13 + ITEM Assertion OK : Range Address is: R8C6:R13C6 + ITEM Assertion FAIL : Range Address is: R8C6:R13C6 + ITEM Assertion OK : Range Address is: R8C6:R13C6 + ITEM Assertion OK : Range Address is: R[6]C[4]:R[11]C[4] + ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$F$8:$F$13 +END 'Column-Address' Symbol + TEST OK : Column-Address +---------------------------------------------------------------- +Row-Address + TEST START : Row-Address + ITEM Assertion OK : Range Address is: $E$9:$G$9 + ITEM Assertion OK : Range Address is: $E9:$G9 + ITEM Assertion OK : Range Address is: E$9:G$9 + ITEM Assertion OK : Range Address is: R9C5:R9C7 + ITEM Assertion FAIL : Range Address is: R9C5:R9C7 + ITEM Assertion OK : Range Address is: R9C5:R9C7 + ITEM Assertion OK : Range Address is: R[7]C[3]:R[7]C[5] + ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$E$9:$G$9 +END 'Row-Address' Symbol + TEST OK : Row-Address +---------------------------------------------------------------- +SingleCell-Address + TEST START : SingleCell-Address + ITEM Assertion OK : Range Address is: $F$9 + ITEM Assertion OK : Range Address is: $F9 + ITEM Assertion OK : Range Address is: F$9 + ITEM Assertion OK : Range Address is: R9C6 + ITEM Assertion FAIL : Range Address is: R9C6 + ITEM Assertion OK : Range Address is: R9C6 + ITEM Assertion OK : Range Address is: R[7]C[4] + ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$F$9 +END 'SingleCell-Address' Symbol + TEST OK : SingleCell-Address +---------------------------------------------------------------- +Heights and Widths + TEST START : Heights and Widths + ITEM Assertion OK : Range RowHeight is 40 + ITEM Assertion OK : Range ColumnWidth is 50 + ITEM Assertion OK : Range Height is 240 + ITEM Assertion OK : Range Width is 795 + ITEM Assertion OK : Range RowHeight is 50 + ITEM Assertion OK : Range ColumnWidth is 50 + ITEM Assertion OK : Range Height is 300 + ITEM Assertion OK : Range Width is 795 + ITEM Assertion OK : RowHeight is null: True + ITEM Assertion OK : ColumnWidth is null: True +END 'Heights and Widths' Symbol + TEST OK : Heights and Widths +---------------------------------------------------------------- +RangeRowColumn-Issue + TEST START : RangeRowColumn-Issue + ITEM Assertion OK : Row is: 8 + ITEM Assertion OK : Column is: 5 + ITEM Assertion OK : EntireRow.Columns.Count = 256 + ITEM Assertion OK : EntireColumn.Rows.Count = 131072 +END 'RangeRowColumn-Issue' Symbol + TEST OK : RangeRowColumn-Issue +---------------------------------------------------------------- +Replace-Issue + TEST START : Replace-Issue + ITEM Assertion OK : Value after Replace: YourValue + ITEM Assertion OK : Value after Replace: YourValue + ITEM Assertion OK : Value after Replace: ReplaceValue + ITEM Assertion OK : Value after Replace: New ReplaceValue + ITEM Assertion OK : Value after Replace: New ReplaceValue + ITEM Assertion OK : Value after Replace: New Replace + ITEM Assertion OK : Value after Replace: +END 'Replace-Issue' Symbol + TEST OK : Replace-Issue +---------------------------------------------------------------- +Hidden-Issue + TEST START : Hidden-Issue + ITEM Assertion OK : - Range.Rows.Hidden (set) + ITEM Assertion OK : - Range.Rows.Hidden (get) + ITEM Assertion OK : - Range.Rows.Item(1).Hidden (set) + ITEM Assertion OK : - Range.Rows.Item(1).Hidden (get) + ITEM Assertion OK : - Range.Columns.Hidden (set) + ITEM Assertion OK : - Range.Columns.Hidden (get) + ITEM Assertion OK : - Range.Columns.Item(1).Hidden (set) + ITEM Assertion OK : - Range.Columns.Item(1).Hidden (get) +END 'Hidden-Issue' Symbol + TEST OK : Hidden-Issue +---------------------------------------------------------------- +End issue + TEST START : End issue + ITEM Assertion OK : - = $E$48 + ITEM Assertion OK : - = $E$1 + ITEM Assertion OK : - = $E$3 + ITEM Assertion OK : - = $A$8 + ITEM Assertion OK : - = $B$8 + ITEM Assertion OK : - = $IV$8 + ITEM Assertion OK : - = $Z$8 +END 'End issue' Symbol + TEST OK : End issue +---------------------------------------------------------------- +Outline issue + TEST START : Outline issue + ITEM Assertion OK : - Range.clearOutline - please check visually + ITEM Assertion OK : - Range.AutoOutline - please check visually + ITEM Assertion OK : - Range.AutoOutline - please check visually +END 'Outline issue' Symbol + TEST OK : Outline issue +---------------------------------------------------------------- +Validation + TEST START : Validation + ITEM Assertion OK : Validation Input Message is : Attention! + ITEM Assertion OK : Validation Input Message is : Enter an integer from five to ten + ITEM Assertion OK : Validation Error Title is : You must enter a number from five to ten + ITEM Assertion OK : Validation Error Message is : An Error occured + ITEM Assertion OK : Validation Error Title is : Microsoft Excel +END 'Validation' Symbol + TEST OK : Validation +Test run finished : 10/03/2008 15:15:13 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Shapes.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Shapes.log new file mode 100644 index 000000000000..3193a0b1094d --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Shapes.log @@ -0,0 +1,77 @@ +Test run started : 10/16/2007 05:25:21 PM +BEGIN Shapes_Collection_Behaviour + TEST START : Shapes_Collection_Behaviour + ITEM Assertion OK : Name of indexed shape should be 'Sheet2Shape1' + ITEM Assertion OK : Name of indexed shape should be 'Sheet2Shape2' + TEST Success. : Shapes_Collection_Behaviour +END Shapes_Collection_Behaviour +BEGIN Shapes_Select_Item + TEST START : Shapes_Select_Item + ITEM Assertion OK : Correctly selected shape through Range + ITEM Assertion OK : Correctly selected shape through Item + ITEM Assertion OK : Needs to be visually checked. Is there a line on the document? + ITEM Assertion OK : Needs to be visually checked. Are All Shapes Selected? + TEST Success. : Shapes_Select_Item +END Shapes_Select_Item +BEGIN Shapes_Fill + TEST START : Shapes_Fill + ITEM Assertion OK : correctly set visibility of shape fill + ITEM Assertion OK : correctly set transparency of shape line + ITEM Assertion OK : correctly set forecolor of shape fill + ITEM Assertion FAIL : correctly set backcolor of shape fill + ITEM Assertion OK : the success of the TwoColorGradient method needs to be verified visually! + ITEM Assertion OK : correctly set forecolor of shape fill + ITEM Assertion FAIL : correctly set forecolor of shape fill + TEST Success. : Shapes_Fill +END Shapes_Fill +BEGIN Shapes_Line + TEST START : Shapes_Line + ITEM Assertion FAIL : correctly set weight of shape line + ITEM Assertion OK : correctly set visibility of shape line + ITEM Assertion OK : correctly set transparency of shape line + ITEM Assertion OK : correctly set dash style of shape line + ITEM Assertion OK : correctly set dash style of shape line + ITEM Assertion OK : correctly set forecolor of shape line + ITEM Assertion FAIL : correctly set backcolor of shape line + TEST Success. : Shapes_Line +END Shapes_Line +BEGIN Shapes_TextFrame + TEST START : Shapes_TextFrame + ITEM Assertion OK : correctly set Autosize of Shape TextFrame + TEST Success. : Shapes_TextFrame +END Shapes_TextFrame +BEGIN Shapes_SimpleGeometry + TEST START : Shapes_SimpleGeometery + ITEM Assertion OK : shape height should be 47.0425168477155 and got 46.9984222363199 + ITEM Assertion OK : shape width should be 101.467710269751 and got 101.423615658355 + ITEM Assertion OK : shape left should be 68.5574761223637 and got 68.5417279658754 + ITEM Assertion OK : shape top should be 42.0251943291216 and got 42.0094461726333 + ITEM Assertion OK : shape rotation should be 0 and got 0 + ITEM Assertion OK : shape rotation should be 25 and got 25 + ITEM Assertion OK : shape incrementrotation should be 50 and got 50 + ITEM Assertion OK : shape incrementleft should be 70.6834602404119 and got 70.6677120839236 + ITEM Assertion OK : shape incrementtop should be 91.262986503119 and got 91.2472383466307 + TEST Success. : Shapes_SimpleGeometery +END Shapes_SimpleGeometry +BEGIN Shapes_Range + TEST START : Shapes_Range + ITEM Assertion OK : expected Sheets(2).Shapes.Range(1) to contain 1 element, it contains 1 + ITEM Assertion OK : expected Sheets(2).Shapes.Range(1) to return Sheet2Shape1 got Sheet2Shape1 + ITEM Assertion OK : expected Sheets(2).Shapes.Range(Sheet2Shape3) to contain 1 element, it contains 1 + ITEM Assertion OK : expected Sheets(2).Shapes.Range(Sheet2Shape3) to return Sheet2Shape3 got Sheet2Shape3 + ITEM Assertion OK : expected Sheets(2).Shapes.Range(Array(3, 1) to contain 2 elements, it contains 2 + ITEM Assertion OK : expected Sheets(2).Shapes.Range(Array(3, 1) to return concated element/shape names Sheet2Shape3Sheet2Shape1 and got Sheet2Shape3Sheet2Shape1 + ITEM Assertion OK : expected Sheets(2).Shapes.Range(Array('Sheet2Shape3', 1, 'Sheet2Shape2')) to contain 3 elements, it contains 3 + ITEM Assertion OK : expected Sheets(2).Shapes.Range(Array('Sheet2Shape3', 1, 'Sheet2Shape2')) to return concated element/shape names Sheet2Shape3Sheet2Shape1Sheet2Shape2 and got Sheet2Shape3Sheet2Shape1Sheet2Shape2 + TEST Success. : Shapes_Range +END Shapes_Range +BEGIN Shapes_ShapeRange + TEST START : Shapes_ShapeRange + ITEM Assertion OK : ShapeRange.IncrementLeft shp1.left should be 90.6677120839236 and got 90.6519627935771 + ITEM Assertion OK : ShapeRange.IncrementLeft shp2.left should be 240.02518299054 and got 240.009433700193 + ITEM Assertion OK : ShapeRange.IncrementTop shp1.Top should be 111.247238346631 and got 111.231489056284 + ITEM Assertion OK : ShapeRange.IncrementTop shp2.Top should be 65.0708633026228 and got 65.0551140122763 + ITEM Assertion OK : ShapeRange.IncrementRotation shp1.Rotation should be 70 and got 70 + ITEM Assertion OK : ShapeRange.IncrementRotation shp2.Rotation should be 20 and got 20 +END Shapes_ShapeRange +Test run finished : 10/16/2007 05:25:22 PM diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/StrConv-test.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/StrConv-test.log new file mode 100644 index 000000000000..c7a7d8750583 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/StrConv-test.log @@ -0,0 +1,9 @@ +Test run started : 05/29/2008 02:51:03 PM +BEGIN StrConv + TEST START : Test StrConv function + ITEM Assertion OK : Converts the string to uppercase characters:ABC EFG HIJ + ITEM Assertion OK : Converts the string to lowercase characters:abc efg hij + ITEM Assertion OK : Converts the first letter of every word in string to uppercase:Abc Efg Hij + TEST OK : Test StrConv function +END StrConv +Test run finished : 05/29/2008 02:51:03 PM diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Template.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Template.log new file mode 100644 index 000000000000..c6376c5b3732 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Template.log @@ -0,0 +1,14 @@ +Test run started : 2008/07/10 11:57:05 +---------------------------------------------------------------- +TestCaseName + TEST START : TestCaseName + ITEM Assertion OK : Something has been done. +Test Results +============ + +Tests passed: 1 +Tests failed: 0 + +END 'TestCaseName + TEST OK : TestCaseName +Test run finished : 2008/07/10 11:57:05 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/TestAddress.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/TestAddress.log new file mode 100644 index 000000000000..4fa4bc820f59 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/TestAddress.log @@ -0,0 +1,67 @@ +Test run started : 12/05/2009 11:23:35 +---------------------------------------------------------------- +TestAddress + TEST START : TestAddress + ITEM Assertion OK : test1 Range('e3:f3') A1 style addressing + ITEM Assertion OK : test2 Range('e3:f3') R1C1 style addressing + ITEM Assertion OK : test3 Range ('e:f') A1 style addressing + ITEM Assertion OK : test4 Range ('e:f') R1C1 style addressing + ITEM Assertion OK : test5 Columns A1 style addressing + ITEM Assertion OK : test6 Columns R1C1 style addressing + ITEM Assertion OK : test7 Columns(3) A1 style addressing + ITEM Assertion OK : test8 Columns(3) R1C1 style addressing + ITEM Assertion OK : test9 Columns('e') A1 style addressing + ITEM Assertion OK : test10 Columns('e') R1C1 style addressing + ITEM Assertion OK : test11 Columns('b:d') A1 style addressing + ITEM Assertion OK : test12 Columns('b:d') R1C1 style addressing + ITEM Assertion OK : test13 Range('c1:g10').Columns A1 style addressing + ITEM Assertion OK : test14 Range('c1:g10').Columns R1C1 style addressing + ITEM Assertion OK : test15 Range('c1:g10').Columns(1) A1 style addressing + ITEM Assertion OK : test16 Range('c1:g10').Columns(1) R1C1 style addressing + ITEM Assertion OK : test17 Range('c1:g10').Columns('a') A1 style addressing + ITEM Assertion OK : test18 Range('c1:g10').Columns('a') R1C1 style addressing + ITEM Assertion OK : test19 Range('c1:g10').Columns('c') A1 style addressing + ITEM Assertion OK : test20 Range('c1:g10').Columns('c') R1C1 style addressing + ITEM Assertion OK : test21 Range('c1:g10').Columns('x:z') A1 style addressing + ITEM Assertion OK : test22 Range('c1:g10').Columns('x:z') R1C1 style addressing + ITEM Assertion OK : test23 Range('c1:g10').Columns(30) A1 style addressing + ITEM Assertion OK : test24 Range('c1:g10').Columns(30) R1C1 style addressing + ITEM Assertion OK : test25 Worksheets('Sheet2').Cells(1, 1) A1 style addressing + ITEM Assertion OK : test26 Worksheets('Sheet2').Cells(1, 1) A1 style addressing, RowAddressAbsolute is false + ITEM Assertion OK : test27 Worksheets('Sheet2').Cells(1, 1) A1 style addressing, ColAddressAbsolute is false + ITEM Assertion OK : test28 Worksheets('Sheet2').Cells(1, 1) R1C1 style addressing + ITEM Assertion OK : test29 Worksheets('Sheet2').Range('A1:E5').EntireColumn A1 style addressing + ITEM Assertion OK : test30 Worksheets('Sheet2').Range('A1').EntireColumn A1 style addressing + ITEM Assertion OK : test31 Worksheets('Sheet2').Range('A1:E5').EntireRow A1 style addressing + ITEM Assertion OK : test32 Worksheets('Sheet2').Range('A1') A1 style addressing + ITEM Assertion OK : test33 Worksheets('Sheet2').Range('IV65536').EntireRow A1 style addressing + ITEM Assertion OK : test34 Worksheets('Sheet2').Range('IU2:IV65536') A1 style addressing + ITEM Assertion OK : test35 Range('c1:g10').Columns('x:z') R1C1 style addressing + ITEM Assertion OK : test36 Worksheets('Sheet2').Range('A1') A1 style addressing + ITEM Assertion OK : test37 Worksheets('Sheet2').Range('A1:E5').EntireColumn A1 style addressing + ITEM Assertion OK : test38 Worksheets('Sheet2').Range('10:12') A1 style addressing + ITEM Assertion OK : test39 Worksheets('Sheet2').Range('10:12') R1C1 style addressing + ITEM Assertion OK : test40 Range('Sheet3!A1:B4') A1 style addressing + ITEM Assertion OK : test41 Range('Sheet3!A1,B1,D4:F20') A1 style addressing + ITEM Assertion OK : test42 Range('g20:h40').Columns('c:c') + ITEM Assertion OK : test43 Range('g20:h40').Columns('c:f') + ITEM Assertion OK : test44 Range('g20:h40').Columns(-1) + ITEM Assertion OK : test45 Range('c4:g10').Rows(-1) + ITEM Assertion OK : test46 Range('a2:b4').Rows('1:1') + ITEM Assertion OK : test47 Range('a2:b4').Rows('1:2') + ITEM Assertion OK : test48 Range('a2:b4').Rows('2:2') + ITEM Assertion OK : test49 Range('a2:b4').Rows('2:3') + ITEM Assertion OK : test50 Range(' A2:B4 ') + ITEM Assertion OK : test51 Range('A 2:B 4') + ITEM Assertion OK : test52 Range('A2 : B4 ') + ITEM Assertion OK : test53 Range('Sheet1 !A2 : B4 ') + ITEM Assertion OK : test54 Range('Sheet1! A2 : B4 ') +Test Results +============ + +Tests passed: 54 +Tests failed: 0 + +END 'TestAddress + TEST OK : TestAddress +Test run finished : 12/05/2009 11:23:35 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/TestCalc_Rangetest.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/TestCalc_Rangetest.log new file mode 100644 index 000000000000..083819d4b64e --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/TestCalc_Rangetest.log @@ -0,0 +1,60 @@ +Test run started : 30/05/2007 15:59:40 +BEGIN TestCalc + TEST START : RangeTest2 + ITEM Assertion OK : - Range("D15").Row + ITEM Assertion OK : - WorkSheet("D15").Range.Row + ITEM Assertion OK : - Range("D15").Column + ITEM Assertion OK : - Worksheet.Range("D15").Column + ITEM Assertion OK : - Range("D1").EntireRow.Valuer + ITEM Assertion OK : - Range("D1").EntireRow.Valuer + ITEM Assertion OK : - Range("D1").EntireRow.Columns.Count + ITEM Assertion OK : - Range("D1").EntireColumn.Rows.Count + ITEM Assertion OK : - Range("D15").ClearContent + ITEM Assertion OK : - Range("M1:N2").Rows.Hidden (set) + ITEM Assertion OK : - Range("M1:N2").Rows.Hidden (get) + ITEM Assertion OK : - Range("M1:N2").Rows(1).Hidden (set) + ITEM Assertion OK : - Range("M1:N2").Rows(1).Hidden (get) + ITEM Assertion OK : - Range("M1:N2").Columns.Hidden (set) + ITEM Assertion OK : - Range("M1:N2").Columns.Hidden (get) + ITEM Assertion OK : - Range("M1:N2").Columns(1).Hidden (set) + ITEM Assertion OK : - Range("M1:N2").Columns(1).Hidden (get) + ITEM Assertion OK : - Range("B38").Orientation (get) + ITEM Assertion OK : - Range("B38").Orientation (set) + ITEM Assertion OK : - Range("B38").Orientation (set = xlDownward) + ITEM Assertion OK : - Range("B38").Orientation (set) + ITEM Assertion OK : - Range("B38").Orientation (set = xlUpward) + ITEM Assertion OK : - Range("B38").Orientation (set) + ITEM Assertion OK : - Range("B38").Orientation (set = xlVertical) + ITEM Assertion OK : - Range("B38").Orientation (set) + ITEM Assertion OK : - Range("B38").Orientation (set = xlVertical) + ITEM Assertion OK : - Range("B39").WrapText (get) + ITEM Assertion OK : - Range("B39").WrapText (set) + ITEM Assertion OK : - Range("B39").WrapText (set) + ITEM Assertion OK : - Range("E39").MergeCells (get) + ITEM Assertion OK : - Range("F39").MergeCells (get) + ITEM Assertion OK : - Range("E39").MergeCells (set) + ITEM Assertion FAIL : - Range("F39").MergeCells (set) + ITEM Assertion OK : - Range("E39").MergeCells (set) + ITEM Assertion OK : - Range("F39").MergeCells (set) + ITEM Assertion OK : - Range("C41:C42").Replace MatchCase:=True + ITEM Assertion OK : - Range("C41:C42").Replace MatchCase:=True + ITEM Assertion OK : - Range("D41:D42").Replace MatchCase:=False + ITEM Assertion OK : - Range("B39").VerticalAlignment (get) + ITEM Assertion OK : - Range("B39").VerticalAlignment (set) + ITEM Assertion OK : - Range("B39").VerticalAlignment (get) + ITEM Assertion OK : - Range("B39").VerticalAlignment (get) + ITEM Assertion OK : - Range("B39").VerticalAlignment (set) + ITEM Assertion OK : - Range("B39").VerticalAlignment (get) + ITEM Assertion OK : - Range("B39").VerticalAlignment (set) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (get) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (set) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (get) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (set) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (get) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (set) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (get) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (set) + ITEM FAIL (RangeTest2) + TEST Not succesfully completed : RangeTest2 +END TestCalc +Test run finished : 30/05/2007 15:59:42 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/TestCalc_Rangetest2.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/TestCalc_Rangetest2.log new file mode 100644 index 000000000000..b1573c06d90e --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/TestCalc_Rangetest2.log @@ -0,0 +1,65 @@ +Test run started : 10/03/2008 15:15:19 +BEGIN TestCalc + TEST START : RangeTest3 + ITEM Assertion OK : - setFormulaR1C1 + ITEM Assertion OK : - getFormulaR1C1 + ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial() + ITEM Assertion OK : - Range.Copy(Range("I10")) + ITEM Assertion OK : PasteSpecial Paste:=xlPasteValues + ITEM Assertion OK : PasteSpecial Paste:=xlPasteFormulas + ITEM Assertion OK : PasteSpecial Paste:=xlPasteFormats + ITEM Assertion OK : PasteSpecial + ITEM Assertion OK : PasteSpecial SkipBlanks:=True + ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationAdd + ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationSubtract + ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationMultiply + ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationDivide + ITEM Assertion OK : PasteSpecial Transpose:=True + ITEM Assertion FAIL : ActiveWorkbook.FileFormat + ITEM Assertion OK : ActiveWorkbook.Name + ITEM Assertion OK : ActiveWorkbook.FullName und ActiveWorkbook.Path + ITEM Assertion FAIL : - = ActiveWorkbook.Colors(3) set + ITEM Assertion OK : - = ActiveWorkbook.ResetColors + ITEM Assertion OK : - = ActiveWorkbook.Colors(3) get + ITEM Assertion OK : - = Range("K22").End (xlDown) + ITEM Assertion OK : - = Range("K22").End (xlUo) + ITEM Assertion OK : - = Range("K22").End (xlToLeft) + ITEM Assertion OK : - = Range("K22").End (xlRight) + ITEM Assertion OK : - ActiveSpreadsheet.Next + ITEM Assertion OK : - ActiveSpreadsheet.Next + ITEM Assertion OK : - ActiveSpreadsheet.Previous + ITEM Assertion OK : - ActiveSpreadsheet.Previous + ITEM Assertion OK : - Range("J4:J11").AutoFilter field:=1, Criteria1:="x" + ITEM Assertion OK : - Range("J4:J11").AutoFilter field:=1, Criteria1:="<>" + ITEM Assertion OK : - Range("J4:J11").AutoFilter field:=1, Criteria1:="=" + ITEM Assertion OK : - Range("J4:J11").AutoFilter + ITEM Assertion OK : - ActiveSheet.Resize.Select + ITEM Assertion OK : - Application.GoTo Reference:="R8C2" + ITEM Assertion FAIL : - Application.GoTo Reference:="R[8]C[2]" + ITEM Assertion OK : - Application.GoTo Reference:="R8C2" + ITEM Assertion OK : - Range.Group - please check visually + ITEM Assertion OK : - Range.Group - please check visually + ITEM Assertion OK : - Range.Ungroup- please check visually + ITEM Assertion OK : - Range.Ungroup - please check visually + ITEM Assertion OK : - Range.Group - please check visually + ITEM Assertion OK : - Range.Group - please check visually + ITEM Assertion OK : - Range.clearOutline - please check visually + ITEM Assertion OK : - Range.AutoOutline - please check visually + ITEM Assertion OK : - Range.AutoOutline - please check visually + ITEM Assertion OK : - ActiveSheet.UsedRange.Select + ITEM Assertion OK : - Range("A13").AddIndent + ITEM Assertion OK : - Range("A13").IndentLevel set + ITEM Assertion OK : - Range("A13").IndentLevel get + ITEM Assertion OK : - Range("A13").IndentLevel get + ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial() + ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial() + ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial() + ITEM Assertion OK : - Range.Calculate + ITEM Assertion OK : Worksheet.Calculate + ITEM Assertion OK : - Application.Calculate + ITEM Assertion OK : Global.Calculate + ITEM Assertion OK : Calculation set + ITEM FAIL (RangeTest3) + TEST Not succesfully completed : RangeTest3 +END TestCalc +Test run finished : 10/03/2008 15:15:21 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/TestIntersection.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/TestIntersection.log new file mode 100644 index 000000000000..ea686a830cde --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/TestIntersection.log @@ -0,0 +1,26 @@ +Test run started : 13/01/2009 14:31:43 +---------------------------------------------------------------- +TestIntersection + TEST START : TestIntersection + ITEM Assertion OK : test1 Application.Intersect( Range('A2:D10'), Range('C4:E6')) + ITEM Assertion OK : test2 Application.Intersect( Range('A2:D10'), Range('A4:G10')) + ITEM Assertion OK : test3 Application.Intersect( Range('A2:c8,d2:f8,g2:i8'), Range('A4:G10')) + ITEM Assertion OK : test4 Application.Intersect( Range('A4:G10'), Range('A2:c8,d2:f8,g2:i8')) + ITEM Assertion OK : test5 Application.Intersect( Range('A2:c8,d2:f8,g2:i8'), Range('g4:i10,A4:G10')) + ITEM Assertion OK : test6 Application.Intersect( Range('g4:i10,A4:G10'), Range('A2:c8,d2:f8,g2:i8')) + ITEM Assertion OK : test7 Application.Intersect( Range('a2:d10,b5:e10'), Range('a5:i10')) + ITEM Assertion OK : test8 Application.Intersect( Range('a2:c8,d2:f8'), Range('b6:e9,a6:f9')) + ITEM Assertion OK : test9 Application.Intersect( Range('a2:c8,e2:f8'), Range('b6:e9,a6:f9')) + ITEM Assertion OK : test10 Application.Intersect( Range('a1:a3,c1:c3'), Range('a2:c3')) + ITEM Assertion OK : test11 Application.Intersect( Range('a1:a3,b1:b3'), Range('a2:c3')) + ITEM Assertion OK : test12 Application.Intersect( Range('a2:d5,b3:f7,c1:g4'), Range('b2:e6')) + ITEM Assertion OK : test13 Range(" a2:d10,b5:e10,g13:j32 "), Range(" a5:i10,b6:e9 "), Range("b2:r5,f10:h19") +Test Results +============ + +Tests passed: 13 +Tests failed: 0 + +END 'TestIntersection + TEST OK : TestIntersection +Test run finished : 13/01/2009 14:31:43 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/TestUnion.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/TestUnion.log new file mode 100644 index 000000000000..da3cb35dedb3 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/TestUnion.log @@ -0,0 +1,17 @@ +Test run started : 13/01/2009 14:32:16 +---------------------------------------------------------------- +TestUnion + TEST START : TestUnion + ITEM Assertion OK : test1Application.Range('A2:D10'), Range('C4:E6') + ITEM Assertion OK : test2Application.Range('A2:D5,a3:d4'), Range('A4:G10') + ITEM Assertion OK : test3Application.Range('A4:G10,A1:B6'), Range('A2:D5,A3:D4') + ITEM Assertion OK : test4Application.Range('A5:D10'), Range('B5:E10') +Test Results +============ + +Tests passed: 4 +Tests failed: 0 + +END 'TestUnion + TEST OK : TestUnion +Test run finished : 13/01/2009 14:32:16 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/VariantTest.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/VariantTest.log new file mode 100644 index 000000000000..a916ac4a37fd --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/VariantTest.log @@ -0,0 +1,47 @@ +Test run started : 24/09/2008 10:58:18 +---------------------------------------------------------------- +TestAddress + TEST START : TestAddress + ITEM Assertion OK : test1: res = (aboo = '') + ITEM Assertion OK : test 2: res = (aboo = 'fiddlesticks') + ITEM Assertion OK : test 3: res = ('' = aboo) + ITEM Assertion OK : test 4: res = ('fiddlesticks' = aboo ) + ITEM Assertion OK : test 5: res = (testString = '') + ITEM Assertion OK : test 6: res = (testString = 'fiddlesticks') + ITEM Assertion OK : test 7: res = ('' = testString) + ITEM Assertion OK : test 8: res = ('fiddlesticks' = testString ) + ITEM Assertion OK : test 9: res = ( aboo < " ) + ITEM Assertion OK : test 10: res = ( testString < " ) + ITEM Assertion OK : test 11: res = ( aboo > " ) + ITEM Assertion OK : test 12: res = ( testString > " ) + ITEM Assertion OK : test 13: res = ( aboo <> '' ) + ITEM Assertion OK : test 14: res = ( testString <> '' ) + ITEM Assertion OK : test 15: res = (aboo = something/14) + ITEM Assertion OK : test 16: res = something + 'string' + ITEM Assertion OK : test 17: res = something & 'string' + ITEM Assertion OK : test 18: res = something MOD 10 ) + ITEM Assertion OK : test 19: res = something AND 1 ) + ITEM Assertion OK : test 20: res = something AND 0 ) + ITEM Assertion OK : test 21: res = something OR 12) + ITEM Assertion OK : test 22: res = something OR 0 ) + ITEM Assertion OK : test 23: res = something XOR 0 ) + ITEM Assertion OK : test 24: res = something XOR 1 ) + ITEM Assertion OK : test 25: res = something EQV 0 ) + ITEM Assertion OK : test 26: res = something EQV 1 ) + ITEM Assertion OK : test 27: res = something IMP 0 ) + ITEM Assertion OK : test 28: res = something IMP 1 ) + ITEM Assertion OK : test 29: res = something IMP 14 ) + ITEM Assertion OK : test 30: res = NOT something ) + ITEM Assertion OK : test 31: res = something + 12 ) + ITEM Assertion OK : test 32: res = something - 12 ) + ITEM Assertion OK : test 33: res = -something ) + ITEM Assertion OK : test 34: res = something * 12 ) +Test Results +============ + +Tests passed: 34 +Tests failed: 0 + +END 'TestAddress + TEST OK : TestAddress +Test run finished : 24/09/2008 10:58:20 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Window.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Window.log new file mode 100644 index 000000000000..ec9a6656113e --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/Window.log @@ -0,0 +1,46 @@ +Test run started : 05/29/2008 02:55:00 PM +---------------------------------------------------------------- + TEST START : Window-Issue + ITEM Assertion OK : Window.Left is: 0 (Test only applies to maximized Window) + ITEM Assertion OK : Window.Top is: 21 (Test only applies to maximized Window) + ITEM Assertion OK : Window.Width is: 1280 (Test only applies to maximized Window) + ITEM Assertion OK : Window.Height is: 752 (Test only applies to maximized Window) + ITEM Assertion OK : Window.ScrollColumn is: 100 + ITEM Assertion OK : Window.ScrollColumn is: 1 + ITEM Assertion OK : Window.ScrollRow is: 100 + ITEM Assertion OK : Window.ScrollRow is: 1 + ITEM Assertion OK : Window.LargeScroll(Down): ScrollRow is: 94 (Test may only apply to maximized Window) + ITEM Assertion OK : Window.LargeScroll(Up): ScrollRow is: 1 + ITEM Assertion OK : Window.LargeScroll(ToRight): ScrollColumn is: 58 (Test may only apply to maximized Window) + ITEM Assertion OK : Window.LargeScroll(ToLeft): ScrollColumn is: 1 + ITEM Assertion OK : Window.SmallScroll(ToRight): ScrollColumn is: 4 (Test may only apply to maximized Window) + ITEM Assertion OK : Window.SmallScroll(ToLeft): ScrollColumn is: 1 + ITEM Assertion OK : Window.DisplayWorkBookTabs is: False + ITEM Assertion OK : Window.DisplayWorkBookTabs is: True + ITEM Assertion OK : Window.DisplayVerticalScrollBar is: True + ITEM Assertion OK : Window.DisplayVerticalScrollBar is: False + ITEM Assertion OK : Window.DisplayHorizontalScrollBar is: False + ITEM Assertion OK : Window.DisplayHorizontalScrollBar is: True + ITEM Assertion OK : Window.DisplayHeadings is: False + ITEM Assertion OK : Window.DisplayHeadings is: True + ITEM Assertion OK : Window.DisplayOutline is: False + ITEM Assertion OK : Window.DisplayOutline is: True + ITEM Assertion OK : Window.Visible is: False + ITEM Assertion OK : Window.Visible is: True + ITEM Assertion OK : Window.Caption is: MyCaption + ITEM Assertion OK : Pane.ScrollColumn is: 100 + ITEM Assertion OK : Pane.ScrollColumn is: 1 + ITEM Assertion OK : Pane.ScrollRow is: 100 + ITEM Assertion OK : Pane.ScrollRow is: 1 + ITEM Assertion OK : Pane.LargeScroll(Down): ScrollRow is: 94 (Test may only apply to maximized Window) + ITEM Assertion OK : Pane.LargeScroll(Up): ScrollRow is: 1 + ITEM Assertion OK : Pane.LargeScroll(ToRight): ScrollColumn is: 58 (Test may only apply to maximized Window) + ITEM Assertion OK : Pane.LargeScroll(ToLeft): ScrollColumn is: 1 + ITEM Assertion OK : Pane.SmallScroll(ToRight): ScrollColumn is: 4 (Test may only apply to maximized Window) + ITEM Assertion OK : Pane.SmallScroll(ToLeft): ScrollColumn is: 1 + ITEM Assertion OK : Window Selection: $A$2:$D$5 + ITEM Assertion OK : ActiveSheet name of Window: Sheet1 + ITEM Assertion OK : Window ActiveCell: $A$1 +END 'Window-Issue' Symbol + TEST OK : Window-Issue +Test run finished : 05/29/2008 02:55:01 PM diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/bytearraystring.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/bytearraystring.log new file mode 100644 index 000000000000..bd243283d8f1 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/bytearraystring.log @@ -0,0 +1,8 @@ +Test run started : 05/29/2008 02:25:58 PM +BEGIN Bytearray To String + TEST START : Test the conversion between bytearray and string + ITEM Assertion OK : The number of byte is:6 + ITEM Assertion OK : the return string is: abc + TEST OK : Test the conversion between bytearray and string +END Bytearray To String +Test run finished : 05/29/2008 02:25:58 PM diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/dateserial.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/dateserial.log new file mode 100644 index 000000000000..4dd5f53160f2 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/dateserial.log @@ -0,0 +1,9 @@ +Test run started : 01/24/2008 01:24:50 PM +BEGIN DateSerial + TEST START : Test DateSerial function + ITEM Assertion OK : the return date is: 06/15/1999 + ITEM Assertion OK : the return date is: 06/15/1999 + ITEM Assertion OK : the return date is: 06/15/1999 + TEST OK : Test DateSerial function +END DateSerial +Test run finished : 01/24/2008 01:24:50 PM diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/datevalue.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/datevalue.log new file mode 100644 index 000000000000..830d5e7b6c3e --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/datevalue.log @@ -0,0 +1,8 @@ +Test run started : 01/24/2008 01:24:41 PM +BEGIN DateValue + TEST START : Test DateValue function + ITEM Assertion OK : the return date is: 02/12/1969 + ITEM Assertion OK : the return date is: 01/21/2008 + TEST OK : Test DateValue function +END DateValue +Test run finished : 01/24/2008 01:24:41 PM diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/format.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/format.log new file mode 100644 index 000000000000..96725bf7daa8 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/format.log @@ -0,0 +1,36 @@ +Test run started : 2008/09/18 11:35:34 +BEGIN Format + TEST START : Test Predefined_Number_Format_Sample function + ITEM Assertion OK : General Number: 562486.2356 + ITEM Assertion OK : Fixed: 0.20 + ITEM Assertion OK : Standard: 562,486.24 + ITEM Assertion OK : Percent: 75.21% + ITEM Assertion OK : Scientific: 5.62E+05 + ITEM Assertion OK : Scientific: -3.46E+03 + ITEM Assertion OK : Yes/No: No + ITEM Assertion OK : Yes/No: Yes + ITEM Assertion OK : True/False: False + ITEM Assertion OK : True/False: True + ITEM Assertion OK : On/Off: Off + ITEM Assertion OK : On/Off: On + TEST OK : Test Predefined_Number_Format_Sample function + TEST START : Test Custom_Number_Format_Sample function + ITEM Assertion OK : 00.0000: 23.6750 + ITEM Assertion OK : 00.00: 23.68 + ITEM Assertion OK : 00000: 02658 + ITEM Assertion OK : 00.00: 2658.00 + ITEM Assertion OK : ##.####: 23.675 + ITEM Assertion OK : ##.##: 23.68 + ITEM Assertion OK : #,###.##: 12,345.25 + ITEM Assertion OK : ##.00%: 25.00% + ITEM Assertion OK : #,###: 1,000,000 + ITEM Assertion OK : ######E-###: 109838E-5 + ITEM Assertion OK : $#,###.##: $2,345.25 + ITEM Assertion OK : ##.###\%: .25% + TEST OK : Test Custom_Number_Format_Sample function + TEST START : Test Custom_Text_Format_Sample function + ITEM Assertion OK : <: vba + ITEM Assertion OK : >: VBA + TEST OK : Test Custom_Text_Format_Sample function +END Format +Test run finished : 2008/09/18 11:35:34 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/pagesetup.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/pagesetup.log new file mode 100644 index 000000000000..f04585c3f9e1 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/pagesetup.log @@ -0,0 +1,77 @@ +Test run started : 07/21/2008 02:00:06 PM +BEGIN PageSetup + TEST START : Sheet_PrintArea + ITEM Assertion OK : PrintArea has changed as expected + TEST OK : Sheet_PrintArea + TEST START : Test margins (no headers) + ITEM Assertion OK : PageSetup.LeftMargin set/get + ITEM Assertion OK : PageSetup.RightMargin set/get + ITEM Assertion OK : PageSetup.TopMargin set/get + ITEM Assertion OK : PageSetup.BottomMargin set/get +Verify that page margins on sheet 1 are all 0.5inch + TEST OK : Test margins (no headers) + TEST START : Test margins (headers) + ITEM Assertion OK : PageSetup.HeaderMargin set/get + ITEM Assertion OK : PageSetup.FooterMargin set/get + ITEM Assertion OK : PageSetup.LeftMargin set/get + ITEM Assertion OK : PageSetup.LeftMargin set/get +Verify that top/bottom/header/footer page margins on sheet 2 are all 0.5inch + TEST OK : Test margins (headers) + TEST START : Test header/footer text + ITEM Assertion OK : PageSetup.LeftHeader set + ITEM Assertion OK : PageSetup.LeftHeader set/get + ITEM Assertion OK : PageSetup.CenterHeader set + ITEM Assertion OK : PageSetup.CenterHeader set/get + ITEM Assertion OK : PageSetup.RightHeader set + ITEM Assertion OK : PageSetup.RightHeader set/get + ITEM Assertion OK : PageSetup.LeftFooter set + ITEM Assertion OK : PageSetup.LeftFooter set/get + ITEM Assertion OK : PageSetup.CenterFooter set + ITEM Assertion OK : PageSetup.CenterFooter set/get + ITEM Assertion OK : PageSetup.RightFooter set + ITEM Assertion OK : PageSetup.RightFooter set/get +Verify that headers on sheet 2 are Ready,to,go +Verify that footers on sheet 2 are This,now,Works + TEST OK : Test header/footer text + TEST START : Test zoom + ITEM Assertion OK : PageSetup.Zoom set + ITEM Assertion OK : PageSetup.Zoom set/get +Verify that sheet 1 zoom is 10% + TEST OK : Test zoom + TEST START : Test orientation + ITEM Assertion OK : PageSetup.Zoom set + ITEM Assertion OK : PageSetup.Orientation set/get +Verify that sheet 1 orientation is now landscape + TEST OK : Test orientation + TEST START : Test order + ITEM Assertion OK : PageSetup.Order get + ITEM Assertion OK : PageSetup.Order set/get +Verify that order on sheet 1 is now over, then down. + TEST OK : Test order + TEST START : Test first page number + ITEM Assertion OK : PageSetup.FirstPageNumber get + ITEM Assertion OK : PageSetup.FirstPageNumber set/get +Verify that first page number on sheet 1 is now 2. + TEST OK : Test first page number + TEST START : Test center vertically + ITEM Assertion OK : PageSetup.CenterVertically get + ITEM Assertion OK : PageSetup.CenterVertically set/get +Verify that CenterVertically on sheet 1 is now true. + TEST OK : Test center vertically + TEST START : Test center horizontally + ITEM Assertion OK : PageSetup.CenterHorizontally get + ITEM Assertion OK : PageSetup.CenterHorizontally set/get +Verify that CenterHorizontally on sheet 1 is now true. + TEST OK : Test center horizontally + TEST START : Test FitToPagesTall + ITEM Assertion OK : PageSetup.FitToPagesTall set/get + TEST OK : Test FitToPagesTall + TEST START : Test FitToPagesWide + ITEM Assertion OK : PageSetup.FitToPagesWide set/get + TEST OK : Test FitToPagesWide + TEST START : Test PrintHeadings + ITEM Assertion OK : PageSetup.PrintHeadings set/get + ITEM Assertion OK : PageSetup.PrintHeadings set/get + TEST OK : Test PrintHeadings +END PageSetup +Test run finished : 07/21/2008 02:00:07 PM diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/partition.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/partition.log new file mode 100644 index 000000000000..7b4f2a01bead --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/partition.log @@ -0,0 +1,11 @@ +Test run started : 12/10/2007 11:26:43 AM +BEGIN Partition + TEST START : Test Partition function + ITEM Assertion OK : the number 20 occurs in the range:20:24 + ITEM Assertion OK : the number 20 occurs in the range: 20: 20 + ITEM Assertion OK : the number 120 occurs in the range:100: + ITEM Assertion OK : the number -5 occurs in the range: : -1 + ITEM Assertion OK : the number 2 occurs in the range: 2: 3 + TEST OK : Test Partition function +END Partition +Test run finished : 12/10/2007 11:26:43 AM diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/range-4.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/range-4.log new file mode 100644 index 000000000000..fb37b6ff201b --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/range-4.log @@ -0,0 +1,16 @@ +Test run started : 2008/06/19 17:14:57 +---------------------------------------------------------------- +ShowDetail-Issue + TEST START : ShowDetail-Issue + ITEM Assertion OK : Range.ShowDetail is True + ITEM Assertion OK : Range.ShowDetail is False +END 'ShowDetail-Issue' Symbol + TEST OK : ShowDetail-Issue +---------------------------------------------------------------- +RangeMerged-Issue + TEST START : RangeMerged-Issue + ITEM Assertion OK : Range.RangeMerged is $F$2:$H$5 + ITEM Assertion OK : The first address of Range.RangeMerged is $F$2 +END 'RangeMerged-Issue' Symbol + TEST OK : RangeMerged-Issue +Test run finished : 2008/06/19 17:14:57 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/replace.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/replace.log new file mode 100644 index 000000000000..8f600faaa6b1 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/replace.log @@ -0,0 +1,14 @@ +Test run started : 09/05/2008 10:21:46 AM +BEGIN Replace + TEST START : Test Replace function + ITEM Assertion OK : common string:aefefdBc + ITEM Assertion OK : expression string:aefefdef + ITEM Assertion OK : binanary compare:aefefdBc + ITEM Assertion OK : text compare:aefefdef + ITEM Assertion OK : text compare:aefefdef + ITEM Assertion OK : start = 3:cefdBc + ITEM Assertion OK : count = 2: aefefdBc + ITEM Assertion OK : start = 1, count = 0, not support in Unix: abcbcdBc + TEST OK : Test Replace function +END Replace +Test run finished : 09/05/2008 10:21:47 AM diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/stringplusdouble.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/stringplusdouble.log new file mode 100644 index 000000000000..6e8b8d994bd1 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/stringplusdouble.log @@ -0,0 +1,62 @@ +Test run started : 05/29/2008 02:51:22 PM +BEGIN String Plus Double + TEST START : double = string + double +The next compute raises error: s = null, d = null, r = s + d + ITEM Assertion OK : s = null, d = null, r = s + d .The result is: -1 + ITEM Assertion OK : s = null, d = null, r = s & d .The result is: 0 +The next compute raises error: s = null, d = 20, r = s + d + ITEM Assertion OK : s = null, d = 20, r = s + d .The result is: -1 + ITEM Assertion OK : s = null, d = 20, r = s & d .The result is: 20 + ITEM Assertion OK : s = '10', d = null, r = s + d .The result is: 10 + ITEM Assertion OK : s = '10', d = null, r = s & d .The result is: 100 + ITEM Assertion OK : s = '10', d = 20, r = s + d .The result is: 30 + ITEM Assertion OK : s = '10', d = 20, r = s & d .The result is: 1020 +The next compute raises error: s = 'abc', d = null, r = s + d + ITEM Assertion OK : s = 'abc', d = null, r = s + d .The result is: -1 +The next compute raises error: s = 'abc', d = null, r = s & d + ITEM Assertion OK : s = 'abc', d = null, r = s & d .The result is: -1 +The next compute raises error: s = 'abc', d = 20, r = s + d + ITEM Assertion OK : s = 'abc', d = 20, r = s + d .The result is: -1 +The next compute raises error: s = 'abc', d = 20, r = s & d + ITEM Assertion OK : s = 'abc', d = 20, r = s & d .The result is: -1 + TEST OK : double = string + double + TEST START : string = string + double +The next compute raises error: s = null, d = null, r = s + d + ITEM Assertion OK : s = null, d = null, r = s + d .The result is: -1 + ITEM Assertion OK : s = null, d = null, r = s & d .The result is: 0 +The next compute raises error: s = null, d = 20, r = s + d + ITEM Assertion OK : s = null, d = 20, r = s + d .The result is: -1 + ITEM Assertion OK : s = null, d = 20, r = s & d .The result is: 20 + ITEM Assertion OK : s = '10', d = null, r = s + d .The result is: 10 + ITEM Assertion OK : s = '10', d = null, r = s & d .The result is: 100 + ITEM Assertion OK : s = '10', d = 20, r = s + d .The result is: 30 + ITEM Assertion OK : s = '10', d = 20, r = s & d .The result is: 1020 +The next compute raises error: s = 'abc', d = null, r = s + d + ITEM Assertion OK : s = 'abc', d = null, r = s + d .The result is: -1 + ITEM Assertion OK : s = 'abc', d = null, r = s & d .The result is: abc0 +The next compute raises error: s = 'abc', d = 20, r = s + d + ITEM Assertion OK : s = 'abc', d = 20, r = s + d .The result is: -1 + ITEM Assertion OK : s = 'abc', d = 20, r = s & d .The result is: abc20 + TEST OK : string = string + double + TEST START : double = string + string +The next compute raises error: s = null, d = null, r = s + d + ITEM Assertion OK : s = null, d = null, r = s + d .The result is: -1 +The next compute raises error: s = null, d = null, r = s & d + ITEM Assertion OK : s = null, d = null, r = s & d .The result is: -1 + ITEM Assertion OK : s = null, d = 20, r = s + d .The result is: 20 + ITEM Assertion OK : s = null, d = 20, r = s & d .The result is: 20 + ITEM Assertion OK : s = '10', d = null, r = s + d .The result is: 10 + ITEM Assertion OK : s = '10', d = null, r = s & d .The result is: 10 + ITEM Assertion OK : s = '10', d = 20, r = s + d .The result is: 1020 + ITEM Assertion OK : s = '10', d = 20, r = s & d .The result is: 1020 +The next compute raises error: s = 'abc', d = null, r = s + d + ITEM Assertion OK : s = 'abc', d = null, r = s + d .The result is: -1 +The next compute raises error: s = 'abc', d = null, r = s & d + ITEM Assertion OK : s = 'abc', d = null, r = s & d .The result is: -1 +The next compute raises error: s = 'abc', d = 20, r = s + d + ITEM Assertion OK : s = 'abc', d = 20, r = s + d .The result is: -1 +The next compute raises error: s = 'abc', d = 20, r = s & d + ITEM Assertion OK : s = 'abc', d = 20, r = s & d .The result is: -1 + TEST OK : double = string + string +END String Plus Double +Test run finished : 05/29/2008 02:51:22 PM diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/window2.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/window2.log new file mode 100644 index 000000000000..8e26d0580621 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/unix/window2.log @@ -0,0 +1,41 @@ +Test run started : 2008/09/22 11:18:57 +BEGIN Window2 + TEST START : Test Window.SplitRow + ITEM Assertion OK : Test SplitColumn: 2 (Test only applies to maximized Window and at least has 800*600 solotion) + ITEM Assertion OK : Test SplitRow: 2 (Test only applies to maximized Window and at least has 800*600 solotion) + ITEM Assertion OK : Test SplitVertical: 242.465788476212 + ITEM Assertion OK : Test SplitHorizontal: 242.465788476212 + ITEM Assertion OK : Test SplitRow: 4 (Test only applies to maximized Window and at least has 800*600 solotion) + ITEM Assertion OK : Test SplitColumn: 3 (Test only applies to maximized Window and at least has 800*600 solotion) + ITEM Assertion OK : Test SplitColumn: 0 + ITEM Assertion OK : Test SplitRow: 0 + TEST OK : Test Window.SplitRow + TEST START : Test Window.DisplayGridlines + ITEM Assertion OK : Test gridlines are on + ITEM Assertion OK : Test gridlines are off + TEST OK : Test Window.DisplayGridlines + TEST START : Test Window.DisplayHeadings + ITEM Assertion OK : Test Headings are on + ITEM Assertion OK : Test Headings are off + TEST OK : Test Window.DisplayHeadings + TEST START : Test Window.Visibility + ITEM Assertion OK : Window is visible + ITEM Assertion OK : Window is not visible + TEST OK : Test Window.Visibility + TEST START : Test Window.FreezePanes + ITEM Assertion OK : Test no panes frozen + ITEM Assertion OK : Test panes frozen at center + ITEM Assertion OK : Test panes frozen at split + TEST OK : Test Window.FreezePanes + TEST START : Test Window.View + TEST OK : Test Window.View + TEST START : Test Window.Zoom + ITEM Assertion OK : Test zoom=100% + ITEM Assertion OK : Test zoom=150% + TEST OK : Test Window.Zoom + TEST START : Test Windows.Count + ITEM Assertion OK : Windows Count: 1 + ITEM Assertion OK : Application.Windows Count: 1 + TEST OK : Test Windows.Count +END Window2 +Test run finished : 2008/09/22 11:18:58 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/AutoFilter.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/AutoFilter.log new file mode 100644 index 000000000000..b8d0b85a8ff9 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/AutoFilter.log @@ -0,0 +1,20 @@ +Test run started : 16/10/2007 17:42:01 +---------------------------------------------------------------- +TestAddress + TEST START : TestAddress + ITEM Assertion OK : test1 'starts with' string criteria + ITEM Assertion OK : test2 'not equal to' string criteria + ITEM Assertion OK : test3 'ends with' string criteria + ITEM Assertion OK : test4 field 'all' + ITEM Assertion OK : test5 numeric '<15' + ITEM Assertion OK : test6 numeric '>=15' + ITEM Assertion OK : test7 numeric '<=12' +Test Results +============ + +Tests passed: 7 +Tests failed: 0 + +END 'TestAddress + TEST OK : TestAddress +Test run finished : 16/10/2007 17:42:02 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/CalcFont.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/CalcFont.log new file mode 100644 index 000000000000..e8695523a0a1 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/CalcFont.log @@ -0,0 +1,17 @@ +Test run started : 15/01/2009 17:00:35 +CalcFont_Format + TEST START : Font_Format + ITEM Assertion OK : correctly set font to Bold + ITEM Assertion OK : correctly set font to Italic + ITEM Assertion OK : correctly read FontStyle + ITEM Assertion OK : correctly set font to Shadow + ITEM Assertion OK : correctly set font color + ITEM Assertion OK : correctly set font color index + ITEM Assertion OK : correctly set font name + ITEM Assertion OK : correctly set font outline + ITEM Assertion OK : correctly set font size + ITEM Assertion OK : correctly set font strikethrough + ITEM Assertion OK : correctly set font underline + TEST Success. : Font_Format +CalcFont_Format +Test run finished : 15/01/2009 17:00:36 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/MiscOperatorTests.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/MiscOperatorTests.log new file mode 100644 index 000000000000..3ccec0a1577d --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/MiscOperatorTests.log @@ -0,0 +1,29 @@ +Test run started : 15/01/2009 17:03:13 +---------------------------------------------------------------- +TestAddress + TEST START : TestAddress + ITEM Assertion OK : test1: res = Not ( A > B ) + ITEM Assertion OK : test2: res = Not ( B > A ) + ITEM Assertion OK : test3: res = Not ( D ) + ITEM Assertion OK : test4: res = Not A + ITEM Assertion OK : test5: res = ( A > D ) + ITEM Assertion OK : test6: res = ( D > A ) + ITEM Assertion OK : test7: res = ( A < D ) + ITEM Assertion OK : test8: res = ( D < A ) + ITEM Assertion OK : test9: res = ( A >= D ) + ITEM Assertion OK : test10: res = ( D >= A ) + ITEM Assertion OK : test11: res = ( A <= D ) + ITEM Assertion OK : test12: res = ( D <= A ) + ITEM Assertion OK : test13: res = ( D = A ) + ITEM Assertion OK : test14: res = ( A = D ) + ITEM Assertion OK : test15: res = ( D <> A ) + ITEM Assertion OK : test16: res = ( A <> D ) +Test Results +============ + +Tests passed: 16 +Tests failed: 0 + +END 'TestAddress + TEST OK : TestAddress +Test run finished : 15/01/2009 17:03:15 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/MiscRangeTests.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/MiscRangeTests.log new file mode 100644 index 000000000000..d190abb5f645 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/MiscRangeTests.log @@ -0,0 +1,45 @@ +Test run started : 17/07/2007 15:08:56 +---------------------------------------------------------------- +MiscRangeTests + TEST START : MiscRangeTests + ITEM Assertion OK : test 1 + ITEM Assertion OK : test 2 + ITEM Assertion OK : test 3 + ITEM Assertion OK : test 4 + ITEM Assertion OK : test 5 + ITEM Assertion OK : test 6 + ITEM Assertion OK : test 7 + ITEM Assertion OK : test 8 + ITEM Assertion OK : test 9 + ITEM Assertion OK : test 10 + ITEM Assertion OK : test 11 + ITEM Assertion OK : test 12 + ITEM Assertion OK : test 13 + ITEM Assertion OK : test 14 + ITEM Assertion OK : test 15 + ITEM Assertion OK : test 16 + ITEM Assertion OK : test 17 + ITEM Assertion OK : test 18 + ITEM Assertion OK : test 19 + ITEM Assertion OK : test 20 + ITEM Assertion OK : test 21 + ITEM Assertion OK : test 22 + ITEM Assertion OK : test 23 + ITEM Assertion OK : test 24 + ITEM Assertion OK : test 25 + ITEM Assertion OK : test 26 + ITEM Assertion OK : test 27 + ITEM Assertion OK : test 28 + ITEM Assertion OK : test 29 + ITEM Assertion OK : test 30 + ITEM Assertion OK : test 31 +No. tests: 31 +Summary +======= +Run: 31 +Passed: 31 +Failed: 0 + +END 'MiscRangeTests + TEST OK : MiscRangeTests +Test run finished : 17/07/2007 15:08:59 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/PageBreaks.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/PageBreaks.log new file mode 100644 index 000000000000..30b6e45d1681 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/PageBreaks.log @@ -0,0 +1,10 @@ +Test run started : 08/10/2008 12:02:12 +---------------------------------------------------------------- + TEST START : PageBreaks-Issue + ITEM Assertion OK : HPageBreaks.Count is 3 + ITEM Assertion OK : HPageBreak.Type is -4135 + ITEM Assertion OK : HPageBreak.Location: Range.Row is 5 + ITEM Assertion OK : HPageBreak.Delete: HPageBreaks.Count is 2 +END 'PageBreaks-Issue' Symbol + TEST OK : PageBreaks-Issue +Test run finished : 08/10/2008 12:02:12 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Ranges-2.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Ranges-2.log new file mode 100644 index 000000000000..b80d996e3d3f --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Ranges-2.log @@ -0,0 +1,68 @@ +Test run started : 10/07/2007 01:55:47 +---------------------------------------------------------------- +ClearFormtsIssue + TEST START : ClearFormtsIssue + ITEM Assertion OK : Range.Font.Bold is: True + ITEM Assertion OK : Range.Font.Bold is: False +END 'ClearFormtsIssue' Symbol + TEST OK : ClearFormtsIssue +---------------------------------------------------------------- +VerticalAlignment-Issue + TEST START : VerticalAlignment-Issue + ITEM Assertion OK : - Range.VerticalAlignment (get) + ITEM Assertion OK : - Range.VerticalAlignment (set) + ITEM Assertion OK : - Range.VerticalAlignment (get) + ITEM Assertion OK : - Range.VerticalAlignment (get) + ITEM Assertion OK : - Range.VerticalAlignment (set) + ITEM Assertion OK : - Range.VerticalAlignment (get) + ITEM Assertion OK : - Range.VerticalAlignment (set) + ITEM Assertion OK : Range.VeritcalAlignment is Null +END 'VerticalAlignment-Issue' Symbol + TEST OK : VerticalAlignment-Issue +---------------------------------------------------------------- +HorizontalAlignment-Issue + TEST START : HorizontalAlignment-Issue + ITEM Assertion OK : - Range.HorizontalAlignment (get) + ITEM Assertion OK : - Range.HorizontalAlignment (set) + ITEM Assertion OK : - Range.HorizontalAlignment (get) + ITEM Assertion OK : - Range.HorizontalAlignment (set) + ITEM Assertion OK : - Range.HorizontalAlignment (get) + ITEM Assertion OK : - Range.HorizontalAlignment (set) + ITEM Assertion OK : - Range.HorizontalAlignment (get) + ITEM Assertion OK : - Range.HorizontalAlignment (set) + ITEM Assertion OK : Range.HorizontalAlignment is Null +END 'HorizontalAlignment-Issue' Symbol + TEST OK : HorizontalAlignment-Issue +---------------------------------------------------------------- +WrapText-Issue + TEST START : WrapText-Issue + ITEM Assertion OK : - Range.WrapText (get) + ITEM Assertion OK : - Range.WrapText (get) + ITEM Assertion OK : Range.WrapText is Null +END 'WrapText-Issue' Symbol + TEST OK : WrapText-Issue +---------------------------------------------------------------- +FontBorderIssues + TEST START : FontBorderIssues + ITEM Assertion OK : - = Borders.Color (getColor) + ITEM Assertion OK : - = Font.Color (getColor) +END 'FontBorderIssues' Symbol + TEST OK : FontBorderIssues +---------------------------------------------------------------- +RangeSizeIssues + TEST START : RangeSizeIssues + ITEM Assertion OK : Range.Left is: 100.5291 + ITEM Assertion OK : Range.Top is: 95.39775 + ITEM Assertion OK : Range.Width is: 191.25 + ITEM Assertion OK : Range.Height is: 271.5 +END 'RangeSizeIssues' Symbol + TEST OK : RangeSizeIssues +---------------------------------------------------------------- +ApplicationIssues + TEST START : ApplicationIssues + ITEM Assertion OK : Range.Address is: $E$8:$G$13,$G$13:$K$19 + ITEM Assertion OK : Range.Address is: $E$8:$G$13,$G$13:$K$19 + ITEM Assertion OK : Application.ActiveSheet.Name: Sheet1 +END 'ApplicationIssues' Symbol + TEST OK : ApplicationIssues +Test run finished : 10/07/2007 01:55:48 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Ranges-3.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Ranges-3.log new file mode 100644 index 000000000000..365d126a7e2d --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Ranges-3.log @@ -0,0 +1,8 @@ +Test run started : 10/07/2007 01:55:51 +---------------------------------------------------------------- +MyGoalseek-Issue + TEST START : MyGoalseek-Issue + ITEM Assertion OK : Variable Range value: 15 +END 'MyGoalseek-Issue' Symbol + TEST OK : MyGoalseek-Issue +Test run finished : 10/07/2007 01:55:51 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Ranges.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Ranges.log new file mode 100644 index 000000000000..6491fe4173ec --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Ranges.log @@ -0,0 +1,280 @@ +Test run started : 08/10/2008 11:30:21 +---------------------------------------------------------------- +ApplicationMethods + TEST START : ApplicationMethods + ITEM Assertion OK : Name of Workbook is: Ranges.xls + ITEM Assertion OK : Address of Application.Columns is: $A:$A + ITEM Assertion OK : Address of Application.Rows is: $1:$1 + ITEM Assertion OK : Address of Application.Range is: $1:$1,$5:$7 + ITEM Assertion OK : Please check manually: DefaultFilePath is: C:\Documents and Settings\vituosity\My Documents + ITEM Assertion OK : Please check manually: Library Path is: C:\Documents and Settings\vituosity\Application Data\OpenOffice.org\3\user\basic + ITEM Assertion OK : Please check manually: Template Path is: C:\Documents and Settings\vituosity\Application Data\OpenOffice.org\3\user\template + ITEM Assertion OK : FileSeparator is \ + ITEM Assertion OK : Name of ActiveWorkbook is: Ranges.xls +END 'ApplicationMethods' Symbol + TEST OK : ApplicationMethods +---------------------------------------------------------------- +Insert-Issue + TEST START : Insert-Issue + ITEM Assertion OK : Insert with xlShiftToRight: 10 +END 'Insert-Issue' Symbol + TEST OK : Insert-Issue +---------------------------------------------------------------- +MergeCells-Issue + TEST START : MergeCells-Issue + ITEM Assertion OK : Range.MergeCells is True + ITEM Assertion FAIL : MergeCells is null: False + ITEM Assertion OK : RowCount after Merge: 13 + ITEM Assertion OK : Range.MergeCells is False + ITEM Assertion OK : MergeCells is null: False + ITEM Assertion FAIL : MergeCells of Second Area is null : False + ITEM Assertion FAIL : MergeCells of Ranges is Null: False + ITEM Assertion OK : RowCount after Merge: 7 + ITEM Assertion OK : Range.MergeCells is False + ITEM Assertion OK : MergeCells is null: False + ITEM Assertion OK : RowCount after Merge: 7 +END 'MergeCells-Issue' Symbol + TEST OK : MergeCells-Issue +---------------------------------------------------------------- +Areas-Issue + TEST START : Areas-Issue + ITEM Assertion OK : Range Areas Count is2 + ITEM Assertion OK : First Range Address is: $E$8:$G$13 + ITEM Assertion OK : First Row is: 8 + ITEM Assertion OK : First Column is: 5 + ITEM Assertion OK : EntireRow Address is: $8:$13,$13:$19 + ITEM Assertion OK : EntireColumn Address is: $E:$G,$G:$K + ITEM Assertion OK : Range Count:53 +END 'Areas-Issue' Symbol + TEST OK : Areas-Issue +---------------------------------------------------------------- +Fill-Methods-Issue + TEST START : Fill-Methods-Issue + ITEM Assertion OK : Range Value after FillDown: MyFillValue + ITEM Assertion OK : Range Value after FillDown: MyFillValue + ITEM Assertion OK : Range Value after FillDown: MyRightFillValue + ITEM Assertion OK : Range Value after FillDown: MyBottomFillValue +END 'Fill-Methods-Issue' Symbol + TEST OK : Fill-Methods-Issue +---------------------------------------------------------------- +Range/Item-Method-Issue + TEST START : Range/Item-Method-Issue + ITEM Assertion OK : Range of multiple columns is: $A:$A,$C:$C + ITEM Assertion OK : Range of multiple rows is: $1:$1,$5:$7 + ITEM Assertion OK : Range of several columns is: $C:$E,$D:$D + ITEM Assertion OK : Range of several rows is: $5:$8,$6:$10 + ITEM Assertion OK : Range of several single cells is: $C$5,$E$8 + ITEM Assertion OK : Range of several named ranges is: $L$1:$M$6,$E$8:$G$13,$G$13:$K$19 + ITEM Assertion OK : Range of a single Item Cell is: $E$21 + ITEM Assertion OK : Range of a single Item Cell is: $F$21 + ITEM Assertion OK : Range of a single Item Cell is: $F$10 +END 'Range/Item-Method-Issue' Symbol + TEST OK : Range/Item-Method-Issue +---------------------------------------------------------------- +R1C1-Formulas-Issue + TEST START : R1C1-Formulas-Issue + ITEM Assertion OK : R1C1 Range.Formula is: =IF(OR(R[-2]C[1]=0,RC[2]="YES"),"") + ITEM Assertion OK : Range.Formula is: =IF(OR(J8=0,K10="YES"),"") +END 'R1C1-Formulas-Issue' Symbol + TEST OK : R1C1-Formulas-Issue +---------------------------------------------------------------- +Verify_Delete + TEST START : Verify_Delete + ITEM Assertion OK : Ranges are intersecting: $G$13 + ITEM Assertion OK : Delete with Default: $AJ$4 + ITEM Assertion OK : Delete with ShifttoLeft: $AJ$4 + ITEM Assertion OK : Delete with ShiftUp: $M$22 +END 'Verify_Delete' Symbol + TEST OK : Verify_Delete +---------------------------------------------------------------- +Value-Issue + TEST START : Value-Issue + ITEM Assertion OK : Value of Range is: 12.3 + ITEM Assertion OK : Text of Range is: 12.3 + ITEM Assertion OK : Range has Formula: False + ITEM Assertion OK : Cell has Formula: False + ITEM Assertion FAIL : Text of Range is null: False + ITEM Assertion OK : Range has Formula: True + ITEM Assertion OK : Cell has Formula: True + ITEM Assertion OK : Value of Cell is: 12 + ITEM Assertion OK : Application.Calculation is : -4135 + ITEM Assertion OK : Calculation is automated: True + ITEM Assertion OK : Range has Formula: True + ITEM Assertion OK : Value of Cell is: 16 + ITEM Assertion OK : Text of Cell is: 16 + ITEM Assertion OK : Text of Cell is: 16 + ITEM Assertion OK : Range has Formula after 'ClearContents: False + ITEM Assertion OK : Text of Cell is: + ITEM Assertion OK : Text of Cell is: +END 'Value-Issue' Symbol + TEST OK : Value-Issue +---------------------------------------------------------------- +AutoFit issue + TEST START : AutoFit issue + ITEM Assertion OK : Columns.AutoFit: CurrentWidth is 680 + ITEM Assertion OK : Rows.AutoFit: CurrentHeight is 582 +END 'AutoFit issue' Symbol + TEST OK : AutoFit issue +---------------------------------------------------------------- +Selections + TEST START : Selections + ITEM Assertion OK : ActiveCell is : $E$8 + ITEM Assertion OK : Active Cell is : $E$8 + ITEM Assertion OK : Number of Cells in Range: 52 + ITEM Assertion OK : Number of Cells in Range: 52 + ITEM Assertion OK : Number of Cells in Range: 52 +END 'Selections' Symbol + TEST OK : Selections +---------------------------------------------------------------- +Offset-Resize + TEST START : Offset-Resize + ITEM Assertion OK : Offset is : $G$10:$I$15,$I$15:$M$21 + ITEM Assertion OK : Offset is : $G$7:$I$12,$I$12:$M$18 + ITEM Assertion OK : Resized Range is : $A$20:$D$23 +END 'Offset-Resize' Symbol + TEST OK : Offset-Resize +---------------------------------------------------------------- +Ranges-Address + TEST START : Ranges-Address + ITEM Assertion OK : Range Address is: $E$8:$G$13,$G$13:$K$19 + ITEM Assertion OK : Range Address is: $E8:$G13,$G13:$K19 + ITEM Assertion OK : Range Address is: E$8:G$13,G$13:K$19 + ITEM Assertion OK : Range Address is: R8C5:R13C7,R13C7:R19C11 + ITEM Assertion FAIL : Range Address is: R8C5:R13C7,R13C7:R19C11 + ITEM Assertion OK : Range Address is: R8C5:R13C7,R13C7:R19C11 + ITEM Assertion OK : Range Address is: R[6]C[3]:R[11]C[5],R[11]C[5]:R[17]C[9] + ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$E$8:$G$13,$G$13:$K$19 +END 'Ranges-Address' Symbol + TEST OK : Ranges-Address +---------------------------------------------------------------- +Range-Address + TEST START : Range-Address + ITEM Assertion OK : Range Address is: $E$8:$G$13 + ITEM Assertion OK : Range Address is: $E8:$G13 + ITEM Assertion OK : Range Address is: E$8:G$13 + ITEM Assertion OK : Range Address is: R8C5:R13C7 + ITEM Assertion FAIL : Range Address is: R8C5:R13C7 + ITEM Assertion OK : Range Address is: R8C5:R13C7 + ITEM Assertion OK : Range Address is: R[6]C[3]:R[11]C[5] + ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$E$8:$G$13 +END 'Range-Address' Symbol + TEST OK : Range-Address +---------------------------------------------------------------- +Column-Address + TEST START : Column-Address + ITEM Assertion OK : Range Address is: $F$8:$F$13 + ITEM Assertion OK : Range Address is: $F8:$F13 + ITEM Assertion OK : Range Address is: F$8:F$13 + ITEM Assertion OK : Range Address is: R8C6:R13C6 + ITEM Assertion FAIL : Range Address is: R8C6:R13C6 + ITEM Assertion OK : Range Address is: R8C6:R13C6 + ITEM Assertion OK : Range Address is: R[6]C[4]:R[11]C[4] + ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$F$8:$F$13 +END 'Column-Address' Symbol + TEST OK : Column-Address +---------------------------------------------------------------- +Row-Address + TEST START : Row-Address + ITEM Assertion OK : Range Address is: $E$9:$G$9 + ITEM Assertion OK : Range Address is: $E9:$G9 + ITEM Assertion OK : Range Address is: E$9:G$9 + ITEM Assertion OK : Range Address is: R9C5:R9C7 + ITEM Assertion FAIL : Range Address is: R9C5:R9C7 + ITEM Assertion OK : Range Address is: R9C5:R9C7 + ITEM Assertion OK : Range Address is: R[7]C[3]:R[7]C[5] + ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$E$9:$G$9 +END 'Row-Address' Symbol + TEST OK : Row-Address +---------------------------------------------------------------- +SingleCell-Address + TEST START : SingleCell-Address + ITEM Assertion OK : Range Address is: $F$9 + ITEM Assertion OK : Range Address is: $F9 + ITEM Assertion OK : Range Address is: F$9 + ITEM Assertion OK : Range Address is: R9C6 + ITEM Assertion FAIL : Range Address is: R9C6 + ITEM Assertion OK : Range Address is: R9C6 + ITEM Assertion OK : Range Address is: R[7]C[4] + ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$F$9 +END 'SingleCell-Address' Symbol + TEST OK : SingleCell-Address +---------------------------------------------------------------- +Heights and Widths + TEST START : Heights and Widths + ITEM Assertion OK : Range RowHeight is 40 + ITEM Assertion OK : Range ColumnWidth is 50 + ITEM Assertion OK : Range Height is 240 + ITEM Assertion FAIL : Range Width is 675 + ITEM Assertion OK : Range RowHeight is 50 + ITEM Assertion OK : Range ColumnWidth is 50 + ITEM Assertion OK : Range Height is 300 + ITEM Assertion FAIL : Range Width is 675 + ITEM Assertion OK : RowHeight is null: True + ITEM Assertion OK : ColumnWidth is null: True +END 'Heights and Widths' Symbol + TEST OK : Heights and Widths +---------------------------------------------------------------- +RangeRowColumn-Issue + TEST START : RangeRowColumn-Issue + ITEM Assertion OK : Row is: 8 + ITEM Assertion OK : Column is: 5 + ITEM Assertion OK : EntireRow.Columns.Count = 1024 + ITEM Assertion OK : EntireColumn.Rows.Count = 131072 +END 'RangeRowColumn-Issue' Symbol + TEST OK : RangeRowColumn-Issue +---------------------------------------------------------------- +Replace-Issue + TEST START : Replace-Issue + ITEM Assertion OK : Value after Replace: YourValue + ITEM Assertion OK : Value after Replace: YourValue + ITEM Assertion OK : Value after Replace: ReplaceValue + ITEM Assertion OK : Value after Replace: New ReplaceValue + ITEM Assertion OK : Value after Replace: New ReplaceValue + ITEM Assertion OK : Value after Replace: New Replace + ITEM Assertion OK : Value after Replace: +END 'Replace-Issue' Symbol + TEST OK : Replace-Issue +---------------------------------------------------------------- +Hidden-Issue + TEST START : Hidden-Issue + ITEM Assertion OK : - Range.Rows.Hidden (set) + ITEM Assertion OK : - Range.Rows.Hidden (get) + ITEM Assertion OK : - Range.Rows.Item(1).Hidden (set) + ITEM Assertion OK : - Range.Rows.Item(1).Hidden (get) + ITEM Assertion OK : - Range.Columns.Hidden (set) + ITEM Assertion OK : - Range.Columns.Hidden (get) + ITEM Assertion OK : - Range.Columns.Item(1).Hidden (set) + ITEM Assertion OK : - Range.Columns.Item(1).Hidden (get) +END 'Hidden-Issue' Symbol + TEST OK : Hidden-Issue +---------------------------------------------------------------- +End issue + TEST START : End issue + ITEM Assertion OK : - = $E$48 + ITEM Assertion OK : - = $E$1 + ITEM Assertion OK : - = $E$3 + ITEM Assertion OK : - = $A$8 + ITEM Assertion OK : - = $B$8 + ITEM Assertion OK : - = $AMJ$8 + ITEM Assertion OK : - = $Z$8 +END 'End issue' Symbol + TEST OK : End issue +---------------------------------------------------------------- +Outline issue + TEST START : Outline issue + ITEM Assertion OK : - Range.clearOutline - please check visually + ITEM Assertion OK : - Range.AutoOutline - please check visually + ITEM Assertion OK : - Range.AutoOutline - please check visually +END 'Outline issue' Symbol + TEST OK : Outline issue +---------------------------------------------------------------- +Validation + TEST START : Validation + ITEM Assertion OK : Validation Input Message is : Attention! + ITEM Assertion OK : Validation Input Message is : Enter an integer from five to ten + ITEM Assertion OK : Validation Error Title is : You must enter a number from five to ten + ITEM Assertion OK : Validation Error Message is : An Error occured + ITEM Assertion OK : Validation Error Title is : Microsoft Excel +END 'Validation' Symbol + TEST OK : Validation +Test run finished : 08/10/2008 11:30:24 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Shapes.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Shapes.log new file mode 100644 index 000000000000..fe62ab03d3f2 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Shapes.log @@ -0,0 +1,77 @@ +Test run started : 16/10/2007 17:46:03 +BEGIN Shapes_Collection_Behaviour + TEST START : Shapes_Collection_Behaviour + ITEM Assertion OK : Name of indexed shape should be 'Sheet2Shape1' + ITEM Assertion OK : Name of indexed shape should be 'Sheet2Shape2' + TEST Success. : Shapes_Collection_Behaviour +END Shapes_Collection_Behaviour +BEGIN Shapes_Select_Item + TEST START : Shapes_Select_Item + ITEM Assertion OK : Correctly selected shape through Range + ITEM Assertion OK : Correctly selected shape through Item + ITEM Assertion OK : Needs to be visually checked. Is there a line on the document? + ITEM Assertion OK : Needs to be visually checked. Are All Shapes Selected? + TEST Success. : Shapes_Select_Item +END Shapes_Select_Item +BEGIN Shapes_Fill + TEST START : Shapes_Fill + ITEM Assertion OK : correctly set visibility of shape fill + ITEM Assertion OK : correctly set transparency of shape line + ITEM Assertion OK : correctly set forecolor of shape fill + ITEM Assertion FAIL : correctly set backcolor of shape fill + ITEM Assertion OK : the success of the TwoColorGradient method needs to be verified visually! + ITEM Assertion OK : correctly set forecolor of shape fill + ITEM Assertion FAIL : correctly set forecolor of shape fill + TEST Success. : Shapes_Fill +END Shapes_Fill +BEGIN Shapes_Line + TEST START : Shapes_Line + ITEM Assertion FAIL : correctly set weight of shape line + ITEM Assertion OK : correctly set visibility of shape line + ITEM Assertion OK : correctly set transparency of shape line + ITEM Assertion OK : correctly set dash style of shape line + ITEM Assertion OK : correctly set dash style of shape line + ITEM Assertion OK : correctly set forecolor of shape line + ITEM Assertion FAIL : correctly set backcolor of shape line + TEST Success. : Shapes_Line +END Shapes_Line +BEGIN Shapes_TextFrame + TEST START : Shapes_TextFrame + ITEM Assertion OK : correctly set Autosize of Shape TextFrame + TEST Success. : Shapes_TextFrame +END Shapes_TextFrame +BEGIN Shapes_SimpleGeometry + TEST START : Shapes_SimpleGeometery + ITEM Assertion OK : shape height should be 49.4519655148368 and got 49.4078709034412 + ITEM Assertion OK : shape width should be 101.467710269751 and got 101.423615658355 + ITEM Assertion OK : shape left should be 68.5574761223637 and got 68.5417279658754 + ITEM Assertion OK : shape top should be 44.1511784471699 and got 44.1354302906816 + ITEM Assertion OK : shape rotation should be 0 and got 0 + ITEM Assertion OK : shape rotation should be 25 and got 25 + ITEM Assertion OK : shape incrementrotation should be 50 and got 50 + ITEM Assertion OK : shape incrementleft should be 69.7480272284707 and got 69.7322790719824 + ITEM Assertion OK : shape incrementtop should be 93.8141674447769 and got 93.7984192882885 + TEST Success. : Shapes_SimpleGeometery +END Shapes_SimpleGeometry +BEGIN Shapes_Range + TEST START : Shapes_Range + ITEM Assertion OK : expected Sheets(2).Shapes.Range(1) to contain 1 element, it contains 1 + ITEM Assertion OK : expected Sheets(2).Shapes.Range(1) to return Sheet2Shape1 got Sheet2Shape1 + ITEM Assertion OK : expected Sheets(2).Shapes.Range(Sheet2Shape3) to contain 1 element, it contains 1 + ITEM Assertion OK : expected Sheets(2).Shapes.Range(Sheet2Shape3) to return Sheet2Shape3 got Sheet2Shape3 + ITEM Assertion OK : expected Sheets(2).Shapes.Range(Array(3, 1) to contain 2 elements, it contains 2 + ITEM Assertion OK : expected Sheets(2).Shapes.Range(Array(3, 1) to return concated element/shape names Sheet2Shape3Sheet2Shape1 and got Sheet2Shape3Sheet2Shape1 + ITEM Assertion OK : expected Sheets(2).Shapes.Range(Array('Sheet2Shape3', 1, 'Sheet2Shape2')) to contain 3 elements, it contains 3 + ITEM Assertion OK : expected Sheets(2).Shapes.Range(Array('Sheet2Shape3', 1, 'Sheet2Shape2')) to return concated element/shape names Sheet2Shape3Sheet2Shape1Sheet2Shape2 and got Sheet2Shape3Sheet2Shape1Sheet2Shape2 + TEST Success. : Shapes_Range +END Shapes_Range +BEGIN Shapes_ShapeRange + TEST START : Shapes_ShapeRange + ITEM Assertion OK : ShapeRange.IncrementLeft shp1.left should be 89.7322790719824 and got 89.7165297816359 + ITEM Assertion OK : ShapeRange.IncrementLeft shp2.left should be 240.02518299054 and got 240.009433700193 + ITEM Assertion OK : ShapeRange.IncrementTop shp1.Top should be 113.798419288289 and got 113.782669997942 + ITEM Assertion OK : ShapeRange.IncrementTop shp2.Top should be 67.4519655148368 and got 67.4362162244903 + ITEM Assertion OK : ShapeRange.IncrementRotation shp1.Rotation should be 70 and got 70 + ITEM Assertion OK : ShapeRange.IncrementRotation shp2.Rotation should be 20 and got 20 +END Shapes_ShapeRange +Test run finished : 16/10/2007 17:46:04 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/StrConv-test.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/StrConv-test.log new file mode 100644 index 000000000000..b1f7794234f9 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/StrConv-test.log @@ -0,0 +1,9 @@ +Test run started : 08/10/2008 12:04:16 +BEGIN StrConv + TEST START : Test StrConv function + ITEM Assertion OK : Converts the string to uppercase characters:ABC EFG HIJ + ITEM Assertion OK : Converts the string to lowercase characters:abc efg hij + ITEM Assertion OK : Converts the first letter of every word in string to uppercase:Abc Efg Hij + TEST OK : Test StrConv function +END StrConv +Test run finished : 08/10/2008 12:04:16 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Template.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Template.log new file mode 100644 index 000000000000..774994adb02c --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Template.log @@ -0,0 +1,14 @@ +Test run started : 08/10/2008 12:05:52 +---------------------------------------------------------------- +TestCaseName + TEST START : TestCaseName + ITEM Assertion OK : Something has been done. +Test Results +============ + +Tests passed: 1 +Tests failed: 0 + +END 'TestCaseName + TEST OK : TestCaseName +Test run finished : 08/10/2008 12:05:52 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/TestAddress.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/TestAddress.log new file mode 100644 index 000000000000..0007e6f9c958 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/TestAddress.log @@ -0,0 +1,67 @@ +Test run started : 08/10/2008 11:30:32 +---------------------------------------------------------------- +TestAddress + TEST START : TestAddress + ITEM Assertion OK : test1 Range('e3:f3') A1 style addressing + ITEM Assertion OK : test2 Range('e3:f3') R1C1 style addressing + ITEM Assertion OK : test3 Range ('e:f') A1 style addressing + ITEM Assertion OK : test4 Range ('e:f') R1C1 style addressing + ITEM Assertion OK : test5 Columns A1 style addressing + ITEM Assertion OK : test6 Columns R1C1 style addressing + ITEM Assertion OK : test7 Columns(3) A1 style addressing + ITEM Assertion OK : test8 Columns(3) R1C1 style addressing + ITEM Assertion OK : test9 Columns('e') A1 style addressing + ITEM Assertion OK : test10 Columns('e') R1C1 style addressing + ITEM Assertion OK : test11 Columns('b:d') A1 style addressing + ITEM Assertion OK : test12 Columns('b:d') R1C1 style addressing + ITEM Assertion OK : test13 Range('c1:g10').Columns A1 style addressing + ITEM Assertion OK : test14 Range('c1:g10').Columns R1C1 style addressing + ITEM Assertion OK : test15 Range('c1:g10').Columns(1) A1 style addressing + ITEM Assertion OK : test16 Range('c1:g10').Columns(1) R1C1 style addressing + ITEM Assertion OK : test17 Range('c1:g10').Columns('a') A1 style addressing + ITEM Assertion OK : test18 Range('c1:g10').Columns('a') R1C1 style addressing + ITEM Assertion OK : test19 Range('c1:g10').Columns('c') A1 style addressing + ITEM Assertion OK : test20 Range('c1:g10').Columns('c') R1C1 style addressing + ITEM Assertion OK : test21 Range('c1:g10').Columns('x:z') A1 style addressing + ITEM Assertion OK : test22 Range('c1:g10').Columns('x:z') R1C1 style addressing + ITEM Assertion OK : test23 Range('c1:g10').Columns(30) A1 style addressing + ITEM Assertion OK : test24 Range('c1:g10').Columns(30) R1C1 style addressing + ITEM Assertion OK : test25 Worksheets('Sheet2').Cells(1, 1) A1 style addressing + ITEM Assertion OK : test26 Worksheets('Sheet2').Cells(1, 1) A1 style addressing, RowAddressAbsolute is false + ITEM Assertion OK : test27 Worksheets('Sheet2').Cells(1, 1) A1 style addressing, ColAddressAbsolute is false + ITEM Assertion OK : test28 Worksheets('Sheet2').Cells(1, 1) R1C1 style addressing + ITEM Assertion OK : test29 Worksheets('Sheet2').Range('A1:E5').EntireColumn A1 style addressing + ITEM Assertion OK : test30 Worksheets('Sheet2').Range('A1').EntireColumn A1 style addressing + ITEM Assertion OK : test31 Worksheets('Sheet2').Range('A1:E5').EntireRow A1 style addressing + ITEM Assertion OK : test32 Worksheets('Sheet2').Range('A1') A1 style addressing + ITEM Assertion OK : test33 Worksheets('Sheet2').Range('IV65536').EntireRow A1 style addressing + ITEM Assertion OK : test34 Worksheets('Sheet2').Range('IU2:IV65536') A1 style addressing + ITEM Assertion OK : test35 Range('c1:g10').Columns('x:z') R1C1 style addressing + ITEM Assertion OK : test36 Worksheets('Sheet2').Range('A1') A1 style addressing + ITEM Assertion OK : test37 Worksheets('Sheet2').Range('A1:E5').EntireColumn A1 style addressing + ITEM Assertion OK : test38 Worksheets('Sheet2').Range('10:12') A1 style addressing + ITEM Assertion OK : test39 Worksheets('Sheet2').Range('10:12') R1C1 style addressing + ITEM Assertion OK : test40 Range('Sheet3!A1:B4') A1 style addressing + ITEM Assertion OK : test41 Range('Sheet3!A1,B1,D4:F20') A1 style addressing + ITEM Assertion OK : test42 Range('g20:h40').Columns('c:c') + ITEM Assertion OK : test43 Range('g20:h40').Columns('c:f') + ITEM Assertion OK : test44 Range('g20:h40').Columns(-1) + ITEM Assertion OK : test45 Range('c4:g10').Rows(-1) + ITEM Assertion OK : test46 Range('a2:b4').Rows('1:1') + ITEM Assertion OK : test47 Range('a2:b4').Rows('1:2') + ITEM Assertion OK : test48 Range('a2:b4').Rows('2:2') + ITEM Assertion OK : test49 Range('a2:b4').Rows('2:3') + ITEM Assertion OK : test50 Range(' A2:B4 ') + ITEM Assertion OK : test51 Range('A 2:B 4') + ITEM Assertion OK : test52 Range('A2 : B4 ') + ITEM Assertion OK : test53 Range('Sheet1 !A2 : B4 ') + ITEM Assertion OK : test54 Range('Sheet1! A2 : B4 ') +Test Results +============ + +Tests passed: 54 +Tests failed: 0 + +END 'TestAddress + TEST OK : TestAddress +Test run finished : 08/10/2008 11:30:32 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/TestCalc_Rangetest.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/TestCalc_Rangetest.log new file mode 100644 index 000000000000..492c24bc023c --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/TestCalc_Rangetest.log @@ -0,0 +1,60 @@ +Test run started : 10/07/2007 01:56:07 +BEGIN TestCalc + TEST START : RangeTest2 + ITEM Assertion OK : - Range("D15").Row + ITEM Assertion OK : - WorkSheet("D15").Range.Row + ITEM Assertion OK : - Range("D15").Column + ITEM Assertion OK : - Worksheet.Range("D15").Column + ITEM Assertion OK : - Range("D1").EntireRow.Valuer + ITEM Assertion OK : - Range("D1").EntireRow.Valuer + ITEM Assertion OK : - Range("D1").EntireRow.Columns.Count + ITEM Assertion OK : - Range("D1").EntireColumn.Rows.Count + ITEM Assertion OK : - Range("D15").ClearContent + ITEM Assertion OK : - Range("M1:N2").Rows.Hidden (set) + ITEM Assertion OK : - Range("M1:N2").Rows.Hidden (get) + ITEM Assertion OK : - Range("M1:N2").Rows(1).Hidden (set) + ITEM Assertion OK : - Range("M1:N2").Rows(1).Hidden (get) + ITEM Assertion OK : - Range("M1:N2").Columns.Hidden (set) + ITEM Assertion OK : - Range("M1:N2").Columns.Hidden (get) + ITEM Assertion OK : - Range("M1:N2").Columns(1).Hidden (set) + ITEM Assertion OK : - Range("M1:N2").Columns(1).Hidden (get) + ITEM Assertion OK : - Range("B38").Orientation (get) + ITEM Assertion OK : - Range("B38").Orientation (set) + ITEM Assertion OK : - Range("B38").Orientation (set = xlDownward) + ITEM Assertion OK : - Range("B38").Orientation (set) + ITEM Assertion OK : - Range("B38").Orientation (set = xlUpward) + ITEM Assertion OK : - Range("B38").Orientation (set) + ITEM Assertion OK : - Range("B38").Orientation (set = xlVertical) + ITEM Assertion OK : - Range("B38").Orientation (set) + ITEM Assertion OK : - Range("B38").Orientation (set = xlVertical) + ITEM Assertion OK : - Range("B39").WrapText (get) + ITEM Assertion OK : - Range("B39").WrapText (set) + ITEM Assertion OK : - Range("B39").WrapText (set) + ITEM Assertion OK : - Range("E39").MergeCells (get) + ITEM Assertion OK : - Range("F39").MergeCells (get) + ITEM Assertion OK : - Range("E39").MergeCells (set) + ITEM Assertion FAIL : - Range("F39").MergeCells (set) + ITEM Assertion OK : - Range("E39").MergeCells (set) + ITEM Assertion OK : - Range("F39").MergeCells (set) + ITEM Assertion OK : - Range("C41:C42").Replace MatchCase:=True + ITEM Assertion OK : - Range("C41:C42").Replace MatchCase:=True + ITEM Assertion OK : - Range("D41:D42").Replace MatchCase:=False + ITEM Assertion OK : - Range("B39").VerticalAlignment (get) + ITEM Assertion OK : - Range("B39").VerticalAlignment (set) + ITEM Assertion OK : - Range("B39").VerticalAlignment (get) + ITEM Assertion OK : - Range("B39").VerticalAlignment (get) + ITEM Assertion OK : - Range("B39").VerticalAlignment (set) + ITEM Assertion OK : - Range("B39").VerticalAlignment (get) + ITEM Assertion OK : - Range("B39").VerticalAlignment (set) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (get) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (set) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (get) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (set) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (get) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (set) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (get) + ITEM Assertion OK : - Range("B39").HorizontalAlignment (set) + ITEM FAIL (RangeTest2) + TEST Not succesfully completed : RangeTest2 +END TestCalc +Test run finished : 10/07/2007 01:56:12 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/TestCalc_Rangetest2.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/TestCalc_Rangetest2.log new file mode 100644 index 000000000000..9159217cb442 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/TestCalc_Rangetest2.log @@ -0,0 +1,65 @@ +Test run started : 08/10/2008 11:30:38 +BEGIN TestCalc + TEST START : RangeTest3 + ITEM Assertion OK : - setFormulaR1C1 + ITEM Assertion OK : - getFormulaR1C1 + ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial() + ITEM Assertion OK : - Range.Copy(Range("I10")) + ITEM Assertion OK : PasteSpecial Paste:=xlPasteValues + ITEM Assertion OK : PasteSpecial Paste:=xlPasteFormulas + ITEM Assertion OK : PasteSpecial Paste:=xlPasteFormats + ITEM Assertion OK : PasteSpecial + ITEM Assertion OK : PasteSpecial SkipBlanks:=True + ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationAdd + ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationSubtract + ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationMultiply + ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationDivide + ITEM Assertion OK : PasteSpecial Transpose:=True + ITEM Assertion FAIL : ActiveWorkbook.FileFormat + ITEM Assertion OK : ActiveWorkbook.Name + ITEM Assertion OK : ActiveWorkbook.FullName und ActiveWorkbook.Path + ITEM Assertion FAIL : - = ActiveWorkbook.Colors(3) set + ITEM Assertion OK : - = ActiveWorkbook.ResetColors + ITEM Assertion OK : - = ActiveWorkbook.Colors(3) get + ITEM Assertion OK : - = Range("K22").End (xlDown) + ITEM Assertion OK : - = Range("K22").End (xlUo) + ITEM Assertion OK : - = Range("K22").End (xlToLeft) + ITEM Assertion OK : - = Range("K22").End (xlRight) + ITEM Assertion OK : - ActiveSpreadsheet.Next + ITEM Assertion OK : - ActiveSpreadsheet.Next + ITEM Assertion OK : - ActiveSpreadsheet.Previous + ITEM Assertion OK : - ActiveSpreadsheet.Previous + ITEM Assertion OK : - Range("J4:J11").AutoFilter field:=1, Criteria1:="x" + ITEM Assertion OK : - Range("J4:J11").AutoFilter field:=1, Criteria1:="<>" + ITEM Assertion OK : - Range("J4:J11").AutoFilter field:=1, Criteria1:="=" + ITEM Assertion OK : - Range("J4:J11").AutoFilter + ITEM Assertion OK : - ActiveSheet.Resize.Select + ITEM Assertion OK : - Application.GoTo Reference:="R8C2" + ITEM Assertion FAIL : - Application.GoTo Reference:="R[8]C[2]" + ITEM Assertion OK : - Application.GoTo Reference:="R8C2" + ITEM Assertion OK : - Range.Group - please check visually + ITEM Assertion OK : - Range.Group - please check visually + ITEM Assertion OK : - Range.Ungroup- please check visually + ITEM Assertion OK : - Range.Ungroup - please check visually + ITEM Assertion OK : - Range.Group - please check visually + ITEM Assertion OK : - Range.Group - please check visually + ITEM Assertion OK : - Range.clearOutline - please check visually + ITEM Assertion OK : - Range.AutoOutline - please check visually + ITEM Assertion OK : - Range.AutoOutline - please check visually + ITEM Assertion OK : - ActiveSheet.UsedRange.Select + ITEM Assertion OK : - Range("A13").AddIndent + ITEM Assertion OK : - Range("A13").IndentLevel set + ITEM Assertion OK : - Range("A13").IndentLevel get + ITEM Assertion OK : - Range("A13").IndentLevel get + ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial() + ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial() + ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial() + ITEM Assertion OK : - Range.Calculate + ITEM Assertion OK : Worksheet.Calculate + ITEM Assertion OK : - Application.Calculate + ITEM Assertion OK : Global.Calculate + ITEM Assertion OK : Calculation set + ITEM FAIL (RangeTest3) + TEST Not succesfully completed : RangeTest3 +END TestCalc +Test run finished : 08/10/2008 11:30:41 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/TestIntersection.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/TestIntersection.log new file mode 100644 index 000000000000..2cf4fe36ea6f --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/TestIntersection.log @@ -0,0 +1,26 @@ +Test run started : 15/01/2009 17:05:08 +---------------------------------------------------------------- +TestIntersection + TEST START : TestIntersection + ITEM Assertion OK : test1 Application.Intersect( Range('A2:D10'), Range('C4:E6')) + ITEM Assertion OK : test2 Application.Intersect( Range('A2:D10'), Range('A4:G10')) + ITEM Assertion OK : test3 Application.Intersect( Range('A2:c8,d2:f8,g2:i8'), Range('A4:G10')) + ITEM Assertion OK : test4 Application.Intersect( Range('A4:G10'), Range('A2:c8,d2:f8,g2:i8')) + ITEM Assertion OK : test5 Application.Intersect( Range('A2:c8,d2:f8,g2:i8'), Range('g4:i10,A4:G10')) + ITEM Assertion OK : test6 Application.Intersect( Range('g4:i10,A4:G10'), Range('A2:c8,d2:f8,g2:i8')) + ITEM Assertion OK : test7 Application.Intersect( Range('a2:d10,b5:e10'), Range('a5:i10')) + ITEM Assertion OK : test8 Application.Intersect( Range('a2:c8,d2:f8'), Range('b6:e9,a6:f9')) + ITEM Assertion OK : test9 Application.Intersect( Range('a2:c8,e2:f8'), Range('b6:e9,a6:f9')) + ITEM Assertion OK : test10 Application.Intersect( Range('a1:a3,c1:c3'), Range('a2:c3')) + ITEM Assertion OK : test11 Application.Intersect( Range('a1:a3,b1:b3'), Range('a2:c3')) + ITEM Assertion OK : test12 Application.Intersect( Range('a2:d5,b3:f7,c1:g4'), Range('b2:e6')) + ITEM Assertion OK : test13 Range(" a2:d10,b5:e10,g13:j32 "), Range(" a5:i10,b6:e9 "), Range("b2:r5,f10:h19") +Test Results +============ + +Tests passed: 13 +Tests failed: 0 + +END 'TestIntersection + TEST OK : TestIntersection +Test run finished : 15/01/2009 17:05:09 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/TestUnion.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/TestUnion.log new file mode 100644 index 000000000000..2382db549554 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/TestUnion.log @@ -0,0 +1,17 @@ +Test run started : 15/01/2009 17:06:07 +---------------------------------------------------------------- +TestUnion + TEST START : TestUnion + ITEM Assertion OK : test1Application.Range('A2:D10'), Range('C4:E6') + ITEM Assertion OK : test2Application.Range('A2:D5,a3:d4'), Range('A4:G10') + ITEM Assertion OK : test3Application.Range('A4:G10,A1:B6'), Range('A2:D5,A3:D4') + ITEM Assertion OK : test4Application.Range('A5:D10'), Range('B5:E10') +Test Results +============ + +Tests passed: 4 +Tests failed: 0 + +END 'TestUnion + TEST OK : TestUnion +Test run finished : 15/01/2009 17:06:08 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/VariantTest.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/VariantTest.log new file mode 100644 index 000000000000..d2bfeb8e14a1 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/VariantTest.log @@ -0,0 +1,47 @@ +Test run started : 08/10/2008 12:07:24 +---------------------------------------------------------------- +TestAddress + TEST START : TestAddress + ITEM Assertion OK : test1: res = (aboo = '') + ITEM Assertion OK : test 2: res = (aboo = 'fiddlesticks') + ITEM Assertion OK : test 3: res = ('' = aboo) + ITEM Assertion OK : test 4: res = ('fiddlesticks' = aboo ) + ITEM Assertion OK : test 5: res = (testString = '') + ITEM Assertion OK : test 6: res = (testString = 'fiddlesticks') + ITEM Assertion OK : test 7: res = ('' = testString) + ITEM Assertion OK : test 8: res = ('fiddlesticks' = testString ) + ITEM Assertion OK : test 9: res = ( aboo < " ) + ITEM Assertion OK : test 10: res = ( testString < " ) + ITEM Assertion OK : test 11: res = ( aboo > " ) + ITEM Assertion OK : test 12: res = ( testString > " ) + ITEM Assertion OK : test 13: res = ( aboo <> '' ) + ITEM Assertion OK : test 14: res = ( testString <> '' ) + ITEM Assertion OK : test 15: res = (aboo = something/14) + ITEM Assertion OK : test 16: res = something + 'string' + ITEM Assertion OK : test 17: res = something & 'string' + ITEM Assertion OK : test 18: res = something MOD 10 ) + ITEM Assertion OK : test 19: res = something AND 1 ) + ITEM Assertion OK : test 20: res = something AND 0 ) + ITEM Assertion OK : test 21: res = something OR 12) + ITEM Assertion OK : test 22: res = something OR 0 ) + ITEM Assertion OK : test 23: res = something XOR 0 ) + ITEM Assertion OK : test 24: res = something XOR 1 ) + ITEM Assertion OK : test 25: res = something EQV 0 ) + ITEM Assertion OK : test 26: res = something EQV 1 ) + ITEM Assertion OK : test 27: res = something IMP 0 ) + ITEM Assertion OK : test 28: res = something IMP 1 ) + ITEM Assertion OK : test 29: res = something IMP 14 ) + ITEM Assertion OK : test 30: res = NOT something ) + ITEM Assertion OK : test 31: res = something + 12 ) + ITEM Assertion OK : test 32: res = something - 12 ) + ITEM Assertion OK : test 33: res = -something ) + ITEM Assertion OK : test 34: res = something * 12 ) +Test Results +============ + +Tests passed: 34 +Tests failed: 0 + +END 'TestAddress + TEST OK : TestAddress +Test run finished : 08/10/2008 12:07:26 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Window.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Window.log new file mode 100644 index 000000000000..178582e753c7 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/Window.log @@ -0,0 +1,46 @@ +Test run started : 08/10/2008 12:09:50 +---------------------------------------------------------------- + TEST START : Window-Issue + ITEM Assertion OK : Window.Left is: 0 (Test only applies to maximized Window) + ITEM Assertion OK : Window.Top is: 26 (Test only applies to maximized Window) + ITEM Assertion OK : Window.Width is: 1280 (Test only applies to maximized Window) + ITEM Assertion OK : Window.Height is: 968 (Test only applies to maximized Window) + ITEM Assertion OK : Window.ScrollColumn is: 100 + ITEM Assertion OK : Window.ScrollColumn is: 1 + ITEM Assertion OK : Window.ScrollRow is: 100 + ITEM Assertion OK : Window.ScrollRow is: 1 + ITEM Assertion OK : Window.LargeScroll(Down): ScrollRow is: 127 (Test may only apply to maximized Window) + ITEM Assertion OK : Window.LargeScroll(Up): ScrollRow is: 1 + ITEM Assertion OK : Window.LargeScroll(ToRight): ScrollColumn is: 58 (Test may only apply to maximized Window) + ITEM Assertion OK : Window.LargeScroll(ToLeft): ScrollColumn is: 1 + ITEM Assertion OK : Window.SmallScroll(ToRight): ScrollColumn is: 4 (Test may only apply to maximized Window) + ITEM Assertion OK : Window.SmallScroll(ToLeft): ScrollColumn is: 1 + ITEM Assertion OK : Window.DisplayWorkBookTabs is: False + ITEM Assertion OK : Window.DisplayWorkBookTabs is: True + ITEM Assertion OK : Window.DisplayVerticalScrollBar is: True + ITEM Assertion OK : Window.DisplayVerticalScrollBar is: False + ITEM Assertion OK : Window.DisplayHorizontalScrollBar is: False + ITEM Assertion OK : Window.DisplayHorizontalScrollBar is: True + ITEM Assertion OK : Window.DisplayHeadings is: False + ITEM Assertion OK : Window.DisplayHeadings is: True + ITEM Assertion OK : Window.DisplayOutline is: False + ITEM Assertion OK : Window.DisplayOutline is: True + ITEM Assertion OK : Window.Visible is: False + ITEM Assertion OK : Window.Visible is: True + ITEM Assertion OK : Window.Caption is: MyCaption + ITEM Assertion OK : Pane.ScrollColumn is: 100 + ITEM Assertion OK : Pane.ScrollColumn is: 1 + ITEM Assertion OK : Pane.ScrollRow is: 100 + ITEM Assertion OK : Pane.ScrollRow is: 1 + ITEM Assertion OK : Pane.LargeScroll(Down): ScrollRow is: 127 (Test may only apply to maximized Window) + ITEM Assertion OK : Pane.LargeScroll(Up): ScrollRow is: 1 + ITEM Assertion OK : Pane.LargeScroll(ToRight): ScrollColumn is: 58 (Test may only apply to maximized Window) + ITEM Assertion OK : Pane.LargeScroll(ToLeft): ScrollColumn is: 1 + ITEM Assertion OK : Pane.SmallScroll(ToRight): ScrollColumn is: 4 (Test may only apply to maximized Window) + ITEM Assertion OK : Pane.SmallScroll(ToLeft): ScrollColumn is: 1 + ITEM Assertion OK : Window Selection: $A$2:$D$5 + ITEM Assertion OK : ActiveSheet name of Window: Sheet1 + ITEM Assertion OK : Window ActiveCell: $A$1 +END 'Window-Issue' Symbol + TEST OK : Window-Issue +Test run finished : 08/10/2008 12:09:50 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/bytearraystring.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/bytearraystring.log new file mode 100644 index 000000000000..8913fc096dc2 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/bytearraystring.log @@ -0,0 +1,8 @@ +Test run started : 08/10/2008 12:54:46 +BEGIN Bytearray To String + TEST START : Test the conversion between bytearray and string + ITEM Assertion OK : The number of byte is:6 + ITEM Assertion OK : the return string is: abc + TEST OK : Test the conversion between bytearray and string +END Bytearray To String +Test run finished : 08/10/2008 12:54:46 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/dateserial.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/dateserial.log new file mode 100644 index 000000000000..0b02f7b91a2c --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/dateserial.log @@ -0,0 +1,9 @@ +Test run started : 08/10/2008 12:56:07 +BEGIN DateSerial + TEST START : Test DateSerial function + ITEM Assertion OK : the return date is: 15/06/1999 + ITEM Assertion OK : the return date is: 15/06/1999 + ITEM Assertion OK : the return date is: 15/06/1999 + TEST OK : Test DateSerial function +END DateSerial +Test run finished : 08/10/2008 12:56:07 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/datevalue.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/datevalue.log new file mode 100644 index 000000000000..4698463362d2 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/datevalue.log @@ -0,0 +1,8 @@ +Test run started : 08/10/2008 13:07:49 +BEGIN DateValue + TEST START : Test DateValue function + ITEM Assertion OK : the return date is: 12/02/1969 + ITEM Assertion OK : the return date is: 21/01/2008 + TEST OK : Test DateValue function +END DateValue +Test run finished : 08/10/2008 13:07:49 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/format.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/format.log new file mode 100644 index 000000000000..ef84cbbdb925 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/format.log @@ -0,0 +1,36 @@ +Test run started : 15/01/2009 17:07:59 +BEGIN Format + TEST START : Test Predefined_Number_Format_Sample function + ITEM Assertion OK : General Number: 562486.2356 + ITEM Assertion OK : Fixed: 0.20 + ITEM Assertion OK : Standard: 562,486.24 + ITEM Assertion OK : Percent: 75.21% + ITEM Assertion OK : Scientific: 5.62E+05 + ITEM Assertion OK : Scientific: -3.46E+03 + ITEM Assertion OK : Yes/No: No + ITEM Assertion OK : Yes/No: Yes + ITEM Assertion OK : True/False: False + ITEM Assertion OK : True/False: True + ITEM Assertion OK : On/Off: Off + ITEM Assertion OK : On/Off: On + TEST OK : Test Predefined_Number_Format_Sample function + TEST START : Test Custom_Number_Format_Sample function + ITEM Assertion OK : 00.0000: 23.6750 + ITEM Assertion OK : 00.00: 23.68 + ITEM Assertion OK : 00000: 02658 + ITEM Assertion OK : 00.00: 2658.00 + ITEM Assertion OK : ##.####: 23.675 + ITEM Assertion OK : ##.##: 23.68 + ITEM Assertion OK : #,###.##: 12,345.25 + ITEM Assertion OK : ##.00%: 25.00% + ITEM Assertion OK : #,###: 1,000,000 + ITEM Assertion OK : ######E-###: 109838E-5 + ITEM Assertion OK : $#,###.##: $2,345.25 + ITEM Assertion OK : ##.###\%: .25% + TEST OK : Test Custom_Number_Format_Sample function + TEST START : Test Custom_Text_Format_Sample function + ITEM Assertion OK : <: vba + ITEM Assertion OK : >: VBA + TEST OK : Test Custom_Text_Format_Sample function +END Format +Test run finished : 15/01/2009 17:07:59 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/pagesetup.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/pagesetup.log new file mode 100644 index 000000000000..a1c90473ce07 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/pagesetup.log @@ -0,0 +1,87 @@ +Test run started : 7/21/2008 10:37:24 AM +BEGIN PageSetup + TEST START : Sheet_PrintArea + ITEM Assertion OK : PrintArea has changed as expected + TEST OK : Sheet_PrintArea + TEST START : Test margins (no headers) + ITEM Assertion OK : PageSetup.LeftMargin set/get + ITEM Assertion OK : PageSetup.RightMargin set/get + ITEM Assertion OK : PageSetup.TopMargin set/get + ITEM Assertion OK : PageSetup.BottomMargin set/get +Verify that page margins on sheet 1 are all 0.5inch + TEST OK : Test margins (no headers) + TEST START : Test margins (headers) + ITEM Assertion OK : PageSetup.HeaderMargin set/get + ITEM Assertion OK : PageSetup.FooterMargin set/get + ITEM Assertion OK : PageSetup.LeftMargin set/get + ITEM Assertion OK : PageSetup.LeftMargin set/get +Verify that top/bottom/header/footer page margins on sheet 2 are all 0.5inch + TEST OK : Test margins (headers) + TEST START : Test header/footer text + ITEM Assertion OK : PageSetup.LeftHeader set + ITEM Assertion OK : PageSetup.LeftHeader set/get + ITEM Assertion OK : PageSetup.CenterHeader set + ITEM Assertion OK : PageSetup.CenterHeader set/get + ITEM Assertion OK : PageSetup.RightHeader set + ITEM Assertion OK : PageSetup.RightHeader set/get + ITEM Assertion OK : PageSetup.LeftFooter set + ITEM Assertion OK : PageSetup.LeftFooter set/get + ITEM Assertion OK : PageSetup.CenterFooter set + ITEM Assertion OK : PageSetup.CenterFooter set/get + ITEM Assertion OK : PageSetup.RightFooter set + ITEM Assertion OK : PageSetup.RightFooter set/get +Verify that headers on sheet 2 are Ready,to,go +Verify that footers on sheet 2 are This,now,Works + TEST OK : Test header/footer text + TEST START : Test zoom + ITEM Assertion OK : PageSetup.Zoom set + ITEM Assertion OK : PageSetup.Zoom set/get +Verify that sheet 1 zoom is 10% + TEST OK : Test zoom + TEST START : Test orientation + ITEM Assertion OK : PageSetup.Zoom set + ITEM Assertion OK : PageSetup.Orientation set/get +Verify that sheet 1 orientation is now landscape + TEST OK : Test orientation + TEST START : Test paper size + ITEM Assertion OK : PageSetup.PaperSize get + ITEM Assertion OK : PageSetup.PaperSize set/get +Verify that paper size on sheet 1 is now Letter + TEST OK : Test paper size + TEST START : Test order + ITEM Assertion OK : PageSetup.Order get + ITEM Assertion OK : PageSetup.Order set/get +Verify that order on sheet 1 is now over, then down. + TEST OK : Test order + TEST START : Test first page number + ITEM Assertion OK : PageSetup.FirstPageNumber get + ITEM Assertion OK : PageSetup.FirstPageNumber set/get +Verify that first page number on sheet 1 is now 2. + TEST OK : Test first page number + TEST START : Test center vertically + ITEM Assertion OK : PageSetup.CenterVertically get + ITEM Assertion OK : PageSetup.CenterVertically set/get +Verify that CenterVertically on sheet 1 is now true. + TEST OK : Test center vertically + TEST START : Test center horizontally + ITEM Assertion OK : PageSetup.CenterHorizontally get + ITEM Assertion OK : PageSetup.CenterHorizontally set/get +Verify that CenterHorizontally on sheet 1 is now true. + TEST OK : Test center horizontally + TEST START : Test FitToPagesTall + ITEM Assertion OK : PageSetup.FitToPagesTall set/get + TEST OK : Test FitToPagesTall + TEST START : Test FitToPagesWide + ITEM Assertion OK : PageSetup.FitToPagesWide set/get + TEST OK : Test FitToPagesWide + TEST START : Test PrintHeadings + ITEM Assertion OK : PageSetup.PrintHeadings set/get + ITEM Assertion OK : PageSetup.PrintHeadings set/get + TEST OK : Test PrintHeadings + TEST START : Test PrintTitleRows + ITEM Assertion OK : PageSetup.PrintTitleRows get + ITEM Assertion OK : PageSetup.PrintTitleRows set range/get + ITEM Assertion OK : PageSetup.PrintTitleRows set false/get + TEST OK : Test PrintTitleRows +END PageSetup +Test run finished : 7/21/2008 10:37:32 AM diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/partition.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/partition.log new file mode 100644 index 000000000000..1ea267d641e8 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/partition.log @@ -0,0 +1,11 @@ +Test run started : 08/10/2008 13:09:51 +BEGIN Partition + TEST START : Test Partition function + ITEM Assertion OK : the number 20 occurs in the range:20:24 + ITEM Assertion OK : the number 20 occurs in the range: 20: 20 + ITEM Assertion OK : the number 120 occurs in the range:100: + ITEM Assertion OK : the number -5 occurs in the range: : -1 + ITEM Assertion OK : the number 2 occurs in the range: 2: 3 + TEST OK : Test Partition function +END Partition +Test run finished : 08/10/2008 13:09:51 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/range-4.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/range-4.log new file mode 100644 index 000000000000..11de80133dfa --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/range-4.log @@ -0,0 +1,16 @@ +Test run started : 08/10/2008 11:30:16 +---------------------------------------------------------------- +ShowDetail-Issue + TEST START : ShowDetail-Issue + ITEM Assertion OK : Range.ShowDetail is True + ITEM Assertion OK : Range.ShowDetail is False +END 'ShowDetail-Issue' Symbol + TEST OK : ShowDetail-Issue +---------------------------------------------------------------- +RangeMerged-Issue + TEST START : RangeMerged-Issue + ITEM Assertion OK : Range.RangeMerged is $F$2:$H$5 + ITEM Assertion OK : The first address of Range.RangeMerged is $F$2 +END 'RangeMerged-Issue' Symbol + TEST OK : RangeMerged-Issue +Test run finished : 08/10/2008 11:30:16 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/replace.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/replace.log new file mode 100644 index 000000000000..e96004e4d2a6 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/replace.log @@ -0,0 +1,14 @@ +Test run started : 2007-11-21 11:24:04 +BEGIN Replace + TEST START : Test Replace function + ITEM Assertion OK : common string:aefefdBc + ITEM Assertion OK : expression string:aefefdef + ITEM Assertion OK : binanary compare:aefefdBc + ITEM Assertion OK : text compare:aefefdef + ITEM Assertion OK : text compare:aefefdef + ITEM Assertion OK : start = 3:cefdBc + ITEM Assertion OK : count = 2: aefefdBc + ITEM Assertion OK : start = 1, count = 0, not support in Unix: abcbcdBc + TEST OK : Test Replace function +END Replace +Test run finished : 2007-11-21 11:24:04 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/stringplusdouble.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/stringplusdouble.log new file mode 100644 index 000000000000..51a958a412cf --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/stringplusdouble.log @@ -0,0 +1,62 @@ +Test run started : 15/01/2009 17:09:03 +BEGIN String Plus Double + TEST START : double = string + double +The next compute raises error: s = null, d = null, r = s + d + ITEM Assertion OK : s = null, d = null, r = s + d .The result is: -1 + ITEM Assertion OK : s = null, d = null, r = s & d .The result is: 0 +The next compute raises error: s = null, d = 20, r = s + d + ITEM Assertion OK : s = null, d = 20, r = s + d .The result is: -1 + ITEM Assertion OK : s = null, d = 20, r = s & d .The result is: 20 + ITEM Assertion OK : s = '10', d = null, r = s + d .The result is: 10 + ITEM Assertion OK : s = '10', d = null, r = s & d .The result is: 100 + ITEM Assertion OK : s = '10', d = 20, r = s + d .The result is: 30 + ITEM Assertion OK : s = '10', d = 20, r = s & d .The result is: 1020 +The next compute raises error: s = 'abc', d = null, r = s + d + ITEM Assertion OK : s = 'abc', d = null, r = s + d .The result is: -1 +The next compute raises error: s = 'abc', d = null, r = s & d + ITEM Assertion OK : s = 'abc', d = null, r = s & d .The result is: -1 +The next compute raises error: s = 'abc', d = 20, r = s + d + ITEM Assertion OK : s = 'abc', d = 20, r = s + d .The result is: -1 +The next compute raises error: s = 'abc', d = 20, r = s & d + ITEM Assertion OK : s = 'abc', d = 20, r = s & d .The result is: -1 + TEST OK : double = string + double + TEST START : string = string + double +The next compute raises error: s = null, d = null, r = s + d + ITEM Assertion OK : s = null, d = null, r = s + d .The result is: -1 + ITEM Assertion OK : s = null, d = null, r = s & d .The result is: 0 +The next compute raises error: s = null, d = 20, r = s + d + ITEM Assertion OK : s = null, d = 20, r = s + d .The result is: -1 + ITEM Assertion OK : s = null, d = 20, r = s & d .The result is: 20 + ITEM Assertion OK : s = '10', d = null, r = s + d .The result is: 10 + ITEM Assertion OK : s = '10', d = null, r = s & d .The result is: 100 + ITEM Assertion OK : s = '10', d = 20, r = s + d .The result is: 30 + ITEM Assertion OK : s = '10', d = 20, r = s & d .The result is: 1020 +The next compute raises error: s = 'abc', d = null, r = s + d + ITEM Assertion OK : s = 'abc', d = null, r = s + d .The result is: -1 + ITEM Assertion OK : s = 'abc', d = null, r = s & d .The result is: abc0 +The next compute raises error: s = 'abc', d = 20, r = s + d + ITEM Assertion OK : s = 'abc', d = 20, r = s + d .The result is: -1 + ITEM Assertion OK : s = 'abc', d = 20, r = s & d .The result is: abc20 + TEST OK : string = string + double + TEST START : double = string + string +The next compute raises error: s = null, d = null, r = s + d + ITEM Assertion OK : s = null, d = null, r = s + d .The result is: -1 +The next compute raises error: s = null, d = null, r = s & d + ITEM Assertion OK : s = null, d = null, r = s & d .The result is: -1 + ITEM Assertion OK : s = null, d = 20, r = s + d .The result is: 20 + ITEM Assertion OK : s = null, d = 20, r = s & d .The result is: 20 + ITEM Assertion OK : s = '10', d = null, r = s + d .The result is: 10 + ITEM Assertion OK : s = '10', d = null, r = s & d .The result is: 10 + ITEM Assertion OK : s = '10', d = 20, r = s + d .The result is: 1020 + ITEM Assertion OK : s = '10', d = 20, r = s & d .The result is: 1020 +The next compute raises error: s = 'abc', d = null, r = s + d + ITEM Assertion OK : s = 'abc', d = null, r = s + d .The result is: -1 +The next compute raises error: s = 'abc', d = null, r = s & d + ITEM Assertion OK : s = 'abc', d = null, r = s & d .The result is: -1 +The next compute raises error: s = 'abc', d = 20, r = s + d + ITEM Assertion OK : s = 'abc', d = 20, r = s + d .The result is: -1 +The next compute raises error: s = 'abc', d = 20, r = s & d + ITEM Assertion OK : s = 'abc', d = 20, r = s & d .The result is: -1 + TEST OK : double = string + string +END String Plus Double +Test run finished : 15/01/2009 17:09:03 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/window2.log b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/window2.log new file mode 100644 index 000000000000..01fba9c6dfa6 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/logs/win/window2.log @@ -0,0 +1,41 @@ +Test run started : 15/01/2009 17:10:02 +BEGIN Window2 + TEST START : Test Window.SplitRow + ITEM Assertion OK : Test SplitColumn: 2 (Test only applies to maximized Window and at least has 800*600 solotion) + ITEM Assertion FAIL : Test SplitRow: 1 (Test only applies to maximized Window and at least has 800*600 solotion) + ITEM Assertion OK : Test SplitVertical: 242.283803521067 + ITEM Assertion OK : Test SplitHorizontal: 242.283803521067 + ITEM Assertion FAIL : Test SplitRow: 3 (Test only applies to maximized Window and at least has 800*600 solotion) + ITEM Assertion OK : Test SplitColumn: 3 (Test only applies to maximized Window and at least has 800*600 solotion) + ITEM Assertion OK : Test SplitColumn: 0 + ITEM Assertion OK : Test SplitRow: 0 + TEST OK : Test Window.SplitRow + TEST START : Test Window.DisplayGridlines + ITEM Assertion OK : Test gridlines are on + ITEM Assertion OK : Test gridlines are off + TEST OK : Test Window.DisplayGridlines + TEST START : Test Window.DisplayHeadings + ITEM Assertion OK : Test Headings are on + ITEM Assertion OK : Test Headings are off + TEST OK : Test Window.DisplayHeadings + TEST START : Test Window.Visibility + ITEM Assertion OK : Window is visible + ITEM Assertion OK : Window is not visible + TEST OK : Test Window.Visibility + TEST START : Test Window.FreezePanes + ITEM Assertion OK : Test no panes frozen + ITEM Assertion OK : Test panes frozen at center + ITEM Assertion OK : Test panes frozen at split + TEST OK : Test Window.FreezePanes + TEST START : Test Window.View + TEST OK : Test Window.View + TEST START : Test Window.Zoom + ITEM Assertion OK : Test zoom=100% + ITEM Assertion OK : Test zoom=150% + TEST OK : Test Window.Zoom + TEST START : Test Windows.Count + ITEM Assertion OK : Windows Count: 1 + ITEM Assertion OK : Application.Windows Count: 1 + TEST OK : Test Windows.Count +END Window2 +Test run finished : 15/01/2009 17:10:03 diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/notwork/error.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/notwork/error.xls new file mode 100644 index 000000000000..ea2095d5e3d7 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/notwork/error.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/notwork/imagecontrols.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/notwork/imagecontrols.xls new file mode 100644 index 000000000000..0de17b403f23 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/notwork/imagecontrols.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/notwork/keyword.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/notwork/keyword.xls new file mode 100644 index 000000000000..3bf711ed4f42 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/notwork/keyword.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/notwork/objectmodule.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/notwork/objectmodule.xls new file mode 100644 index 000000000000..d3aff35b938c Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/notwork/objectmodule.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/notwork/stringtodouble.ods b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/notwork/stringtodouble.ods new file mode 100644 index 000000000000..5a732a765886 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/notwork/stringtodouble.ods differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/partition.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/partition.xls new file mode 100644 index 000000000000..5c8d12b1d54f Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/partition.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/range-4.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/range-4.xls new file mode 100644 index 000000000000..52452369462f Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/range-4.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/replace.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/replace.xls new file mode 100644 index 000000000000..dcf3c6e8ec06 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/replace.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/stringplusdouble.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/stringplusdouble.xls new file mode 100644 index 000000000000..596be7f6b9bc Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/stringplusdouble.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments-ooo-build/window2.xls b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/window2.xls new file mode 100644 index 000000000000..4d5e1cbfe944 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments-ooo-build/window2.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments/ApplicationRunTest.xls b/sc/source/ui/vba/testvba/TestDocuments/ApplicationRunTest.xls new file mode 100644 index 000000000000..a5a591c1f849 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments/ApplicationRunTest.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments/CalcFont.xls b/sc/source/ui/vba/testvba/TestDocuments/CalcFont.xls new file mode 100644 index 000000000000..9ddb69600643 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments/CalcFont.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments/FinancialFuncs.xls b/sc/source/ui/vba/testvba/TestDocuments/FinancialFuncs.xls new file mode 100644 index 000000000000..bb8941809947 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments/FinancialFuncs.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments/PageSetup.xls b/sc/source/ui/vba/testvba/TestDocuments/PageSetup.xls deleted file mode 100755 index dfa1b2a8be58..000000000000 Binary files a/sc/source/ui/vba/testvba/TestDocuments/PageSetup.xls and /dev/null differ diff --git a/sc/source/ui/vba/testvba/TestDocuments/TestIntersection.xls b/sc/source/ui/vba/testvba/TestDocuments/TestIntersection.xls new file mode 100644 index 000000000000..24f88db87ccc Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments/TestIntersection.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments/TestUnion.xls b/sc/source/ui/vba/testvba/TestDocuments/TestUnion.xls new file mode 100644 index 000000000000..5b8f0968cf38 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments/TestUnion.xls differ diff --git a/sc/source/ui/vba/testvba/TestDocuments/logs/unix/CalcFont.log b/sc/source/ui/vba/testvba/TestDocuments/logs/unix/CalcFont.log new file mode 100644 index 000000000000..f3583e4cbb12 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments/logs/unix/CalcFont.log @@ -0,0 +1,17 @@ +Test run started : 10/09/2008 02:40:17 PM +CalcFont_Format + TEST START : Font_Format + ITEM Assertion OK : correctly set font to Bold + ITEM Assertion OK : correctly set font to Italic + ITEM Assertion OK : correctly read FontStyle + ITEM Assertion OK : correctly set font to Shadow + ITEM Assertion OK : correctly set font color + ITEM Assertion OK : correctly set font color index + ITEM Assertion OK : correctly set font name + ITEM Assertion OK : correctly set font outline + ITEM Assertion OK : correctly set font size + ITEM Assertion OK : correctly set font strikethrough + ITEM Assertion OK : correctly set font underline + TEST Success. : Font_Format +CalcFont_Format +Test run finished : 10/09/2008 02:40:17 PM diff --git a/sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestIntersection.log b/sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestIntersection.log new file mode 100644 index 000000000000..ea686a830cde --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestIntersection.log @@ -0,0 +1,26 @@ +Test run started : 13/01/2009 14:31:43 +---------------------------------------------------------------- +TestIntersection + TEST START : TestIntersection + ITEM Assertion OK : test1 Application.Intersect( Range('A2:D10'), Range('C4:E6')) + ITEM Assertion OK : test2 Application.Intersect( Range('A2:D10'), Range('A4:G10')) + ITEM Assertion OK : test3 Application.Intersect( Range('A2:c8,d2:f8,g2:i8'), Range('A4:G10')) + ITEM Assertion OK : test4 Application.Intersect( Range('A4:G10'), Range('A2:c8,d2:f8,g2:i8')) + ITEM Assertion OK : test5 Application.Intersect( Range('A2:c8,d2:f8,g2:i8'), Range('g4:i10,A4:G10')) + ITEM Assertion OK : test6 Application.Intersect( Range('g4:i10,A4:G10'), Range('A2:c8,d2:f8,g2:i8')) + ITEM Assertion OK : test7 Application.Intersect( Range('a2:d10,b5:e10'), Range('a5:i10')) + ITEM Assertion OK : test8 Application.Intersect( Range('a2:c8,d2:f8'), Range('b6:e9,a6:f9')) + ITEM Assertion OK : test9 Application.Intersect( Range('a2:c8,e2:f8'), Range('b6:e9,a6:f9')) + ITEM Assertion OK : test10 Application.Intersect( Range('a1:a3,c1:c3'), Range('a2:c3')) + ITEM Assertion OK : test11 Application.Intersect( Range('a1:a3,b1:b3'), Range('a2:c3')) + ITEM Assertion OK : test12 Application.Intersect( Range('a2:d5,b3:f7,c1:g4'), Range('b2:e6')) + ITEM Assertion OK : test13 Range(" a2:d10,b5:e10,g13:j32 "), Range(" a5:i10,b6:e9 "), Range("b2:r5,f10:h19") +Test Results +============ + +Tests passed: 13 +Tests failed: 0 + +END 'TestIntersection + TEST OK : TestIntersection +Test run finished : 13/01/2009 14:31:43 diff --git a/sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestUnion.log b/sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestUnion.log new file mode 100644 index 000000000000..da3cb35dedb3 --- /dev/null +++ b/sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestUnion.log @@ -0,0 +1,17 @@ +Test run started : 13/01/2009 14:32:16 +---------------------------------------------------------------- +TestUnion + TEST START : TestUnion + ITEM Assertion OK : test1Application.Range('A2:D10'), Range('C4:E6') + ITEM Assertion OK : test2Application.Range('A2:D5,a3:d4'), Range('A4:G10') + ITEM Assertion OK : test3Application.Range('A4:G10,A1:B6'), Range('A2:D5,A3:D4') + ITEM Assertion OK : test4Application.Range('A5:D10'), Range('B5:E10') +Test Results +============ + +Tests passed: 4 +Tests failed: 0 + +END 'TestUnion + TEST OK : TestUnion +Test run finished : 13/01/2009 14:32:16 diff --git a/sc/source/ui/vba/testvba/TestDocuments/pagesetup.xls b/sc/source/ui/vba/testvba/TestDocuments/pagesetup.xls new file mode 100755 index 000000000000..dfa1b2a8be58 Binary files /dev/null and b/sc/source/ui/vba/testvba/TestDocuments/pagesetup.xls differ diff --git a/sc/source/ui/vba/testvba/testclient b/sc/source/ui/vba/testvba/testclient new file mode 100755 index 000000000000..12e9ca1659f4 Binary files /dev/null and b/sc/source/ui/vba/testvba/testclient differ diff --git a/sc/source/ui/vba/vbabutton.cxx b/sc/source/ui/vba/vbabutton.cxx deleted file mode 100644 index 4c21c70c88b5..000000000000 --- a/sc/source/ui/vba/vbabutton.cxx +++ /dev/null @@ -1,74 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbabutton.cxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include "vbabutton.hxx" -#include - -using namespace com::sun::star; -using namespace ooo::vba; - - -const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") ); -ScVbaButton::ScVbaButton( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : ButtonImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper ) -{ -} - -// Attributes -rtl::OUString SAL_CALL -ScVbaButton::getCaption() throw (css::uno::RuntimeException) -{ - rtl::OUString Label; - m_xProps->getPropertyValue( LABEL ) >>= Label; - return Label; -} - -void SAL_CALL -ScVbaButton::setCaption( const rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException) -{ - m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) ); -} - -rtl::OUString& -ScVbaButton::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaButton") ); - return sImplName; -} - -uno::Sequence< rtl::OUString > -ScVbaButton::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Button" ) ); - } - return aServiceNames; -} diff --git a/sc/source/ui/vba/vbabutton.hxx b/sc/source/ui/vba/vbabutton.hxx deleted file mode 100644 index a2ce28b3ba53..000000000000 --- a/sc/source/ui/vba/vbabutton.hxx +++ /dev/null @@ -1,51 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbabutton.hxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef SC_VBA_BUTTON_HXX -#define SC_VBA_BUTTON_HXX -#include -#include - -#include "vbacontrol.hxx" -#include "vbahelper.hxx" - -typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XButton > ButtonImpl_BASE; - -class ScVbaButton : public ButtonImpl_BASE -{ -public: - ScVbaButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ); - // Attributes - virtual rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException); - virtual void SAL_CALL setCaption( const rtl::OUString& _caption ) throw (css::uno::RuntimeException); - //XHelperInterface - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); -}; -#endif //SC_VBA_BUTTON_HXX diff --git a/sc/source/ui/vba/vbacheckbox.cxx b/sc/source/ui/vba/vbacheckbox.cxx deleted file mode 100644 index 0a53d05f985f..000000000000 --- a/sc/source/ui/vba/vbacheckbox.cxx +++ /dev/null @@ -1,110 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * - * $Revision$ - * - * last change: $Author$ $Date$ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ -#include "vbacheckbox.hxx" -#include - -using namespace com::sun::star; -using namespace ooo::vba; - - -const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") ); -const static rtl::OUString STATE( RTL_CONSTASCII_USTRINGPARAM("State") ); -ScVbaCheckbox::ScVbaCheckbox( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ) : CheckBoxImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper ) -{ -} - -// Attributes -rtl::OUString SAL_CALL -ScVbaCheckbox::getCaption() throw (css::uno::RuntimeException) -{ - rtl::OUString Label; - m_xProps->getPropertyValue( LABEL ) >>= Label; - return Label; -} - -void SAL_CALL -ScVbaCheckbox::setCaption( const rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException) -{ - m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) ); -} - -uno::Any SAL_CALL -ScVbaCheckbox::getValue() throw (css::uno::RuntimeException) -{ - sal_Int16 nValue = -1; - m_xProps->getPropertyValue( STATE ) >>= nValue; - if( nValue != 0 ) - nValue = -1; -// return uno::makeAny( nValue ); -// I must be missing something MSO says value should be -1 if selected, 0 if not -// selected - return uno::makeAny( ( nValue == -1 ) ? sal_True : sal_False ); -} - -void SAL_CALL -ScVbaCheckbox::setValue( const uno::Any& _value ) throw (css::uno::RuntimeException) -{ - sal_Int16 nValue = 0; - sal_Bool bValue = false; - if( _value >>= nValue ) - { - if( nValue == -1) - nValue = 1; - } - else if ( _value >>= bValue ) - { - if ( bValue ) - nValue = 1; - } - m_xProps->setPropertyValue( STATE, uno::makeAny( nValue ) ); -} -rtl::OUString& -ScVbaCheckbox::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaCheckbox") ); - return sImplName; -} - -uno::Sequence< rtl::OUString > -ScVbaCheckbox::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.CheckBox" ) ); - } - return aServiceNames; -} diff --git a/sc/source/ui/vba/vbacheckbox.hxx b/sc/source/ui/vba/vbacheckbox.hxx deleted file mode 100644 index 58805c6b4b7c..000000000000 --- a/sc/source/ui/vba/vbacheckbox.hxx +++ /dev/null @@ -1,60 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * - * $Revision$ - * - * last change: $Author$ $Date$ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ -#ifndef SC_VBA_CHECKBOX_HXX -#define SC_VBA_CHECKBOX_HXX -#include -#include - -#include "vbacontrol.hxx" -#include "vbahelper.hxx" - -typedef cppu::ImplInheritanceHelper2< ScVbaControl, ov::msforms::XRadioButton, css::script::XDefaultProperty > CheckBoxImpl_BASE; - -class ScVbaCheckbox : public CheckBoxImpl_BASE -{ -public: - ScVbaCheckbox( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ); - // Attributes - virtual rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException); - virtual void SAL_CALL setCaption( const rtl::OUString& _caption ) throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException); - virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException); - // XDefaultProperty - rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); } - //XHelperInterface - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); -}; -#endif //SC_VBA_CHECKBOX_HXX diff --git a/sc/source/ui/vba/vbacollectionimpl.cxx b/sc/source/ui/vba/vbacollectionimpl.cxx deleted file mode 100644 index fdf7a2ebc976..000000000000 --- a/sc/source/ui/vba/vbacollectionimpl.cxx +++ /dev/null @@ -1,136 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbacollectionimpl.cxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include -#include "vbaglobals.hxx" -using namespace ::com::sun::star; -using namespace ::ooo::vba; - - -ScVbaCollectionBaseImpl::ScVbaCollectionBaseImpl( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XIndexAccess >& xIndexAccess ) throw (uno::RuntimeException) : m_xContext( xContext ), m_xIndexAccess( xIndexAccess ) -{ - m_xNameAccess.set( xIndexAccess, uno::UNO_QUERY ); -} - -uno::Any -ScVbaCollectionBaseImpl::getItemByStringIndex( const rtl::OUString& sIndex ) throw (::uno::RuntimeException) -{ - if ( !m_xNameAccess.is() ) - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ScVbaCollectionBaseImpl string index access not supported by this object") ), uno::Reference< uno::XInterface >() ); - - return createCollectionObject( m_xNameAccess->getByName( sIndex ) ); -} - -uno::Any -ScVbaCollectionBaseImpl::getItemByIntIndex( const sal_Int32 nIndex ) throw (uno::RuntimeException) -{ - if ( !m_xIndexAccess.is() ) - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ScVbaCollectionBaseImpl numeric index access not supported by this object") ), uno::Reference< uno::XInterface >() ); - if ( nIndex <= 0 ) - { - throw lang::IndexOutOfBoundsException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "index is 0 or negative" ) ), - uno::Reference< uno::XInterface >() ); - } - // need to adjust for vba index ( for which first element is 1 ) - return createCollectionObject( m_xIndexAccess->getByIndex( nIndex - 1 ) ); -} - -::sal_Int32 SAL_CALL -ScVbaCollectionBaseImpl::getCount() throw (uno::RuntimeException) -{ - return m_xIndexAccess->getCount(); -} - -uno::Any SAL_CALL -ScVbaCollectionBaseImpl::getParent() throw (uno::RuntimeException) -{ - // #TODO #FIXME investigate whether this makes sense - uno::Reference< excel::XApplication > xApplication = - ScVbaGlobals::getGlobalsImpl( m_xContext )->getApplication(); - uno::Reference< excel::XWorkbook > xWorkbook; - if ( xApplication.is() ) - { - xWorkbook = xApplication->getActiveWorkbook(); - } - return uno::Any( xWorkbook ); -} - -::sal_Int32 SAL_CALL ScVbaCollectionBaseImpl::getCreator() throw (uno::RuntimeException) -{ - // #TODO #FIXE some sort of implementation - //SC_VBA_STUB(); - return 0; -} -uno::Reference< excel::XApplication > SAL_CALL ScVbaCollectionBaseImpl::getApplication() throw (uno::RuntimeException) -{ - // #TODO #FIXME investigate whether this makes sense - uno::Reference< excel::XApplication > xApplication = - ScVbaGlobals::getGlobalsImpl( m_xContext )->getApplication(); - return xApplication; -} - -uno::Any SAL_CALL ScVbaCollectionBaseImpl::Item( const uno::Any& aIndex ) throw (uno::RuntimeException) -{ - if ( aIndex.getValueTypeClass() != uno::TypeClass_STRING ) - { - sal_Int32 nIndex = 0; - - if ( ( aIndex >>= nIndex ) != sal_True ) - { - rtl::OUString message; - message = rtl::OUString::createFromAscii( - "Couldn't convert index to Int32"); - throw lang::IndexOutOfBoundsException( message, - uno::Reference< uno::XInterface >() ); - } - return getItemByIntIndex( nIndex ); - } - rtl::OUString aStringSheet; - - aIndex >>= aStringSheet; - return getItemByStringIndex( aStringSheet ); -} - -::rtl::OUString SAL_CALL -ScVbaCollectionBaseImpl::getDefaultMethodName( ) throw (css::uno::RuntimeException) -{ - const static rtl::OUString sName( RTL_CONSTASCII_USTRINGPARAM("Item") ); - return sName; -} - - // XElementAccess - -::sal_Bool SAL_CALL ScVbaCollectionBaseImpl::hasElements() throw (uno::RuntimeException) -{ - return ( m_xIndexAccess->getCount() > 0 ); -} - - diff --git a/sc/source/ui/vba/vbacollectionimpl.hxx b/sc/source/ui/vba/vbacollectionimpl.hxx deleted file mode 100644 index 14fceb1b5f71..000000000000 --- a/sc/source/ui/vba/vbacollectionimpl.hxx +++ /dev/null @@ -1,259 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbacollectionimpl.hxx,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef SC_VBA_COLLECTION_IMPL_HXX -#define SC_VBA_COLLECTION_IMPL_HXX - -#include -//#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "vbahelper.hxx" -#include "vbahelperinterface.hxx" -#include "vbaglobals.hxx" - -#include - -typedef ::cppu::WeakImplHelper1< css::container::XEnumeration > EnumerationHelper_BASE; - -class EnumerationHelperImpl : public EnumerationHelper_BASE -{ -protected: - css::uno::Reference< css::uno::XComponentContext > m_xContext; - css::uno::Reference< css::container::XEnumeration > m_xEnumeration; -public: - - EnumerationHelperImpl( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XEnumeration >& xEnumeration ) throw ( css::uno::RuntimeException ) : m_xContext( xContext ), m_xEnumeration( xEnumeration ) { } - virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (css::uno::RuntimeException) { return m_xEnumeration->hasMoreElements(); } -}; - -// a wrapper class for a providing a XIndexAccess, XNameAccess, XEnumerationAccess impl based on providing a vector of interfaces -// only requirement is the object needs to implement XName - - - -typedef ::cppu::WeakImplHelper3< css::container::XNameAccess, css::container::XIndexAccess, css::container::XEnumerationAccess > XNamedCollectionHelper_BASE; - -template< typename Ifc1 > -class XNamedObjectCollectionHelper : public XNamedCollectionHelper_BASE -{ -public: -typedef std::vector< css::uno::Reference< Ifc1 > > XNamedVec; -private: - - class XNamedEnumerationHelper : public EnumerationHelper_BASE - { - XNamedVec mXNamedVec; - typename XNamedVec::iterator mIt; - public: - XNamedEnumerationHelper( const XNamedVec& sMap ) : mXNamedVec( sMap ), mIt( mXNamedVec.begin() ) {} - - virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (css::uno::RuntimeException) - { - return ( mIt != mXNamedVec.end() ); - } - - virtual css::uno::Any SAL_CALL nextElement( ) throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException) - { - if ( hasMoreElements() ) - return css::uno::makeAny( *mIt++ ); - throw css::container::NoSuchElementException(); - } - }; - -protected: - XNamedVec mXNamedVec; - typename XNamedVec::iterator cachePos; -public: - XNamedObjectCollectionHelper( const XNamedVec& sMap ) : mXNamedVec( sMap ), cachePos(mXNamedVec.begin()) {} - // XElementAccess - virtual css::uno::Type SAL_CALL getElementType( ) throw (css::uno::RuntimeException) { return Ifc1::static_type(0); } - virtual ::sal_Bool SAL_CALL hasElements( ) throw (css::uno::RuntimeException) { return ( mXNamedVec.size() > 0 ); } - // XNameAcess - virtual css::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException) - { - if ( !hasByName(aName) ) - throw css::container::NoSuchElementException(); - return css::uno::makeAny( *cachePos ); - } - virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw (css::uno::RuntimeException) - { - css::uno::Sequence< rtl::OUString > sNames( mXNamedVec.size() ); - rtl::OUString* pString = sNames.getArray(); - typename XNamedVec::iterator it = mXNamedVec.begin(); - typename XNamedVec::iterator it_end = mXNamedVec.end(); - - for ( ; it != it_end; ++it, ++pString ) - { - css::uno::Reference< css::container::XNamed > xName( *it, css::uno::UNO_QUERY_THROW ); - *pString = xName->getName(); - } - return sNames; - } - virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (css::uno::RuntimeException) - { - cachePos = mXNamedVec.begin(); - typename XNamedVec::iterator it_end = mXNamedVec.end(); - for ( ; cachePos != it_end; ++cachePos ) - { - css::uno::Reference< css::container::XNamed > xName( *cachePos, css::uno::UNO_QUERY_THROW ); - if ( aName.equals( xName->getName() ) ) - break; - } - return ( cachePos != it_end ); - } - - // XElementAccess - virtual ::sal_Int32 SAL_CALL getCount( ) throw (css::uno::RuntimeException) { return mXNamedVec.size(); } - virtual css::uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (css::lang::IndexOutOfBoundsException, css::lang::WrappedTargetException, css::uno::RuntimeException ) - { - if ( Index < 0 || Index >= getCount() ) - throw css::lang::IndexOutOfBoundsException(); - - return css::uno::makeAny( mXNamedVec[ Index ] ); - - } - // XEnumerationAccess - virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration( ) throw (css::uno::RuntimeException) - { - return new XNamedEnumerationHelper( mXNamedVec ); - } -}; - -// including a HelperInterface implementation -template< typename Ifc1 > -class ScVbaCollectionBase : public InheritedHelperInterfaceImpl< Ifc1 > -{ -typedef InheritedHelperInterfaceImpl< Ifc1 > BaseColBase; -protected: - css::uno::Reference< css::container::XIndexAccess > m_xIndexAccess; - css::uno::Reference< css::container::XNameAccess > m_xNameAccess; - - virtual css::uno::Any getItemByStringIndex( const rtl::OUString& sIndex ) throw (css::uno::RuntimeException) - { - if ( !m_xNameAccess.is() ) - throw css::uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ScVbaCollectionBase string index access not supported by this object") ), css::uno::Reference< css::uno::XInterface >() ); - - return createCollectionObject( m_xNameAccess->getByName( sIndex ) ); - } - - virtual css::uno::Any getItemByIntIndex( const sal_Int32 nIndex ) throw (css::uno::RuntimeException) - { - if ( !m_xIndexAccess.is() ) - throw css::uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ScVbaCollectionBase numeric index access not supported by this object") ), css::uno::Reference< css::uno::XInterface >() ); - if ( nIndex <= 0 ) - { - throw css::lang::IndexOutOfBoundsException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "index is 0 or negative" ) ), - css::uno::Reference< css::uno::XInterface >() ); - } - // need to adjust for vba index ( for which first element is 1 ) - return createCollectionObject( m_xIndexAccess->getByIndex( nIndex - 1 ) ); - } -public: - ScVbaCollectionBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess ) : BaseColBase( xParent, xContext ), m_xIndexAccess( xIndexAccess ){ m_xNameAccess.set(m_xIndexAccess, css::uno::UNO_QUERY); } - //XCollection - virtual ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException) - { - return m_xIndexAccess->getCount(); - } - - virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index1, const css::uno::Any& /*not processed in this base class*/ ) throw (css::uno::RuntimeException) - { - if ( Index1.getValueTypeClass() != css::uno::TypeClass_STRING ) - { - sal_Int32 nIndex = 0; - - if ( ( Index1 >>= nIndex ) != sal_True ) - { - rtl::OUString message; - message = rtl::OUString::createFromAscii( - "Couldn't convert index to Int32"); - throw css::lang::IndexOutOfBoundsException( message, - css::uno::Reference< css::uno::XInterface >() ); - } - return getItemByIntIndex( nIndex ); - } - rtl::OUString aStringSheet; - - Index1 >>= aStringSheet; - return getItemByStringIndex( aStringSheet ); - } - // XDefaultMethod - ::rtl::OUString SAL_CALL getDefaultMethodName( ) throw (css::uno::RuntimeException) - { - const static rtl::OUString sName( RTL_CONSTASCII_USTRINGPARAM("Item") ); - return sName; - } - // XEnumerationAccess - virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException) = 0; - - // XElementAccess - virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException) = 0; - // XElementAccess - virtual ::sal_Bool SAL_CALL hasElements() throw (css::uno::RuntimeException) - { - return ( m_xIndexAccess->getCount() > 0 ); - } - virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ) = 0; - -}; - -typedef ::cppu::WeakImplHelper1 XCollection_InterfacesBASE; - -typedef ScVbaCollectionBase< XCollection_InterfacesBASE > CollImplBase1; -// compatible with the old collections ( pre XHelperInterface base class ) ( some internal objects still use this ) -class ScVbaCollectionBaseImpl : public CollImplBase1 -{ -public: - ScVbaCollectionBaseImpl( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess ) throw( css::uno::RuntimeException ) : CollImplBase1( xParent, xContext, xIndexAccess){} - -}; - -template // where Ifc must implement XCollectionTest -class CollTestImplHelper : public ScVbaCollectionBase< ::cppu::WeakImplHelper1< Ifc > > -{ -typedef ScVbaCollectionBase< ::cppu::WeakImplHelper1< Ifc > > ImplBase1; - -public: - CollTestImplHelper( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess ) throw( css::uno::RuntimeException ) : ImplBase1( xParent, xContext, xIndexAccess ) {} -}; - - -#endif //SC_VBA_COLLECTION_IMPL_HXX diff --git a/sc/source/ui/vba/vbacolorformat.cxx b/sc/source/ui/vba/vbacolorformat.cxx deleted file mode 100644 index df918e9d15fc..000000000000 --- a/sc/source/ui/vba/vbacolorformat.cxx +++ /dev/null @@ -1,190 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbacolorformat.cxx,v $ - * $Revision: 1.3.146.1 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include -#include -#include "vbacolorformat.hxx" - -using namespace ooo::vba; -using namespace com::sun::star; - -sal_Int32 -MsoColorIndizes::getColorIndex( sal_Int32 nIndex ) -{ - const static sal_Int32 COLORINDIZES[56] = - { HAPICOLOR_BLACK, HAPICOLOR_WITHE, HAPICOLOR_RED, HAPICOLOR_BRIGHTGREEN, HAPICOLOR_BLUE, HAPICOLOR_YELLOW, HAPICOLOR_PINK, - HAPICOLOR_TURQUOISE, HAPICOLOR_DARKRED, HAPICOLOR_GREEN, HAPICOLOR_DARKBLUE, HAPICOLOR_DARKYELLOW, HAPICOLOR_VIOLET, - HAPICOLOR_TEAL, HAPICOLOR_GRAY_25_PERCENT, HAPICOLOR_GRAY_50_PERCENT, HAPICOLOR_PERIWINCKLE, HAPICOLOR_PLUM, - HAPICOLOR_IVORY, HAPICOLOR_LIGHTTURQUOISE, HAPICOLOR_DARKPRUPLE, HAPICOLOR_CORAL, HAPICOLOR_OCEANBLUE, HAPICOLOR_ICEBLUE, - HAPICOLOR_GREEN, HAPICOLOR_PINK, HAPICOLOR_YELLOW, HAPICOLOR_TURQUOISE, HAPICOLOR_VIOLET, HAPICOLOR_DARKRED, HAPICOLOR_TEAL, - HAPICOLOR_BLUE, HAPICOLOR_SKYBLUE, HAPICOLOR_LIGHTTURQUOISE, HAPICOLOR_LIGHTGREEN, HAPICOLOR_LIGHTYELLOW, HAPICOLOR_PALEBLUE, - HAPICOLOR_ROSE, HAPICOLOR_LAVENDER, HAPICOLOR_TAN, HAPICOLOR_LIGHTBLUE, HAPICOLOR_AQUA, HAPICOLOR_LIME, HAPICOLOR_GOLD, - HAPICOLOR_LIGHTORANGE, HAPICOLOR_ORANGE, HAPICOLOR_BLUEGRAY, HAPICOLOR_GRAY_40_PERCENT, HAPICOLOR_DARKTEAL, - HAPICOLOR_SEAGREEN, HAPICOLOR_NONAME, HAPICOLOR_OLIVEGREEN, HAPICOLOR_BROWN, HAPICOLOR_PLUM, HAPICOLOR_INDIGO, - HAPICOLOR_GRAY_80_PERCENT - }; - return COLORINDIZES[nIndex]; -} -ScVbaColorFormat::ScVbaColorFormat( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< XHelperInterface > xInternalParent, const uno::Reference< drawing::XShape > xShape, const sal_Int16 nColorFormatType ) : ScVbaColorFormat_BASE( xParent, xContext ), m_xInternalParent( xInternalParent ), m_xShape( xShape ), m_nColorFormatType( nColorFormatType ) -{ - m_xPropertySet.set( xShape, uno::UNO_QUERY_THROW ); - m_nFillFormatBackColor = 0; - try - { - uno::Reference< ov::msforms::XFillFormat > xFillFormat( xInternalParent, uno::UNO_QUERY_THROW ); - m_pFillFormat = ( ScVbaFillFormat* )( xFillFormat.get() ); - }catch ( uno::RuntimeException e ) - { - m_pFillFormat = NULL; - } -} - -void -ScVbaColorFormat::setColorFormat( sal_Int16 _ntype ) -{ - m_nColorFormatType = _ntype; -} - -// Attribute -sal_Int32 SAL_CALL -ScVbaColorFormat::getRGB() throw (uno::RuntimeException) -{ - sal_Int32 nRGB = 0; - switch( m_nColorFormatType ) - { - case ColorFormatType::LINEFORMAT_FORECOLOR: - m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("LineColor") ) >>= nRGB; - break; - case ColorFormatType::LINEFORMAT_BACKCOLOR: - //TODO BackColor not supported - // m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii("Color"), uno::makeAny( nRGB ) ); - break; - case ColorFormatType::FILLFORMAT_FORECOLOR: - m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("FillColor") ) >>= nRGB; - break; - case ColorFormatType::FILLFORMAT_BACKCOLOR: - nRGB = m_nFillFormatBackColor; - break; - default: - throw uno::RuntimeException( rtl::OUString::createFromAscii("Second parameter of ColorFormat is wrong."), uno::Reference< uno::XInterface >() ); - } - nRGB = OORGBToXLRGB( nRGB ); - return nRGB; -} - -void SAL_CALL -ScVbaColorFormat::setRGB( sal_Int32 _rgb ) throw (uno::RuntimeException) -{ - sal_Int32 nRGB = XLRGBToOORGB( _rgb ); - switch( m_nColorFormatType ) - { - case ColorFormatType::LINEFORMAT_FORECOLOR: - m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "LineColor" ), uno::makeAny( nRGB ) ); - break; - case ColorFormatType::LINEFORMAT_BACKCOLOR: - // TODO BackColor not supported - break; - case ColorFormatType::FILLFORMAT_FORECOLOR: - m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "FillColor" ), uno::makeAny( nRGB ) ); - if( m_pFillFormat ) - { - m_pFillFormat->setForeColorAndInternalStyle(nRGB); - } - break; - case ColorFormatType::FILLFORMAT_BACKCOLOR: - m_nFillFormatBackColor = nRGB; - if( m_pFillFormat ) - { - m_pFillFormat->setForeColorAndInternalStyle(nRGB); - } - break; - default: - throw uno::RuntimeException( rtl::OUString::createFromAscii("Second parameter of ColorFormat is wrong."), uno::Reference< uno::XInterface >() ); - } -} - -sal_Int32 SAL_CALL -ScVbaColorFormat::getSchemeColor() throw (uno::RuntimeException) -{ - sal_Int32 nColor = getRGB(); - // #TODO I guess the number of elements is determined by the correct scheme - // the implementation here seems to be a rehash of color index ( which seems to be a - // different thing ) - I would guess we need to know/import etc. the correct color scheme - // or at least find out a little more - sal_Int32 i = 0; - for( ; i < 56; i++ ) - { - if( nColor == MsoColorIndizes::getColorIndex(i) ) - break; - } - - if( i == 56 ) // this is most likely an error condition - --i; - return i; - // #TODO figure out what craziness is this, - // the 56 colors seems incorrect, as in default XL ( 2003 ) there are 80 colors -/* - if( i == 56 ) - { - i = -2; - } - - return ( i + 2 ); -*/ -} - -void SAL_CALL -ScVbaColorFormat::setSchemeColor( sal_Int32 _schemecolor ) throw (uno::RuntimeException) -{ - // the table is 0 based - sal_Int32 nColor = MsoColorIndizes::getColorIndex( _schemecolor ); - // nColor is already xl RGB - setRGB( nColor ); -} - - -rtl::OUString& -ScVbaColorFormat::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaColorFormat") ); - return sImplName; -} - -uno::Sequence< rtl::OUString > -ScVbaColorFormat::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.ColorFormat" ) ); - } - return aServiceNames; -} - diff --git a/sc/source/ui/vba/vbacolorformat.hxx b/sc/source/ui/vba/vbacolorformat.hxx deleted file mode 100644 index cff4f7c3719d..000000000000 --- a/sc/source/ui/vba/vbacolorformat.hxx +++ /dev/null @@ -1,128 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbacolorformat.hxx,v $ - * $Revision: 1.3.146.1 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef SC_VBA_XCOLORFORMAT_HXX -#define SC_VBA_XCOLORFORMAT_HXX - -#include -#include -#include -#include "vbahelperinterface.hxx" -#include "vbafillformat.hxx" - -typedef InheritedHelperInterfaceImpl1< ov::msforms::XColorFormat > ScVbaColorFormat_BASE; - -class ColorFormatType -{ -public: - const static sal_Int16 LINEFORMAT_FORECOLOR = 1; - const static sal_Int16 LINEFORMAT_BACKCOLOR = 2; - const static sal_Int16 FILLFORMAT_FORECOLOR = 3; - const static sal_Int16 FILLFORMAT_BACKCOLOR = 4; - const static sal_Int16 THREEDFORMAT_EXTRUSIONCOLOR = 5; -}; - -struct MsoColorIndizes -{ - const static sal_Int32 HAPICOLOR_BLACK = 0; - const static sal_Int32 HAPICOLOR_WITHE = 16777215; - const static sal_Int32 HAPICOLOR_RED = 16711680; - const static sal_Int32 HAPICOLOR_BRIGHTGREEN = 65280; - const static sal_Int32 HAPICOLOR_BLUE = 255; - const static sal_Int32 HAPICOLOR_YELLOW = 16776960; - const static sal_Int32 HAPICOLOR_PINK = 16711935; - const static sal_Int32 HAPICOLOR_TURQUOISE = 65535; - const static sal_Int32 HAPICOLOR_DARKRED = 8388608; - const static sal_Int32 HAPICOLOR_GREEN = 32768; - const static sal_Int32 HAPICOLOR_DARKBLUE = 128; - const static sal_Int32 HAPICOLOR_DARKYELLOW = 8421376; - const static sal_Int32 HAPICOLOR_VIOLET = 8388736; - const static sal_Int32 HAPICOLOR_TEAL = 32896; - const static sal_Int32 HAPICOLOR_GRAY_25_PERCENT = 12632256; - const static sal_Int32 HAPICOLOR_GRAY_50_PERCENT = 8421504; - const static sal_Int32 HAPICOLOR_PERIWINCKLE = 10066431; - const static sal_Int32 HAPICOLOR_PLUM = 10040166; - const static sal_Int32 HAPICOLOR_IVORY = 16777164; - const static sal_Int32 HAPICOLOR_LIGHTTURQUOISE = 13434879; - const static sal_Int32 HAPICOLOR_DARKPRUPLE = 6684774; - const static sal_Int32 HAPICOLOR_CORAL = 16744576; - const static sal_Int32 HAPICOLOR_OCEANBLUE = 26316; - const static sal_Int32 HAPICOLOR_ICEBLUE = 13421823; - const static sal_Int32 HAPICOLOR_SKYBLUE = 52479; - const static sal_Int32 HAPICOLOR_LIGHTGREEN = 13434828; - const static sal_Int32 HAPICOLOR_LIGHTYELLOW = 16777113; - const static sal_Int32 HAPICOLOR_PALEBLUE = 10079487; - const static sal_Int32 HAPICOLOR_ROSE = 16751052; - const static sal_Int32 HAPICOLOR_LAVENDER = 13408767; - const static sal_Int32 HAPICOLOR_TAN = 16764057; - const static sal_Int32 HAPICOLOR_LIGHTBLUE = 3368703; - const static sal_Int32 HAPICOLOR_AQUA = 3394764; - const static sal_Int32 HAPICOLOR_LIME = 10079232; - const static sal_Int32 HAPICOLOR_GOLD = 16763904; - const static sal_Int32 HAPICOLOR_LIGHTORANGE = 16750848; - const static sal_Int32 HAPICOLOR_ORANGE = 16737792; - const static sal_Int32 HAPICOLOR_BLUEGRAY = 6710937; - const static sal_Int32 HAPICOLOR_GRAY_40_PERCENT = 9868950; - const static sal_Int32 HAPICOLOR_DARKTEAL = 13158; - const static sal_Int32 HAPICOLOR_SEAGREEN = 3381606; - const static sal_Int32 HAPICOLOR_NONAME = 13056; - const static sal_Int32 HAPICOLOR_OLIVEGREEN = 3355392; - const static sal_Int32 HAPICOLOR_BROWN = 10040064; - const static sal_Int32 HAPICOLOR_INDIGO = 3355545; - const static sal_Int32 HAPICOLOR_GRAY_80_PERCENT = 3355443; - - static sal_Int32 getColorIndex( sal_Int32 nIndex ); - -}; - -class ScVbaColorFormat : public ScVbaColorFormat_BASE -{ -private: - css::uno::Reference< ov::XHelperInterface > m_xInternalParent; - css::uno::Reference< css::drawing::XShape > m_xShape; - css::uno::Reference< css::beans::XPropertySet > m_xPropertySet; - ScVbaFillFormat *m_pFillFormat; - sal_Int16 m_nColorFormatType; - sal_Int32 m_nFillFormatBackColor; -protected: - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); - void setColorFormat( sal_Int16 nType ); -public: - ScVbaColorFormat( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< ov::XHelperInterface > xInternalParent, const css::uno::Reference< css::drawing::XShape > xShape, const sal_Int16 nColorFormatType ); - - // Attributes - virtual sal_Int32 SAL_CALL getRGB() throw (css::uno::RuntimeException); - virtual void SAL_CALL setRGB( sal_Int32 _rgb ) throw (css::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getSchemeColor() throw (css::uno::RuntimeException); - virtual void SAL_CALL setSchemeColor( sal_Int32 _schemecolor ) throw (css::uno::RuntimeException); - -}; - -#endif//SC_VBA_XCOLORFORMAT_HXX diff --git a/sc/source/ui/vba/vbacombobox.cxx b/sc/source/ui/vba/vbacombobox.cxx deleted file mode 100644 index e13ab7d7bf2d..000000000000 --- a/sc/source/ui/vba/vbacombobox.cxx +++ /dev/null @@ -1,175 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbacombobox.cxx,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include "vbacombobox.hxx" -#include - -using namespace com::sun::star; -using namespace ooo::vba; - - -//SelectedItems list of integer indexes -//StringItemList list of items - -const static rtl::OUString TEXT( RTL_CONSTASCII_USTRINGPARAM("Text") ); -const static rtl::OUString SELECTEDITEMS( RTL_CONSTASCII_USTRINGPARAM("SelectedItems") ); -const static rtl::OUString ITEMS( RTL_CONSTASCII_USTRINGPARAM("StringItemList") ); -const static rtl::OUString CONTROLSOURCEPROP( RTL_CONSTASCII_USTRINGPARAM("DataFieldProperty") ); - -ScVbaComboBox::ScVbaComboBox( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper, bool bDialogType ) : ComboBoxImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper ), mbDialogType( bDialogType ) -{ - mpListHelper.reset( new ListControlHelper( m_xProps ) ); - // grab the default value property name - m_xProps->getPropertyValue( CONTROLSOURCEPROP ) >>= sSourceName; -} - -// Attributes - - -// Value, [read] e.g. getValue returns the value of ooo Text propery e.g. the value in -// the drop down -uno::Any SAL_CALL -ScVbaComboBox::getValue() throw (uno::RuntimeException) -{ - return m_xProps->getPropertyValue( sSourceName ); -} - -void SAL_CALL -ScVbaComboBox::setListIndex( const uno::Any& _value ) throw (uno::RuntimeException) -{ - uno::Sequence< sal_Int16 > sSelection(1); - _value >>= sSelection[ 0 ]; - m_xProps->setPropertyValue( SELECTEDITEMS, uno::makeAny( sSelection ) ); -} - -uno::Any SAL_CALL -ScVbaComboBox::getListIndex() throw (uno::RuntimeException) -{ - uno::Sequence< rtl::OUString > sItems; - m_xProps->getPropertyValue( ITEMS ) >>= sItems; - // should really return the item that has focus regardless of - // it been selected - if ( sItems.getLength() > 0 ) - { - rtl::OUString sText = getText(); - sal_Int32 nLen = sItems.getLength(); - for ( sal_Int32 index = 0; sText.getLength() && index < nLen; ++index ) - { - if ( sItems[ index ].equals( sText ) ) - { - OSL_TRACE("getListIndex returning %d", index ); - return uno::makeAny( index ); - } - - } - } - OSL_TRACE("getListIndex returning %d", -1 ); - return uno::makeAny( sal_Int32( -1 ) ); -} - -// Value, [write]e.g. setValue sets the value in the drop down, and if the value is one -// of the values in the list then the selection is also set -void SAL_CALL -ScVbaComboBox::setValue( const uno::Any& _value ) throw (uno::RuntimeException) -{ - m_xProps->setPropertyValue( sSourceName, _value ); -} - -// see Value - -::rtl::OUString SAL_CALL -ScVbaComboBox::getText() throw (uno::RuntimeException) -{ - rtl::OUString result; - getValue() >>= result; - return result; -} - -void SAL_CALL -ScVbaComboBox::setText( const ::rtl::OUString& _text ) throw (uno::RuntimeException) -{ - setValue( uno::makeAny( _text ) ); // seems the same -} - -// Methods -void SAL_CALL -ScVbaComboBox::AddItem( const uno::Any& pvargItem, const uno::Any& pvargIndex ) throw (uno::RuntimeException) -{ - mpListHelper->AddItem( pvargItem, pvargIndex ); -} - -void SAL_CALL -ScVbaComboBox::removeItem( const uno::Any& index ) throw (uno::RuntimeException) - { - mpListHelper->removeItem( index ); -} - -void SAL_CALL -ScVbaComboBox::Clear( ) throw (uno::RuntimeException) - { - mpListHelper->Clear(); - } - -void SAL_CALL -ScVbaComboBox::setRowSource( const rtl::OUString& _rowsource ) throw (css::uno::RuntimeException) -{ - ScVbaControl::setRowSource( _rowsource ); - mpListHelper->setRowSource( _rowsource ); - } - -sal_Int32 SAL_CALL -ScVbaComboBox::getListCount() throw (uno::RuntimeException) -{ - return mpListHelper->getListCount(); -} - -uno::Any SAL_CALL -ScVbaComboBox::List( const ::uno::Any& pvargIndex, const uno::Any& pvarColumn ) throw (uno::RuntimeException) -{ - return mpListHelper->List( pvargIndex, pvarColumn ); - } - -rtl::OUString& -ScVbaComboBox::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaComboBox") ); - return sImplName; -} - -uno::Sequence< rtl::OUString > -ScVbaComboBox::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.ComboBox" ) ); - } - return aServiceNames; -} diff --git a/sc/source/ui/vba/vbacombobox.hxx b/sc/source/ui/vba/vbacombobox.hxx deleted file mode 100644 index d1cf47c9c7b2..000000000000 --- a/sc/source/ui/vba/vbacombobox.hxx +++ /dev/null @@ -1,80 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbacombobox.hxx,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef SC_VBA_COMBOBOX_HXX -#define SC_VBA_COMBOBOX_HXX -#include -#include -#include -#include -#include -#include -#include -#include - -#include "vbacontrol.hxx" -#include "vbalistcontrolhelper.hxx" -#include "vbahelper.hxx" - -typedef cppu::ImplInheritanceHelper2 ComboBoxImpl_BASE; -class ScVbaComboBox : public ComboBoxImpl_BASE -{ - std::auto_ptr< ListControlHelper > mpListHelper; - rtl::OUString sSourceName; - rtl::OUString msDftPropName; - bool mbDialogType; - -public: - ScVbaComboBox( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper, bool bDialogType = false ); - - // Attributes - virtual css::uno::Any SAL_CALL getListIndex() throw (css::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL getListCount() throw (css::uno::RuntimeException); - virtual void SAL_CALL setListIndex( const css::uno::Any& _value ) throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException); - virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getText() throw (css::uno::RuntimeException); - virtual void SAL_CALL setText( const ::rtl::OUString& _text ) throw (css::uno::RuntimeException); - - // Methods - virtual void SAL_CALL AddItem( const css::uno::Any& pvargItem, const css::uno::Any& pvargIndex ) throw (css::uno::RuntimeException); - virtual void SAL_CALL removeItem( const css::uno::Any& index ) throw (css::uno::RuntimeException); - virtual void SAL_CALL Clear( ) throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL List( const css::uno::Any& pvargIndex, const css::uno::Any& pvarColumn ) throw (css::uno::RuntimeException); - // XControl - virtual void SAL_CALL setRowSource( const rtl::OUString& _rowsource ) throw (css::uno::RuntimeException); - - // XDefaultProperty - ::rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); } - //XHelperInterface - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); -}; - -#endif // diff --git a/sc/source/ui/vba/vbacommandbar.cxx b/sc/source/ui/vba/vbacommandbar.cxx deleted file mode 100644 index ca463a4f746b..000000000000 --- a/sc/source/ui/vba/vbacommandbar.cxx +++ /dev/null @@ -1,329 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * - * $Revision$ - * - * last change: $Author$ $Date$ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ -#include -#include -#include -#include -#include - -#include "vbacommandbar.hxx" -#include "vbacommandbarcontrols.hxx" -#include "vbahelper.hxx" - - -using namespace com::sun::star; -using namespace ooo::vba; - -ScVbaCommandBar::ScVbaCommandBar( const uno::Reference< XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, sal_Int32 nModuleType ) throw (uno::RuntimeException) : CommandBar_BASE( xParent, xContext ) -{ - // it's a menu bar - // only supporting factory menus ( no custom menus ) - m_xParentHardRef.set( xParent, uno::UNO_QUERY_THROW ); - initCommandBar(); - switch( nModuleType ) - { - case 0: - m_sMenuModuleName = rtl::OUString::createFromAscii( "com.sun.star.sheet.SpreadsheetDocument" ); - break; - case 1: - m_sMenuModuleName = rtl::OUString::createFromAscii( "com.sun.star.text.TextDocument" ); - break; - default: - m_sMenuModuleName = rtl::OUString::createFromAscii( "com.sun.star.text.TextDocument" ); - } - getMenuSettings(); - m_bIsMenu = sal_True; - m_bCustom = sal_False; -} -ScVbaCommandBar::ScVbaCommandBar( const uno::Reference< XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, rtl::OUString sToolBarName, sal_Bool bTemporary, sal_Bool bCreate ) throw (uno::RuntimeException) : CommandBar_BASE( xParent, xContext ) -{ - // it's a tool bar - m_xParentHardRef.set( xParent, uno::UNO_QUERY_THROW ); - initCommandBar(); - m_bTemporary = bTemporary; - m_bCreate = bCreate; - // get OOo ToolBarName - CommandBarNameMap::const_iterator iter = mCommandBarNameMap.find( sToolBarName.toAsciiLowerCase() ); - if( iter != mCommandBarNameMap.end() ) - { - m_sToolBarName = iter->second; - } - else - { - m_sToolBarName = sToolBarName; - } - m_sUIName = m_sToolBarName; - m_bIsMenu = sal_False; - getToolBarSettings( m_sToolBarName ); -} -void -ScVbaCommandBar::initCommandBar() throw (uno::RuntimeException) -{ - m_pScVbaCommandBars = dynamic_cast< ScVbaCommandBars* >( m_xParentHardRef.get() ); - if ( !m_pScVbaCommandBars ) - throw uno::RuntimeException( rtl::OUString::createFromAscii( "Parent needs to be a ScVbaCommandBars"), uno::Reference< uno::XInterface >() ); - m_bIsMenu = sal_False; - m_bCustom = sal_False; - m_bTemporary = sal_True; - m_sToolBarName = rtl::OUString::createFromAscii(""); - m_sUIName = rtl::OUString::createFromAscii(""); - m_sMenuModuleName = rtl::OUString::createFromAscii( "com.sun.star.sheet.SpreadsheetDocument" ); -} -void -ScVbaCommandBar::getToolBarSettings( rtl::OUString sToolBarName ) throw( uno::RuntimeException ) -{ - rtl::OUString sFactoryToolBar = rtl::OUString::createFromAscii("private:resource/toolbar/") + sToolBarName.toAsciiLowerCase(); - rtl::OUString sCustomToolBar = rtl::OUString::createFromAscii("private:resource/toolbar/custom_toolbar_") + sToolBarName; - uno::Reference< lang::XMultiServiceFactory > xMSF( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); - uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xUICfgManagerSup( xMSF->createInstance(rtl::OUString::createFromAscii("com.sun.star.ui.ModuleUIConfigurationManagerSupplier") ), uno::UNO_QUERY_THROW ); - m_xUICfgManager.set( xUICfgManagerSup->getUIConfigurationManager( m_pScVbaCommandBars->GetModuleName() ), uno::UNO_QUERY_THROW ); - m_xUICfgPers.set( m_xUICfgManager, uno::UNO_QUERY_THROW ); - if( m_xUICfgManager->hasSettings( sFactoryToolBar ) ) - { - // exsiting standard ToolBar - m_xBarSettings.set( m_xUICfgManager->getSettings( sFactoryToolBar, sal_True ), uno::UNO_QUERY_THROW ); - m_sToolBarName = sFactoryToolBar; - } - else if( m_xUICfgManager->hasSettings( sCustomToolBar ) ) - { - // exisiting custom ToolBar - m_xBarSettings.set( m_xUICfgManager->getSettings( sCustomToolBar, sal_True ), uno::UNO_QUERY_THROW ); - m_sToolBarName = sCustomToolBar; - m_bCustom = sal_True; - } - else if( m_bCreate ) - { - // new custom ToolBar - m_xBarSettings.set( m_xUICfgManager->createSettings(), uno::UNO_QUERY_THROW ); - m_sToolBarName = sCustomToolBar; - m_bCustom = sal_True; - addCustomBar(); - } - else - throw uno::RuntimeException( rtl::OUString::createFromAscii("ToolBar do not exist"), uno::Reference< uno::XInterface >() ); - if( m_pScVbaCommandBars->GetWindows()->hasByName( m_sToolBarName ) ) - { - uno::Any aToolBar = m_pScVbaCommandBars->GetWindows()->getByName( m_sToolBarName ); - aToolBar >>= m_aToolBar; - } -} -void -ScVbaCommandBar::addCustomBar() -{ - uno::Reference< beans::XPropertySet > xPropertySet( m_xBarSettings, uno::UNO_QUERY_THROW ); - xPropertySet->setPropertyValue(rtl::OUString::createFromAscii("UIName"), uno::makeAny( m_sUIName )); - - if( m_xUICfgManager->hasSettings(m_sToolBarName) ) - { - m_xUICfgManager->replaceSettings( m_sToolBarName, uno::Reference< container::XIndexAccess > (m_xBarSettings, uno::UNO_QUERY_THROW ) ); - } - else - { - m_xUICfgManager->insertSettings( m_sToolBarName, uno::Reference< container::XIndexAccess > (m_xBarSettings, uno::UNO_QUERY_THROW ) ); - } - if( !m_bTemporary ) - { - m_xUICfgPers->store(); - } -} -void -ScVbaCommandBar::getMenuSettings() -{ - try - { - rtl::OUString sMenuBar = rtl::OUString::createFromAscii( "private:resource/menubar/menubar" ); - uno::Reference< lang::XMultiServiceFactory > xMSF( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); - uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xUICfgManagerSup( xMSF->createInstance(rtl::OUString::createFromAscii("com.sun.star.ui.ModuleUIConfigurationManagerSupplier") ), uno::UNO_QUERY_THROW ); - m_xUICfgManager.set( xUICfgManagerSup->getUIConfigurationManager( m_sMenuModuleName ), uno::UNO_QUERY_THROW ); - m_xUICfgPers.set( m_xUICfgManager, uno::UNO_QUERY_THROW ); - m_xBarSettings.set( m_xUICfgManager->getSettings( sMenuBar, sal_True ), uno::UNO_QUERY_THROW ); - } - catch ( uno::Exception e) - { - OSL_TRACE( "getMenuSetting got a error\n" ); - } -} -::rtl::OUString SAL_CALL -ScVbaCommandBar::getName() throw ( uno::RuntimeException ) -{ - // This will get a "NULL length string" when Name is not set. - uno::Reference< beans::XPropertySet > xPropertySet( m_xBarSettings, uno::UNO_QUERY_THROW ); - uno::Any aName = xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("UIName") ); - rtl::OUString sName; - aName >>= sName; - if( sName.getLength() < 1 && !m_bIsMenu ) - { - uno::Reference< container::XNameAccess > xNameAccess( m_pScVbaCommandBars->GetWindows(), uno::UNO_QUERY_THROW ); - if( xNameAccess->hasByName( m_sToolBarName ) ) - { - beans::PropertyValues aToolBar; - xNameAccess->getByName( m_sToolBarName ) >>= aToolBar; - sal_Int32 nCount = aToolBar.getLength(); - beans::PropertyValue aPropertyValue; - for( sal_Int32 i = 0; i < nCount; i++ ) - { - aPropertyValue = aToolBar[i]; - if( aPropertyValue.Name.equals( rtl::OUString::createFromAscii("UIName") ) ) - { - aPropertyValue.Value >>= sName; - return sName; - } - } - } - } - return sName; -} -void SAL_CALL -ScVbaCommandBar::setName( const ::rtl::OUString& _name ) throw (uno::RuntimeException) -{ - uno::Reference< beans::XPropertySet > xPropertySet( m_xBarSettings, uno::UNO_QUERY_THROW ); - xPropertySet->setPropertyValue( rtl::OUString::createFromAscii("UIName"), uno::makeAny( _name ) ); - uno::Reference< container::XIndexAccess > xIndexAccess( m_xBarSettings, uno::UNO_QUERY_THROW ); - - if( m_xUICfgManager->hasSettings( m_sToolBarName ) ) - { - m_xUICfgManager->replaceSettings( m_sToolBarName, xIndexAccess ); - } - else - { - // toolbar not found - } - if( !m_bTemporary ) - { - m_xUICfgPers->store(); - } -} -::sal_Bool SAL_CALL -ScVbaCommandBar::getVisible() throw (uno::RuntimeException) -{ - sal_Bool bVisible = sal_False; - try - { - sal_Int32 i = 0; - while( !m_aToolBar[i].Name.equals( rtl::OUString::createFromAscii( "Visible" ) ) ) - { - i++; - } - m_aToolBar[i].Value >>= bVisible; - } - catch ( uno::Exception e ) - { - } - return bVisible; -} -void SAL_CALL -ScVbaCommandBar::setVisible( ::sal_Bool _visible ) throw (uno::RuntimeException) -{ - try - { - uno::Reference< frame::XFrame > xFrame( getCurrentDocument()->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW ); - uno::Reference< beans::XPropertySet > xPropertySet( xFrame, uno::UNO_QUERY_THROW ); - uno::Reference< frame::XLayoutManager > xLayoutManager( xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("LayoutManager") ), uno::UNO_QUERY_THROW ); - if( _visible ) - { - xLayoutManager->createElement( m_sToolBarName ); - xLayoutManager->showElement( m_sToolBarName ); - } - else - { - xLayoutManager->hideElement( m_sToolBarName ); - xLayoutManager->destroyElement( m_sToolBarName ); - } - } - catch( uno::Exception e ) - { - OSL_TRACE( "SetVisible get an exception\n" ); - } -} -void SAL_CALL -ScVbaCommandBar::Delete( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) -{ - if( m_bCustom ) - { - if( m_xUICfgManager->hasSettings( m_sToolBarName ) ) - { - m_xUICfgManager->removeSettings(m_sToolBarName); - // make it permanent - if( !m_bTemporary ) - { - m_xUICfgPers->store(); - } - } - else - { - // toolbar not found - // TODO throw Error - } - uno::Reference< container::XNameContainer > xNameContainer( m_pScVbaCommandBars->GetWindows(), uno::UNO_QUERY_THROW ); - if( xNameContainer->hasByName( m_sToolBarName ) ) - { - xNameContainer->removeByName( m_sToolBarName ); - } - } -} -uno::Any SAL_CALL -ScVbaCommandBar::Controls( const uno::Any& aIndex ) throw (script::BasicErrorException, uno::RuntimeException) -{ - sal_Int32 nIndex; - uno::Reference< XCommandBarControls > xCommandBarControls( new ScVbaCommandBarControls( this, mxContext, uno::Reference< container::XIndexAccess >() ) ); - if( aIndex.hasValue() ) - { - if( aIndex >>= nIndex ) - { - uno::Reference< XCommandBarControl > xCommandBarControl( xCommandBarControls->Item( aIndex, uno::Any() ), uno::UNO_QUERY_THROW ); - return uno::makeAny( xCommandBarControl ); - } - else - throw uno::RuntimeException( rtl::OUString::createFromAscii( "invalid index" ), uno::Reference< uno::XInterface >() ); - } - return uno::makeAny( xCommandBarControls ); -} -rtl::OUString& -ScVbaCommandBar::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaCommandBar") ); - return sImplName; -} -uno::Sequence -ScVbaCommandBar::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.CommandBar" ) ); - } - return aServiceNames; -} diff --git a/sc/source/ui/vba/vbacommandbar.hxx b/sc/source/ui/vba/vbacommandbar.hxx deleted file mode 100644 index 303dc0ada798..000000000000 --- a/sc/source/ui/vba/vbacommandbar.hxx +++ /dev/null @@ -1,105 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * - * $Revision$ - * - * last change: $Author$ $Date$ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ -#ifndef SC_VBA_COMMANDBAR_HXX -#define SC_VBA_COMMANDBAR_HXX - -#include -#include -#include -#include -#include - -#include "vbahelperinterface.hxx" -#include "vbacommandbars.hxx" - -#include -typedef std::map< const rtl::OUString, rtl::OUString > CommandBarNameMap; -typedef std::pair< const rtl::OUString, rtl::OUString > CommandBarNamePair; -const CommandBarNamePair namePair[] = { - CommandBarNamePair( rtl::OUString::createFromAscii("standard"), rtl::OUString::createFromAscii("standardbar") ), - CommandBarNamePair( rtl::OUString::createFromAscii("formatting"), rtl::OUString::createFromAscii("formatobjectbar") ), -}; -static const CommandBarNameMap mCommandBarNameMap( namePair, ( namePair + sizeof(namePair) / sizeof(namePair[0]) ) ); - - -typedef InheritedHelperInterfaceImpl1< ov::XCommandBar > CommandBar_BASE; - -class ScVbaCommandBar : public CommandBar_BASE -{ -private: - rtl::OUString m_sToolBarName; - rtl::OUString m_sMenuModuleName; - rtl::OUString m_sUIName; - sal_Bool m_bTemporary; - sal_Bool m_bIsMenu; - sal_Bool m_bCustom; - sal_Bool m_bCreate; - ScVbaCommandBars* m_pScVbaCommandBars; - css::beans::PropertyValues m_aToolBar; - // hard reference for parent - css::uno::Reference< ov::XHelperInterface > m_xParentHardRef; - css::uno::Reference< css::ui::XUIConfigurationManager > m_xUICfgManager; - css::uno::Reference< css::ui::XUIConfigurationPersistence > m_xUICfgPers; - css::uno::Reference< css::container::XIndexContainer > m_xBarSettings; - void initCommandBar() throw( css::uno::RuntimeException ); -protected: - void getToolBarSettings( rtl::OUString sToolBarName ) throw( css::uno::RuntimeException ); - void getMenuSettings(); - void addCustomBar(); -public: - ScVbaCommandBar( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, sal_Int32 nModuleType ) throw( css::uno::RuntimeException ); - ScVbaCommandBar( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, rtl::OUString sToolBarName, sal_Bool bTemporary, sal_Bool bCreate ) throw( css::uno::RuntimeException ); - - sal_Bool IsMenu() { return m_bIsMenu; }; - css::uno::Reference< css::ui::XUIConfigurationManager > GetUICfgManager() { return m_xUICfgManager; }; - css::uno::Reference< css::ui::XUIConfigurationPersistence > GetUICfgPers() { return m_xUICfgPers; }; - css::uno::Reference< css::container::XIndexContainer > GetBarSettings() { return m_xBarSettings; }; - rtl::OUString GetToolBarName() { return m_sToolBarName; }; - - // Attributes - virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException); - virtual void SAL_CALL setName( const ::rtl::OUString& _name ) throw (css::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException); - virtual void SAL_CALL setVisible( ::sal_Bool _visible ) throw (css::uno::RuntimeException); - - // Methods - virtual void SAL_CALL Delete( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL Controls( const css::uno::Any& aIndex ) throw (css::script::BasicErrorException, css::uno::RuntimeException); - - // XHelperInterface - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); -}; -#endif//SC_VBA_COMMANDBAR_HXX diff --git a/sc/source/ui/vba/vbacommandbarcontrol.cxx b/sc/source/ui/vba/vbacommandbarcontrol.cxx deleted file mode 100644 index 74e38bffb81c..000000000000 --- a/sc/source/ui/vba/vbacommandbarcontrol.cxx +++ /dev/null @@ -1,403 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * - * $Revision$ - * - * last change: $Author$ $Date$ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ -#include "vbacommandbarcontrol.hxx" - -using namespace com::sun::star; -using namespace ooo::vba; - -uno::Any lcl_getPropertyValue( beans::PropertyValues aPropertyValues, rtl::OUString sPropertyName ) -{ - sal_Int32 nCount = aPropertyValues.getLength(); - for( sal_Int32 i = 0; i < nCount; i++ ) - { - if( aPropertyValues[i].Name.equalsIgnoreAsciiCase( sPropertyName ) ) - { - return aPropertyValues[i].Value; - } - } - return uno::Any(); -} - -beans::PropertyValues lcl_repalcePropertyValue( beans::PropertyValues aPropertyValues, rtl::OUString sPropertyName, uno::Any aValue ) -{ - sal_Int32 nCount = aPropertyValues.getLength(); - for( sal_Int32 i = 0; i < nCount; i++ ) - { - if( aPropertyValues[i].Name.equalsIgnoreAsciiCase( sPropertyName ) ) - { - aPropertyValues[i].Value = aValue; - return aPropertyValues; - } - } - return aPropertyValues; -} - -ScVbaCommandBarControl::ScVbaCommandBarControl( const uno::Reference< XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, rtl::OUString sName ) throw (uno::RuntimeException) : CommandBarControl_BASE( xParent, xContext ), m_sName( sName ) -{ - // exsiting CommandBarBarControl - m_xParentHardRef.set( xParent, uno::UNO_QUERY_THROW ); - initObjects(); - if( m_xBarSettings->hasElements() ) - { - ScVbaCommandBarControl* pParentCommandBarControl = m_pCommandBarControls->GetParentCommandBarControl(); - if( pParentCommandBarControl ) - { - beans::PropertyValues aPropertyValues; - pParentCommandBarControl->GetCurrentSettings()->getByIndex( pParentCommandBarControl->GetPosition() ) >>= aPropertyValues; - pParentCommandBarControl->SetPropertyValues( aPropertyValues ); - m_xCurrentSettings.set( lcl_getPropertyValue( pParentCommandBarControl->GetPropertyValues(), rtl::OUString::createFromAscii( "ItemDescriptorContainer" ) ), uno::UNO_QUERY_THROW ); - } - if( !m_xCurrentSettings.is() ) - { - m_xCurrentSettings.set( m_xUICfgManager->getSettings( m_pCommandBarControls->GetParentToolBarName(), sal_True ), uno::UNO_QUERY_THROW ); - } - for( sal_Int32 i = 0; i < m_xCurrentSettings->getCount(); i++ ) - { - beans::PropertyValues aPropertyValuesTemp; - m_xCurrentSettings->getByIndex( i ) >>= aPropertyValuesTemp; - // Label always empty in OOo - rtl::OUString sLabel; - lcl_getPropertyValue( aPropertyValuesTemp, rtl::OUString::createFromAscii( "Label" ) ) >>= sLabel; - if( sLabel.equalsIgnoreAsciiCase( sName ) ) - { - m_nPosition = i; - break; - } - // using CammandURL to find - rtl::OUString sCommandURL; - lcl_getPropertyValue( aPropertyValuesTemp, rtl::OUString::createFromAscii( "CommandURL" ) ) >>= sCommandURL; - sal_Int32 nLastIndex = sCommandURL.lastIndexOf( rtl::OUString::createFromAscii(":") ); - if( ( nLastIndex != -1 ) && ( ( nLastIndex + 1 ) < sCommandURL.getLength() ) ) - { - sCommandURL = sCommandURL.copy( nLastIndex + 1 ); - } - if( sCommandURL.equalsIgnoreAsciiCase( sName ) ) - { - m_nPosition = i; - break; - } - } - if( m_nPosition == -1 ) - throw uno::RuntimeException( rtl::OUString::createFromAscii("The CommandBarControl do not exist"), uno::Reference< uno::XInterface >() ); - } - if( m_bIsMenu ) - { - m_sBarName = rtl::OUString::createFromAscii("private:resource/menubar/menubar"); - } - else - { - m_sBarName = m_pCommandBarControls->GetParentToolBarName(); - } - m_bTemporary = sal_True; -} -ScVbaCommandBarControl::ScVbaCommandBarControl( const uno::Reference< XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, rtl::OUString sName, rtl::OUString sCommand, sal_Int32 nPosition, sal_Bool bTemporary ) throw (uno::RuntimeException) : CommandBarControl_BASE( xParent, xContext ), m_nPosition( nPosition ), m_bTemporary( bTemporary ) -{ - m_xParentHardRef.set( xParent, uno::UNO_QUERY_THROW ); - initObjects(); - if( sName.getLength() > 0 ) - { - m_sName = sName; - } - if( sCommand.getLength() > 0 ) - { - m_sCommand = sCommand; - } - else - { - m_sCommand = rtl::OUString::createFromAscii("vnd.openoffice.org:") + sName; - } - if( m_bIsMenu ) - { - m_sBarName = rtl::OUString::createFromAscii("private:resource/menubar/menubar"); - createNewMenuBarControl(); - } - else - { - m_sBarName = m_pCommandBarControls->GetParentToolBarName(); - createNewToolBarControl(); - } -} - -void -ScVbaCommandBarControl::initObjects() throw (uno::RuntimeException) -{ - m_pCommandBarControls = dynamic_cast< ScVbaCommandBarControls* >( m_xParentHardRef.get() ); - if( !m_pCommandBarControls ) - throw uno::RuntimeException( rtl::OUString::createFromAscii( "Parent needs to be a ScVbaCommandBarControls"), uno::Reference< uno::XInterface >() ); - m_xUICfgManager.set( m_pCommandBarControls->GetUICfgManager(), uno::UNO_QUERY_THROW ); - m_xUICfgPers.set( m_pCommandBarControls->GetUICfgPers(), uno::UNO_QUERY_THROW ); - m_xBarSettings.set( m_pCommandBarControls->GetBarSettings(), uno::UNO_QUERY_THROW ); - m_bIsMenu = m_pCommandBarControls->IsMenu(); - m_sName = rtl::OUString::createFromAscii( "Custom" ); - m_nPosition = -1; -} - -void -ScVbaCommandBarControl::createNewMenuBarControl() -{ - uno::Sequence< beans::PropertyValue > aPropertys(4); - aPropertys[0].Name = rtl::OUString::createFromAscii("CommandURL"); - aPropertys[0].Value <<= m_sCommand; - aPropertys[1].Name = rtl::OUString::createFromAscii("Label"); - aPropertys[1].Value <<= m_sName; - aPropertys[2].Name = rtl::OUString::createFromAscii("Type"); - aPropertys[2].Value <<= m_nType; - aPropertys[3].Name = rtl::OUString::createFromAscii("ItemDescriptorContainer"); - - m_xBarSettings->insertByIndex( m_nPosition, uno::makeAny( aPropertys ) ); - uno::Reference< beans::XPropertySet > xPropertySet( m_xBarSettings, uno::UNO_QUERY_THROW ); - rtl::OUString sUIName; - xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("UIName") ) >>= sUIName; - - uno::Reference< lang::XSingleComponentFactory > xMenuMSF( m_xBarSettings, uno::UNO_QUERY_THROW ); - if( m_pCommandBarControls->GetParentCommandBar() != NULL ) - { - // create a new menu - m_xBarSettings->insertByIndex( m_nPosition, uno::makeAny( aPropertys ) ); - m_xCurrentSettings.set( m_xBarSettings, uno::UNO_QUERY_THROW ); - } - else if( m_pCommandBarControls->GetParentCommandBarControl() != NULL ) - { - // create a new menu entry - // change the parent MenuItem to a PopupMenu - ScVbaCommandBarControl* pPc = m_pCommandBarControls->GetParentCommandBarControl(); - beans::PropertyValues aPropertyValues; - pPc->GetCurrentSettings()->getByIndex( pPc->GetPosition() ) >>= aPropertyValues; - pPc->SetPropertyValues( aPropertyValues ); - - // has the property already been set? - if( lcl_getPropertyValue( pPc->GetPropertyValues(), rtl::OUString::createFromAscii("ItemDescriptorContainer") ).hasValue() ) - { - lcl_repalcePropertyValue( pPc->GetPropertyValues(), rtl::OUString::createFromAscii("ItemDescriptorContainer"), uno::makeAny( xMenuMSF->createInstanceWithContext( mxContext ) ) ); - pPc->GetCurrentSettings()->replaceByIndex( pPc->GetPosition(), uno::makeAny( pPc->GetPropertyValues() ) ); - } - m_xCurrentSettings.set( lcl_getPropertyValue( pPc->GetPropertyValues(), rtl::OUString::createFromAscii("ItemDescriptorContainer") ), uno::UNO_QUERY_THROW ); - m_xCurrentSettings->insertByIndex( m_nPosition, uno::makeAny( m_aPropertyValues ) ); - } - if( m_xUICfgManager->hasSettings( m_sBarName ) ) - { - m_xUICfgManager->replaceSettings( m_sBarName, uno::Reference< container::XIndexAccess > (m_xBarSettings, uno::UNO_QUERY_THROW ) ); - } - else - { - m_xUICfgManager->insertSettings( m_sBarName, uno::Reference< container::XIndexAccess > (m_xBarSettings, uno::UNO_QUERY_THROW ) ); - } - if( !m_bTemporary ) - { - m_xUICfgPers->store(); - } -} - -void -ScVbaCommandBarControl::createNewToolBarControl() -{ - uno::Sequence< beans::PropertyValue > aPropertys(4); - aPropertys[0].Name = rtl::OUString::createFromAscii("CommandURL"); - aPropertys[0].Value <<= m_sCommand; - aPropertys[1].Name = rtl::OUString::createFromAscii("Label"); - aPropertys[1].Value <<= m_sName; - aPropertys[2].Name = rtl::OUString::createFromAscii("Type"); - aPropertys[2].Value <<= m_nType; - aPropertys[3].Name = rtl::OUString::createFromAscii("IsVisible"); - aPropertys[3].Value <<= sal_True; - - m_xBarSettings->insertByIndex( m_nPosition, uno::makeAny( aPropertys ) ); - uno::Reference< beans::XPropertySet > xPropertySet( m_xBarSettings, uno::UNO_QUERY_THROW ); - rtl::OUString sUIName; - xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("UIName") ) >>= sUIName; - - m_xCurrentSettings.set( m_xBarSettings, uno::UNO_QUERY_THROW ); - if( m_xUICfgManager->hasSettings( m_sBarName ) ) - { - m_xUICfgManager->replaceSettings( m_sBarName, uno::Reference< container::XIndexAccess > (m_xBarSettings, uno::UNO_QUERY_THROW ) ); - } - else - { - m_xUICfgManager->insertSettings( m_sBarName, uno::Reference< container::XIndexAccess > (m_xBarSettings, uno::UNO_QUERY_THROW ) ); - } - if( !m_bTemporary ) - { - m_xUICfgPers->store(); - } -} - -::rtl::OUString SAL_CALL -ScVbaCommandBarControl::getCaption() throw ( uno::RuntimeException ) -{ - // "Label" always empty - rtl::OUString sCaption; - beans::PropertyValues aPropertyValues; - if( m_xCurrentSettings.is() ) - { - m_xCurrentSettings->getByIndex( m_nPosition ) >>= aPropertyValues; - lcl_getPropertyValue( aPropertyValues, rtl::OUString::createFromAscii("Label") ) >>= sCaption; - } - else if( m_xBarSettings.is() ) - { - m_xBarSettings->getByIndex( m_nPosition ) >>= aPropertyValues; - lcl_getPropertyValue( aPropertyValues, rtl::OUString::createFromAscii("Label") ) >>= sCaption; - } - return sCaption; -} -void SAL_CALL -ScVbaCommandBarControl::setCaption( const ::rtl::OUString& _caption ) throw (uno::RuntimeException) -{ - if( m_xCurrentSettings.is() ) - { - beans::PropertyValues aPropertyValues; - m_xCurrentSettings->getByIndex( m_nPosition ) >>= aPropertyValues; - beans::PropertyValues aNewPropertyValues; - aNewPropertyValues = lcl_repalcePropertyValue( aPropertyValues, rtl::OUString::createFromAscii("Label"), uno::makeAny( _caption ) ); - m_xCurrentSettings->replaceByIndex( m_nPosition, uno::makeAny( aNewPropertyValues ) ); - if( m_xUICfgManager->hasSettings( m_sBarName ) ) - { - m_xUICfgManager->replaceSettings( m_sBarName, uno::Reference< container::XIndexAccess > (m_xBarSettings, uno::UNO_QUERY_THROW ) ); - } - else - { - m_xUICfgManager->insertSettings( m_sBarName, uno::Reference< container::XIndexAccess > (m_xBarSettings, uno::UNO_QUERY_THROW ) ); - } - // make it permanent - if( !m_bTemporary ) - { - m_xUICfgPers->store(); - } - } -} -::rtl::OUString SAL_CALL -ScVbaCommandBarControl::getOnAction() throw (uno::RuntimeException) -{ - if( m_xCurrentSettings.is() ) - { - beans::PropertyValues aPropertyValues; - m_xCurrentSettings->getByIndex( m_nPosition ) >>= aPropertyValues; - rtl::OUString sCommandURL; - lcl_getPropertyValue( aPropertyValues, rtl::OUString::createFromAscii( "CommandURL" ) ) >>= sCommandURL; - return sCommandURL; - } - return ::rtl::OUString(); -} -void SAL_CALL -ScVbaCommandBarControl::setOnAction( const ::rtl::OUString& _onaction ) throw (uno::RuntimeException) -{ - if( m_xCurrentSettings.is() ) - { - beans::PropertyValues aPropertyValues; - m_xCurrentSettings->getByIndex( m_nPosition ) >>= aPropertyValues; - beans::PropertyValues aNewPropertyValues; - aNewPropertyValues = lcl_repalcePropertyValue( aPropertyValues, rtl::OUString::createFromAscii("CommandURL"), uno::makeAny( _onaction ) ); - m_xCurrentSettings->replaceByIndex( m_nPosition, uno::makeAny( aNewPropertyValues ) ); - if( m_xUICfgManager->hasSettings( m_sBarName ) ) - { - m_xUICfgManager->replaceSettings( m_sBarName, uno::Reference< container::XIndexAccess > (m_xBarSettings, uno::UNO_QUERY_THROW ) ); - } - else - { - m_xUICfgManager->insertSettings( m_sBarName, uno::Reference< container::XIndexAccess > (m_xBarSettings, uno::UNO_QUERY_THROW ) ); - } - // make it permanent - if( !m_bTemporary ) - { - m_xUICfgPers->store(); - } - } -} -::sal_Bool SAL_CALL -ScVbaCommandBarControl::getVisible() throw (uno::RuntimeException) -{ - // not possible in UNO? - return sal_True; -} -void SAL_CALL -ScVbaCommandBarControl::setVisible( ::sal_Bool /*_visible*/ ) throw (uno::RuntimeException) -{ - // "IsVisilbe" -} -void SAL_CALL -ScVbaCommandBarControl::Delete( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) -{ - if( m_xCurrentSettings.is() ) - { - m_xCurrentSettings->removeByIndex( m_nPosition ); - - if( m_xUICfgManager->hasSettings( m_sBarName ) ) - { - m_xUICfgManager->replaceSettings( m_sBarName, uno::Reference< container::XIndexAccess > (m_xBarSettings, uno::UNO_QUERY_THROW ) ); - } - else - { - m_xUICfgManager->insertSettings( m_sBarName, uno::Reference< container::XIndexAccess > (m_xBarSettings, uno::UNO_QUERY_THROW ) ); - } - // make it permanent - if( !m_bTemporary ) - { - m_xUICfgPers->store(); - } - } -} -uno::Any SAL_CALL -ScVbaCommandBarControl::Controls( const uno::Any& aIndex ) throw (script::BasicErrorException, uno::RuntimeException) -{ - sal_Int32 nIndex; - uno::Reference< XCommandBarControls > xCommandBarControls( new ScVbaCommandBarControls( this, mxContext, uno::Reference< container::XIndexAccess >() ) ); - if( aIndex.hasValue() ) - { - if( aIndex >>= nIndex ) - { - uno::Reference< XCommandBarControl > xCommandBarControl( xCommandBarControls->Item( aIndex, uno::Any() ), uno::UNO_QUERY_THROW ); - return uno::makeAny( xCommandBarControl ); - } - else - throw uno::RuntimeException( rtl::OUString::createFromAscii( "invalid index" ), uno::Reference< uno::XInterface >() ); - } - return uno::makeAny( xCommandBarControls ); -} -rtl::OUString& -ScVbaCommandBarControl::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaCommandBarControl") ); - return sImplName; -} -uno::Sequence -ScVbaCommandBarControl::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.CommandBarControl" ) ); - } - return aServiceNames; -} diff --git a/sc/source/ui/vba/vbacommandbarcontrol.hxx b/sc/source/ui/vba/vbacommandbarcontrol.hxx deleted file mode 100644 index a77c4b64b56f..000000000000 --- a/sc/source/ui/vba/vbacommandbarcontrol.hxx +++ /dev/null @@ -1,90 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * - * $Revision$ - * - * last change: $Author$ $Date$ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ -#ifndef SC_VBA_COMMANDBARCONTROL_HXX -#define SC_VBA_COMMANDBARCONTROL_HXX - -#include - -#include "vbahelperinterface.hxx" -#include "vbacommandbarcontrols.hxx" - -typedef InheritedHelperInterfaceImpl1< ov::XCommandBarControl > CommandBarControl_BASE; - -class ScVbaCommandBarControl : public CommandBarControl_BASE -{ -private: - rtl::OUString m_sName; - rtl::OUString m_sBarName; - rtl::OUString m_sCommand; - sal_Int32 m_nType; - sal_Int32 m_nPosition; - sal_Bool m_bTemporary; - sal_Bool m_bIsMenu; - ScVbaCommandBarControls* m_pCommandBarControls; - css::uno::Reference< ov::XHelperInterface > m_xParentHardRef; - css::uno::Reference< css::ui::XUIConfigurationManager > m_xUICfgManager; - css::uno::Reference< css::ui::XUIConfigurationPersistence > m_xUICfgPers; - css::uno::Reference< css::container::XIndexContainer > m_xBarSettings; - css::uno::Reference< css::container::XIndexContainer > m_xCurrentSettings; - css::beans::PropertyValues m_aPropertyValues; - - void initObjects() throw (css::uno::RuntimeException); - void createNewMenuBarControl(); - void createNewToolBarControl(); -public: - ScVbaCommandBarControl( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, rtl::OUString sName ) throw (css::uno::RuntimeException); - ScVbaCommandBarControl( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, rtl::OUString sName, rtl::OUString sCommand, sal_Int32 nPosition, sal_Bool bTemporary ) throw (css::uno::RuntimeException); - sal_Int32 GetPosition() { return m_nPosition; }; - css::uno::Reference< css::container::XIndexContainer > GetCurrentSettings() { return m_xCurrentSettings; }; - css::beans::PropertyValues GetPropertyValues() { return m_aPropertyValues; }; - void SetPropertyValues( css::beans::PropertyValues aPropertyValues ) { m_aPropertyValues = aPropertyValues; }; - - // Attributes - virtual ::rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException); - virtual void SAL_CALL setCaption( const ::rtl::OUString& _caption ) throw (css::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getOnAction() throw (css::uno::RuntimeException); - virtual void SAL_CALL setOnAction( const ::rtl::OUString& _onaction ) throw (css::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException); - virtual void SAL_CALL setVisible( ::sal_Bool _visible ) throw (css::uno::RuntimeException); - - // Methods - virtual void SAL_CALL Delete( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL Controls( const css::uno::Any& aIndex ) throw (css::script::BasicErrorException, css::uno::RuntimeException); - - // XHelperInterface - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); -}; -#endif//SC_VBA_COMMANDBARCONTROL_HXX diff --git a/sc/source/ui/vba/vbacommandbarcontrols.cxx b/sc/source/ui/vba/vbacommandbarcontrols.cxx deleted file mode 100644 index f40636369d95..000000000000 --- a/sc/source/ui/vba/vbacommandbarcontrols.cxx +++ /dev/null @@ -1,246 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * - * $Revision$ - * - * last change: $Author$ $Date$ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ -#include "vbacommandbarcontrols.hxx" -#include "vbacommandbarcontrol.hxx" - -using namespace com::sun::star; -using namespace ooo::vba; - -typedef ::cppu::WeakImplHelper1< container::XEnumeration > CommandBarControlEnumeration_BASE; -class CommandBarControlEnumeration : public CommandBarControlEnumeration_BASE -{ - //uno::Reference< uno::XComponentContext > m_xContext; - ScVbaCommandBarControls* m_pCommandBarControls; - sal_Int32 m_nCurrentPosition; -public: - CommandBarControlEnumeration( ScVbaCommandBarControls* pCommandBarControls ) : m_pCommandBarControls( pCommandBarControls ), m_nCurrentPosition( 0 ) {} - virtual sal_Bool SAL_CALL hasMoreElements() throw ( uno::RuntimeException ) - { - if( m_nCurrentPosition < m_pCommandBarControls->getCount() ) - return sal_True; - return sal_False; - } - virtual uno::Any SAL_CALL nextElement() throw ( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException ) - { - if( hasMoreElements() ) - { - rtl::OUString sName = m_pCommandBarControls->GetControlNameByIndex( m_nCurrentPosition ); - m_nCurrentPosition = m_nCurrentPosition + 1; - if( sName.getLength() > 0 ) - return m_pCommandBarControls->createCollectionObject( uno::makeAny( sName ) ); - else - return nextElement(); - } - else - throw container::NoSuchElementException(); - } -}; - -ScVbaCommandBarControls::ScVbaCommandBarControls( const uno::Reference< XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, const uno::Reference< container::XIndexAccess> xIndexAccess ) throw (uno::RuntimeException) : CommandBarControls_BASE( xParent, xContext, xIndexAccess ) -{ - m_bIsMenu = sal_False; - m_bHasElements = sal_False; - m_xParentHardRef.set( xParent, uno::UNO_QUERY_THROW ); - m_pCommandBar = dynamic_cast< ScVbaCommandBar* >( m_xParentHardRef.get() ); - m_pCommandBarControl = dynamic_cast< ScVbaCommandBarControl* >( m_xParentHardRef.get() ); - if( m_pCommandBar ) - { - m_xUICfgManager.set( m_pCommandBar->GetUICfgManager(), uno::UNO_QUERY_THROW ); - m_xUICfgPers.set( m_pCommandBar->GetUICfgPers(), uno::UNO_QUERY_THROW ); - m_xBarSettings.set( m_pCommandBar->GetBarSettings(), uno::UNO_QUERY_THROW ); - m_bIsMenu = m_pCommandBar->IsMenu(); - if( m_xBarSettings->hasElements() ) - { - m_bHasElements = sal_True; - } - } - else if( m_pCommandBarControl ) - { - } - else - { - throw uno::RuntimeException( rtl::OUString::createFromAscii("Parent needs to be a ScVbaCommandBar or a ScVbaCommandBarControl"), uno::Reference< uno::XInterface >() ); - } -} -rtl::OUString -ScVbaCommandBarControls::GetControlNameByIndex( const sal_Int32 nIndex ) throw ( uno::RuntimeException ) -{ - sal_Int32 nCount = 0; - if( m_bHasElements ) - { - sal_Int32 nBarSettingsCount = m_xBarSettings->getCount(); - for( sal_Int32 i = 0; i < nBarSettingsCount; i++ ) - { - beans::PropertyValues aMenuValues; - m_xBarSettings->getByIndex( i ) >>= aMenuValues; - for( sal_Int32 j = 0; j < aMenuValues.getLength(); j++ ) - { - if( aMenuValues[j].Name.equalsIgnoreAsciiCase( rtl::OUString::createFromAscii( "CommandURL" ) ) ) - { - nCount++; - if( nIndex == nCount ) - { - rtl::OUString sCommandURL; - aMenuValues[j].Value >>= sCommandURL; - sal_Int32 nLastIndex = sCommandURL.lastIndexOf( rtl::OUString::createFromAscii(":") ); - if( ( nLastIndex != -1 ) && ( ( nLastIndex +1 ) < sCommandURL.getLength() ) ) - { - sCommandURL = sCommandURL.copy( nLastIndex + 1 ); - return sCommandURL; - } - } - } - } - } - } - else - throw uno::RuntimeException( rtl::OUString::createFromAscii( "Out of bound" ), uno::Reference< uno::XInterface >() ); - return rtl::OUString(); -} - -// Attributes -sal_Int32 SAL_CALL -ScVbaCommandBarControls::getCount() throw (uno::RuntimeException) -{ - sal_Int32 nCount = 0; - if( m_bHasElements ) - { - sal_Int32 nBarSettingsCount = m_xBarSettings->getCount(); - for( sal_Int32 i = 0; i < nBarSettingsCount; i++ ) - { - beans::PropertyValues aMenuValues; - m_xBarSettings->getByIndex( i ) >>= aMenuValues; - for( sal_Int32 j = 0; j < aMenuValues.getLength(); j++ ) - { - if( aMenuValues[j].Name.equalsIgnoreAsciiCase( rtl::OUString::createFromAscii( "CommandURL" ) ) ) - { - nCount++; - } - } - } - } - return nCount; -} -// XEnumerationAccess -uno::Type SAL_CALL -ScVbaCommandBarControls::getElementType() throw ( uno::RuntimeException ) -{ - return XCommandBarControls::static_type( 0 ); -} -uno::Reference< container::XEnumeration > -ScVbaCommandBarControls::createEnumeration() throw ( uno::RuntimeException ) -{ - return uno::Reference< container::XEnumeration >( new CommandBarControlEnumeration( this ) ); -} -uno::Any -ScVbaCommandBarControls::createCollectionObject( const uno::Any& aSource ) -{ - // only surport the aSource as a name string, because this class is a API wrapper - rtl::OUString sName; - if( aSource >>= sName ) - return uno::makeAny( uno::Reference< XCommandBarControl > ( new ScVbaCommandBarControl( this, mxContext, sName ) ) ); - return uno::Any(); -} - -// Methods -uno::Any SAL_CALL -ScVbaCommandBarControls::Item( const uno::Any& aIndex, const uno::Any& /*aIndex*/ ) throw (uno::RuntimeException) -{ - if( aIndex.getValueTypeClass() == uno::TypeClass_STRING ) - { - return createCollectionObject( aIndex ); - } - sal_Int32 nIndex = 0; - if( aIndex >>= nIndex ) - { - return createCollectionObject( uno::makeAny( GetControlNameByIndex( nIndex ) ) ); - } - - return uno::Any(); -} -uno::Reference< XCommandBarControl > SAL_CALL -ScVbaCommandBarControls::Add( const uno::Any& Type, const uno::Any& Id, const uno::Any& /*Parameter*/, const uno::Any& Before, const uno::Any& Temporary ) throw (script::BasicErrorException, uno::RuntimeException) -{ - // Parameter is not supported - // the following name needs to be individually created; - rtl::OUString sCaption( rtl::OUString::createFromAscii("custom Control") ); - rtl::OUString sCommand( rtl::OUString::createFromAscii("macro:///Standard.Module1.Test()") ); - sal_Int32 nType =0; - sal_Int32 nPosition = 0; - sal_Int32 nId; - sal_Bool bTemporary = sal_True; - - if( Type.hasValue() ) - if( Type >>= nType ) - { - // evalute the type of the new control - } - if( Id.hasValue() ) - if( Id >>= nId ) - { - // evalute the action of the new control - } - if( Before.hasValue() ) - if( Before >>= nPosition ) - { - // evalute the position of the new Control - } - if( Temporary.hasValue() ) - if( Temporary >>= bTemporary ) - { - // evalute the temporary of the new Control - } - return uno::Reference< XCommandBarControl > ( new ScVbaCommandBarControl( this, mxContext, sCaption, sCommand, nPosition, bTemporary ) ); -} - -// XHelperInterface -rtl::OUString& -ScVbaCommandBarControls::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaCommandBarControls") ); - return sImplName; -} -uno::Sequence -ScVbaCommandBarControls::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.CommandBarControls" ) ); - } - return aServiceNames; -} - diff --git a/sc/source/ui/vba/vbacommandbarcontrols.hxx b/sc/source/ui/vba/vbacommandbarcontrols.hxx deleted file mode 100644 index 9243d55697d7..000000000000 --- a/sc/source/ui/vba/vbacommandbarcontrols.hxx +++ /dev/null @@ -1,90 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * - * $Revision$ - * - * last change: $Author$ $Date$ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ -#ifndef SC_VBA_COMMANDBARCONTROLS_HXX -#define SC_VBA_COMMANDBARCONTROLS_HXX - -#include - -#include "vbahelperinterface.hxx" -#include "vbacommandbar.hxx" -#include "vbacollectionimpl.hxx" - -class ScVbaCommandBarControl; - -typedef CollTestImplHelper< ov::XCommandBarControls > CommandBarControls_BASE; - -class ScVbaCommandBarControls : public CommandBarControls_BASE -{ -private: - sal_Bool m_bIsMenu; - sal_Bool m_bHasElements; - ScVbaCommandBar* m_pCommandBar; - ScVbaCommandBarControl* m_pCommandBarControl; - css::uno::Reference< ov::XHelperInterface > m_xParentHardRef; - css::uno::Reference< css::ui::XUIConfigurationManager > m_xUICfgManager; - css::uno::Reference< css::ui::XUIConfigurationPersistence > m_xUICfgPers; - css::uno::Reference< css::container::XIndexContainer > m_xBarSettings; - -public: - ScVbaCommandBarControls( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, const css::uno::Reference< css::container::XIndexAccess > xIndexAccess ) throw( css::uno::RuntimeException ); - css::uno::Reference< css::ui::XUIConfigurationManager > GetUICfgManager() { return m_xUICfgManager; }; - css::uno::Reference< css::ui::XUIConfigurationPersistence > GetUICfgPers() { return m_xUICfgPers; }; - css::uno::Reference< css::container::XIndexContainer > GetBarSettings() { return m_xBarSettings; }; - sal_Bool IsMenu() { return m_bIsMenu; }; - ScVbaCommandBar* GetParentCommandBar() { return m_pCommandBar; }; - ScVbaCommandBarControl* GetParentCommandBarControl() { return m_pCommandBarControl; }; - rtl::OUString GetParentToolBarName() - { - if( m_pCommandBar ) return m_pCommandBar->GetToolBarName(); - else return rtl::OUString(); - } - rtl::OUString GetControlNameByIndex( const sal_Int32 nIndex ) throw ( css::uno::RuntimeException ); - - // Attributes - virtual ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException); - // XEnumerationAccess - virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); - virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); - virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); - - // Methods - virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index, const css::uno::Any& /*Index2*/ ) throw (css::uno::RuntimeException); - virtual css::uno::Reference< ov::XCommandBarControl > SAL_CALL Add( const css::uno::Any& Type, const css::uno::Any& Id, const css::uno::Any& Parameter, const css::uno::Any& Before, const css::uno::Any& Temporary ) throw (css::script::BasicErrorException, css::uno::RuntimeException); - // XHelperInterface - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); -}; - -#endif//SC_VBA_COMMANDBARCONTROLS_HXX diff --git a/sc/source/ui/vba/vbacommandbars.cxx b/sc/source/ui/vba/vbacommandbars.cxx deleted file mode 100644 index 101b62902460..000000000000 --- a/sc/source/ui/vba/vbacommandbars.cxx +++ /dev/null @@ -1,247 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * - * $Revision$ - * - * last change: $Author$ $Date$ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ -#include -#include -#include - -#include "vbacommandbars.hxx" -#include "vbacommandbar.hxx" - -using namespace com::sun::star; -using namespace ooo::vba; - -typedef ::cppu::WeakImplHelper1< container::XEnumeration > CommandBarEnumeration_BASE; - -static rtl::OUString sSpreadsheetDocumentUrl( rtl::OUString::createFromAscii( "com.sun.star.sheet.SpreadsheetDocument" ) ); -static rtl::OUString sTextDocumentUrl( rtl::OUString::createFromAscii( "com.sun.star.text.TextDocument" ) ); -static rtl::OUString sWindowStateConfUrl( rtl::OUString::createFromAscii( "com.sun.star.ui.WindowStateConfiguration" ) ); - -class CommandBarEnumeration : public CommandBarEnumeration_BASE -{ - uno::Reference< uno::XComponentContext > m_xContext; - uno::Reference< XCommandBars > m_xCommandBars; - uno::Sequence< rtl::OUString > m_sNames; - sal_Int32 m_nCurrentPosition; -public: - CommandBarEnumeration( const uno::Reference< uno::XComponentContext > xContext, const uno::Reference< XCommandBars > xCommandBars, const uno::Sequence< rtl::OUString > sNames ) : m_xContext( xContext ), m_xCommandBars( xCommandBars ), m_sNames( sNames ), m_nCurrentPosition( 0 ) - { - } - virtual sal_Bool SAL_CALL hasMoreElements() throw ( uno::RuntimeException ) - { - if( m_nCurrentPosition < m_sNames.getLength() ) - return sal_True; - return sal_False; - } - virtual uno::Any SAL_CALL nextElement() throw ( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException ) - { - if( hasMoreElements() ) - { - rtl::OUString sName( m_sNames[ m_nCurrentPosition ] ); - m_nCurrentPosition = m_nCurrentPosition + 1; - if( sName.indexOf( rtl::OUString::createFromAscii("private:resource/toolbar/") ) != -1 ) - { - sal_Int32 nLastIndex = sName.lastIndexOf( rtl::OUString::createFromAscii( "/" ) ); - if( ( nLastIndex != -1 ) && ( ( nLastIndex + 1 ) < sName.getLength() ) ) - { - sName = sName.copy( nLastIndex + 1); - if( sName.getLength() > 0 ) - { - uno::Reference< XHelperInterface > xHelperInterface( m_xCommandBars, uno::UNO_QUERY_THROW ); - uno::Reference< XCommandBar > xCommandBar( new ScVbaCommandBar( xHelperInterface, m_xContext, sName, sal_True, sal_False ) ); - if( xCommandBar.is() ) - return uno::makeAny( xCommandBar ); - else - return nextElement(); - } - else - return nextElement(); - } - } - else - return nextElement(); - } - else - throw container::NoSuchElementException(); - return uno::Any(); - } -}; - - -ScVbaCommandBars::ScVbaCommandBars( const uno::Reference< XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, const uno::Reference< container::XIndexAccess > xIndexAccess ) : CommandBars_BASE( xParent, xContext, xIndexAccess ) -{ - retrieveObjects(); -} -void -ScVbaCommandBars::retrieveObjects() throw ( uno::RuntimeException ) -{ - uno::Reference< lang::XServiceInfo > xServiceInfo( getCurrentDocument(), uno::UNO_QUERY_THROW ); - if( xServiceInfo->supportsService( sSpreadsheetDocumentUrl ) ) - { - m_sModuleName = sSpreadsheetDocumentUrl; - } - else if( xServiceInfo->supportsService( sTextDocumentUrl ) ) - { - m_sModuleName = sTextDocumentUrl; - } - else - throw uno::RuntimeException( rtl::OUString::createFromAscii( "Unsupported Document" ), uno::Reference< uno::XInterface >() ); - - uno::Reference < lang::XMultiServiceFactory > xMSF( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); - uno::Reference < container::XNameAccess > xNameAccess( xMSF->createInstance( sWindowStateConfUrl ), uno::UNO_QUERY_THROW ); - m_xNameAccess.set( xNameAccess->getByName( m_sModuleName ), uno::UNO_QUERY_THROW ); -} - -// XEnumerationAccess -uno::Type SAL_CALL -ScVbaCommandBars::getElementType() throw ( uno::RuntimeException ) -{ - return XCommandBars::static_type( 0 ); -} -uno::Reference< container::XEnumeration > -ScVbaCommandBars::createEnumeration() throw ( uno::RuntimeException ) -{ - return uno::Reference< container::XEnumeration >( new CommandBarEnumeration( mxContext, this, m_xNameAccess->getElementNames() ) ); -} - -uno::Any -ScVbaCommandBars::createCollectionObject( const uno::Any& aSource ) -{ - // aSource should be a name at this time, because of the class is API wrapper. - rtl::OUString sToolBarName; - if( aSource >>= sToolBarName ) - { - sToolBarName = sToolBarName.toAsciiLowerCase(); - if( sToolBarName.equalsIgnoreAsciiCase( rtl::OUString::createFromAscii("Worksheet Menu Bar") ) ) - { - return uno::makeAny( uno::Reference< XCommandBar > ( new ScVbaCommandBar( this, mxContext, 0 ) ) ); - } - else if( sToolBarName.equalsIgnoreAsciiCase( rtl::OUString::createFromAscii("Menu Bar") ) ) - { - return uno::makeAny( uno::Reference< XCommandBar > ( new ScVbaCommandBar( this, mxContext, 1 ) ) ); - } - else if( checkToolBarExist( sToolBarName ) ) - { - return uno::makeAny( uno::Reference< XCommandBar > (new ScVbaCommandBar( this, mxContext, sToolBarName, sal_True, sal_False ) ) ); - } - } - return uno::Any(); -} - -// XCommandBars -uno::Reference< XCommandBar > SAL_CALL -ScVbaCommandBars::Add( const css::uno::Any& Name, const css::uno::Any& /*Position*/, const css::uno::Any& /*MenuBar*/, const css::uno::Any& Temporary ) throw (css::script::BasicErrorException, css::uno::RuntimeException) -{ - // Position - MsoBar MenuBar - sal_Bool - // Currently only the Name is supported. - rtl::OUString sName; - if( !( Name >>= sName ) ) - { - sName = rtl::OUString::createFromAscii("Custom1"); - } - sal_Bool bTemporary = false; - if( !( Temporary >>= bTemporary ) ) - { - bTemporary = sal_True; - } - return uno::Reference< XCommandBar >( new ScVbaCommandBar( this, mxContext, sName.toAsciiLowerCase(), bTemporary, sal_True ) ); -} -sal_Int32 SAL_CALL -ScVbaCommandBars::getCount() throw(css::uno::RuntimeException) -{ - // Filter out all toolbars from the window collection - sal_Int32 nCount = 0; - uno::Sequence< ::rtl::OUString > allNames = m_xNameAccess->getElementNames(); - for( sal_Int32 i = 0; i < allNames.getLength(); i++ ) - { - if(allNames[i].indexOf( rtl::OUString::createFromAscii("private:resource/toolbar/") ) != -1 ) - { - nCount++; - } - } - return nCount; -} - -// ScVbaCollectionBaseImpl -uno::Any SAL_CALL -ScVbaCommandBars::Item( const uno::Any& aIndex, const uno::Any& /*aIndex2*/ ) throw( uno::RuntimeException ) -{ - if( aIndex.getValueTypeClass() == uno::TypeClass_STRING ) - { - return createCollectionObject( aIndex ); - } - return uno::Any(); -} - -sal_Bool -ScVbaCommandBars::checkToolBarExist( rtl::OUString sToolBarName ) -{ - CommandBarNameMap::const_iterator iter = mCommandBarNameMap.find( sToolBarName.toAsciiLowerCase() ); - if( iter != mCommandBarNameMap.end() ) - { - return sal_True; - } - uno::Sequence< ::rtl::OUString > allNames = m_xNameAccess->getElementNames(); - for( sal_Int32 i = 0; i < allNames.getLength(); i++ ) - { - if(allNames[i].indexOf( rtl::OUString::createFromAscii("private:resource/toolbar/") ) != -1 ) - { - if( allNames[i].indexOf( sToolBarName ) != -1 ) - { - return sal_True; - } - } - } - return sal_False; -} - -// XHelperInterface -rtl::OUString& -ScVbaCommandBars::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaCommandBars") ); - return sImplName; -} -uno::Sequence -ScVbaCommandBars::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.CommandBars" ) ); - } - return aServiceNames; -} - diff --git a/sc/source/ui/vba/vbacommandbars.hxx b/sc/source/ui/vba/vbacommandbars.hxx deleted file mode 100644 index b9de44ee79d6..000000000000 --- a/sc/source/ui/vba/vbacommandbars.hxx +++ /dev/null @@ -1,79 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * - * $Revision$ - * - * last change: $Author$ $Date$ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ -#ifndef SC_VBA_COMMANDBARS_HXX -#define SC_VBA_COMMANDBARS_HXX - -#include -#include -#include - -#include - -#include "vbahelperinterface.hxx" -#include "vbacollectionimpl.hxx" - -typedef CollTestImplHelper< ov::XCommandBars > CommandBars_BASE; - -class ScVbaCommandBars : public CommandBars_BASE -{ -private: - css::uno::Reference< css::container::XNameAccess > m_xNameAccess; - rtl::OUString m_sModuleName; - void retrieveObjects() throw( css::uno::RuntimeException ); -public: - ScVbaCommandBars( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, const css::uno::Reference< css::container::XIndexAccess > xIndexAccess ); - - sal_Bool checkToolBarExist( rtl::OUString sToolBarName ); - rtl::OUString GetModuleName(){ return m_sModuleName; }; - css::uno::Reference< css::container::XNameAccess > GetWindows() - { - retrieveObjects(); - return m_xNameAccess; - }; - // XCommandBars - virtual css::uno::Reference< ov::XCommandBar > SAL_CALL Add( const css::uno::Any& Name, const css::uno::Any& Position, const css::uno::Any& MenuBar, const css::uno::Any& Temporary ) throw (css::script::BasicErrorException, css::uno::RuntimeException); - // XEnumerationAccess - virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); - virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); - virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); - - virtual sal_Int32 SAL_CALL getCount() throw(css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL Item( const css::uno::Any& aIndex, const css::uno::Any& /*aIndex2*/ ) throw( css::uno::RuntimeException); - // XHelperInterface - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); -}; - -#endif//SC_VBA_COMMANDBARS_HXX diff --git a/sc/source/ui/vba/vbacontrol.hxx b/sc/source/ui/vba/vbacontrol.hxx deleted file mode 100644 index 02f340ac05ee..000000000000 --- a/sc/source/ui/vba/vbacontrol.hxx +++ /dev/null @@ -1,111 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbacontrol.hxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef SC_VBA_CONTROL_HXX -#define SC_VBA_CONTROL_HXX - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "vbahelper.hxx" -#include "vbahelperinterface.hxx" - -//typedef ::cppu::WeakImplHelper1< ov::msforms::XControl > ControlImpl_BASE; -typedef InheritedHelperInterfaceImpl1< ov::msforms::XControl > ControlImpl_BASE; - -class ScVbaControl : public ControlImpl_BASE -{ -private: - com::sun::star::uno::Reference< com::sun::star::lang::XEventListener > m_xEventListener; -protected: - std::auto_ptr< ov::AbstractGeometryAttributes > mpGeometryHelper; - css::uno::Reference< css::beans::XPropertySet > m_xProps; - css::uno::Reference< css::uno::XInterface > m_xControl; - css::uno::Reference< css::frame::XModel > m_xModel; - - virtual css::uno::Reference< css::awt::XWindowPeer > getWindowPeer() throw (css::uno::RuntimeException); -public: - ScVbaControl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, - const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pHelper ); - virtual ~ScVbaControl(); - // This class will own the helper, so make sure it is allocated from - // the heap - void setGeometryHelper( ov::AbstractGeometryAttributes* pHelper ); - // XControl - virtual sal_Bool SAL_CALL getEnabled() throw (css::uno::RuntimeException); - virtual void SAL_CALL setEnabled( sal_Bool _enabled ) throw (css::uno::RuntimeException); - virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException); - virtual void SAL_CALL setVisible( sal_Bool _visible ) throw (css::uno::RuntimeException); - virtual double SAL_CALL getHeight() throw (css::uno::RuntimeException); - virtual void SAL_CALL setHeight( double _height ) throw (css::uno::RuntimeException); - virtual double SAL_CALL getWidth() throw (css::uno::RuntimeException); - virtual void SAL_CALL setWidth( double _width ) throw (css::uno::RuntimeException); - virtual double SAL_CALL getLeft() throw (css::uno::RuntimeException); - virtual void SAL_CALL setLeft( double _left ) throw (css::uno::RuntimeException); - virtual double SAL_CALL getTop() throw (css::uno::RuntimeException); - virtual void SAL_CALL setTop( double _top ) throw (css::uno::RuntimeException); - virtual void SAL_CALL SetFocus( ) throw (css::uno::RuntimeException); - - virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getObject() throw (css::uno::RuntimeException); - virtual rtl::OUString SAL_CALL getControlSource() throw (css::uno::RuntimeException); - virtual void SAL_CALL setControlSource( const rtl::OUString& _controlsource ) throw (css::uno::RuntimeException); - virtual rtl::OUString SAL_CALL getRowSource() throw (css::uno::RuntimeException); - virtual void SAL_CALL setRowSource( const rtl::OUString& _rowsource ) throw (css::uno::RuntimeException); - virtual rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException); - virtual void SAL_CALL setName( const rtl::OUString& _name ) throw (css::uno::RuntimeException); - //remove resouce because ooo.vba.excel.XControl is a wrapper of com.sun.star.drawing.XControlShape - virtual void removeResouce() throw( css::uno::RuntimeException ); - //XHelperInterface - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); -}; - - -class ScVbaControlFactory -{ -public: - ScVbaControlFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext, - const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel ); - ScVbaControl* createControl() throw ( css::uno::RuntimeException ); - ScVbaControl* createControl( const css::uno::Reference< css::uno::XInterface >& xParent ) throw ( css::uno::RuntimeException ); -private: - ScVbaControl* createControl( const css::uno::Reference< css::awt::XControl >&, const css::uno::Reference< css::uno::XInterface >& ) throw ( css::uno::RuntimeException ); - ScVbaControl* createControl( const css::uno::Reference< css::drawing::XControlShape >&, const css::uno::Reference< css::uno::XInterface >& ) throw ( css::uno::RuntimeException ); - css::uno::Reference< css::uno::XComponentContext > m_xContext; - css::uno::Reference< css::uno::XInterface > m_xControl; - css::uno::Reference< css::frame::XModel > m_xModel; -}; - -#endif//SC_VBA_CONTROL_HXX diff --git a/sc/source/ui/vba/vbacontrols.cxx b/sc/source/ui/vba/vbacontrols.cxx deleted file mode 100644 index 6faf418df206..000000000000 --- a/sc/source/ui/vba/vbacontrols.cxx +++ /dev/null @@ -1,227 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * $Revision$ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "vbacontrols.hxx" -#include "vbacontrol.hxx" -#include -#include -#include - -using namespace com::sun::star; -using namespace ooo::vba; - - -typedef ::cppu::WeakImplHelper2< container::XNameAccess, container::XIndexAccess > ArrayWrapImpl; - -typedef std::hash_map< rtl::OUString, sal_Int32, ::rtl::OUStringHash, - ::std::equal_to< ::rtl::OUString > > ControlIndexMap; -typedef std::vector< uno::Reference< awt::XControl > > ControlVec; - -class ControlArrayWrapper : public ArrayWrapImpl -{ - uno::Reference< awt::XControlContainer > mxDialog; - uno::Sequence< ::rtl::OUString > msNames; - ControlVec mControls; - ControlIndexMap mIndices; - - rtl::OUString getControlName( const uno::Reference< awt::XControl >& xCtrl ) - { - uno::Reference< beans::XPropertySet > xProp( xCtrl->getModel(), uno::UNO_QUERY ); - rtl::OUString sName; - xProp->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ) ) ) >>= sName; - return sName; - } - -public: - - ControlArrayWrapper( const uno::Reference< awt::XControl >& xDialog ) - { - mxDialog.set( xDialog, uno::UNO_QUERY_THROW ); - uno::Sequence< uno::Reference< awt::XControl > > sXControls = mxDialog->getControls(); - - msNames.realloc( sXControls.getLength() ); - for ( sal_Int32 i = 0; i < sXControls.getLength(); ++i ) - { - uno::Reference< awt::XControl > xCtrl = sXControls[ i ]; - msNames[ i ] = getControlName( xCtrl ); - mControls.push_back( xCtrl ); - mIndices[ msNames[ i ] ] = i; - } - } - - // XElementAccess - virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException) - { - return awt::XControl::static_type(0); - } - - virtual ::sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException) - { - return ( mControls.size() > 0 ); - } - - // XNameAcess - virtual uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) - { - if ( !hasByName( aName ) ) - throw container::NoSuchElementException(); - return getByIndex( mIndices[ aName ] ); - } - - virtual uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw (uno::RuntimeException) - { - return msNames; - } - - virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (css::uno::RuntimeException) - { - ControlIndexMap::iterator it = mIndices.find( aName ); - return it != mIndices.end(); - } - - // XElementAccess - virtual ::sal_Int32 SAL_CALL getCount( ) throw (css::uno::RuntimeException) - { - return mControls.size(); - } - - virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException ) - { - if ( Index < 0 || Index >= static_cast< sal_Int32 >( mControls.size() ) ) - throw lang::IndexOutOfBoundsException(); - return uno::makeAny( mControls[ Index ] ); - } -}; - - -class ControlsEnumWrapper : public EnumerationHelper_BASE -{ - uno::Reference m_xParent; - uno::Reference m_xContext; - uno::Reference m_xIndexAccess; - uno::Reference m_xDlg; - sal_Int32 nIndex; - -public: - - ControlsEnumWrapper( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XIndexAccess >& xIndexAccess, const uno::Reference< awt::XControl >& xDlg ) : m_xParent( xParent ), m_xContext( xContext), m_xIndexAccess( xIndexAccess ), m_xDlg( xDlg ), nIndex( 0 ) {} - - virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException) - { - return ( nIndex < m_xIndexAccess->getCount() ); - } - - virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) - { - if ( nIndex < m_xIndexAccess->getCount() ) - { - uno::Reference< frame::XModel > xModel; - uno::Reference< uno::XInterface > xControl; - m_xIndexAccess->getByIndex( nIndex++ ) >>= xControl; - // Create control from awt::XControl - ScVbaControlFactory aFac( m_xContext, xControl, xModel ); - uno::Reference< msforms::XControl > xVBAControl( aFac.createControl( m_xDlg->getModel() ) ); - return uno::makeAny( xVBAControl ); - } - throw container::NoSuchElementException(); - } - -}; - - -uno::Reference -lcl_controlsWrapper( const uno::Reference< awt::XControl >& xDlg ) -{ - return new ControlArrayWrapper( xDlg ); -} - -ScVbaControls::ScVbaControls( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, - const css::uno::Reference< awt::XControl >& xDialog ) - : ControlsImpl_BASE( xParent, xContext, lcl_controlsWrapper( xDialog ) ) -{ - mxDialog.set( xDialog, uno::UNO_QUERY_THROW ); -} - -uno::Reference< container::XEnumeration > -ScVbaControls::createEnumeration() throw (uno::RuntimeException) -{ - uno::Reference< container::XEnumeration > xEnum( new ControlsEnumWrapper( mxParent, mxContext, m_xIndexAccess, mxDialog ) ); - if ( !xEnum.is() ) - throw uno::RuntimeException(); - return xEnum; -} - -uno::Any -ScVbaControls::createCollectionObject( const css::uno::Any& aSource ) -{ - // Create control from awt::XControl - uno::Reference< awt::XControl > xControl; - aSource >>= xControl; - uno::Reference< frame::XModel > xModel; - ScVbaControlFactory aFac( mxContext, xControl, xModel ); - uno::Reference< msforms::XControl > xVBAControl( aFac.createControl( mxDialog->getModel() ) ); - return uno::makeAny( xVBAControl ); -} - -void SAL_CALL -ScVbaControls::Move( double cx, double cy ) throw (uno::RuntimeException) -{ - uno::Reference< container::XEnumeration > xEnum( createEnumeration() ); - while ( xEnum->hasMoreElements() ) - { - uno::Reference< msforms::XControl > xControl( xEnum->nextElement(), uno::UNO_QUERY_THROW ); - xControl->setLeft( xControl->getLeft() + cx ); - xControl->setTop( xControl->getTop() + cy ); - } -} - -uno::Type -ScVbaControls::getElementType() throw (uno::RuntimeException) -{ - return ooo::vba::msforms::XControl::static_type(0); -} -rtl::OUString& -ScVbaControls::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaControls") ); - return sImplName; -} - -uno::Sequence< rtl::OUString > -ScVbaControls::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Controls" ) ); - } - return aServiceNames; -} diff --git a/sc/source/ui/vba/vbacontrols.hxx b/sc/source/ui/vba/vbacontrols.hxx deleted file mode 100644 index bdb25ff3d5d2..000000000000 --- a/sc/source/ui/vba/vbacontrols.hxx +++ /dev/null @@ -1,62 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * $Revision$ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef SC_VBA_CONTROLS_HXX -#define SC_VBA_CONTROLS_HXX - -#include -#include -#include - -#include "vbacollectionimpl.hxx" -#include "vbahelper.hxx" - -typedef CollTestImplHelper< ov::msforms::XControls > ControlsImpl_BASE; - -class ScVbaControls : public ControlsImpl_BASE -{ - css::uno::Reference< css::awt::XControl > mxDialog; -protected: - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); -public: - ScVbaControls( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, - const css::uno::Reference< css::awt::XControl >& xDialog ); - // XControls - virtual void SAL_CALL Move( double cx, double cy ) throw (css::uno::RuntimeException); - // XEnumerationAccess - virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); - virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); - - // ScVbaCollectionBaseImpl - virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); - -}; -#endif //SC_VBA_OLEOBJECTS_HXX - diff --git a/sc/source/ui/vba/vbafillformat.cxx b/sc/source/ui/vba/vbafillformat.cxx deleted file mode 100644 index 3b25efcb614a..000000000000 --- a/sc/source/ui/vba/vbafillformat.cxx +++ /dev/null @@ -1,202 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbafillformat.cxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include -#include -#include -#include -#include "vbafillformat.hxx" -#include "vbacolorformat.hxx" - -using namespace ooo::vba; -using namespace com::sun::star; - -ScVbaFillFormat::ScVbaFillFormat( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< drawing::XShape > xShape ) : ScVbaFillFormat_BASE( xParent, xContext ), m_xShape( xShape ) -{ - m_xPropertySet.set( xShape, uno::UNO_QUERY_THROW ); - m_nFillStyle = drawing::FillStyle_SOLID; - m_nForeColor = 0; - m_nBackColor = 0; - m_nGradientAngle = 0; -} - -void -ScVbaFillFormat::setFillStyle( drawing::FillStyle nFillStyle ) throw (uno::RuntimeException) -{ - m_nFillStyle = nFillStyle; - if( m_nFillStyle == drawing::FillStyle_GRADIENT ) - { - m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii("FillStyle"), uno::makeAny( drawing::FillStyle_GRADIENT ) ); - awt::Gradient aGradient; - // AXIAL - // RADIAL - // ELLIPTICAL - // SQUARE - // RECT - aGradient.Style = awt::GradientStyle_LINEAR; - aGradient.StartColor = ForeColor()->getRGB(); - aGradient.EndColor = BackColor()->getRGB(); - aGradient.Angle = m_nGradientAngle; - aGradient.Border = 0; - aGradient.XOffset = 0; - aGradient.YOffset = 0; - aGradient.StartIntensity = 100; - aGradient.EndIntensity = 100; - aGradient.StepCount = 1; - m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii("FillGradient"), uno::makeAny( aGradient ) ); - } - else if( m_nFillStyle == drawing::FillStyle_SOLID ) - { - m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii("FillStyle"), uno::makeAny(drawing::FillStyle_SOLID) ); - } -} - -void -ScVbaFillFormat::setForeColorAndInternalStyle( sal_Int32 nForeColor ) throw (css::uno::RuntimeException) -{ - m_nForeColor = nForeColor; - setFillStyle( m_nFillStyle ); -} - -// Attributes -sal_Bool SAL_CALL -ScVbaFillFormat::getVisible() throw (uno::RuntimeException) -{ - drawing::FillStyle nFillStyle; - m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("FillStyle") ) >>= nFillStyle; - if( nFillStyle == drawing::FillStyle_NONE ) - return sal_False; - return sal_True; -} - -void SAL_CALL -ScVbaFillFormat::setVisible( sal_Bool _visible ) throw (uno::RuntimeException) -{ - drawing::FillStyle aFillStyle; - m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("FillStyle") ) >>= aFillStyle; - if( !_visible ) - { - m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii("FillStyle"), uno::makeAny( drawing::FillStyle_NONE ) ); - } - else - { - if( aFillStyle == drawing::FillStyle_NONE ) - { - setFillStyle( m_nFillStyle ); - } - } -} - -double SAL_CALL -ScVbaFillFormat::getTransparency() throw (uno::RuntimeException) -{ - sal_Int16 nTransparence = 0; - double dTransparence = 0; - m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "FillTransparence" ) ) >>= nTransparence; - dTransparence = static_cast( nTransparence ); - dTransparence /= 100; - return dTransparence; -} - -void SAL_CALL -ScVbaFillFormat::setTransparency( double _transparency ) throw (uno::RuntimeException) -{ - sal_Int16 nTransparence = static_cast< sal_Int16 >( _transparency * 100 ); - m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "FillTransparence" ), uno::makeAny( nTransparence ) ); -} - - -// Methods -void SAL_CALL -ScVbaFillFormat::Solid() throw (uno::RuntimeException) -{ - setFillStyle( drawing::FillStyle_SOLID ); -} - -void SAL_CALL -ScVbaFillFormat::TwoColorGradient( sal_Int32 style, sal_Int32 /*variant*/ ) throw (uno::RuntimeException) -{ - if( style == office::MsoGradientStyle::msoGradientHorizontal ) - { - m_nGradientAngle = 0; - setFillStyle( drawing::FillStyle_GRADIENT ); - } - else if( style == office::MsoGradientStyle::msoGradientVertical ) - { - m_nGradientAngle = 900; - setFillStyle( drawing::FillStyle_GRADIENT ); - } - else if( style == office::MsoGradientStyle::msoGradientDiagonalDown ) - { - m_nGradientAngle = 450; - setFillStyle( drawing::FillStyle_GRADIENT ); - } - else if( style == office::MsoGradientStyle::msoGradientDiagonalUp ) - { - m_nGradientAngle = 900 + 450; - setFillStyle( drawing::FillStyle_GRADIENT ); - } -} - -uno::Reference< msforms::XColorFormat > SAL_CALL -ScVbaFillFormat::BackColor() throw (uno::RuntimeException) -{ - if( !m_xColorFormat.is() ) - m_xColorFormat.set( new ScVbaColorFormat( getParent(), mxContext, this, m_xShape, ColorFormatType::FILLFORMAT_BACKCOLOR ) ); - return m_xColorFormat; -} - -uno::Reference< msforms::XColorFormat > SAL_CALL -ScVbaFillFormat::ForeColor() throw (uno::RuntimeException) -{ - if( !m_xColorFormat.is() ) - m_xColorFormat.set( new ScVbaColorFormat( getParent(), mxContext, this, m_xShape, ColorFormatType::FILLFORMAT_FORECOLOR ) ); - return m_xColorFormat; -} - - -rtl::OUString& -ScVbaFillFormat::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaFillFormat") ); - return sImplName; -} - -uno::Sequence< rtl::OUString > -ScVbaFillFormat::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.FillFormat" ) ); - } - return aServiceNames; -} - diff --git a/sc/source/ui/vba/vbafillformat.hxx b/sc/source/ui/vba/vbafillformat.hxx deleted file mode 100644 index 03029c89dbe4..000000000000 --- a/sc/source/ui/vba/vbafillformat.hxx +++ /dev/null @@ -1,74 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbafillformat.hxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef SC_VBA_XFILLFORMAT_HXX -#define SC_VBA_XFILLFORMAT_HXX - -#include -#include -#include -#include "vbahelperinterface.hxx" - -typedef InheritedHelperInterfaceImpl1< ov::msforms::XFillFormat > ScVbaFillFormat_BASE; - -class ScVbaFillFormat : public ScVbaFillFormat_BASE -{ -private: - css::uno::Reference< css::drawing::XShape > m_xShape; - css::uno::Reference< css::beans::XPropertySet > m_xPropertySet; - css::uno::Reference< ov::msforms::XColorFormat > m_xColorFormat; - css::drawing::FillStyle m_nFillStyle; - sal_Int32 m_nForeColor; - sal_Int32 m_nBackColor; - sal_Int16 m_nGradientAngle; -private: - void setFillStyle( css::drawing::FillStyle nFillStyle ) throw (css::uno::RuntimeException); -protected: - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); - -public: - ScVbaFillFormat( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape > xShape ); - - void setForeColorAndInternalStyle( sal_Int32 nForeColor ) throw (css::uno::RuntimeException); - // Attributes - virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException); - virtual void SAL_CALL setVisible( sal_Bool _visible ) throw (css::uno::RuntimeException); - virtual double SAL_CALL getTransparency() throw (css::uno::RuntimeException); - virtual void SAL_CALL setTransparency( double _transparency ) throw (css::uno::RuntimeException); - - // Methods - virtual void SAL_CALL Solid() throw (css::uno::RuntimeException); - virtual void SAL_CALL TwoColorGradient( sal_Int32 style, sal_Int32 variant ) throw (css::uno::RuntimeException); - virtual css::uno::Reference< ov::msforms::XColorFormat > SAL_CALL BackColor() throw (css::uno::RuntimeException); - virtual css::uno::Reference< ov::msforms::XColorFormat > SAL_CALL ForeColor() throw (css::uno::RuntimeException); - -}; - -#endif//SC_VBA_XFILLFORMAT_HXX diff --git a/sc/source/ui/vba/vbaframe.cxx b/sc/source/ui/vba/vbaframe.cxx deleted file mode 100644 index 24f8884e4d3b..000000000000 --- a/sc/source/ui/vba/vbaframe.cxx +++ /dev/null @@ -1,93 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * - * $Revision$ - * - * last change: $Author$ $Date$ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ -#include "vbaframe.hxx" -#include - -using namespace com::sun::star; -using namespace ooo::vba; - - -const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") ); -ScVbaFrame::ScVbaFrame( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ) : FrameImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper ) -{ -} - -// Attributes -rtl::OUString SAL_CALL -ScVbaFrame::getCaption() throw (css::uno::RuntimeException) -{ - rtl::OUString Label; - m_xProps->getPropertyValue( LABEL ) >>= Label; - return Label; -} - -void SAL_CALL -ScVbaFrame::setCaption( const rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException) -{ - m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) ); -} - -uno::Any SAL_CALL -ScVbaFrame::getValue() throw (css::uno::RuntimeException) -{ - return uno::makeAny( getCaption() ); -} - -void SAL_CALL -ScVbaFrame::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException) -{ - rtl::OUString sCaption; - _value >>= sCaption; - setCaption( sCaption ); -} - -rtl::OUString& -ScVbaFrame::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaFrame") ); - return sImplName; -} - -uno::Sequence< rtl::OUString > -ScVbaFrame::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Frame" ) ); - } - return aServiceNames; -} diff --git a/sc/source/ui/vba/vbaframe.hxx b/sc/source/ui/vba/vbaframe.hxx deleted file mode 100644 index 60204571c749..000000000000 --- a/sc/source/ui/vba/vbaframe.hxx +++ /dev/null @@ -1,58 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * - * $Revision$ - * - * last change: $Author$ $Date$ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ -#ifndef SC_VBA_FRAME_HXX -#define SC_VBA_FRAME_HXX -#include -#include - -#include "vbacontrol.hxx" -#include "vbahelper.hxx" - -typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XLabel > FrameImpl_BASE; - -class ScVbaFrame : public FrameImpl_BASE -{ -public: - ScVbaFrame( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ); - // Attributes - virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException); - virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException); - virtual rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException); - virtual void SAL_CALL setCaption( const rtl::OUString& _caption ) throw (css::uno::RuntimeException); - //XHelperInterface - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); -}; -#endif //SC_VBA_LABEL_HXX diff --git a/sc/source/ui/vba/vbahelper.hxx b/sc/source/ui/vba/vbahelper.hxx deleted file mode 100644 index 3def6b078096..000000000000 --- a/sc/source/ui/vba/vbahelper.hxx +++ /dev/null @@ -1,352 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbahelper.hxx,v $ - * $Revision: 1.5.32.1 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef SC_VBA_HELPER_HXX -#define SC_VBA_HELPER_HXX - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "cellsuno.hxx" - -namespace css = ::com::sun::star; - -namespace ooo -{ - namespace vba - { - template < class T > - css::uno::Reference< T > getXSomethingFromArgs( css::uno::Sequence< css::uno::Any > const & args, sal_Int32 nPos, bool bCanBeNull = true ) throw (css::lang::IllegalArgumentException) - { - if ( args.getLength() < ( nPos + 1) ) - throw css::lang::IllegalArgumentException(); - css::uno::Reference< T > aSomething( args[ nPos ], css::uno::UNO_QUERY ); - if ( !bCanBeNull && !aSomething.is() ) - throw css::lang::IllegalArgumentException(); - return aSomething; - } - css::uno::Reference< css::beans::XIntrospectionAccess > getIntrospectionAccess( const css::uno::Any& aObject ) throw (css::uno::RuntimeException); - css::uno::Reference< css::script::XTypeConverter > getTypeConverter( const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw (css::uno::RuntimeException); - - void dispatchRequests (css::uno::Reference< css::frame::XModel>& xModel,rtl::OUString & aUrl) ; - void dispatchRequests (css::uno::Reference< css::frame::XModel>& xModel,rtl::OUString & aUrl, css::uno::Sequence< css::beans::PropertyValue >& sProps ) ; - void dispatchExecute(css::uno::Reference< css::frame::XModel>& xModel, USHORT nSlot, SfxCallMode nCall = SFX_CALLMODE_SYNCHRON ); - void implnCopy(); - void implnPaste(); - void implnCut(); - void implnPasteSpecial(sal_uInt16 nFlags,sal_uInt16 nFunction,sal_Bool bSkipEmpty, sal_Bool bTranspose); - css::uno::Reference< css::frame::XModel > - getCurrentDocument() throw (css::uno::RuntimeException); - ScTabViewShell* getBestViewShell( css::uno::Reference< css::frame::XModel>& xModel ) ; - ScDocShell* getDocShell( css::uno::Reference< css::frame::XModel>& xModel ) ; - ScTabViewShell* getCurrentBestViewShell(); - SfxViewFrame* getCurrentViewFrame(); - sal_Int32 OORGBToXLRGB( sal_Int32 ); - sal_Int32 XLRGBToOORGB( sal_Int32 ); - css::uno::Any OORGBToXLRGB( const css::uno::Any& ); - css::uno::Any XLRGBToOORGB( const css::uno::Any& ); - // provide a NULL object that can be passed as variant so that - // the object when passed to IsNull will return true. aNULL - // contains an empty object reference - const css::uno::Any& aNULL(); - void PrintOutHelper( const css::uno::Any& From, const css::uno::Any& To, const css::uno::Any& Copies, const css::uno::Any& Preview, const css::uno::Any& ActivePrinter, const css::uno::Any& PrintToFile, const css::uno::Any& Collate, const css::uno::Any& PrToFileName, css::uno::Reference< css::frame::XModel >& xModel, sal_Bool bSelection ); - void PrintPreviewHelper( const css::uno::Any& EnableChanges, css::uno::Reference< css::frame::XModel >& xModel ); - - rtl::OUString getAnyAsString( const css::uno::Any& pvargItem ) throw ( css::uno::RuntimeException ); - rtl::OUString VBAToRegexp(const rtl::OUString &rIn, bool bForLike = false); // needs to be in an uno service ( already this code is duplicated in basic ) - double getPixelTo100thMillimeterConversionFactor( css::uno::Reference< css::awt::XDevice >& xDevice, sal_Bool bVertical); - double PointsToPixels( css::uno::Reference< css::awt::XDevice >& xDevice, double fPoints, sal_Bool bVertical); - double PixelsToPoints( css::uno::Reference< css::awt::XDevice >& xDevice, double fPoints, sal_Bool bVertical); - - -class ScVbaCellRangeAccess -{ -public: - static SfxItemSet* GetDataSet( ScCellRangeObj* pRangeObj ); -}; - -class Millimeter -{ -//Factor to translate between points and hundredths of millimeters: -private: - static const double factor; - - double m_nMillimeter; - -public: - Millimeter():m_nMillimeter(0) {} - - Millimeter(double mm):m_nMillimeter(mm) {} - - void set(double mm) { m_nMillimeter = mm; } - void setInPoints(double points) - { - m_nMillimeter = points * 0.352777778; - // 25.4mm / 72 - } - - void setInHundredthsOfOneMillimeter(double hmm) - { - m_nMillimeter = hmm / 100; - } - - double get() - { - return m_nMillimeter; - } - double getInHundredthsOfOneMillimeter() - { - return m_nMillimeter * 100; - } - double getInPoints() - { - return m_nMillimeter * 2.834645669; // 72 / 25.4mm - } - - static sal_Int32 getInHundredthsOfOneMillimeter(double points) - { - sal_Int32 mm = static_cast(points * factor); - return mm; - } - - static double getInPoints(int _hmm) - { - double points = double( static_cast(_hmm) / factor); - return points; - } -}; - -class AbstractGeometryAttributes // probably should replace the ShapeHelper below -{ -public: - virtual ~AbstractGeometryAttributes() {} - virtual double getLeft() = 0; - virtual void setLeft( double ) = 0; - virtual double getTop() = 0; - virtual void setTop( double ) = 0; - virtual double getHeight() = 0; - virtual void setHeight( double ) = 0; - virtual double getWidth() = 0; - virtual void setWidth( double ) = 0; -}; - -class ConcreteXShapeGeometryAttributes : public AbstractGeometryAttributes -{ -public: - css::uno::Reference< ooo::vba::msforms::XShape > m_xShape; - ConcreteXShapeGeometryAttributes( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape >& xShape ); - virtual double getLeft() - { - return m_xShape->getLeft(); - } - virtual void setLeft( double nLeft ) - { - m_xShape->setLeft( nLeft ); - } - virtual double getTop() - { - return m_xShape->getTop(); - } - virtual void setTop( double nTop ) - { - m_xShape->setTop( nTop ); - } - - virtual double getHeight() - { - return m_xShape->getHeight(); - } - virtual void setHeight( double nHeight ) - { - m_xShape->setHeight( nHeight ); - } - virtual double getWidth() - { - return m_xShape->getWidth(); - } - virtual void setWidth( double nWidth) - { - m_xShape->setHeight( nWidth ); - } - - -}; -#define VBA_LEFT "PositionX" -#define VBA_TOP "PositionY" -class UserFormGeometryHelper : public AbstractGeometryAttributes -{ - - css::uno::Reference< css::beans::XPropertySet > mxModel; -public: - UserFormGeometryHelper( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::awt::XControl >& xControl ); - virtual double getLeft(); - virtual void setLeft( double nLeft ); - virtual double getTop(); - virtual void setTop( double nTop ); - virtual double getHeight(); - virtual void setHeight( double nHeight ); - virtual double getWidth(); - virtual void setWidth( double nWidth); -}; - -class ShapeHelper -{ -protected: - css::uno::Reference< css::drawing::XShape > xShape; -public: - ShapeHelper( const css::uno::Reference< css::drawing::XShape >& _xShape) throw (css::script::BasicErrorException ) : xShape( _xShape ) - { - if( !xShape.is() ) - throw css::uno::RuntimeException( rtl::OUString::createFromAscii("No valid shape for helper"), css::uno::Reference< css::uno::XInterface >() ); - } - - double getHeight() - { - return Millimeter::getInPoints(xShape->getSize().Height); - } - - - void setHeight(double _fheight) throw ( css::script::BasicErrorException ) - { - try - { - css::awt::Size aSize = xShape->getSize(); - aSize.Height = Millimeter::getInHundredthsOfOneMillimeter(_fheight); - xShape->setSize(aSize); - } - catch ( css::uno::Exception& /*e*/) - { - throw css::script::BasicErrorException( rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() ); - } - } - - - double getWidth() - { - return Millimeter::getInPoints(xShape->getSize().Width); - } - - void setWidth(double _fWidth) throw ( css::script::BasicErrorException ) - { - try - { - css::awt::Size aSize = xShape->getSize(); - aSize.Width = Millimeter::getInHundredthsOfOneMillimeter(_fWidth); - xShape->setSize(aSize); - } - catch (css::uno::Exception& /*e*/) - { - throw css::script::BasicErrorException( rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() ); - } - } - - - double getLeft() - { - return Millimeter::getInPoints(xShape->getPosition().X); - } - - - void setLeft(double _fLeft) - { - css::awt::Point aPoint = xShape->getPosition(); - aPoint.X = Millimeter::getInHundredthsOfOneMillimeter(_fLeft); - xShape->setPosition(aPoint); - } - - - double getTop() - { - return Millimeter::getInPoints(xShape->getPosition().Y); - } - - - void setTop(double _fTop) - { - css::awt::Point aPoint = xShape->getPosition(); - aPoint.Y = Millimeter::getInHundredthsOfOneMillimeter(_fTop); - xShape->setPosition(aPoint); - } - -}; - -class ContainerUtilities -{ - -public: - static rtl::OUString getUniqueName( const css::uno::Sequence< ::rtl::OUString >& _slist, const rtl::OUString& _sElementName, const ::rtl::OUString& _sSuffixSeparator); - static rtl::OUString getUniqueName( const css::uno::Sequence< rtl::OUString >& _slist, const rtl::OUString _sElementName, const rtl::OUString& _sSuffixSeparator, sal_Int32 _nStartSuffix ); - - static sal_Int32 FieldInList( const css::uno::Sequence< rtl::OUString >& SearchList, const rtl::OUString& SearchString ); -}; - -// really just a a place holder to ease the porting pain -class DebugHelper -{ -public: - static void exception( const rtl::OUString& DetailedMessage, const css::uno::Exception& ex, int err, const rtl::OUString& /*additionalArgument*/ ) throw( css::script::BasicErrorException ) - { - // #TODO #FIXME ( do we want to support additionalArg here ) - throw css::script::BasicErrorException( DetailedMessage.concat( rtl::OUString::createFromAscii(" ") ).concat( ex.Message ), css::uno::Reference< css::uno::XInterface >(), err, rtl::OUString() ); - } - - static void exception( int err, const rtl::OUString& additionalArgument ) throw( css::script::BasicErrorException ) - { - exception( rtl::OUString(), css::uno::Exception(), err, additionalArgument ); - } - - static void exception( css::uno::Exception& ex ) throw( css::script::BasicErrorException ) - { - exception( rtl::OUString(), ex, SbERR_INTERNAL_ERROR, rtl::OUString() ); - } -}; - } // openoffice -} // org - -namespace ov = ooo::vba; - -#ifdef DEBUG -# define SC_VBA_FIXME(a) OSL_TRACE( a ) -# define SC_VBA_STUB() SC_VBA_FIXME(( "%s - stubbed\n", __FUNCTION__ )) -#else -# define SC_VBA_FIXME(a) -# define SC_VBA_STUB() -#endif - -#endif diff --git a/sc/source/ui/vba/vbahelperinterface.hxx b/sc/source/ui/vba/vbahelperinterface.hxx deleted file mode 100644 index 567741cfafbc..000000000000 --- a/sc/source/ui/vba/vbahelperinterface.hxx +++ /dev/null @@ -1,116 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbahelperinterface.hxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef SC_VBA_HELPERINTERFACE_HXX -#define SC_VBA_HELPERINTERFACE_HXX - -#include -#include -#include "vbahelper.hxx" -#include "vbaglobals.hxx" - -// use this class when you have an a object like -// interface XAnInterface which contains XHelperInterface in its inheritance hierarchy -// interface XAnInterface -// { -// interface XHelperInterface; -// [attribute, string] name; -// } -// or -// interface XAnInterface : XHelperInterface; -// { -// [attribute, string] name; -// } -// -// then this class can provide a default implementation of XHelperInterface, -// you can use it like this -// typedef InheritedHelperInterfaceImpl< XAnInterface > > AnInterfaceImpl_BASE; -// class AnInterfaceImpl : public AnInterfaceImpl_BASE -// { -// public: -// AnInterface( const Reference< HelperInterface >& xParent ) : AnInterfaceImpl_BASE( xParent ) {} -// // implement XAnInterface methods only, no need to implement the XHelperInterface -// // methods -// virtual void setName( const OUString& ); -// virtual OUString getName(); -// } -// -const ::rtl::OUString sHelperServiceName( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.HelperServiceBase" ) ); - -template< typename Ifc1 > -class InheritedHelperInterfaceImpl : public Ifc1 -{ -protected: - css::uno::WeakReference< ov::XHelperInterface > mxParent; - css::uno::Reference< css::uno::XComponentContext > mxContext; -public: - InheritedHelperInterfaceImpl() {} - InheritedHelperInterfaceImpl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : mxParent( xParent ), mxContext( xContext ) {} - virtual rtl::OUString& getServiceImplName() = 0; - virtual css::uno::Sequence getServiceNames() = 0; - - // XHelperInterface Methods - virtual ::sal_Int32 SAL_CALL getCreator() throw (css::script::BasicErrorException, css::uno::RuntimeException) - { - return 0x53756E4F; - } - virtual css::uno::Reference< ov::XHelperInterface > SAL_CALL getParent( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) { return mxParent; } - - virtual css::uno::Any SAL_CALL Application( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) { return css::uno::makeAny( ScVbaGlobals::getGlobalsImpl( mxContext )->getApplication() ); } - - - // XServiceInfo Methods - virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (css::uno::RuntimeException) { return getServiceImplName(); } - virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (css::uno::RuntimeException) - { - css::uno::Sequence< rtl::OUString > sServices = getSupportedServiceNames(); - const rtl::OUString* pStart = sServices.getConstArray(); - const rtl::OUString* pEnd = pStart + sServices.getLength(); - for ( ; pStart != pEnd ; ++pStart ) - if ( (*pStart).equals( ServiceName ) ) - return sal_True; - return sal_False; - } - virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (css::uno::RuntimeException) - { - css::uno::Sequence< rtl::OUString > aNames = getServiceNames();; - return aNames; - } - }; - -template< typename Ifc1 > -class InheritedHelperInterfaceImpl1 : public InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper1< Ifc1 > > - -{ -typedef InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper1< Ifc1 > > Base; -public: - InheritedHelperInterfaceImpl1< Ifc1 > ( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : Base( xParent, xContext ) {} - -}; -#endif diff --git a/sc/source/ui/vba/vbaimage.cxx b/sc/source/ui/vba/vbaimage.cxx deleted file mode 100644 index 7e6cd34c191e..000000000000 --- a/sc/source/ui/vba/vbaimage.cxx +++ /dev/null @@ -1,59 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * $Revision$ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include "vbaimage.hxx" -#include - -using namespace com::sun::star; -using namespace ooo::vba; - - -const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") ); -ScVbaImage::ScVbaImage( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : ImageImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper ) -{ -} - -rtl::OUString& -ScVbaImage::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaImage") ); - return sImplName; -} - -uno::Sequence< rtl::OUString > -ScVbaImage::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Image" ) ); - } - return aServiceNames; -} diff --git a/sc/source/ui/vba/vbaimage.hxx b/sc/source/ui/vba/vbaimage.hxx deleted file mode 100644 index 9d4b33818663..000000000000 --- a/sc/source/ui/vba/vbaimage.hxx +++ /dev/null @@ -1,48 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * $Revision$ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef SC_VBA_IMAGE_HXX -#define SC_VBA_IMAGE_HXX -#include -#include - -#include "vbacontrol.hxx" -#include "vbahelper.hxx" - -typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XImage > ImageImpl_BASE; - -class ScVbaImage : public ImageImpl_BASE -{ -public: - ScVbaImage( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ); - //XHelperInterface - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); -}; -#endif //SC_VBA_IMAGE_HXX diff --git a/sc/source/ui/vba/vbalabel.cxx b/sc/source/ui/vba/vbalabel.cxx deleted file mode 100644 index 0a7614ee4eb0..000000000000 --- a/sc/source/ui/vba/vbalabel.cxx +++ /dev/null @@ -1,88 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbalabel.cxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include "vbalabel.hxx" -#include - -using namespace com::sun::star; -using namespace ooo::vba; - - -const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") ); -ScVbaLabel::ScVbaLabel( const css::uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ) : LabelImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper ) -{ -} - -// Attributes -rtl::OUString SAL_CALL -ScVbaLabel::getCaption() throw (css::uno::RuntimeException) -{ - rtl::OUString Label; - m_xProps->getPropertyValue( LABEL ) >>= Label; - return Label; -} - -void SAL_CALL -ScVbaLabel::setCaption( const rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException) -{ - m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) ); -} -uno::Any SAL_CALL -ScVbaLabel::getValue() throw (css::uno::RuntimeException) -{ - return uno::makeAny( getCaption() ); -} - -void SAL_CALL -ScVbaLabel::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException) -{ - rtl::OUString sCaption; - _value >>= sCaption; - setCaption( sCaption ); -} - - -rtl::OUString& -ScVbaLabel::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaLabel") ); - return sImplName; -} - -uno::Sequence< rtl::OUString > -ScVbaLabel::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Label" ) ); - } - return aServiceNames; -} diff --git a/sc/source/ui/vba/vbalabel.hxx b/sc/source/ui/vba/vbalabel.hxx deleted file mode 100644 index 7ced8b65f731..000000000000 --- a/sc/source/ui/vba/vbalabel.hxx +++ /dev/null @@ -1,56 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbalabel.hxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef SC_VBA_LABEL_HXX -#define SC_VBA_LABEL_HXX -#include -#include - -#include "vbacontrol.hxx" -#include "vbahelper.hxx" -#include - -typedef cppu::ImplInheritanceHelper2< ScVbaControl, ov::msforms::XLabel, css::script::XDefaultProperty > LabelImpl_BASE; - -class ScVbaLabel : public LabelImpl_BASE -{ -public: - ScVbaLabel( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ); - // Attributes - virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException); - virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException); - virtual rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException); - virtual void SAL_CALL setCaption( const rtl::OUString& _caption ) throw (css::uno::RuntimeException); - //XHelperInterface - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); - // XDefaultProperty - rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); } -}; -#endif //SC_VBA_LABEL_HXX diff --git a/sc/source/ui/vba/vbalineformat.cxx b/sc/source/ui/vba/vbalineformat.cxx deleted file mode 100644 index 8e99086f74da..000000000000 --- a/sc/source/ui/vba/vbalineformat.cxx +++ /dev/null @@ -1,458 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbalineformat.cxx,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include -#include -#include -#include -#include -#include -#include "vbalineformat.hxx" -#include "vbacolorformat.hxx" - -using namespace ooo::vba; -using namespace com::sun::star; - -ScVbaLineFormat::ScVbaLineFormat( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< drawing::XShape > xShape ) : ScVbaLineFormat_BASE( xParent, xContext ), m_xShape( xShape ) -{ - m_xPropertySet.set( xShape, uno::UNO_QUERY_THROW ); - m_nLineDashStyle = office::MsoLineDashStyle::msoLineSolid; - m_nLineWeight = 1; -} - -sal_Int32 -ScVbaLineFormat::calculateArrowheadSize() -{ - return 0; -} - -sal_Int32 -ScVbaLineFormat::convertLineStartEndNameToArrowheadStyle( rtl::OUString sLineName ) -{ - sal_Int32 nLineType = office::MsoArrowheadStyle::msoArrowheadNone; - if (sLineName.equals(rtl::OUString::createFromAscii("Small Arrow")) || - sLineName.equals(rtl::OUString::createFromAscii("Arrow")) || - sLineName.equals(rtl::OUString::createFromAscii("msArrowEnd")) || - sLineName.equals(rtl::OUString::createFromAscii("Double Arrow"))) - { - // msoArrowheadTriangle - nLineType = office::MsoArrowheadStyle::msoArrowheadTriangle; - } - else if (sLineName.equals(rtl::OUString::createFromAscii("Square 45")) || - sLineName.equals(rtl::OUString::createFromAscii("Square")) || - sLineName.equals(rtl::OUString::createFromAscii("msArrowDiamondEnd"))) - { - // msoArrowheadDiamond - nLineType = office::MsoArrowheadStyle::msoArrowheadDiamond; - } - else if (sLineName.equals(rtl::OUString::createFromAscii("Circle")) || - sLineName.equals(rtl::OUString::createFromAscii("msArrowOvalEnd")) || - sLineName.equals(rtl::OUString::createFromAscii("Dimension Lines")) ) - { - // msoArrowheadOval - nLineType = office::MsoArrowheadStyle::msoArrowheadOval; - } - else if (sLineName.equals(rtl::OUString::createFromAscii("Arrow concave")) || - sLineName.equals(rtl::OUString::createFromAscii("msArrowStealthEnd"))) - { - // msoArrowheadStealth - nLineType = office::MsoArrowheadStyle::msoArrowheadStealth; - } - else if (sLineName.equals(rtl::OUString::createFromAscii("Rounded short Arrow")) || - sLineName.equals(rtl::OUString::createFromAscii("Rounded large Arrow")) || - sLineName.equals(rtl::OUString::createFromAscii("Symmetric Arrow")) || - sLineName.equals(rtl::OUString::createFromAscii("msArrowOpenEnd")) || - sLineName.equals(rtl::OUString::createFromAscii("Line Arrow"))) - { - // msoArrowheadOpen - nLineType = office::MsoArrowheadStyle::msoArrowheadOpen; - } - else - { - // msoArrowheadNone - nLineType = office::MsoArrowheadStyle::msoArrowheadNone; - } - return nLineType; -} - -rtl::OUString -ScVbaLineFormat::convertArrowheadStyleToLineStartEndName( sal_Int32 nArrowheadStyle ) throw (uno::RuntimeException) -{ - switch( nArrowheadStyle ) - { - case office::MsoArrowheadStyle::msoArrowheadNone: - return rtl::OUString(rtl::OUString::createFromAscii( "" ) ); - case office::MsoArrowheadStyle::msoArrowheadStealth: - return rtl::OUString::createFromAscii( "Arrow concave" ); - case office::MsoArrowheadStyle::msoArrowheadOpen: - return rtl::OUString::createFromAscii("Line Arrow" ); - case office::MsoArrowheadStyle::msoArrowheadOval: - return rtl::OUString::createFromAscii("Circle" ); - case office::MsoArrowheadStyle::msoArrowheadDiamond: - return rtl::OUString::createFromAscii( "Square 45" ); - case office::MsoArrowheadStyle::msoArrowheadTriangle: - return rtl::OUString::createFromAscii( "Arrow" ); - default: - throw uno::RuntimeException( rtl::OUString::createFromAscii("Invalid Arrow Style!"), uno::Reference< uno::XInterface >() ); - } -} - -// Attributes -sal_Int32 SAL_CALL -ScVbaLineFormat::getBeginArrowheadStyle() throw (uno::RuntimeException) -{ - sal_Int32 nLineType = office::MsoArrowheadStyle::msoArrowheadNone; - rtl::OUString sLineName; - m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "LineStartName" ) ) >>= sLineName; - if( ( sLineName.getLength() > 7 ) && ( sLineName.indexOf( rtl::OUString::createFromAscii( "msArray" ) ) ) != -1 ) - { - sal_Int32 nIndex = sLineName.indexOf( rtl::OUString::createFromAscii(" ") ); - rtl::OUString sName = sLineName.copy( 0, nIndex ); - //sal_Int32 nSize = sLineName.copy( nIndex + 1 ).toInt32(); - nLineType = convertLineStartEndNameToArrowheadStyle( sName ); - } - else - { - nLineType = convertLineStartEndNameToArrowheadStyle( sLineName ); - } - return nLineType; -} - -void SAL_CALL -ScVbaLineFormat::setBeginArrowheadStyle( sal_Int32 _beginarrowheadstyle ) throw (uno::RuntimeException) -{ - rtl::OUString sArrayName = convertArrowheadStyleToLineStartEndName( _beginarrowheadstyle ); - m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "LineStartName" ), uno::makeAny( sArrayName ) ); -} - -sal_Int32 SAL_CALL -ScVbaLineFormat::getBeginArrowheadLength() throw (uno::RuntimeException) -{ - throw uno::RuntimeException( rtl::OUString::createFromAscii("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() ); -} - -void SAL_CALL -ScVbaLineFormat::setBeginArrowheadLength( sal_Int32 /*_beginarrowheadlength*/ ) throw (uno::RuntimeException) -{ - throw uno::RuntimeException( rtl::OUString::createFromAscii("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() ); -} - -sal_Int32 SAL_CALL -ScVbaLineFormat::getBeginArrowheadWidth() throw (uno::RuntimeException) -{ - throw uno::RuntimeException( rtl::OUString::createFromAscii("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() ); -} - -void SAL_CALL -ScVbaLineFormat::setBeginArrowheadWidth( sal_Int32 /*_beginarrowheadwidth*/ ) throw (uno::RuntimeException) -{ - throw uno::RuntimeException( rtl::OUString::createFromAscii("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() ); -} - -sal_Int32 SAL_CALL -ScVbaLineFormat::getEndArrowheadStylel() throw (uno::RuntimeException) -{ - return 0; -} - -void SAL_CALL -ScVbaLineFormat::setEndArrowheadStylel( sal_Int32 /*_endarrowheadstylel*/ ) throw (uno::RuntimeException) -{ -} - -sal_Int32 SAL_CALL -ScVbaLineFormat::getEndArrowheadLength() throw (uno::RuntimeException) -{ - throw uno::RuntimeException( rtl::OUString::createFromAscii("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() ); -} - -void SAL_CALL -ScVbaLineFormat::setEndArrowheadLength( sal_Int32 /*_endarrowheadlength*/ ) throw (uno::RuntimeException) -{ - throw uno::RuntimeException( rtl::OUString::createFromAscii("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() ); -} - -sal_Int32 SAL_CALL -ScVbaLineFormat::getEndArrowheadWidth() throw (uno::RuntimeException) -{ - throw uno::RuntimeException( rtl::OUString::createFromAscii("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() ); -} - -void SAL_CALL -ScVbaLineFormat::setEndArrowheadWidth( sal_Int32 /*_endarrowheadwidth*/ ) throw (uno::RuntimeException) -{ - throw uno::RuntimeException( rtl::OUString::createFromAscii("Property 'EndArrowheadWidth' is not supported."), uno::Reference< uno::XInterface >() ); -} - -double SAL_CALL -ScVbaLineFormat::getWeight() throw (uno::RuntimeException) -{ - sal_Int32 nLineWidth=0; - m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "LineWidth") ) >>= nLineWidth; - double dLineWidth = Millimeter::getInPoints( nLineWidth ); - return dLineWidth; -} - -void SAL_CALL -ScVbaLineFormat::setWeight( double _weight ) throw (uno::RuntimeException) -{ - if( _weight < 0 ) - throw uno::RuntimeException( rtl::OUString::createFromAscii("Parameter: Must be positv."), uno::Reference< uno::XInterface >() ); - if( _weight == 0 ) - _weight = 0.5; - m_nLineWeight = _weight; - Millimeter aMillimeter; - aMillimeter.setInPoints( _weight ); - - sal_Int32 nLineWidth = static_cast( aMillimeter.getInHundredthsOfOneMillimeter() ); - m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "LineWidth" ), uno::makeAny( nLineWidth ) ); - setDashStyle( m_nLineDashStyle ); -} - -sal_Bool SAL_CALL -ScVbaLineFormat::getVisible() throw (uno::RuntimeException) -{ - drawing::LineStyle aLineStyle; - m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "LineStyle" ) ) >>= aLineStyle; - if( aLineStyle == drawing::LineStyle_NONE ) - { - return sal_False; - } - return sal_True; -} - -void SAL_CALL -ScVbaLineFormat::setVisible( sal_Bool _visible ) throw (uno::RuntimeException) -{ - drawing::LineStyle aLineStyle; - m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "LineStyle" ) ) >>= aLineStyle; - if( !_visible ) - { - aLineStyle = drawing::LineStyle_NONE; - m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "LineStyle" ), uno::makeAny( aLineStyle ) ); - } - else - { - if( aLineStyle == drawing::LineStyle_NONE ) - { - setDashStyle( m_nLineDashStyle ); - } - } -} - -double SAL_CALL -ScVbaLineFormat::getTransparency() throw (uno::RuntimeException) -{ - sal_Int16 nTransparency = 0; - m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "LineTransparence" ) ) >>= nTransparency; - double fTransparency = static_cast( nTransparency ); - return fTransparency / 100; -} - -void SAL_CALL -ScVbaLineFormat::setTransparency( double _transparency ) throw (uno::RuntimeException) -{ - sal_Int16 nTransparency = static_cast( _transparency * 100 ); - m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "LineTransparence" ), uno::makeAny( nTransparency ) ); -} - -sal_Int16 SAL_CALL -ScVbaLineFormat::getStyle() throw (uno::RuntimeException) -{ - //OpenOffice.org only supports one LineStyle (other than the DashStyles) - //Therefore we can only return the SingleLine - return 1; -} - -void SAL_CALL -ScVbaLineFormat::setStyle( sal_Int16 /*_style */) throw (uno::RuntimeException) -{ - //OpenOffice.org only supports one LineStyle (other than the DashStyles) - //Therefore we do not set the LineStyle, because it maybe is already set - //to Dashed or Single Line. Setting the 'Visible' or 'DashStyle' properties - //will be done with the according methods. -} - -sal_Int32 SAL_CALL -ScVbaLineFormat::getDashStyle() throw (uno::RuntimeException) -{ - drawing::LineStyle eLineStyle; - //LineStyle integer in Xray - m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "LineStyle" ) ) >>= eLineStyle; - if( eLineStyle == drawing::LineStyle_SOLID ) - m_nLineDashStyle = office::MsoLineDashStyle::msoLineSolid; - else - { - drawing::LineDash aLineDash; - m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "LineDash" ) ) >>= aLineDash; - if( aLineDash.Dots == 0 ) - { - //LineDash - //LineLongDash - m_nLineDashStyle = office::MsoLineDashStyle::msoLineDash; - if( aLineDash.Distance > 0 && ( aLineDash.DashLen / aLineDash.Distance > 1 ) ) - { - m_nLineDashStyle = office::MsoLineDashStyle::msoLineLongDash; - } - } - else if( aLineDash.Dots == 1 ) - { - // LineDashDot - // LineLongDashDot - // LineSquareDot - // LineRoundDot ! not supported - m_nLineDashStyle = office::MsoLineDashStyle::msoLineDashDot; - if( aLineDash.Dashes == 0 ) - { - m_nLineDashStyle = office::MsoLineDashStyle::msoLineSquareDot; - } - else - { - if( aLineDash.Distance > 0 && ( aLineDash.DashLen / aLineDash.Distance > 1 ) ) - { - m_nLineDashStyle = office::MsoLineDashStyle::msoLineLongDashDot; - } - } - } - else if( aLineDash.Dots == 2 ) - { - // LineDashDotDot - m_nLineDashStyle = office::MsoLineDashStyle::msoLineDashDotDot; - } - } - - return m_nLineDashStyle; -} - -void SAL_CALL -ScVbaLineFormat::setDashStyle( sal_Int32 _dashstyle ) throw (uno::RuntimeException) -{ - m_nLineDashStyle = _dashstyle; - if( _dashstyle == office::MsoLineDashStyle::msoLineSolid ) - { - m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "LineStyle" ), uno::makeAny( drawing::LineStyle_SOLID )); - } - else - { - m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "LineStyle" ), uno::makeAny( drawing::LineStyle_DASH ) ); - drawing::LineDash pLineDash; - Millimeter aMillimeter( m_nLineWeight ); - sal_Int32 nPixel = static_cast< sal_Int32 >( aMillimeter.getInHundredthsOfOneMillimeter() ); - switch( _dashstyle ) - { - case office::MsoLineDashStyle::msoLineDashDot: - pLineDash.Dots = 1; - pLineDash.DotLen = nPixel; - pLineDash.Dashes = 1; - pLineDash.DashLen = 5 * nPixel; - pLineDash.Distance = 4 * nPixel; - break; - case office::MsoLineDashStyle::msoLineLongDashDot: - pLineDash.Dots = 1; - pLineDash.DotLen = nPixel; - pLineDash.Dashes = 1; - pLineDash.DashLen = 10 * nPixel; - pLineDash.Distance = 4 * nPixel; - break; - case office::MsoLineDashStyle::msoLineDash: - pLineDash.Dots = 0; - pLineDash.DotLen = 0; - pLineDash.Dashes = 1; - pLineDash.DashLen = 6 * nPixel; - pLineDash.Distance = 4 * nPixel; - break; - case office::MsoLineDashStyle::msoLineDashDotDot: - pLineDash.Dots = 2; - pLineDash.DotLen = nPixel; - pLineDash.Dashes = 1; - pLineDash.DashLen = 10 * nPixel; - pLineDash.Distance = 3 * nPixel; - break; - case office::MsoLineDashStyle::msoLineLongDash: - pLineDash.Dots = 0; - pLineDash.DotLen = 0; - pLineDash.Dashes = 1; - pLineDash.DashLen = 10 * nPixel; - pLineDash.Distance = 4 * nPixel; - break; - case office::MsoLineDashStyle::msoLineSquareDot: - pLineDash.Dots = 1; - pLineDash.DotLen = nPixel; - pLineDash.Dashes = 0; - pLineDash.DashLen = 0; - pLineDash.Distance = nPixel; - break; - case office::MsoLineDashStyle::msoLineRoundDot: - pLineDash.Dots = 1; - pLineDash.DotLen = nPixel; - pLineDash.Dashes = 0; - pLineDash.DashLen = 0; - pLineDash.Distance = nPixel; - break; - default: - throw uno::RuntimeException( rtl::OUString::createFromAscii("this MsoLineDashStyle is not supported."), uno::Reference< uno::XInterface >() ); - } - m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "LineDash" ), uno::makeAny( pLineDash ) ); - } -} - -// Methods -uno::Reference< msforms::XColorFormat > SAL_CALL -ScVbaLineFormat::BackColor() throw (uno::RuntimeException) -{ - return uno::Reference< msforms::XColorFormat >( new ScVbaColorFormat( getParent(), mxContext, this, m_xShape, ::ColorFormatType::LINEFORMAT_BACKCOLOR ) ); -} - -uno::Reference< msforms::XColorFormat > SAL_CALL -ScVbaLineFormat::ForeColor() throw (uno::RuntimeException) -{ - return uno::Reference< msforms::XColorFormat >( new ScVbaColorFormat( getParent(), mxContext, this, m_xShape, ::ColorFormatType::LINEFORMAT_FORECOLOR ) ); -} - - -rtl::OUString& -ScVbaLineFormat::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaLineFormat") ); - return sImplName; -} - -uno::Sequence< rtl::OUString > -ScVbaLineFormat::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msform.LineFormat" ) ); - } - return aServiceNames; -} - - diff --git a/sc/source/ui/vba/vbalineformat.hxx b/sc/source/ui/vba/vbalineformat.hxx deleted file mode 100644 index 70a950ebb2a1..000000000000 --- a/sc/source/ui/vba/vbalineformat.hxx +++ /dev/null @@ -1,85 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbalineformat.hxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef SC_VBA_XLINEFORMAT_HXX -#define SC_VBA_XLINEFORMAT_HXX - -#include -#include -#include -#include "vbahelperinterface.hxx" - -typedef InheritedHelperInterfaceImpl1< ov::msforms::XLineFormat > ScVbaLineFormat_BASE; - -class ScVbaLineFormat : public ScVbaLineFormat_BASE -{ -private: - css::uno::Reference< css::drawing::XShape > m_xShape; - css::uno::Reference< css::beans::XPropertySet > m_xPropertySet; - sal_Int32 m_nLineDashStyle; - double m_nLineWeight; -protected: - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); - sal_Int32 convertLineStartEndNameToArrowheadStyle( rtl::OUString sLineName ); - rtl::OUString convertArrowheadStyleToLineStartEndName( sal_Int32 nArrowheadStyle ) throw (css::uno::RuntimeException); - sal_Int32 calculateArrowheadSize(); -public: - ScVbaLineFormat( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape > xShape ); - - // Attributes - virtual sal_Int32 SAL_CALL getBeginArrowheadStyle() throw (css::uno::RuntimeException); - virtual void SAL_CALL setBeginArrowheadStyle( sal_Int32 _beginarrowheadstyle ) throw (css::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getBeginArrowheadLength() throw (css::uno::RuntimeException); - virtual void SAL_CALL setBeginArrowheadLength( sal_Int32 _beginarrowheadlength ) throw (css::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getBeginArrowheadWidth() throw (css::uno::RuntimeException); - virtual void SAL_CALL setBeginArrowheadWidth( sal_Int32 _beginarrowheadwidth ) throw (css::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getEndArrowheadStylel() throw (css::uno::RuntimeException); - virtual void SAL_CALL setEndArrowheadStylel( sal_Int32 _endarrowheadstylel ) throw (css::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getEndArrowheadLength() throw (css::uno::RuntimeException); - virtual void SAL_CALL setEndArrowheadLength( sal_Int32 _endarrowheadlength ) throw (css::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getEndArrowheadWidth() throw (css::uno::RuntimeException); - virtual void SAL_CALL setEndArrowheadWidth( sal_Int32 _endarrowheadwidth ) throw (css::uno::RuntimeException); - virtual double SAL_CALL getWeight() throw (css::uno::RuntimeException); - virtual void SAL_CALL setWeight( double _weight ) throw (css::uno::RuntimeException); - virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException); - virtual void SAL_CALL setVisible( sal_Bool _visible ) throw (css::uno::RuntimeException); - virtual double SAL_CALL getTransparency() throw (css::uno::RuntimeException); - virtual void SAL_CALL setTransparency( double _transparency ) throw (css::uno::RuntimeException); - virtual sal_Int16 SAL_CALL getStyle() throw (css::uno::RuntimeException); - virtual void SAL_CALL setStyle( sal_Int16 _style ) throw (css::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getDashStyle() throw (css::uno::RuntimeException); - virtual void SAL_CALL setDashStyle( sal_Int32 _dashstyle ) throw (css::uno::RuntimeException); - - // Methods - virtual css::uno::Reference< ov::msforms::XColorFormat > SAL_CALL BackColor() throw (css::uno::RuntimeException); - virtual css::uno::Reference< ov::msforms::XColorFormat > SAL_CALL ForeColor() throw (css::uno::RuntimeException); -}; - -#endif//SC_VBA_XLINEFORMAT_HXX diff --git a/sc/source/ui/vba/vbalistbox.cxx b/sc/source/ui/vba/vbalistbox.cxx deleted file mode 100644 index d50653ebb844..000000000000 --- a/sc/source/ui/vba/vbalistbox.cxx +++ /dev/null @@ -1,289 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbalistbox.cxx,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include - -#include "vbalistbox.hxx" -#include "vbapropvalue.hxx" -#include -#include -#include - -using namespace com::sun::star; -using namespace ooo::vba; - -const static rtl::OUString TEXT( RTL_CONSTASCII_USTRINGPARAM("Text") ); -const static rtl::OUString SELECTEDITEMS( RTL_CONSTASCII_USTRINGPARAM("SelectedItems") ); -const static rtl::OUString ITEMS( RTL_CONSTASCII_USTRINGPARAM("StringItemList") ); - - -ScVbaListBox::ScVbaListBox( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< css::uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : ListBoxImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper ) -{ - mpListHelper.reset( new ListControlHelper( m_xProps ) ); -} - -// Attributes -void SAL_CALL -ScVbaListBox::setListIndex( const uno::Any& _value ) throw (uno::RuntimeException) -{ - sal_Int32 nIndex = 0; - _value >>= nIndex; - Selected( nIndex ); -} - -uno::Any SAL_CALL -ScVbaListBox::getListIndex() throw (uno::RuntimeException) -{ - uno::Sequence< sal_Int16 > sSelection; - m_xProps->getPropertyValue( SELECTEDITEMS ) >>= sSelection; - if ( sSelection.getLength() == 0 ) - return uno::Any( sal_Int32( -1 ) ); - return uno::Any( sSelection[ 0 ] ); -} - -uno::Any SAL_CALL -ScVbaListBox::getValue() throw (uno::RuntimeException) -{ - uno::Sequence< sal_Int16 > sSelection; - uno::Sequence< rtl::OUString > sItems; - m_xProps->getPropertyValue( SELECTEDITEMS ) >>= sSelection; - m_xProps->getPropertyValue( ITEMS ) >>= sItems; - if( getMultiSelect() ) - throw uno::RuntimeException( rtl::OUString::createFromAscii( - "Attribute use invalid." ), uno::Reference< uno::XInterface >() ); - uno::Any aRet; - if ( sSelection.getLength() ) - aRet = uno::makeAny( sItems[ sSelection[ 0 ] ] ); - return aRet; -} - -void SAL_CALL -ScVbaListBox::setValue( const uno::Any& _value ) throw (uno::RuntimeException) -{ - if( getMultiSelect() ) - { - throw uno::RuntimeException( rtl::OUString::createFromAscii( - "Attribute use invalid." ), uno::Reference< uno::XInterface >() ); - } - rtl::OUString sValue = getAnyAsString( _value ); - uno::Sequence< rtl::OUString > sList; - m_xProps->getPropertyValue( ITEMS ) >>= sList; - uno::Sequence< sal_Int16 > nList; - sal_Int16 nLength = static_cast( sList.getLength() ); - sal_Int16 nValue = -1; - sal_Int16 i = 0; - for( i = 0; i < nLength; i++ ) - { - if( sList[i].equals( sValue ) ) - { - nValue = i; - break; - } - } - if( nValue == -1 ) - throw uno::RuntimeException( rtl::OUString::createFromAscii( - "Attribute use invalid." ), uno::Reference< uno::XInterface >() ); - - uno::Sequence< sal_Int16 > nSelectedIndices(1); - nSelectedIndices[ 0 ] = nValue; - m_xProps->setPropertyValue( SELECTEDITEMS, uno::makeAny( nSelectedIndices ) ); - m_xProps->setPropertyValue( TEXT, uno::makeAny( sValue ) ); -} - -::rtl::OUString SAL_CALL -ScVbaListBox::getText() throw (uno::RuntimeException) -{ - rtl::OUString result; - getValue() >>= result; - return result; -} - -void SAL_CALL -ScVbaListBox::setText( const ::rtl::OUString& _text ) throw (uno::RuntimeException) -{ - setValue( uno::makeAny( _text ) ); // seems the same -} - -sal_Bool SAL_CALL -ScVbaListBox::getMultiSelect() throw (css::uno::RuntimeException) -{ - sal_Bool bMultiSelect = sal_False; - m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiSelection" ) ) ) >>= bMultiSelect; - return bMultiSelect; -} - -void SAL_CALL -ScVbaListBox::setMultiSelect( sal_Bool _multiselect ) throw (css::uno::RuntimeException) -{ - m_xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiSelection" ) ), uno::makeAny( _multiselect ) ); -} - -css::uno::Any SAL_CALL -ScVbaListBox::Selected( sal_Int32 index ) throw (css::uno::RuntimeException) -{ - uno::Sequence< rtl::OUString > sList; - m_xProps->getPropertyValue( ITEMS ) >>= sList; - sal_Int16 nLength = static_cast< sal_Int16 >( sList.getLength() ); - // no choice but to do a horror cast as internally - // the indices are but sal_Int16 - sal_Int16 nIndex = static_cast< sal_Int16 >( index ); - if( nIndex < 0 || nIndex >= nLength ) - throw uno::RuntimeException( rtl::OUString::createFromAscii( - "Error Number." ), uno::Reference< uno::XInterface >() ); - m_nIndex = nIndex; - return uno::makeAny( uno::Reference< XPropValue > ( new ScVbaPropValue( this ) ) ); -} - -// Methods -void SAL_CALL -ScVbaListBox::AddItem( const uno::Any& pvargItem, const uno::Any& pvargIndex ) throw (uno::RuntimeException) -{ - mpListHelper->AddItem( pvargItem, pvargIndex ); - } - -void SAL_CALL -ScVbaListBox::removeItem( const uno::Any& index ) throw (uno::RuntimeException) -{ - mpListHelper->removeItem( index ); -} - -void SAL_CALL -ScVbaListBox::Clear( ) throw (uno::RuntimeException) -{ - mpListHelper->Clear(); -} - -// this is called when something like the following vba code is used -// to set the selected state of particular entries in the Listbox -// ListBox1.Selected( 3 ) = false -//PropListener -void -ScVbaListBox::setValueEvent( const uno::Any& value ) -{ - sal_Bool bValue = sal_False; - if( !(value >>= bValue) ) - throw uno::RuntimeException( rtl::OUString::createFromAscii( - "Invalid type\n. need boolean." ), uno::Reference< uno::XInterface >() ); - uno::Sequence< sal_Int16 > nList; - m_xProps->getPropertyValue( SELECTEDITEMS ) >>= nList; - sal_Int16 nLength = static_cast( nList.getLength() ); - sal_Int16 nIndex = m_nIndex; - for( sal_Int16 i = 0; i < nLength; i++ ) - { - if( nList[i] == nIndex ) - { - if( bValue ) - return; - else - { - for( ; i < nLength - 1; i++ ) - { - nList[i] = nList[i + 1]; - } - nList.realloc( nLength - 1 ); - //m_xProps->setPropertyValue( sSourceName, uno::makeAny( nList ) ); - m_xProps->setPropertyValue( SELECTEDITEMS, uno::makeAny( nList ) ); - return; - } - } - } - if( bValue ) - { - if( getMultiSelect() ) - { - nList.realloc( nLength + 1 ); - nList[nLength] = nIndex; - } - else - { - nList.realloc( 1 ); - nList[0] = nIndex; - } - m_xProps->setPropertyValue( sSourceName, uno::makeAny( nList ) ); - } -} - -// this is called when something like the following vba code is used -// to determine the selected state of particular entries in the Listbox -// msgbox ListBox1.Selected( 3 ) - -css::uno::Any -ScVbaListBox::getValueEvent() -{ - uno::Sequence< sal_Int16 > nList; - m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SelectedItems" ) ) ) >>= nList; - sal_Int32 nLength = nList.getLength(); - sal_Int32 nIndex = m_nIndex; - - for( sal_Int32 i = 0; i < nLength; i++ ) - { - if( nList[i] == nIndex ) - return uno::makeAny( sal_True ); - } - - return uno::makeAny( sal_False ); -} - -void SAL_CALL -ScVbaListBox::setRowSource( const rtl::OUString& _rowsource ) throw (uno::RuntimeException) -{ - ScVbaControl::setRowSource( _rowsource ); - mpListHelper->setRowSource( _rowsource ); -} - -sal_Int32 SAL_CALL -ScVbaListBox::getListCount() throw (uno::RuntimeException) -{ - return mpListHelper->getListCount(); -} - -uno::Any SAL_CALL -ScVbaListBox::List( const ::uno::Any& pvargIndex, const uno::Any& pvarColumn ) throw (uno::RuntimeException) -{ - return mpListHelper->List( pvargIndex, pvarColumn ); -} - -rtl::OUString& -ScVbaListBox::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaListBox") ); - return sImplName; -} - -uno::Sequence< rtl::OUString > -ScVbaListBox::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.ScVbaListBox" ) ); - } - return aServiceNames; -} diff --git a/sc/source/ui/vba/vbalistbox.hxx b/sc/source/ui/vba/vbalistbox.hxx deleted file mode 100644 index 69697d3ae623..000000000000 --- a/sc/source/ui/vba/vbalistbox.hxx +++ /dev/null @@ -1,90 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbalistbox.hxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef SC_VBA_LISTBOX_HXX -#define SC_VBA_LISTBOX_HXX -#include -#include -#include -#include -#include - -#include "vbacontrol.hxx" -#include "vbapropvalue.hxx" -#include "vbalistcontrolhelper.hxx" -#include "vbahelper.hxx" - -typedef cppu::ImplInheritanceHelper2 ListBoxImpl_BASE; -class ScVbaListBox : public ListBoxImpl_BASE - ,public PropListener -{ - std::auto_ptr< ListControlHelper > mpListHelper; - rtl::OUString sSourceName; - rtl::OUString msDftPropName; - - sal_Int16 m_nIndex; - -public: - ScVbaListBox( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ); - - // Attributes - virtual css::uno::Any SAL_CALL getListIndex() throw (css::uno::RuntimeException); - virtual void SAL_CALL setListIndex( const css::uno::Any& _value ) throw (css::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL getListCount() throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException); - virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException); - virtual rtl::OUString SAL_CALL getText() throw (css::uno::RuntimeException); - virtual void SAL_CALL setText( const ::rtl::OUString& _text ) throw (css::uno::RuntimeException); - virtual sal_Bool SAL_CALL getMultiSelect() throw (css::uno::RuntimeException); - virtual void SAL_CALL setMultiSelect( sal_Bool _multiselect ) throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL Selected( ::sal_Int32 index ) throw (css::uno::RuntimeException); - - // Methods - virtual void SAL_CALL AddItem( const css::uno::Any& pvargItem, const css::uno::Any& pvargIndex ) throw (css::uno::RuntimeException); - virtual void SAL_CALL removeItem( const css::uno::Any& index ) throw (css::uno::RuntimeException); - virtual void SAL_CALL Clear( ) throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL List( const css::uno::Any& pvargIndex, const css::uno::Any& pvarColumn ) throw (css::uno::RuntimeException); - // XControl - virtual void SAL_CALL setRowSource( const rtl::OUString& _rowsource ) throw (css::uno::RuntimeException); - - // XDefaultProperty - rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); } - - //XHelperInterface - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); - - //PropListener - virtual void setValueEvent( const css::uno::Any& value ); - virtual css::uno::Any getValueEvent(); - - -}; - -#endif // diff --git a/sc/source/ui/vba/vbalistcontrolhelper.cxx b/sc/source/ui/vba/vbalistcontrolhelper.cxx deleted file mode 100644 index e51b751290ac..000000000000 --- a/sc/source/ui/vba/vbalistcontrolhelper.cxx +++ /dev/null @@ -1,145 +0,0 @@ -#include - -using namespace com::sun::star; -using namespace ooo::vba; - -const static rtl::OUString ITEMS( RTL_CONSTASCII_USTRINGPARAM("StringItemList") ); - -void SAL_CALL -ListControlHelper::AddItem( const uno::Any& pvargItem, const uno::Any& pvargIndex ) throw (uno::RuntimeException) -{ - if ( pvargItem.hasValue() ) - { - uno::Sequence< rtl::OUString > sList; - m_xProps->getPropertyValue( ITEMS ) >>= sList; - - sal_Int32 nIndex = sList.getLength(); - - if ( pvargIndex.hasValue() ) - pvargIndex >>= nIndex; - - rtl::OUString sString = getAnyAsString( pvargItem ); - - // if no index specified or item is to be appended to end of - // list just realloc the array and set the last item - if ( nIndex == sList.getLength() ) - { - sal_Int32 nOldSize = sList.getLength(); - sList.realloc( nOldSize + 1 ); - sList[ nOldSize ] = sString; - } - else - { - // just copy those elements above the one to be inserted - std::vector< rtl::OUString > sVec; - // reserve just the amount we need to copy - sVec.reserve( sList.getLength() - nIndex ); - - // point at first element to copy - rtl::OUString* pString = sList.getArray() + nIndex; - const rtl::OUString* pEndString = sList.getArray() + sList.getLength(); - // insert the new element - sVec.push_back( sString ); - // copy elements - for ( ; pString != pEndString; ++pString ) - sVec.push_back( *pString ); - - sList.realloc( sList.getLength() + 1 ); - - // point at first element to be overwritten - pString = sList.getArray() + nIndex; - pEndString = sList.getArray() + sList.getLength(); - std::vector< rtl::OUString >::iterator it = sVec.begin(); - for ( ; pString != pEndString; ++pString, ++it) - *pString = *it; - // - } - - m_xProps->setPropertyValue( ITEMS, uno::makeAny( sList ) ); - - } -} - -void SAL_CALL -ListControlHelper::removeItem( const uno::Any& index ) throw (uno::RuntimeException) -{ - sal_Int32 nIndex = 0; - // for int index - if ( index >>= nIndex ) - { - uno::Sequence< rtl::OUString > sList; - m_xProps->getPropertyValue( ITEMS ) >>= sList; - if( nIndex < 0 || nIndex > ( sList.getLength() - 1 ) ) - throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid index" ), uno::Reference< uno::XInterface > () ); - if( sList.hasElements() ) - { - if( sList.getLength() == 1 ) - { - Clear(); - return; - } - for( sal_Int32 i = nIndex; i < ( sList.getLength()-1 ); i++ ) - { - sList[i] = sList[i+1]; - } - sList.realloc( sList.getLength() - 1 ); - } - - m_xProps->setPropertyValue( ITEMS, uno::makeAny( sList ) ); - } -} - -void SAL_CALL -ListControlHelper::Clear( ) throw (uno::RuntimeException) -{ - // urk, setValue doesn't seem to work !! - //setValue( uno::makeAny( sal_Int16() ) ); - m_xProps->setPropertyValue( ITEMS, uno::makeAny( uno::Sequence< rtl::OUString >() ) ); -} - -void SAL_CALL -ListControlHelper::setRowSource( const rtl::OUString& _rowsource ) throw (uno::RuntimeException) -{ - if ( _rowsource.getLength() == 0 ) - Clear(); -} - -sal_Int32 SAL_CALL -ListControlHelper::getListCount() throw (uno::RuntimeException) -{ - uno::Sequence< rtl::OUString > sList; - m_xProps->getPropertyValue( ITEMS ) >>= sList; - return sList.getLength(); -} - -uno::Any SAL_CALL -ListControlHelper::List( const ::uno::Any& pvargIndex, const uno::Any& pvarColumn ) throw (uno::RuntimeException) -{ - uno::Sequence< rtl::OUString > sList; - m_xProps->getPropertyValue( ITEMS ) >>= sList; - sal_Int16 nLength = static_cast< sal_Int16 >( sList.getLength() ); - uno::Any aRet; - if ( pvargIndex.hasValue() ) - { - sal_Int16 nIndex = -1; - pvargIndex >>= nIndex; - if( nIndex < 0 || nIndex >= nLength ) - throw uno::RuntimeException( rtl::OUString::createFromAscii( - "Bad row Index" ), uno::Reference< uno::XInterface >() ); - aRet <<= sList[ nIndex ]; - } - else if ( pvarColumn.hasValue() ) // pvarColumn on its own would be bad - throw uno::RuntimeException( rtl::OUString::createFromAscii( - "Bad column Index" ), uno::Reference< uno::XInterface >() ); - else // List() ( e.g. no args ) - { - uno::Sequence< uno::Sequence< rtl::OUString > > sReturnArray( nLength ); - for ( sal_Int32 i = 0; i < nLength; ++i ) - { - sReturnArray[ i ].realloc( 10 ); - sReturnArray[ i ][ 0 ] = sList[ i ]; - } - aRet = uno::makeAny( sReturnArray ); - } - return aRet; -} diff --git a/sc/source/ui/vba/vbalistcontrolhelper.hxx b/sc/source/ui/vba/vbalistcontrolhelper.hxx deleted file mode 100644 index f1ebe117733f..000000000000 --- a/sc/source/ui/vba/vbalistcontrolhelper.hxx +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef SC_VBA_LISTCONTROLHELPER -#define SC_VBA_LISTCONTROLHELPER - -#include "vbahelper.hxx" - -class ListControlHelper -{ - css::uno::Reference< css::beans::XPropertySet > m_xProps; - -public: - ListControlHelper( const css::uno::Reference< css::beans::XPropertySet >& rxControl ) : m_xProps( rxControl ){} - virtual ~ListControlHelper() {} - virtual void SAL_CALL AddItem( const css::uno::Any& pvargItem, const css::uno::Any& pvargIndex ) throw (css::uno::RuntimeException); - virtual void SAL_CALL removeItem( const css::uno::Any& index ) throw (css::uno::RuntimeException); - virtual void SAL_CALL setRowSource( const rtl::OUString& _rowsource ) throw (css::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL getListCount() throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL List( const css::uno::Any& pvargIndex, const css::uno::Any& pvarColumn ) throw (css::uno::RuntimeException); - virtual void SAL_CALL Clear( ) throw (css::uno::RuntimeException); -}; -#endif diff --git a/sc/source/ui/vba/vbamultipage.cxx b/sc/source/ui/vba/vbamultipage.cxx deleted file mode 100644 index 69410dbadc64..000000000000 --- a/sc/source/ui/vba/vbamultipage.cxx +++ /dev/null @@ -1,132 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * - * $Revision$ - * - * last change: $Author$ $Date$ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ -#include "vbamultipage.hxx" -#include -#include "vbapages.hxx" -#include - -using namespace com::sun::star; -using namespace ooo::vba; - -// uno servicename com.sun.star.awt.UnoControlProgressBarMode -const rtl::OUString SVALUE( RTL_CONSTASCII_USTRINGPARAM("ProgressValue") ); -const rtl::OUString SVALUEMAX( RTL_CONSTASCII_USTRINGPARAM("ProgressValueMax") ); -const rtl::OUString SSTEP( RTL_CONSTASCII_USTRINGPARAM("Step") ); - -typedef cppu::WeakImplHelper1< container::XIndexAccess > PagesImpl_Base; -class PagesImpl : public PagesImpl_Base -{ - sal_Int32 mnPages; -public: - PagesImpl( sal_Int32 nPages ) : mnPages( nPages ) {} - virtual ::sal_Int32 SAL_CALL getCount() throw (uno::RuntimeException) { return mnPages; } - virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, ::uno::RuntimeException) - { - if ( Index < 0 || Index > mnPages ) - throw lang::IndexOutOfBoundsException(); - return uno::makeAny( uno::Reference< uno::XInterface >() ); - } - // XElementAccess - virtual uno::Type SAL_CALL getElementType() throw (uno::RuntimeException) - { - // no Pages object yet #FIXME - //return msforms::XPage::static_type(0); - return uno::XInterface::static_type(0); - } - virtual ::sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException) - { - return ( mnPages > 0 ); - } -}; -uno::Reference< container::XIndexAccess > -ScVbaMultiPage::getPages( sal_Int32 nPages ) -{ - return new PagesImpl( nPages ); -} - -ScVbaMultiPage::ScVbaMultiPage( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper, const uno::Reference< uno::XInterface >& xDialog ) : MultiPageImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper ) -{ - mxDialogProps.set( xDialog, uno::UNO_QUERY_THROW ); - // set dialog step to value of multipage pseudo model - setValue(getValue()); -} - -// Attributes -sal_Int32 SAL_CALL -ScVbaMultiPage::getValue() throw (css::uno::RuntimeException) -{ - sal_Int32 nValue = 0; - m_xProps->getPropertyValue( SVALUE ) >>= nValue; - return nValue; -} - -void SAL_CALL -ScVbaMultiPage::setValue( const sal_Int32 _value ) throw (::com::sun::star::uno::RuntimeException) -{ - // track change in dialog ( dialog value is 1 based, 0 is a special value ) - m_xProps->setPropertyValue( SVALUE, uno::makeAny( _value ) ); - mxDialogProps->setPropertyValue( SSTEP, uno::makeAny( _value + 1) ); -} - - -rtl::OUString& -ScVbaMultiPage::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMultiPage") ); - return sImplName; -} - -uno::Any SAL_CALL -ScVbaMultiPage::Pages( const uno::Any& index ) throw (uno::RuntimeException) -{ - sal_Int32 nValue = 0; - m_xProps->getPropertyValue( SVALUEMAX ) >>= nValue; - uno::Reference< XCollection > xColl( new ScVbaPages( this, mxContext, getPages( nValue ) ) ); - if ( !index.hasValue() ) - return uno::makeAny( xColl ); - return xColl->Item( uno::makeAny( index ), uno::Any() ); -} - -uno::Sequence< rtl::OUString > -ScVbaMultiPage::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.MultiPage" ) ); - } - return aServiceNames; -} diff --git a/sc/source/ui/vba/vbamultipage.hxx b/sc/source/ui/vba/vbamultipage.hxx deleted file mode 100644 index 03db35dff790..000000000000 --- a/sc/source/ui/vba/vbamultipage.hxx +++ /dev/null @@ -1,65 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * - * $Revision$ - * - * last change: $Author$ $Date$ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ -#ifndef SC_VBA_MULTIPAGE_HXX -#define SC_VBA_MULTIPAGE_HXX -#include -#include -#include - -#include "vbacontrol.hxx" -#include "vbahelper.hxx" -//#include -#include - -typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XMultiPage > MultiPageImpl_BASE; - -class ScVbaMultiPage : public MultiPageImpl_BASE -{ - css::uno::Reference< css::container::XIndexAccess > getPages( sal_Int32 nPages ); - css::uno::Reference< css::beans::XPropertySet > mxDialogProps; -public: - ScVbaMultiPage( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper, const css::uno::Reference< css::uno::XInterface >& xDialog ); - // Attributes - virtual sal_Int32 SAL_CALL getValue() throw (css::uno::RuntimeException); - virtual void SAL_CALL setValue( sal_Int32 _value ) throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL Pages( const css::uno::Any& index ) throw (css::uno::RuntimeException); - - //XHelperInterface - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); - // XDefaultProperty - rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); } -}; -#endif //SC_VBA_LABEL_HXX diff --git a/sc/source/ui/vba/vbapages.cxx b/sc/source/ui/vba/vbapages.cxx deleted file mode 100644 index 19f89aaefeed..000000000000 --- a/sc/source/ui/vba/vbapages.cxx +++ /dev/null @@ -1,81 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * - * $Revision$ - * - * last change: $Author$ $Date$ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ -#include "vbapages.hxx" - -using namespace ::ooo::vba; -using namespace ::com::sun::star; -using namespace ::vos; - -ScVbaPages::ScVbaPages( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XIndexAccess >& xPages ) throw( lang::IllegalArgumentException ) : ScVbaPages_BASE( xParent, xContext, xPages ) -{ -} - -uno::Type SAL_CALL -ScVbaPages::getElementType() throw (uno::RuntimeException) -{ - // return msforms::XPage::static_type(0); - return uno::XInterface::static_type(0); -} - -uno::Any -ScVbaPages::createCollectionObject( const css::uno::Any& aSource ) -{ - return aSource; -} - -rtl::OUString& -ScVbaPages::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaPages") ); - return sImplName; -} - -uno::Reference< container::XEnumeration > SAL_CALL -ScVbaPages::createEnumeration() throw (uno::RuntimeException) -{ - return uno::Reference< container::XEnumeration >(); -} - -uno::Sequence< rtl::OUString > -ScVbaPages::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msform.Pages" ) ); - } - return aServiceNames; -} diff --git a/sc/source/ui/vba/vbapages.hxx b/sc/source/ui/vba/vbapages.hxx deleted file mode 100644 index 45ad882d759c..000000000000 --- a/sc/source/ui/vba/vbapages.hxx +++ /dev/null @@ -1,64 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * - * $Revision$ - * - * last change: $Author$ $Date$ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ -#ifndef SC_VBA_PAGES_HXX -#define SC_VBA_PAGES_HXX - -#include -#include -#include -#include -#include -#include - -#include "vbacollectionimpl.hxx" -typedef CollTestImplHelper< -ov::msforms::XPages > ScVbaPages_BASE; - -class ScVbaPages : public ScVbaPages_BASE -{ -protected: - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); -public: - ScVbaPages( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xPages ) throw ( css::lang::IllegalArgumentException ); - virtual ~ScVbaPages() {} - // XEnumerationAccess - virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); - virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); - // ScVbaPages_BASE - virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); - -}; -#endif//SC_VBA_SHAPE_HXX diff --git a/sc/source/ui/vba/vbapictureformat.cxx b/sc/source/ui/vba/vbapictureformat.cxx deleted file mode 100644 index 0d79fc173d50..000000000000 --- a/sc/source/ui/vba/vbapictureformat.cxx +++ /dev/null @@ -1,147 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbapictureformat.cxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include "vbapictureformat.hxx" - -using namespace ooo::vba; -using namespace com::sun::star; - -ScVbaPictureFormat::ScVbaPictureFormat( const css::uno::Reference< ov::XHelperInterface >& xParent, - const css::uno::Reference< css::uno::XComponentContext >& xContext, - uno::Reference< drawing::XShape > xShape ) - throw( lang::IllegalArgumentException ) : ScVbaPictureFormat_BASE( xParent, xContext ), m_xShape( xShape ) -{ - m_xPropertySet.set( m_xShape, uno::UNO_QUERY_THROW ); -} - -void -ScVbaPictureFormat::checkParameterRangeInDouble( double nRange, double nMin, double nMax ) throw (css::uno::RuntimeException) -{ - if( nRange < nMin ) - { - throw uno::RuntimeException( rtl::OUString::createFromAscii("Parameter out of range, value is too small.") , uno::Reference< uno::XInterface >() ); - } - if( nRange > nMax ) - { - throw uno::RuntimeException( rtl::OUString::createFromAscii("Parameter out of range, value is too high.") , uno::Reference< uno::XInterface >() ); - } -} - -// Attributes -double SAL_CALL -ScVbaPictureFormat::getBrightness() throw (uno::RuntimeException) -{ - sal_Int16 nLuminance = 0; - m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("AdjustLuminance") ) >>= nLuminance; - double fBrightness = static_cast< double >( nLuminance ); - fBrightness = ( fBrightness +100 ) / 200; - return fBrightness; -} - -void SAL_CALL -ScVbaPictureFormat::setBrightness( double _brightness ) throw (uno::RuntimeException) -{ - checkParameterRangeInDouble( _brightness, 0.0, 1.0 ); - double fLuminance = _brightness * 200 - 100; - sal_Int16 nLuminance = static_cast< sal_Int16 >( fLuminance ); - m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii("AdjustLuminance"), uno::makeAny( nLuminance ) ); -} - -double SAL_CALL -ScVbaPictureFormat::getContrast() throw (uno::RuntimeException) -{ - sal_Int16 nContrast = 0; - m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("AdjustContrast") ) >>= nContrast; - double fContrast = static_cast< double >( nContrast ); - fContrast = ( fContrast + 100 ) / 200; - return fContrast; -} - -void SAL_CALL -ScVbaPictureFormat::setContrast( double _contrast ) throw (uno::RuntimeException) -{ - checkParameterRangeInDouble( _contrast, 0.0, 1.0 ); - double fContrast = _contrast * 200 - 100; - sal_Int16 nContrast = static_cast< sal_Int16 >( fContrast ); - m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii("AdjustContrast"), uno::makeAny( nContrast ) ); -} - - -// Methods -void SAL_CALL -ScVbaPictureFormat::IncrementBrightness( double increment ) throw (uno::RuntimeException) -{ - double fBrightness = getBrightness(); - fBrightness += increment; - if( fBrightness < 0 ) - { - fBrightness = 0.0; - } - if( fBrightness > 1 ) - { - fBrightness = 1; - } - setBrightness( fBrightness ); -} - -void SAL_CALL -ScVbaPictureFormat::IncrementContrast( double increment ) throw (uno::RuntimeException) -{ - double nContrast = getContrast(); - nContrast += increment; - if( increment < 0 ) - { - increment = 0.0; - } - if( increment > 1 ) - { - increment = 1.0; - } - setContrast( nContrast ); -} - - -rtl::OUString& -ScVbaPictureFormat::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaPictureFormat") ); - return sImplName; -} - -uno::Sequence< rtl::OUString > -ScVbaPictureFormat::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msform.PictureFormat" ) ); - } - return aServiceNames; -} diff --git a/sc/source/ui/vba/vbapictureformat.hxx b/sc/source/ui/vba/vbapictureformat.hxx deleted file mode 100644 index f7b63f94fcbd..000000000000 --- a/sc/source/ui/vba/vbapictureformat.hxx +++ /dev/null @@ -1,64 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbapictureformat.hxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef SC_VBA_PICTUREFORMAT_HXX -#define SC_VBA_PICTUREFORMAT_HXX - -#include -#include -#include -#include "vbahelperinterface.hxx" - -typedef InheritedHelperInterfaceImpl1< ov::msforms::XPictureFormat > ScVbaPictureFormat_BASE; - -class ScVbaPictureFormat : public ScVbaPictureFormat_BASE -{ -private: - css::uno::Reference< css::drawing::XShape > m_xShape; - css::uno::Reference< css::beans::XPropertySet > m_xPropertySet; -protected: - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); -private: - void checkParameterRangeInDouble( double nRange, double nMin, double nMax ) throw (css::uno::RuntimeException); -public: - ScVbaPictureFormat( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, css::uno::Reference< css::drawing::XShape > xShape ) throw( css::lang::IllegalArgumentException ); - - // Attributes - virtual double SAL_CALL getBrightness() throw (css::uno::RuntimeException); - virtual void SAL_CALL setBrightness( double _brightness ) throw (css::uno::RuntimeException); - virtual double SAL_CALL getContrast() throw (css::uno::RuntimeException); - virtual void SAL_CALL setContrast( double _contrast ) throw (css::uno::RuntimeException); - - // Methods - virtual void SAL_CALL IncrementBrightness( double increment ) throw (css::uno::RuntimeException); - virtual void SAL_CALL IncrementContrast( double increment ) throw (css::uno::RuntimeException); -}; - -#endif//SC_VBA_PICTUREFORMAT_HXX diff --git a/sc/source/ui/vba/vbaprogressbar.cxx b/sc/source/ui/vba/vbaprogressbar.cxx deleted file mode 100644 index 27f425f9b808..000000000000 --- a/sc/source/ui/vba/vbaprogressbar.cxx +++ /dev/null @@ -1,78 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * - * $Revision$ - * - * last change: $Author$ $Date$ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ -#include "vbaprogressbar.hxx" -#include - -using namespace com::sun::star; -using namespace ooo::vba; - -// uno servicename com.sun.star.awt.UnoControlProgressBarMode -const rtl::OUString SVALUE( RTL_CONSTASCII_USTRINGPARAM("ProgressValue") ); - -ScVbaProgressBar::ScVbaProgressBar( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : ProgressBarImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper ) -{ -} - -// Attributes -uno::Any SAL_CALL -ScVbaProgressBar::getValue() throw (css::uno::RuntimeException) -{ - return m_xProps->getPropertyValue( SVALUE ); -} - -void SAL_CALL -ScVbaProgressBar::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException) -{ - m_xProps->setPropertyValue( SVALUE, _value ); -} - -rtl::OUString& -ScVbaProgressBar::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaProgressBar") ); - return sImplName; -} - -uno::Sequence< rtl::OUString > -ScVbaProgressBar::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Label" ) ); - } - return aServiceNames; -} diff --git a/sc/source/ui/vba/vbaprogressbar.hxx b/sc/source/ui/vba/vbaprogressbar.hxx deleted file mode 100644 index d040f08f98d6..000000000000 --- a/sc/source/ui/vba/vbaprogressbar.hxx +++ /dev/null @@ -1,59 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * - * $Revision$ - * - * last change: $Author$ $Date$ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ -#ifndef SC_VBA_PROGRESSBAR_HXX -#define SC_VBA_PROGRESSBAR_HXX -#include -#include - -#include "vbacontrol.hxx" -#include "vbahelper.hxx" -#include - -typedef cppu::ImplInheritanceHelper2< ScVbaControl, ov::msforms::XProgressBar, css::script::XDefaultProperty > ProgressBarImpl_BASE; - -class ScVbaProgressBar : public ProgressBarImpl_BASE -{ -public: - ScVbaProgressBar( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ); - // Attributes - virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException); - virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException); - //XHelperInterface - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); - // XDefaultProperty - rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); } -}; -#endif //SC_VBA_LABEL_HXX diff --git a/sc/source/ui/vba/vbaradiobutton.cxx b/sc/source/ui/vba/vbaradiobutton.cxx deleted file mode 100644 index 3ce00bfd862b..000000000000 --- a/sc/source/ui/vba/vbaradiobutton.cxx +++ /dev/null @@ -1,107 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbaradiobutton.cxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include "vbaradiobutton.hxx" -#include - -using namespace com::sun::star; -using namespace ooo::vba; - - -const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") ); -const static rtl::OUString STATE( RTL_CONSTASCII_USTRINGPARAM("State") ); -ScVbaRadioButton::ScVbaRadioButton( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : RadioButtonImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper ) -{ -} - -// Attributes -rtl::OUString SAL_CALL -ScVbaRadioButton::getCaption() throw (css::uno::RuntimeException) -{ - rtl::OUString Label; - m_xProps->getPropertyValue( LABEL ) >>= Label; - return Label; -} - -void SAL_CALL -ScVbaRadioButton::setCaption( const rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException) -{ - m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) ); -} - -uno::Any SAL_CALL -ScVbaRadioButton::getValue() throw (css::uno::RuntimeException) -{ - sal_Int16 nValue = -1; - m_xProps->getPropertyValue( STATE ) >>= nValue; - if( nValue != 0 ) - nValue = -1; -// return uno::makeAny( nValue ); -// I must be missing something MSO says value should be -1 if selected, 0 if not -// selected - return uno::makeAny( ( nValue == -1 ) ? sal_True : sal_False ); - -} - -void SAL_CALL -ScVbaRadioButton::setValue( const uno::Any& _value ) throw (uno::RuntimeException) -{ - sal_Int16 nValue = 0; - sal_Bool bValue = sal_False; - if( _value >>= nValue ) - { - if( nValue == -1) - nValue = 1; - } - else if ( _value >>= bValue ) - { - if ( bValue ) - nValue = 1; - } - m_xProps->setPropertyValue( STATE, uno::makeAny( nValue ) ); -} - -rtl::OUString& -ScVbaRadioButton::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaRadioButton") ); - return sImplName; -} - -uno::Sequence< rtl::OUString > -ScVbaRadioButton::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.RadioButton" ) ); - } - return aServiceNames; -} diff --git a/sc/source/ui/vba/vbaradiobutton.hxx b/sc/source/ui/vba/vbaradiobutton.hxx deleted file mode 100644 index f840030863dc..000000000000 --- a/sc/source/ui/vba/vbaradiobutton.hxx +++ /dev/null @@ -1,55 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbaradiobutton.hxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef SC_VBA_RADIOBUTTON_HXX -#define SC_VBA_RADIOBUTTON_HXX -#include -#include "vbacontrol.hxx" -#include "vbahelper.hxx" -#include - -typedef cppu::ImplInheritanceHelper2< ScVbaControl, ov::msforms::XRadioButton, css::script::XDefaultProperty > RadioButtonImpl_BASE; - -class ScVbaRadioButton : public RadioButtonImpl_BASE -{ -public: - ScVbaRadioButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ); - // Attributes - virtual rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException); - virtual void SAL_CALL setCaption( const rtl::OUString& _caption ) throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException); - virtual void SAL_CALL setValue(const com::sun::star::uno::Any&) throw (css::uno::RuntimeException); - //XHelperInterface - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); - // XDefaultProperty - rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); } - -}; -#endif //SC_VBA_RADIOBUTTON_HXX diff --git a/sc/source/ui/vba/vbascrollbar.cxx b/sc/source/ui/vba/vbascrollbar.cxx deleted file mode 100644 index 3da3230a8761..000000000000 --- a/sc/source/ui/vba/vbascrollbar.cxx +++ /dev/null @@ -1,139 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * - * $Revision$ - * - * last change: $Author$ $Date$ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ -#include "vbascrollbar.hxx" -#include - -using namespace com::sun::star; -using namespace ooo::vba; - - -const static rtl::OUString LARGECHANGE( RTL_CONSTASCII_USTRINGPARAM("BlockIncrement") ); -const static rtl::OUString SMALLCHANGE( RTL_CONSTASCII_USTRINGPARAM("LineIncrement") ); -const static rtl::OUString ORIENTATION( RTL_CONSTASCII_USTRINGPARAM("Orientation") ); -const static rtl::OUString SCROLLVALUE( RTL_CONSTASCII_USTRINGPARAM("ScrollValue") ); -const static rtl::OUString SCROLLMAX( RTL_CONSTASCII_USTRINGPARAM("ScrollValueMax") ); -const static rtl::OUString SCROLLMIN( RTL_CONSTASCII_USTRINGPARAM("ScrollValueMin") ); - -ScVbaScrollBar::ScVbaScrollBar( const css::uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : ScrollBarImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper ) -{ -} - -// Attributes -uno::Any SAL_CALL -ScVbaScrollBar::getValue() throw (css::uno::RuntimeException) -{ - return m_xProps->getPropertyValue( SCROLLVALUE ); -} - -void SAL_CALL -ScVbaScrollBar::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException) -{ - m_xProps->setPropertyValue( SCROLLVALUE, _value ); -} - -::sal_Int32 SAL_CALL -ScVbaScrollBar::getMax() throw (uno::RuntimeException) -{ - sal_Int32 nMax = 0; - m_xProps->getPropertyValue( SCROLLMAX ) >>= nMax; - return nMax; -} - -void SAL_CALL -ScVbaScrollBar::setMax( sal_Int32 nVal ) throw (uno::RuntimeException) -{ - m_xProps->setPropertyValue( SCROLLMAX, uno::makeAny( nVal ) ); -} - -::sal_Int32 SAL_CALL -ScVbaScrollBar::getMin() throw (uno::RuntimeException) -{ - sal_Int32 nVal = 0; - m_xProps->getPropertyValue( SCROLLMIN ) >>= nVal; - return nVal; -} - -void SAL_CALL -ScVbaScrollBar::setMin( sal_Int32 nVal ) throw (uno::RuntimeException) -{ - m_xProps->setPropertyValue( SCROLLMIN, uno::makeAny( nVal ) ); -} - -void SAL_CALL -ScVbaScrollBar::setLargeChange( ::sal_Int32 _largechange ) throw (uno::RuntimeException) -{ - m_xProps->setPropertyValue( LARGECHANGE, uno::makeAny( _largechange ) ); -} - -::sal_Int32 SAL_CALL -ScVbaScrollBar::getLargeChange() throw (uno::RuntimeException) -{ - sal_Int32 nVal = 0; - m_xProps->getPropertyValue( LARGECHANGE ) >>= nVal; - return nVal; -} - -::sal_Int32 SAL_CALL -ScVbaScrollBar::getSmallChange() throw (uno::RuntimeException) -{ - sal_Int32 nSmallChange = 0; - m_xProps->getPropertyValue( SMALLCHANGE ) >>= nSmallChange; - return nSmallChange; -} - -void SAL_CALL -ScVbaScrollBar::setSmallChange( ::sal_Int32 _smallchange ) throw (uno::RuntimeException) -{ - m_xProps->setPropertyValue( SMALLCHANGE, uno::makeAny( _smallchange ) ); -} - -rtl::OUString& -ScVbaScrollBar::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaScrollBar") ); - return sImplName; -} - -uno::Sequence< rtl::OUString > -ScVbaScrollBar::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Frame" ) ); - } - return aServiceNames; -} diff --git a/sc/source/ui/vba/vbascrollbar.hxx b/sc/source/ui/vba/vbascrollbar.hxx deleted file mode 100644 index 04c4853cdbe4..000000000000 --- a/sc/source/ui/vba/vbascrollbar.hxx +++ /dev/null @@ -1,66 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * - * $Revision$ - * - * last change: $Author$ $Date$ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ -#ifndef SC_VBA_SCROLLBAR_HXX -#define SC_VBA_SCROLLBAR_HXX -#include -#include - -#include "vbacontrol.hxx" -#include "vbahelper.hxx" - -typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XScrollBar > ScrollBarImpl_BASE; - -class ScVbaScrollBar : public ScrollBarImpl_BASE -{ -public: - ScVbaScrollBar( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ); - // Attributes - virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException); - virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL getMax() throw (css::uno::RuntimeException); - virtual void SAL_CALL setMax( ::sal_Int32 _max ) throw (css::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL getMin() throw (css::uno::RuntimeException); - virtual void SAL_CALL setMin( ::sal_Int32 _min ) throw (css::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL getLargeChange() throw (css::uno::RuntimeException); - virtual void SAL_CALL setLargeChange( ::sal_Int32 _largechange ) throw (css::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL getSmallChange() throw (css::uno::RuntimeException); - virtual void SAL_CALL setSmallChange( ::sal_Int32 _smallchange ) throw (css::uno::RuntimeException); - - - //XHelperInterface - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); -}; -#endif //SC_VBA_LABEL_HXX diff --git a/sc/source/ui/vba/vbashape.cxx b/sc/source/ui/vba/vbashape.cxx deleted file mode 100644 index 7b81682cb393..000000000000 --- a/sc/source/ui/vba/vbashape.cxx +++ /dev/null @@ -1,480 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbashape.cxx,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "vbashape.hxx" -#include "vbatextframe.hxx" -#include "vbalineformat.hxx" -#include "vbafillformat.hxx" -#include "vbapictureformat.hxx" - -using namespace ::ooo::vba; -using namespace ::com::sun::star; -using namespace ::vos; - -ScVbaShape::ScVbaShape( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< drawing::XShape >& xShape, const uno::Reference< drawing::XShapes >& xShapes, sal_Int32 nType ) throw( lang::IllegalArgumentException ) : ScVbaShape_BASE( xParent, xContext ), m_xShape( xShape ), m_xShapes( xShapes ), m_nType( nType ) -{ - m_xPropertySet.set( m_xShape, uno::UNO_QUERY_THROW ); - addListeners(); -} - -ScVbaShape::ScVbaShape( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< drawing::XShape >& xShape ) throw( lang::IllegalArgumentException ) : ScVbaShape_BASE( uno::Reference< XHelperInterface >(), xContext ), m_xShape( xShape ) -{ - // add listener - addListeners(); -} - -ScVbaShape::~ScVbaShape() -{ - // dtor must never ever throw - try - { - removeShapeListener(); - removeShapesListener(); - } - catch( uno::Exception& ) - { - } -} - -void SAL_CALL -ScVbaShape::disposing( const lang::EventObject& rEventObject ) throw( uno::RuntimeException ) -{ - uno::Reference< drawing::XShapes > xShapes( rEventObject.Source, uno::UNO_QUERY ); - uno::Reference< drawing::XShape > xShape( rEventObject.Source, uno::UNO_QUERY ); - if ( xShapes.is() ) - removeShapesListener(); - if ( xShape.is() ) - removeShapeListener(); -} - - -void ScVbaShape::addListeners() -{ - uno::Reference< lang::XComponent > xComponent( m_xShape, uno::UNO_QUERY ); - if ( xComponent.is() ) - xComponent->addEventListener( this ); - - xComponent.set( m_xShapes, uno::UNO_QUERY ); - if ( xComponent.is() ) - xComponent->addEventListener( this ); -} - -void -ScVbaShape::removeShapeListener() throw( uno::RuntimeException ) -{ - if( m_xShape.is() ) - { - uno::Reference< lang::XComponent > xComponent( m_xShape, uno::UNO_QUERY_THROW ); - xComponent->removeEventListener( this ); - } - m_xShape = NULL; - m_xPropertySet = NULL; -} - -void -ScVbaShape::removeShapesListener() throw( uno::RuntimeException ) -{ - if( m_xShapes.is() ) - { - uno::Reference< lang::XComponent > xComponent( m_xShapes, uno::UNO_QUERY_THROW ); - xComponent->removeEventListener( this ); - } - m_xShapes = NULL; -} - -sal_Int32 -ScVbaShape::getType( const css::uno::Reference< drawing::XShape > xShape ) throw (uno::RuntimeException) -{ - rtl::OUString sShapeType; - uno::Reference< drawing::XShapeDescriptor > xShapeDescriptor( xShape, uno::UNO_QUERY_THROW ); - sShapeType = xShapeDescriptor->getShapeType(); - // office::MsoShapeType::msoDiagram to "com.sun.star.drawing.GroupShape" - if( sShapeType.equals( rtl::OUString::createFromAscii( "com.sun.star.drawing.GroupShape" ) ) ) - return office::MsoShapeType::msoGroup; - else if( sShapeType.equals( rtl::OUString::createFromAscii( "com.sun.star.drawing.GraphicObjectShape" ) ) ) - return office::MsoShapeType::msoPicture; - else if( sShapeType.equals( rtl::OUString::createFromAscii( "com.sun.star.drawing.ControlShape" ) ) ) - return office::MsoShapeType::msoOLEControlObject; - // OOo don't support office::MsoShapeType::msoComment as a Shape. - else if( sShapeType.equals( rtl::OUString::createFromAscii( "com.sun.star.drawing.OLE2Shape" ) ) ) - return office::MsoShapeType::msoChart; - // Art characters office::MsoShapeType::msoTextEffect, in OOo corresponding to "com.sun.star.drawing.CustomShape" - else if( sShapeType.equals( rtl::OUString::createFromAscii( "com.sun.star.drawing.ConnectorShape" ) ) ) - { - enum drawing::ConnectorType connectorType; - uno::Reference< beans::XPropertySet > xPropertySet( xShape, uno::UNO_QUERY_THROW ); - xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("EdgeKind")) >>= connectorType; - if( connectorType == drawing::ConnectorType_CURVE ) - return office::MsoShapeType::msoFreeform; - else if( connectorType == drawing::ConnectorType_LINE ) - return office::MsoShapeType::msoLine; - else - return office::MsoShapeType::msoAutoShape; - } - else if( sShapeType.equals( rtl::OUString::createFromAscii( "com.sun.star.drawing.LineShape" ) ) ) - return office::MsoShapeType::msoLine; - else if( sShapeType.equals( rtl::OUString::createFromAscii( "com.sun.star.drawing.CustomShape" ) ) || - sShapeType.equals( rtl::OUString::createFromAscii( "com.sun.star.drawing.RectangleShape") ) ) - return office::MsoShapeType::msoAutoShape; - else - throw uno::RuntimeException( rtl::OUString::createFromAscii( "the shape type do not be surppored: " ) + sShapeType, uno::Reference< uno::XInterface >() ); -} - -// Attributes -rtl::OUString SAL_CALL -ScVbaShape::getName() throw (uno::RuntimeException) -{ - rtl::OUString sName; - uno::Reference< container::XNamed > xNamed( m_xShape, uno::UNO_QUERY_THROW ); - sName = xNamed->getName(); - return sName; -} - -void SAL_CALL -ScVbaShape::setName( const rtl::OUString& _name ) throw (uno::RuntimeException) -{ - uno::Reference< container::XNamed > xNamed( m_xShape, uno::UNO_QUERY_THROW ); - xNamed->setName( _name ); -} - -double SAL_CALL -ScVbaShape::getHeight() throw (uno::RuntimeException) -{ - return Millimeter::getInPoints( m_xShape->getSize().Height ); -} - -void SAL_CALL -ScVbaShape::setHeight( double _height ) throw (uno::RuntimeException) -{ - awt::Size aSize( m_xShape->getSize() ); - aSize.Height = Millimeter::getInHundredthsOfOneMillimeter( _height ); - m_xShape->setSize( aSize ); -} - -double SAL_CALL -ScVbaShape::getWidth() throw (uno::RuntimeException) -{ - return Millimeter::getInPoints( m_xShape->getSize().Width ); -} - -void SAL_CALL -ScVbaShape::setWidth( double _width ) throw (uno::RuntimeException) -{ - awt::Size aSize( m_xShape->getSize() ); - aSize.Width = Millimeter::getInHundredthsOfOneMillimeter( _width ); - m_xShape->setSize( aSize ); -} - -double SAL_CALL -ScVbaShape::getLeft() throw (uno::RuntimeException) -{ - return Millimeter::getInPoints( m_xShape->getPosition().X ); -} - -void SAL_CALL -ScVbaShape::setLeft( double _left ) throw (uno::RuntimeException) -{ - awt::Point oldPosition; - oldPosition = m_xShape->getPosition(); - oldPosition.X = Millimeter::getInHundredthsOfOneMillimeter( _left ); - m_xShape->setPosition( oldPosition ); -} - -double SAL_CALL -ScVbaShape::getTop() throw (uno::RuntimeException) -{ - return Millimeter::getInPoints( m_xShape->getPosition().Y ); -} - -void SAL_CALL -ScVbaShape::setTop( double _top ) throw (uno::RuntimeException) -{ - awt::Point oldPosition; - oldPosition = m_xShape->getPosition(); - oldPosition.Y = Millimeter::getInHundredthsOfOneMillimeter( _top ); - m_xShape->setPosition( oldPosition ); -} - -sal_Bool SAL_CALL -ScVbaShape::getVisible() throw (uno::RuntimeException) -{ - //UNO Shapes are always visible - return sal_True; -} - -void SAL_CALL -ScVbaShape::setVisible( sal_Bool /*_visible*/ ) throw (uno::RuntimeException) -{ - //UNO Shapes are always visible -} - -sal_Int32 SAL_CALL -ScVbaShape::getZOrderPosition() throw (uno::RuntimeException) -{ - sal_Int32 nZOrderPosition = 0; - uno::Any aZOrderPosition = m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "ZOrder" ) ); - aZOrderPosition >>= nZOrderPosition; - return nZOrderPosition + 1; -} - -sal_Int32 SAL_CALL -ScVbaShape::getType() throw (uno::RuntimeException) -{ - return m_nType; -} - -double SAL_CALL -ScVbaShape::getRotation() throw (uno::RuntimeException) -{ - double dRotation = 0; - sal_Int32 nRotation = 0; - m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "RotateAngle" ) ) >>= nRotation; - dRotation = static_cast< double >( nRotation /100 ); - return dRotation; -} - -void SAL_CALL -ScVbaShape::setRotation( double _rotation ) throw (uno::RuntimeException) -{ - sal_Int32 nRotation = static_cast < sal_Int32 > ( _rotation * 100 ); - m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "RotateAngle" ), uno::makeAny( nRotation ) ); -} - -uno::Reference< msforms::XLineFormat > SAL_CALL -ScVbaShape::getLine() throw (uno::RuntimeException) -{ - // TODO should ongly return line - return uno::Reference< msforms::XLineFormat >( new ScVbaLineFormat( this, mxContext, m_xShape ) ); -} - -uno::Reference< msforms::XFillFormat > SAL_CALL -ScVbaShape::getFill() throw (uno::RuntimeException) -{ - return uno::Reference< msforms::XFillFormat >( new ScVbaFillFormat( this, mxContext, m_xShape ) ); -} - -uno::Reference< msforms::XPictureFormat > SAL_CALL -ScVbaShape::getPictureFormat() throw (uno::RuntimeException) -{ - return uno::Reference< msforms::XPictureFormat >( new ScVbaPictureFormat( this, mxContext, m_xShape ) ); -} - -// Methods -uno::Reference< excel::XTextFrame > SAL_CALL -ScVbaShape::TextFrame() throw (uno::RuntimeException) -{ - return uno::Reference< excel::XTextFrame >(new ScVbaTextFrame( getParent(), mxContext, m_xShape ) ); -} - -void SAL_CALL -ScVbaShape::Delete() throw (uno::RuntimeException) -{ - OGuard aGuard( Application::GetSolarMutex() ); - m_xShapes->remove( m_xShape ); -} - -void SAL_CALL -ScVbaShape::ZOrder( sal_Int32 ZOrderCmd ) throw (uno::RuntimeException) -{ - sal_Int32 nOrderPositon; - uno::Any aOrderPostion = m_xPropertySet->getPropertyValue( rtl::OUString::createFromAscii( "ZOrder" ) ); - aOrderPostion >>= nOrderPositon; - switch( ZOrderCmd ) - { - case office::MsoZOrderCmd::msoBringToFront: - m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "ZOrder" ), uno::makeAny( SAL_MAX_INT32 ) ); - break; - case office::MsoZOrderCmd::msoSendToBack: - m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "ZOrder" ), uno::makeAny( (sal_Int32)0 ) ); - break; - case office::MsoZOrderCmd::msoBringForward: - nOrderPositon += 1; - m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "ZOrder" ), uno::makeAny( nOrderPositon ) ); - break; - case office::MsoZOrderCmd::msoSendBackward: - if( nOrderPositon > 0 ) - { - nOrderPositon -= 1; - m_xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "ZOrder" ), uno::makeAny( nOrderPositon ) ); - } - break; - // below two commands use with Writer for text and image object. - case office::MsoZOrderCmd::msoBringInFrontOfText: - case office::MsoZOrderCmd::msoSendBehindText: - throw uno::RuntimeException( rtl::OUString::createFromAscii( "This ZOrderCmd is not implemented, it is use with writer." ), uno::Reference< uno::XInterface >() ); - default: - throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid Parameter." ), uno::Reference< uno::XInterface >() ); - } -} - -void SAL_CALL -ScVbaShape::IncrementRotation( double Increment ) throw (uno::RuntimeException) -{ - double nCurrentRotation = getRotation(); - nCurrentRotation += Increment; - setRotation(nCurrentRotation); -} - -void SAL_CALL -ScVbaShape::IncrementLeft( double Increment ) throw (uno::RuntimeException) -{ - double nCurrentLeft = getLeft(); - nCurrentLeft += Increment; - setLeft(nCurrentLeft); -} - -void SAL_CALL -ScVbaShape::IncrementTop( double Increment ) throw (uno::RuntimeException) -{ - double nCurrentTop = getTop(); - nCurrentTop += Increment; - setTop(nCurrentTop); -} - -void SAL_CALL -ScVbaShape::ScaleHeight( double Factor, sal_Bool /*RelativeToOriginalSize*/, sal_Int32 Scale ) throw (uno::RuntimeException) -{ - double nHeight = getHeight(); - double nNewHeight = nHeight * Factor; - if( Scale == office::MsoScaleFrom::msoScaleFromTopLeft ) - { - setHeight(nNewHeight); - } - else if( Scale == office::MsoScaleFrom::msoScaleFromBottomRight ) - { - double nDeltaHeight = nNewHeight - nHeight; - double nNewTop = getTop() - nDeltaHeight; - setTop(nNewTop); - setHeight(nNewHeight); - } - else if( Scale == office::MsoScaleFrom::msoScaleFromMiddle ) - { - double nDeltaHeight = (nNewHeight - nHeight) / 2; - double nNewTop = getTop() - nDeltaHeight; - setTop(nNewTop); - setHeight(nNewHeight); - } - else - { - throw uno::RuntimeException( rtl::OUString::createFromAscii( "ScaleHeight.Scale wrong value is given." ) , uno::Reference< uno::XInterface >() ); - } -} - -void SAL_CALL -ScVbaShape::ScaleWidth( double Factor, sal_Bool /*RelativeToOriginalSize*/, sal_Int32 Scale ) throw (uno::RuntimeException) -{ - double nWidth = getWidth(); - double nNewWidth = nWidth * Factor; - if( Scale == office::MsoScaleFrom::msoScaleFromTopLeft ) - { - setWidth(nNewWidth); - } - else if( Scale == office::MsoScaleFrom::msoScaleFromBottomRight ) - { - double nDeltaWidth = nNewWidth - nWidth; - double nNewLeft = getLeft() - nDeltaWidth; - setLeft(nNewLeft); - setWidth(nNewWidth); - } - else if( Scale == office::MsoScaleFrom::msoScaleFromMiddle ) - { - double nDeltaWidth = (nNewWidth - nWidth) / 2; - double nNewLeft = getLeft() - nDeltaWidth; - setLeft(nNewLeft); - setWidth(nNewWidth); - } - else - { - throw uno::RuntimeException( rtl::OUString::createFromAscii( "ScaleHeight.Scale wrong value is given." ) , uno::Reference< uno::XInterface >() ); - } -} - -void SAL_CALL -ScVbaShape::Select( const uno::Any& /*Replace*/ ) throw ( uno::RuntimeException ) -{ - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); - uno::Reference< view::XSelectionSupplier > xSelectSupp( xModel->getCurrentController(), uno::UNO_QUERY_THROW ); - xSelectSupp->select( uno::makeAny( m_xShape ) ); -} - -// This method should not be part of Shape, what we reall need to do is... -// dynamically create the appropriate objects e.g. TextBox, Oval, Picture etc. -// ( e.g. the ones that really do have ShapeRange as an attribute ) -#include "vbashaperange.hxx" - -uno::Any SAL_CALL -ScVbaShape::ShapeRange( const uno::Any& index ) throw ( uno::RuntimeException ) -{ - // perhaps we should store a reference to the Shapes Collection - // in this class - // but anyway this method should not even be in this class - // #TODO not sure what the parent of the Shapes collection should be - - XNamedObjectCollectionHelper< drawing::XShape >::XNamedVec aVec; - aVec.push_back( m_xShape ); - uno::Reference< container::XIndexAccess > xIndexAccess( new XNamedObjectCollectionHelper< drawing::XShape >( aVec ) ); - uno::Reference< container::XChild > xChild( m_xShape, uno::UNO_QUERY_THROW ); - // #FIXME for want of a better parent, setting this - uno::Reference< msforms::XShapeRange > xShapeRange( new ScVbaShapeRange( mxParent, mxContext, xIndexAccess, uno::Reference< drawing::XDrawPage >( xChild->getParent(), uno::UNO_QUERY_THROW ) ) ); - if ( index.hasValue() ) - return xShapeRange->Item( index, uno::Any() ); - return uno::makeAny( xShapeRange ); -} - -rtl::OUString& -ScVbaShape::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaShape") ); - return sImplName; -} - -uno::Sequence< rtl::OUString > -ScVbaShape::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msform.Shape" ) ); - } - return aServiceNames; -} diff --git a/sc/source/ui/vba/vbashape.hxx b/sc/source/ui/vba/vbashape.hxx deleted file mode 100644 index 5ae35500381d..000000000000 --- a/sc/source/ui/vba/vbashape.hxx +++ /dev/null @@ -1,108 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbashape.hxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef SC_VBA_SHAPE_HXX -#define SC_VBA_SHAPE_HXX - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "vbahelperinterface.hxx" - -typedef ::cppu::WeakImplHelper2< ov::msforms::XShape, css::lang::XEventListener > ListeningShape; - -typedef InheritedHelperInterfaceImpl< ListeningShape > ScVbaShape_BASE; - -class ScVbaShape : public ScVbaShape_BASE -{ -friend class ConcreteXShapeHelper; // perhaps an accessor would be better -private: -protected: - css::uno::Reference< css::drawing::XShape > m_xShape; - css::uno::Reference< css::drawing::XShapes > m_xShapes; - css::uno::Reference< css::beans::XPropertySet > m_xPropertySet; - sal_Int32 m_nType; - css::uno::Any m_aRange; - virtual void addListeners(); - virtual void removeShapeListener() throw( css::uno::RuntimeException ); - virtual void removeShapesListener() throw( css::uno::RuntimeException ); - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); -public: - ScVbaShape( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape >& xShape, const css::uno::Reference< css::drawing::XShapes >& xShapes, sal_Int32 nType ) throw ( css::lang::IllegalArgumentException ); - ScVbaShape( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape >& xShape ) throw ( css::lang::IllegalArgumentException ); - virtual ~ScVbaShape(); - css::uno::Any getRange() { return m_aRange; }; - void setRange( css::uno::Any aRange ) { m_aRange = aRange; }; - - static sal_Int32 getType( const css::uno::Reference< css::drawing::XShape > xShape ) throw (css::uno::RuntimeException); - - // Attributes - virtual rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException); - virtual void SAL_CALL setName( const rtl::OUString& _name ) throw (css::uno::RuntimeException); - virtual double SAL_CALL getHeight() throw (css::uno::RuntimeException); - virtual void SAL_CALL setHeight( double _height ) throw (css::uno::RuntimeException); - virtual double SAL_CALL getWidth() throw (css::uno::RuntimeException); - virtual void SAL_CALL setWidth( double _width ) throw (css::uno::RuntimeException); - virtual double SAL_CALL getLeft() throw (css::uno::RuntimeException); - virtual void SAL_CALL setLeft( double _left ) throw (css::uno::RuntimeException); - virtual double SAL_CALL getTop() throw (css::uno::RuntimeException); - virtual void SAL_CALL setTop( double _top ) throw (css::uno::RuntimeException); - virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException); - virtual void SAL_CALL setVisible( sal_Bool _visible ) throw (css::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getZOrderPosition() throw (css::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getType() throw (css::uno::RuntimeException); - virtual double SAL_CALL getRotation() throw (css::uno::RuntimeException); - virtual void SAL_CALL setRotation( double _rotation ) throw (css::uno::RuntimeException); - virtual css::uno::Reference< ov::msforms::XLineFormat > SAL_CALL getLine() throw (css::uno::RuntimeException); - virtual css::uno::Reference< ov::msforms::XFillFormat > SAL_CALL getFill() throw (css::uno::RuntimeException); - virtual css::uno::Reference< ov::msforms::XPictureFormat > SAL_CALL getPictureFormat() throw (css::uno::RuntimeException); - - // Methods - virtual css::uno::Reference< ov::excel::XTextFrame > SAL_CALL TextFrame( ) throw (css::uno::RuntimeException); - virtual void SAL_CALL Delete() throw (css::uno::RuntimeException); - virtual void SAL_CALL ZOrder( sal_Int32 ZOrderCmd ) throw (css::uno::RuntimeException); - virtual void SAL_CALL IncrementRotation( double Increment ) throw (css::uno::RuntimeException); - virtual void SAL_CALL IncrementLeft( double Increment ) throw (css::uno::RuntimeException); - virtual void SAL_CALL IncrementTop( double Increment ) throw (css::uno::RuntimeException); - virtual void SAL_CALL ScaleHeight( double Factor, sal_Bool RelativeToOriginalSize, sal_Int32 Scale ) throw (css::uno::RuntimeException); - virtual void SAL_CALL ScaleWidth( double Factor, sal_Bool RelativeToOriginalSize, sal_Int32 Scale ) throw (css::uno::RuntimeException); - // Replace?? - virtual void SAL_CALL Select( const css::uno::Any& Replace ) throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL ShapeRange( const css::uno::Any& index ) throw ( css::uno::RuntimeException ); - // XEventListener - virtual void SAL_CALL disposing( const css::lang::EventObject& rEventObject ) throw( css::uno::RuntimeException ); -}; -#endif//SC_VBA_SHAPE_HXX diff --git a/sc/source/ui/vba/vbashaperange.cxx b/sc/source/ui/vba/vbashaperange.cxx deleted file mode 100644 index 2298c65bae6f..000000000000 --- a/sc/source/ui/vba/vbashaperange.cxx +++ /dev/null @@ -1,170 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbashaperange.cxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include -#include - -#include "vbashaperange.hxx" -#include "vbashape.hxx" - -using namespace ::ooo::vba; -using namespace ::com::sun::star; - -class VbShapeRangeEnumHelper : public EnumerationHelper_BASE -{ - uno::Reference< XCollection > m_xParent; - uno::Reference m_xIndexAccess; - sal_Int32 nIndex; -public: - VbShapeRangeEnumHelper( const uno::Reference< XCollection >& xParent, const uno::Reference< container::XIndexAccess >& xIndexAccess ) : m_xParent( xParent ), m_xIndexAccess( xIndexAccess ), nIndex( 0 ) {} - virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException) - { - return ( nIndex < m_xIndexAccess->getCount() ); - } - virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) - { - ScVbaShapeRange* pCollectionImpl = dynamic_cast< ScVbaShapeRange* >(m_xParent.get()); - if ( pCollectionImpl && hasMoreElements() ) - return pCollectionImpl->createCollectionObject( m_xIndexAccess->getByIndex( nIndex++ ) ); - throw container::NoSuchElementException(); - } - -}; - -ScVbaShapeRange::ScVbaShapeRange( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XIndexAccess >& xShapes, const uno::Reference< drawing::XDrawPage >& xDrawPage ) : ScVbaShapeRange_BASE( xParent, xContext, xShapes ), m_xDrawPage( xDrawPage ), m_nShapeGroupCount(0) -{ -} - -// Methods -void SAL_CALL -ScVbaShapeRange::Select( ) throw (uno::RuntimeException) -{ - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); - uno::Reference< view::XSelectionSupplier > xSelectSupp( xModel->getCurrentController(), uno::UNO_QUERY_THROW ); - xSelectSupp->select( uno::makeAny( getShapes() ) ); -} - -uno::Reference< msforms::XShape > SAL_CALL -ScVbaShapeRange::Group() throw (uno::RuntimeException) -{ - uno::Reference< drawing::XShapeGrouper > xShapeGrouper( m_xDrawPage, uno::UNO_QUERY_THROW ); - uno::Reference< drawing::XShapeGroup > xShapeGroup( xShapeGrouper->group( getShapes() ), uno::UNO_QUERY_THROW ); - uno::Reference< drawing::XShape > xShape( xShapeGroup, uno::UNO_QUERY_THROW ); - return uno::Reference< msforms::XShape >( new ScVbaShape( getParent(), mxContext, xShape, getShapes(), office::MsoShapeType::msoGroup ) ); -} - -uno::Reference< drawing::XShapes > -ScVbaShapeRange::getShapes() throw (uno::RuntimeException) -{ - if ( !m_xShapes.is() ) - { - uno::Reference< lang::XMultiServiceFactory > xMSF( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); - m_xShapes.set( xMSF->createInstance( rtl::OUString::createFromAscii( "com.sun.star.drawing.ShapeCollection" ) ), uno::UNO_QUERY_THROW ); - sal_Int32 nLen = m_xIndexAccess->getCount(); - for ( sal_Int32 index = 0; index < nLen; ++index ) - m_xShapes->add( uno::Reference< drawing::XShape >( m_xIndexAccess->getByIndex( index ), uno::UNO_QUERY_THROW ) ); - - } - return m_xShapes; -} - - -void SAL_CALL -ScVbaShapeRange::IncrementRotation( double Increment ) throw (uno::RuntimeException) -{ - sal_Int32 nLen = getCount(); - for ( sal_Int32 index = 1; index <= nLen; ++index ) - { - uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW ); - xShape->IncrementRotation( Increment ); - } -} - -void SAL_CALL -ScVbaShapeRange::IncrementLeft( double Increment ) throw (uno::RuntimeException) -{ - sal_Int32 nLen = getCount(); - for ( sal_Int32 index = 1; index <= nLen; ++index ) - { - uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW ); - xShape->IncrementLeft( Increment ); - } -} - -void SAL_CALL -ScVbaShapeRange::IncrementTop( double Increment ) throw (uno::RuntimeException) -{ - sal_Int32 nLen = getCount(); - for ( sal_Int32 index = 1; index <= nLen; ++index ) - { - uno::Reference< msforms::XShape > xShape( Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW ); - xShape->IncrementTop( Increment ); - } -} - -uno::Type SAL_CALL -ScVbaShapeRange::getElementType() throw (uno::RuntimeException) -{ - return msforms::XShape::static_type(0); -} - -uno::Reference< container::XEnumeration > SAL_CALL -ScVbaShapeRange::createEnumeration() throw (uno::RuntimeException) -{ - return new VbShapeRangeEnumHelper( this, m_xIndexAccess ); -} - -uno::Any -ScVbaShapeRange:: createCollectionObject( const css::uno::Any& aSource ) -{ - uno::Reference< drawing::XShape > xShape( aSource, uno::UNO_QUERY_THROW ); - // #TODO #FIXME Shape parent should always be the sheet the shapes belong - // to - uno::Reference< msforms::XShape > xVbShape( new ScVbaShape( uno::Reference< XHelperInterface >(), mxContext, xShape, getShapes(), ScVbaShape::getType( xShape ) ) ); - return uno::makeAny( xVbShape ); -} - -rtl::OUString& -ScVbaShapeRange::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaShapeRange") ); - return sImplName; -} - -uno::Sequence< rtl::OUString > -ScVbaShapeRange::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msform.ShapeRange" ) ); - } - return aServiceNames; -} diff --git a/sc/source/ui/vba/vbashaperange.hxx b/sc/source/ui/vba/vbashaperange.hxx deleted file mode 100644 index 27915d559e85..000000000000 --- a/sc/source/ui/vba/vbashaperange.hxx +++ /dev/null @@ -1,66 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbashaperange.hxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef SC_VBA_SHAPERANGE_HXX -#define SC_VBA_SHAPERANGE_HXX - -#include -#include - -#include "vbacollectionimpl.hxx" - -typedef CollTestImplHelper< ov::msforms::XShapeRange > ScVbaShapeRange_BASE; - -class ScVbaShapeRange : public ScVbaShapeRange_BASE -{ -private: - css::uno::Reference< css::drawing::XDrawPage > m_xDrawPage; - css::uno::Reference< css::drawing::XShapes > m_xShapes; - sal_Int32 m_nShapeGroupCount; -protected: - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); - css::uno::Reference< css::drawing::XShapes > getShapes() throw (css::uno::RuntimeException) ; -public: - ScVbaShapeRange( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xShapes, const css::uno::Reference< css::drawing::XDrawPage>& xDrawShape ); - - // Methods - virtual void SAL_CALL Select( ) throw (css::uno::RuntimeException); - virtual css::uno::Reference< ::ooo::vba::msforms::XShape > SAL_CALL Group() throw (css::uno::RuntimeException); - virtual void SAL_CALL IncrementRotation( double Increment ) throw (css::uno::RuntimeException); - virtual void SAL_CALL IncrementLeft( double Increment ) throw (css::uno::RuntimeException) ; - virtual void SAL_CALL IncrementTop( double Increment ) throw (css::uno::RuntimeException); - //XEnumerationAccess - virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); - virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); - // ScVbaCollectionBaseImpl - virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); -}; - -#endif//SC_VBA_SHAPERANGE_HXX diff --git a/sc/source/ui/vba/vbashapes.cxx b/sc/source/ui/vba/vbashapes.cxx deleted file mode 100644 index 8aac090d0337..000000000000 --- a/sc/source/ui/vba/vbashapes.cxx +++ /dev/null @@ -1,394 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbashapes.cxx,v $ - * $Revision: 1.3.32.1 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include -#include -#include -#include -#include - -#include "vbashapes.hxx" -#include "vbashape.hxx" -#include "vbashaperange.hxx" - -using namespace ::ooo::vba; -using namespace ::com::sun::star; - -class VbShapeEnumHelper : public EnumerationHelper_BASE -{ - uno::Reference m_xParent; - uno::Reference m_xIndexAccess; - sal_Int32 nIndex; -public: - VbShapeEnumHelper( const uno::Reference< msforms::XShapes >& xParent, const uno::Reference< container::XIndexAccess >& xIndexAccess ) : m_xParent( xParent ), m_xIndexAccess( xIndexAccess ), nIndex( 0 ) {} - virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException) - { - return ( nIndex < m_xIndexAccess->getCount() ); - } - virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) - { - ScVbaShapes* pShapes = dynamic_cast< ScVbaShapes* >(m_xParent.get()); - if ( pShapes && hasMoreElements() ) - return pShapes->createCollectionObject( m_xIndexAccess->getByIndex( nIndex++ ) ); - throw container::NoSuchElementException(); - } - -}; - -void ScVbaShapes::initBaseCollection() -{ - if ( m_xNameAccess.is() ) // already has NameAccess - return; - // no NameAccess then use ShapeCollectionHelper - XNamedObjectCollectionHelper< drawing::XShape >::XNamedVec mShapes; - sal_Int32 nLen = m_xIndexAccess->getCount(); - mShapes.reserve( nLen ); - for ( sal_Int32 index=0; index( m_xIndexAccess->getByIndex( index ) , uno::UNO_QUERY ) ); - uno::Reference< container::XIndexAccess > xShapes( new XNamedObjectCollectionHelper< drawing::XShape >( mShapes ) ); - m_xIndexAccess.set( xShapes, uno::UNO_QUERY ); - m_xNameAccess.set( xShapes, uno::UNO_QUERY ); -} - -ScVbaShapes::ScVbaShapes( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess > xShapes ): ScVbaShapes_BASE( xParent, xContext, xShapes ), m_nNewShapeCount(0) -{ - m_xShapes.set( xShapes, uno::UNO_QUERY_THROW ); - m_xDrawPage.set( xShapes, uno::UNO_QUERY_THROW ); - initBaseCollection(); -} - -uno::Reference< container::XEnumeration > -ScVbaShapes::createEnumeration() throw (uno::RuntimeException) -{ - return new VbShapeEnumHelper( this, m_xIndexAccess ); -} - -uno::Any -ScVbaShapes::createCollectionObject( const css::uno::Any& aSource ) -{ - if( aSource.hasValue() ) - { - uno::Reference< drawing::XShape > xShape( aSource, uno::UNO_QUERY_THROW ); - return uno::makeAny( uno::Reference< msforms::XShape >( new ScVbaShape( getParent(), mxContext, xShape, m_xShapes, ScVbaShape::getType( xShape ) ) ) ); - } - return uno::Any(); -} - -uno::Type -ScVbaShapes::getElementType() throw (uno::RuntimeException) -{ - return ooo::vba::msforms::XShape::static_type(0); -} -rtl::OUString& -ScVbaShapes::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaShapes") ); - return sImplName; -} - -uno::Sequence< rtl::OUString > -ScVbaShapes::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msform.Shapes" ) ); - } - return aServiceNames; -} - -css::uno::Reference< css::container::XIndexAccess > -ScVbaShapes::getShapesByArrayIndices( const uno::Any& Index ) throw (uno::RuntimeException) -{ - if ( Index.getValueTypeClass() != uno::TypeClass_SEQUENCE ) - throw uno::RuntimeException(); - - uno::Reference< script::XTypeConverter > xConverter = getTypeConverter(mxContext); - uno::Any aConverted; - aConverted = xConverter->convertTo( Index, getCppuType((uno::Sequence< uno::Any >*)0) ); - - uno::Sequence< uno::Any > sIndices; - aConverted >>= sIndices; - XNamedObjectCollectionHelper< drawing::XShape >::XNamedVec mShapes; - sal_Int32 nElems = sIndices.getLength(); - for( sal_Int32 index = 0; index < nElems; ++index ) - { - uno::Reference< drawing::XShape > xShape; - if ( sIndices[ index ].getValueTypeClass() == uno::TypeClass_STRING ) - { - rtl::OUString sName; - sIndices[ index ] >>= sName; - xShape.set( m_xNameAccess->getByName( sName ), uno::UNO_QUERY ); - } - else - { - sal_Int32 nIndex = 0; - sIndices[ index ] >>= nIndex; - // adjust for 1 based mso indexing - xShape.set( m_xIndexAccess->getByIndex( nIndex - 1 ), uno::UNO_QUERY ); - - } - // populate map with drawing::XShapes - if ( xShape.is() ) - mShapes.push_back( xShape ); - } - uno::Reference< container::XIndexAccess > xIndexAccess( new XNamedObjectCollectionHelper< drawing::XShape >( mShapes ) ); - return xIndexAccess; -} - -uno::Any SAL_CALL -ScVbaShapes::Item( const uno::Any& Index, const uno::Any& Index2 ) throw (uno::RuntimeException) -{ - // I don't think we need to support Array of indices for shapes -/* - if ( Index.getValueTypeClass() == uno::TypeClass_SEQUENCE ) - { - uno::Reference< container::XIndexAccess > xIndexAccess( getShapesByArrayIndices( Index ) ); - // return new collection instance - uno::Reference< XCollection > xShapesCollection( new ScVbaShapes( this->getParent(), mxContext, xIndexAccess ) ); - return uno::makeAny( xShapesCollection ); - } -*/ - return ScVbaShapes_BASE::Item( Index, Index2 ); -} - -uno::Reference< msforms::XShapeRange > SAL_CALL -ScVbaShapes::Range( const uno::Any& shapes ) throw (css::uno::RuntimeException) -{ - // shapes, can be an index or an array of indices - uno::Reference< container::XIndexAccess > xShapes; - if ( shapes.getValueTypeClass() == uno::TypeClass_SEQUENCE ) - xShapes = getShapesByArrayIndices( shapes ); - else - { - // wrap single index into a sequence - uno::Sequence< uno::Any > sIndices(1); - sIndices[ 0 ] = shapes; - uno::Any aIndex; - aIndex <<= sIndices; - xShapes = getShapesByArrayIndices( aIndex ); - } - return new ScVbaShapeRange( getParent(), mxContext, xShapes, m_xDrawPage ); -} - -void SAL_CALL -ScVbaShapes::SelectAll() throw (uno::RuntimeException) -{ - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); - uno::Reference< view::XSelectionSupplier > xSelectSupp( xModel->getCurrentController(), uno::UNO_QUERY_THROW ); - try - { - xSelectSupp->select( uno::makeAny( m_xShapes ) ); - } - // viewuno.cxx ScTabViewObj::select will throw IllegalArgumentException - // if one of the shapes is no 'markable' e.g. a button - // the method still works - catch( lang::IllegalArgumentException& ) - { - } -} - -uno::Reference< drawing::XShape > -ScVbaShapes::createShape( rtl::OUString service ) throw (css::uno::RuntimeException) -{ - uno::Reference< lang::XMultiServiceFactory > xMSF( getCurrentDocument(), uno::UNO_QUERY_THROW ); - uno::Reference< drawing::XShape > xShape( xMSF->createInstance( service ), uno::UNO_QUERY_THROW ); - return xShape; -} - -uno::Any -ScVbaShapes::AddRectangle( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidth, sal_Int32 nLineHeight, uno::Any aRange ) throw (css::uno::RuntimeException) -{ - rtl::OUString sCreateShapeName( rtl::OUString::createFromAscii( "com.sun.star.drawing.RectangleShape" ) ); - sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( startX ); - sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( startY ); - sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( nLineWidth ); - sal_Int32 nHeight = Millimeter::getInHundredthsOfOneMillimeter( nLineHeight ); - - uno::Reference< drawing::XShape > xShape( createShape( sCreateShapeName ), uno::UNO_QUERY_THROW ); - m_xShapes->add( xShape ); - - rtl::OUString sName = createName( rtl::OUString::createFromAscii( "Rectangle" ) ); - setDefaultShapeProperties( xShape ); - setShape_NameProperty( xShape, sName ); - - awt::Point aMovePositionIfRange(0, 0); - awt::Point position; - position.X = nXPos - aMovePositionIfRange.X; - position.Y = nYPos - aMovePositionIfRange.Y; - xShape->setPosition( position ); - - awt::Size size; - size.Height = nHeight; - size.Width = nWidth; - xShape->setSize( size ); - - ScVbaShape *pScVbaShape = new ScVbaShape( getParent(), mxContext, xShape, m_xShapes, ScVbaShape::getType( xShape ) ); - pScVbaShape->setRange( aRange ); - return uno::makeAny( uno::Reference< msforms::XShape > ( pScVbaShape ) ); -} - -uno::Any -ScVbaShapes::AddEllipse( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidth, sal_Int32 nLineHeight, uno::Any aRange ) throw (css::uno::RuntimeException) -{ - rtl::OUString sCreateShapeName( rtl::OUString::createFromAscii( "com.sun.star.drawing.EllipseShape" ) ); - sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( startX ); - sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( startY ); - sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( nLineWidth ); - sal_Int32 nHeight = Millimeter::getInHundredthsOfOneMillimeter( nLineHeight ); - - uno::Reference< drawing::XShape > xShape( createShape( sCreateShapeName ), uno::UNO_QUERY_THROW ); - m_xShapes->add( xShape ); - - awt::Point aMovePositionIfRange( 0, 0 ); - //TODO helperapi using a writer document - /* - XDocument xDocument = (XDocument)getParent(); - if (AnyConverter.isVoid(_aRange)) - { - _aRange = xDocument.Range(new Integer(0), new Integer(1)); - // Top&Left in Word is Top&Left of the paper and not the writeable area. - aMovePositionIfRange = calculateTopLeftMargin((HelperInterfaceAdaptor)xDocument); - } - - setShape_AnchorTypeAndRangeProperty(xShape, _aRange); - */ - rtl::OUString name = createName( rtl::OUString::createFromAscii( "Oval" )); - setDefaultShapeProperties(xShape); - setShape_NameProperty(xShape, name); - - awt::Point position; - position.X = nXPos - aMovePositionIfRange.X; - position.Y = nYPos - aMovePositionIfRange.Y; - xShape->setPosition(position); - - awt::Size size; - size.Height = nHeight; - size.Width = nWidth; - xShape->setSize(size); - - ScVbaShape *pScVbaShape = new ScVbaShape( getParent(), mxContext, xShape, m_xShapes, ScVbaShape::getType( xShape ) ); - pScVbaShape->setRange( aRange ); - return uno::makeAny( uno::Reference< msforms::XShape > ( pScVbaShape ) ); -} - -//helpeapi calc -uno::Any SAL_CALL -ScVbaShapes::AddLine( sal_Int32 StartX, sal_Int32 StartY, sal_Int32 endX, sal_Int32 endY ) throw (uno::RuntimeException) -{ - sal_Int32 nLineWidth = endX - StartX; - sal_Int32 nLineHeight = endY - StartY; - - sal_Int32 nHeight = Millimeter::getInHundredthsOfOneMillimeter( nLineHeight ); - sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( nLineWidth ); - sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( StartX ); - sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( StartY ); - - uno::Reference< drawing::XShape > xShape( createShape( rtl::OUString::createFromAscii("com.sun.star.drawing.LineShape") ), uno::UNO_QUERY_THROW ); - m_xShapes->add( xShape ); - - awt::Point aMovePositionIfRange( 0, 0 ); - - rtl::OUString name = createName( rtl::OUString::createFromAscii( "Line" ) ); - setDefaultShapeProperties(xShape); - setShape_NameProperty(xShape, name); - - awt::Point position; - position.X = nXPos - aMovePositionIfRange.X; - position.Y = nYPos - aMovePositionIfRange.Y; - xShape->setPosition(position); - - awt::Size size; - size.Height = nHeight; - size.Width = nWidth; - xShape->setSize(size); - - ScVbaShape *pScVbaShape = new ScVbaShape( getParent(), mxContext, xShape, m_xShapes, ScVbaShape::getType( xShape ) ); - return uno::makeAny( uno::Reference< msforms::XShape > ( pScVbaShape ) ); -} - -uno::Any SAL_CALL -ScVbaShapes::AddShape( sal_Int32 _nType, sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight ) throw (uno::RuntimeException) -{ - uno::Any _aAnchor; - if (_nType == office::MsoAutoShapeType::msoShapeRectangle) - { - return AddRectangle(_nLeft, _nTop, _nWidth, _nHeight, _aAnchor); - } - else if (_nType == office::MsoAutoShapeType::msoShapeOval) - { - return AddEllipse(_nLeft, _nTop, _nWidth, _nHeight, _aAnchor); - } - return uno::Any(); -} - -void -ScVbaShapes::setDefaultShapeProperties( uno::Reference< drawing::XShape > xShape ) throw (uno::RuntimeException) -{ - uno::Reference< beans::XPropertySet > xPropertySet( xShape, uno::UNO_QUERY_THROW ); - xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "FillStyle" ), uno::makeAny( rtl::OUString::createFromAscii( "SOLID" ) ) ); - xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "FillColor"), uno::makeAny( sal_Int32(0xFFFFFF) ) ); - xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "TextWordWrap"), uno::makeAny( text::WrapTextMode_THROUGHT ) ); - //not find in OOo2.3 - //xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "Opaque"), uno::makeAny( sal_True ) ); -} - -void -ScVbaShapes::setShape_NameProperty( uno::Reference< css::drawing::XShape > xShape, rtl::OUString sName ) -{ - uno::Reference< beans::XPropertySet > xPropertySet( xShape, uno::UNO_QUERY_THROW ); - try - { - xPropertySet->setPropertyValue( rtl::OUString::createFromAscii( "Name" ), uno::makeAny( sName ) ); - } - catch( script::BasicErrorException e ) - { - } -} - -rtl::OUString -ScVbaShapes::createName( rtl::OUString sName ) -{ - sal_Int32 nActNumber = 1 + m_nNewShapeCount; - m_nNewShapeCount++; - sName += rtl::OUString::valueOf( nActNumber ); - return sName; -} - -#if 0 -//TODO helperapi using a writer document -awt::Point -calculateTopLeftMargin( uno::Reference< XHelperInterface > xDocument ) -{ - awt::Point aPoint( 0, 0 ); - uno::Reference< frame::XModel > xModel( xDocument, uno::UNO_QUERY_THROW ); - return awt::Point(); -} -#endif diff --git a/sc/source/ui/vba/vbashapes.hxx b/sc/source/ui/vba/vbashapes.hxx deleted file mode 100644 index 94f68ff6718b..000000000000 --- a/sc/source/ui/vba/vbashapes.hxx +++ /dev/null @@ -1,80 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbashapes.hxx,v $ - * $Revision: 1.3.32.1 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef SC_VBA_SHAPES_HXX -#define SC_VBA_SHAPES_HXX - -#include -#include -#include -#include - -#include "vbahelperinterface.hxx" - -#include "vbacollectionimpl.hxx" - -typedef CollTestImplHelper< ov::msforms::XShapes > ScVbaShapes_BASE; - -class ScVbaShapes : public ScVbaShapes_BASE -{ -private: - css::uno::Reference< css::drawing::XShapes > m_xShapes; - css::uno::Reference< css::drawing::XDrawPage > m_xDrawPage; - sal_Int32 m_nNewShapeCount; - void initBaseCollection(); -protected: - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); - virtual css::uno::Reference< css::container::XIndexAccess > getShapesByArrayIndices( const css::uno::Any& Index ) throw (css::uno::RuntimeException); - css::uno::Reference< css::drawing::XShape > createShape( rtl::OUString service ) throw (css::uno::RuntimeException); - css::uno::Any AddRectangle( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidth, sal_Int32 nLineHeight, css::uno::Any aRange ) throw (css::uno::RuntimeException); - css::uno::Any AddEllipse( sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidth, sal_Int32 nLineHeight, css::uno::Any aRange ) throw (css::uno::RuntimeException); - rtl::OUString createName( rtl::OUString sName ); - //TODO helperapi using a writer document - //css::awt::Point calculateTopLeftMargin( css::uno::Reference< ov::XHelperInterface > xDocument ); - -public: - ScVbaShapes( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess > xShapes ); - static void setDefaultShapeProperties( css::uno::Reference< css::drawing::XShape > xShape ) throw (css::uno::RuntimeException); - static void setShape_NameProperty( css::uno::Reference< css::drawing::XShape > xShape, rtl::OUString sName ); - //XEnumerationAccess - virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); - virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); - - virtual void SAL_CALL SelectAll() throw (css::uno::RuntimeException); - //helper::calc - virtual css::uno::Any SAL_CALL AddLine( sal_Int32 StartX, sal_Int32 StartY, sal_Int32 endX, sal_Int32 endY ) throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL AddShape( sal_Int32 _nType, sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight ) throw (css::uno::RuntimeException); - virtual css::uno::Reference< ov::msforms::XShapeRange > SAL_CALL Range( const css::uno::Any& shapes ) throw (css::uno::RuntimeException); - // ScVbaCollectionBaseImpl - virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); - virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index1, const css::uno::Any& Index2 ) throw (css::uno::RuntimeException); -}; - -#endif//SC_VBA_SHAPES_HXX diff --git a/sc/source/ui/vba/vbaspinbutton.cxx b/sc/source/ui/vba/vbaspinbutton.cxx deleted file mode 100644 index c9da8cf8827c..000000000000 --- a/sc/source/ui/vba/vbaspinbutton.cxx +++ /dev/null @@ -1,109 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * - * $Revision$ - * - * last change: $Author$ $Date$ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ -#include "vbaspinbutton.hxx" -#include - -using namespace com::sun::star; -using namespace ooo::vba; - - -const static rtl::OUString ORIENTATION( RTL_CONSTASCII_USTRINGPARAM("Orientation") ); -const static rtl::OUString SPINVALUE( RTL_CONSTASCII_USTRINGPARAM("SpinValue") ); -const static rtl::OUString SPINMAX( RTL_CONSTASCII_USTRINGPARAM("SpinValueMax") ); -const static rtl::OUString SPINMIN( RTL_CONSTASCII_USTRINGPARAM("SpinValueMin") ); - -ScVbaSpinButton::ScVbaSpinButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : SpinButtonImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper ) -{ -} - -// Attributes -uno::Any SAL_CALL -ScVbaSpinButton::getValue() throw (css::uno::RuntimeException) -{ - return m_xProps->getPropertyValue( SPINVALUE ); -} - -void SAL_CALL -ScVbaSpinButton::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException) -{ - m_xProps->setPropertyValue( SPINVALUE, _value ); -} - -::sal_Int32 SAL_CALL -ScVbaSpinButton::getMax() throw (uno::RuntimeException) -{ - sal_Int32 nMax = 0; - m_xProps->getPropertyValue( SPINMAX ) >>= nMax; - return nMax; -} - -void SAL_CALL -ScVbaSpinButton::setMax( sal_Int32 nVal ) throw (uno::RuntimeException) -{ - m_xProps->setPropertyValue( SPINMAX, uno::makeAny( nVal ) ); -} - -::sal_Int32 SAL_CALL -ScVbaSpinButton::getMin() throw (uno::RuntimeException) -{ - sal_Int32 nVal = 0; - m_xProps->getPropertyValue( SPINMIN ) >>= nVal; - return nVal; -} - -void SAL_CALL -ScVbaSpinButton::setMin( sal_Int32 nVal ) throw (uno::RuntimeException) -{ - m_xProps->setPropertyValue( SPINMIN, uno::makeAny( nVal ) ); -} - -rtl::OUString& -ScVbaSpinButton::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaSpinButton") ); - return sImplName; -} - -uno::Sequence< rtl::OUString > -ScVbaSpinButton::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Frame" ) ); - } - return aServiceNames; -} diff --git a/sc/source/ui/vba/vbaspinbutton.hxx b/sc/source/ui/vba/vbaspinbutton.hxx deleted file mode 100644 index 338d71f34dec..000000000000 --- a/sc/source/ui/vba/vbaspinbutton.hxx +++ /dev/null @@ -1,61 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * - * $Revision$ - * - * last change: $Author$ $Date$ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ -#ifndef SC_VBA_SPINBUTTON_HXX -#define SC_VBA_SPINBUTTON_HXX -#include -#include - -#include "vbacontrol.hxx" -#include "vbahelper.hxx" - -typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XSpinButton > SpinButtonImpl_BASE; - -class ScVbaSpinButton : public SpinButtonImpl_BASE -{ -public: - ScVbaSpinButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ); - // Attributes - virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException); - virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL getMax() throw (css::uno::RuntimeException); - virtual void SAL_CALL setMax( ::sal_Int32 _max ) throw (css::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL getMin() throw (css::uno::RuntimeException); - virtual void SAL_CALL setMin( ::sal_Int32 _min ) throw (css::uno::RuntimeException); - - //XHelperInterface - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); -}; -#endif //SC_VBA_SPINBUTTON_HXX diff --git a/sc/source/ui/vba/vbatextbox.cxx b/sc/source/ui/vba/vbatextbox.cxx deleted file mode 100644 index f6574550c0c9..000000000000 --- a/sc/source/ui/vba/vbatextbox.cxx +++ /dev/null @@ -1,137 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbatextbox.cxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include - -#include "vbatextbox.hxx" -#include - -using namespace com::sun::star; -using namespace ooo::vba; - - - -ScVbaTextBox::ScVbaTextBox( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper, bool bDialog ) : TextBoxImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper ), mbDialog( bDialog ) -{ -} - -// Attributes -uno::Any SAL_CALL -ScVbaTextBox::getValue() throw (css::uno::RuntimeException) -{ - return uno::makeAny( getText() ); -} - -void SAL_CALL -ScVbaTextBox::setValue( const uno::Any& _value ) throw (css::uno::RuntimeException) -{ - rtl::OUString sVal = getAnyAsString( _value ); - setText( sVal ); -} - -//getString() will cause some imfo lose. -rtl::OUString SAL_CALL -ScVbaTextBox::getText() throw (css::uno::RuntimeException) -{ - uno::Any aValue; - aValue = m_xProps->getPropertyValue - (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" ) ) ); - rtl::OUString sString; - aValue >>= sString; - return sString; -} - -void SAL_CALL -ScVbaTextBox::setText( const rtl::OUString& _text ) throw (css::uno::RuntimeException) -{ - if ( !mbDialog ) - { - uno::Reference< text::XTextRange > xTextRange( m_xProps, uno::UNO_QUERY_THROW ); - xTextRange->setString( _text ); -} - else - m_xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ), uno::makeAny( _text ) ); -} - -sal_Int32 SAL_CALL -ScVbaTextBox::getMaxLength() throw (css::uno::RuntimeException) -{ - uno::Any aValue; - aValue = m_xProps->getPropertyValue - (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxTextLen" ) ) ); - sal_Int32 nMaxLength = 0; - aValue >>= nMaxLength; - return nMaxLength; -} - -void SAL_CALL -ScVbaTextBox::setMaxLength( sal_Int32 _maxlength ) throw (css::uno::RuntimeException) -{ - uno::Any aValue( _maxlength ); - m_xProps->setPropertyValue - (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxTextLen" ) ), aValue); -} - -sal_Bool SAL_CALL -ScVbaTextBox::getMultiline() throw (css::uno::RuntimeException) -{ - uno::Any aValue; - aValue = m_xProps->getPropertyValue - (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiLine" ) ) ); - sal_Bool bRet = false; - aValue >>= bRet; - return bRet; -} - -void SAL_CALL -ScVbaTextBox::setMultiline( sal_Bool _multiline ) throw (css::uno::RuntimeException) -{ - uno::Any aValue( _multiline ); - m_xProps->setPropertyValue - (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiLine" ) ), aValue); -} - -rtl::OUString& -ScVbaTextBox::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaTextBox") ); - return sImplName; -} - -uno::Sequence< rtl::OUString > -ScVbaTextBox::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.TextBox" ) ); - } - return aServiceNames; -} diff --git a/sc/source/ui/vba/vbatextbox.hxx b/sc/source/ui/vba/vbatextbox.hxx deleted file mode 100644 index b9d22ced414c..000000000000 --- a/sc/source/ui/vba/vbatextbox.hxx +++ /dev/null @@ -1,57 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: vbatextbox.hxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef SC_VBA_TEXTBOX_HXX -#define SC_VBA_TEXTBOX_HXX -#include -#include -#include "vbacontrol.hxx" -#include "vbahelper.hxx" - -typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XTextBox > TextBoxImpl_BASE; - -class ScVbaTextBox : public TextBoxImpl_BASE -{ - bool mbDialog; -public: - ScVbaTextBox( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper, bool bDialog = false ); - // Attributes - virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException); - virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException); - virtual rtl::OUString SAL_CALL getText() throw (css::uno::RuntimeException); - virtual void SAL_CALL setText( const rtl::OUString& _text ) throw (css::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getMaxLength() throw (css::uno::RuntimeException); - virtual void SAL_CALL setMaxLength( sal_Int32 _maxlength ) throw (css::uno::RuntimeException); - virtual sal_Bool SAL_CALL getMultiline() throw (css::uno::RuntimeException); - virtual void SAL_CALL setMultiline( sal_Bool _multiline ) throw (css::uno::RuntimeException); - //XHelperInterface - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); -}; -#endif //SC_VBA_TEXTBOX_HXX diff --git a/sc/source/ui/vba/vbatogglebutton.cxx b/sc/source/ui/vba/vbatogglebutton.cxx deleted file mode 100644 index d49b2e89affe..000000000000 --- a/sc/source/ui/vba/vbatogglebutton.cxx +++ /dev/null @@ -1,108 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * - * $Revision$ - * - * last change: $Author$ $Date$ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ -#include "vbatogglebutton.hxx" -#include - -using namespace com::sun::star; -using namespace ooo::vba; - - -const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") ); -const static rtl::OUString TOGGLE( RTL_CONSTASCII_USTRINGPARAM("Toggle") ); -const static rtl::OUString STATE( RTL_CONSTASCII_USTRINGPARAM("State") ); -ScVbaToggleButton::ScVbaToggleButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ) : ToggleButtonImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper ) -{ - OSL_TRACE("ScVbaToggleButton(ctor)"); - m_xProps->setPropertyValue( TOGGLE, uno::makeAny( sal_True ) ); -} - -ScVbaToggleButton::~ScVbaToggleButton() -{ - OSL_TRACE("~ScVbaToggleButton(dtor)"); -} - -// Attributes -rtl::OUString SAL_CALL -ScVbaToggleButton::getCaption() throw (css::uno::RuntimeException) -{ - rtl::OUString Label; - m_xProps->getPropertyValue( LABEL ) >>= Label; - return Label; -} - -void SAL_CALL -ScVbaToggleButton::setCaption( const rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException) -{ - m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) ); -} - -uno::Any SAL_CALL -ScVbaToggleButton::getValue() throw (uno::RuntimeException) -{ - sal_Int16 nState = 0; - m_xProps->getPropertyValue( STATE ) >>= nState; - return uno::makeAny( nState ? sal_Int16( -1 ) : sal_Int16( 0 ) ); -} - -void SAL_CALL -ScVbaToggleButton::setValue( const uno::Any& _value ) throw (uno::RuntimeException) -{ - sal_Int16 nState = 0; - _value >>= nState; - OSL_TRACE( "nState - %d", nState ); - nState = ( nState == -1 ) ? 1 : 0; - OSL_TRACE( "nState - %d", nState ); - m_xProps->setPropertyValue( STATE, uno::makeAny( nState ) ); -} - -rtl::OUString& -ScVbaToggleButton::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaToggleButton") ); - return sImplName; -} - -uno::Sequence< rtl::OUString > -ScVbaToggleButton::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.ToggleButton" ) ); - } - return aServiceNames; -} - diff --git a/sc/source/ui/vba/vbatogglebutton.hxx b/sc/source/ui/vba/vbatogglebutton.hxx deleted file mode 100644 index 752eac718b18..000000000000 --- a/sc/source/ui/vba/vbatogglebutton.hxx +++ /dev/null @@ -1,63 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * - * $Revision$ - * - * last change: $Author$ $Date$ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ -#ifndef SC_VBA_TOGGLEBUTTON_HXX -#define SC_VBA_TOGGLEBUTTON_HXX -#include -#include - -#include "vbacontrol.hxx" -#include "vbahelper.hxx" - -typedef cppu::ImplInheritanceHelper2< ScVbaControl, ov::msforms::XToggleButton, css::script::XDefaultProperty > ToggleButtonImpl_BASE; - -class ScVbaToggleButton : public ToggleButtonImpl_BASE -{ - rtl::OUString msDftPropName; -public: - ScVbaToggleButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ); - ~ScVbaToggleButton(); - // Attributes - virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException); - virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException); - - virtual rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException); - virtual void SAL_CALL setCaption( const rtl::OUString& _caption ) throw (css::uno::RuntimeException); - //XHelperInterface - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); - // XDefaultProperty - rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); } -}; -#endif //SC_VBA_TOGGLEBUTTON_HXX diff --git a/sc/source/ui/vba/vbauserform.cxx b/sc/source/ui/vba/vbauserform.cxx deleted file mode 100644 index 9c50347ad839..000000000000 --- a/sc/source/ui/vba/vbauserform.cxx +++ /dev/null @@ -1,228 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * - * $Revision$ - * - * last change: $Author$ $Date$ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ -#include "helperdecl.hxx" -#include "vbauserform.hxx" -#include -#include -#include -#include -#include -#include -#include "unonames.hxx" -#include "vbacontrols.hxx" - -using namespace ::ooo::vba; -using namespace ::com::sun::star; - -// some little notes -// XDialog implementation has the following interesting bits -// a Controls property ( which is an array of the container controls ) -// each item in the controls array is a XControl, where the model is -// basically a property bag -// additionally the XDialog instance has itself a model -// this model has a ControlModels ( array of models ) property -// the models in ControlModels can be accessed by name -// also the XDialog is a XControl ( to access the model above - -ScVbaUserForm::ScVbaUserForm( uno::Sequence< uno::Any > const& aArgs, uno::Reference< uno::XComponentContext >const& xContext ) throw ( lang::IllegalArgumentException ) : ScVbaUserForm_BASE( getXSomethingFromArgs< XHelperInterface >( aArgs, 0 ), xContext, getXSomethingFromArgs< uno::XInterface >( aArgs, 1 ), getXSomethingFromArgs< frame::XModel >( aArgs, 2 ), static_cast< ooo::vba::AbstractGeometryAttributes* >(0) ), m_pDocShell( 0 ), mbDispose( true ) -{ - m_xDialog.set( m_xControl, uno::UNO_QUERY_THROW ); - uno::Reference< awt::XControl > xControl( m_xDialog, uno::UNO_QUERY_THROW ); - m_pDocShell = getDocShell( m_xModel ); - m_xProps.set( xControl->getModel(), uno::UNO_QUERY_THROW ); - setGeometryHelper( new UserFormGeometryHelper( xContext, xControl ) ); -} - -ScVbaUserForm::~ScVbaUserForm() -{ -} - -void SAL_CALL -ScVbaUserForm::Show( ) throw (uno::RuntimeException) -{ - OSL_TRACE("ScVbaUserForm::Show( )"); - short aRet = 0; - if ( m_xDialog.is() ) - aRet = m_xDialog->execute(); - OSL_TRACE("ScVbaUserForm::Show() execute returned %d", aRet); - if ( mbDispose ) - { - try - { - uno::Reference< lang::XComponent > xComp( m_xDialog, uno::UNO_QUERY_THROW ); - m_xDialog = NULL; - xComp->dispose(); - mbDispose = false; - } - catch( uno::Exception& ) - { - } - } -} - -rtl::OUString SAL_CALL -ScVbaUserForm::getCaption() throw (::com::sun::star::uno::RuntimeException) -{ - rtl::OUString sCaption; - m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Title") ) ) >>= sCaption; - return sCaption; -} -void -ScVbaUserForm::setCaption( const ::rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException) -{ - m_xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Title") ), uno::makeAny( _caption ) ); -} - -void SAL_CALL -ScVbaUserForm::Hide( ) throw (uno::RuntimeException) -{ - mbDispose = false; // hide not dispose - if ( m_xDialog.is() ) - m_xDialog->endExecute(); -} - -void SAL_CALL -ScVbaUserForm::RePaint( ) throw (uno::RuntimeException) -{ - // do nothing -} - -void SAL_CALL -ScVbaUserForm::UnloadObject( ) throw (uno::RuntimeException) -{ - mbDispose = true; - if ( m_xDialog.is() ) - m_xDialog->endExecute(); -} - -rtl::OUString& -ScVbaUserForm::getServiceImplName() -{ - static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaUserForm") ); - return sImplName; -} - -uno::Sequence< rtl::OUString > -ScVbaUserForm::getServiceNames() -{ - static uno::Sequence< rtl::OUString > aServiceNames; - if ( aServiceNames.getLength() == 0 ) - { - aServiceNames.realloc( 1 ); - aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.UserForm" ) ); - } - return aServiceNames; -} - -uno::Reference< beans::XIntrospectionAccess > SAL_CALL -ScVbaUserForm::getIntrospection( ) throw (uno::RuntimeException) -{ - return uno::Reference< beans::XIntrospectionAccess >(); -} - -uno::Any SAL_CALL -ScVbaUserForm::invoke( const ::rtl::OUString& /*aFunctionName*/, const uno::Sequence< uno::Any >& /*aParams*/, uno::Sequence< ::sal_Int16 >& /*aOutParamIndex*/, uno::Sequence< uno::Any >& /*aOutParam*/ ) throw (lang::IllegalArgumentException, script::CannotConvertException, reflection::InvocationTargetException, uno::RuntimeException) -{ - throw uno::RuntimeException(); // unsupported operation -} - -void SAL_CALL -ScVbaUserForm::setValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, script::CannotConvertException, reflection::InvocationTargetException, uno::RuntimeException) -{ - uno::Any aObject = getValue( aPropertyName ); - // The Object *must* support XDefaultProperty here because getValue will - // only return properties that are Objects ( e.g. controls ) - // e.g. Userform1.aControl = something - // 'aControl' has to support XDefaultProperty to make sense here - uno::Reference< script::XDefaultProperty > xDfltProp( aObject, uno::UNO_QUERY_THROW ); - rtl::OUString aDfltPropName = xDfltProp->getDefaultPropertyName(); - uno::Reference< beans::XIntrospectionAccess > xUnoAccess( getIntrospectionAccess( aObject ) ); - uno::Reference< beans::XPropertySet > xPropSet( xUnoAccess->queryAdapter( ::getCppuType( (const uno::Reference< beans::XPropertySet > *)0 ) ), uno::UNO_QUERY_THROW ); - xPropSet->setPropertyValue( aDfltPropName, aValue ); -} - -uno::Any SAL_CALL -ScVbaUserForm::getValue( const ::rtl::OUString& aPropertyName ) throw (beans::UnknownPropertyException, uno::RuntimeException) -{ - uno::Reference< awt::XControl > xDialogControl( m_xDialog, uno::UNO_QUERY_THROW ); - uno::Reference< awt::XControlContainer > xContainer( m_xDialog, uno::UNO_QUERY_THROW ); - uno::Reference< awt::XControl > xControl = xContainer->getControl( aPropertyName ); - ScVbaControlFactory aFac( mxContext, xControl, m_xModel ); - uno::Reference< msforms::XControl > xVBAControl( aFac.createControl( xDialogControl->getModel() ) ); - ScVbaControl* pControl = dynamic_cast< ScVbaControl* >( xVBAControl.get() ); - pControl->setGeometryHelper( new UserFormGeometryHelper( mxContext, xControl ) ); - return uno::makeAny( xVBAControl ); -} - -::sal_Bool SAL_CALL -ScVbaUserForm::hasMethod( const ::rtl::OUString& /*aName*/ ) throw (uno::RuntimeException) -{ - return sal_False; -} -uno::Any SAL_CALL -ScVbaUserForm::Controls( const uno::Any& index ) throw (uno::RuntimeException) -{ - uno::Reference< awt::XControl > xDialogControl( m_xDialog, uno::UNO_QUERY_THROW ); - uno::Reference< XCollection > xControls( new ScVbaControls( this, mxContext, xDialogControl ) ); - if ( index.hasValue() ) - return uno::makeAny( xControls->Item( index, uno::Any() ) ); - return uno::makeAny( xControls ); -} - -::sal_Bool SAL_CALL -ScVbaUserForm::hasProperty( const ::rtl::OUString& aName ) throw (uno::RuntimeException) -{ - uno::Reference< awt::XControl > xControl( m_xDialog, uno::UNO_QUERY ); - OSL_TRACE("ScVbaUserForm::hasProperty(%s) %d", rtl::OUStringToOString( aName, RTL_TEXTENCODING_UTF8 ).getStr(), xControl.is() ); - if ( xControl.is() ) - { - uno::Reference< container::XNameAccess > xNameAccess( xControl->getModel(), uno::UNO_QUERY_THROW ); - sal_Bool bRes = xNameAccess->hasByName( aName ); - OSL_TRACE("ScVbaUserForm::hasProperty(%s) %d ---> %d", rtl::OUStringToOString( aName, RTL_TEXTENCODING_UTF8 ).getStr(), xControl.is(), bRes ); - return bRes; - } - return sal_False; -} - -namespace userform -{ -namespace sdecl = comphelper::service_decl; -sdecl::vba_service_class_ > serviceImpl; -extern sdecl::ServiceDecl const serviceDecl( - serviceImpl, - "ScVbaUserForm", - "ooo.vba.excel.UserForm" ); -} - diff --git a/sc/source/ui/vba/vbauserform.hxx b/sc/source/ui/vba/vbauserform.hxx deleted file mode 100644 index 2c8a1b72f728..000000000000 --- a/sc/source/ui/vba/vbauserform.hxx +++ /dev/null @@ -1,78 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile$ - * - * $Revision$ - * - * last change: $Author$ $Date$ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ -#ifndef SC_VBA_USERFORM_HXX -#define SC_VBA_USERFORM_HXX - -#include -#include -#include -#include - -#include "vbahelperinterface.hxx" -#include "vbacontrol.hxx" - -//typedef InheritedHelperInterfaceImpl1< ov::msforms::XUserForm > ScVbaUserForm_BASE; -typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XUserForm > ScVbaUserForm_BASE; - -class ScVbaUserForm : public ScVbaUserForm_BASE -{ -private: - css::uno::Reference< css::awt::XDialog > m_xDialog; - ScDocShell* m_pDocShell; - bool mbDispose; -protected: -public: - ScVbaUserForm( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext >const& xContext ) throw ( css::lang::IllegalArgumentException ); - virtual ~ScVbaUserForm(); - // XUserForm - virtual void SAL_CALL RePaint( ) throw (css::uno::RuntimeException); - virtual void SAL_CALL Show( ) throw (css::uno::RuntimeException); - // XIntrospection - virtual css::uno::Reference< css::beans::XIntrospectionAccess > SAL_CALL getIntrospection( ) throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL invoke( const ::rtl::OUString& aFunctionName, const css::uno::Sequence< css::uno::Any >& aParams, css::uno::Sequence< ::sal_Int16 >& aOutParamIndex, css::uno::Sequence< css::uno::Any >& aOutParam ) throw (css::lang::IllegalArgumentException, css::script::CannotConvertException, css::reflection::InvocationTargetException, css::uno::RuntimeException); - virtual void SAL_CALL setValue( const ::rtl::OUString& aPropertyName, const css::uno::Any& aValue ) throw (css::beans::UnknownPropertyException, css::script::CannotConvertException, css::reflection::InvocationTargetException, css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL getValue( const ::rtl::OUString& aPropertyName ) throw (css::beans::UnknownPropertyException, css::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL hasMethod( const ::rtl::OUString& aName ) throw (css::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL hasProperty( const ::rtl::OUString& aName ) throw (css::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getCaption() throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setCaption( const ::rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL Hide( ) throw (css::uno::RuntimeException); - virtual void SAL_CALL UnloadObject( ) throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL Controls( const css::uno::Any& index ) throw (css::uno::RuntimeException); - //XHelperInterface - virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence getServiceNames(); -}; -#endif -- cgit v1.2.3 From 547af75e0ba1fdc9a3a3ea1e94ecb597f4059993 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Sat, 19 Sep 2009 00:02:22 +0200 Subject: better dependencies for sdi files --- sc/sdi/docsh.sdi | 4 ++-- sc/sdi/makefile.mk | 9 +++++++-- sc/sdi/prevwsh.sdi | 4 ++-- sc/sdi/scslots.sdi | 7 +++++-- sc/sdi/tabvwsh.sdi | 4 ++-- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/sc/sdi/docsh.sdi b/sc/sdi/docsh.sdi index 5d8c1de7612d..5c6f9577cb08 100644 --- a/sc/sdi/docsh.sdi +++ b/sc/sdi/docsh.sdi @@ -69,7 +69,7 @@ interface TableSelection //============================================================================ -interface TableDocument : OfficeDocument +interface TableDocument [ uuid = "BA338A42-064E-11d0-89CB-008029E4B0B1" ; ] @@ -116,7 +116,7 @@ interface TableDocument : OfficeDocument //============================================================================ -shell ScDocShell : SfxObjectShell +shell ScDocShell [ uuid ( "3F543FA0-B6A6-101B-9961-04021C007002" ) ] diff --git a/sc/sdi/makefile.mk b/sc/sdi/makefile.mk index 8431c62307b9..f9ae9d9a230b 100644 --- a/sc/sdi/makefile.mk +++ b/sc/sdi/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2008 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite @@ -47,7 +47,12 @@ SDI1NAME=$(TARGET) SDI1EXPORT=scalc SVSDI1DEPEND= \ - scalc.sdi \ + $(SOLARINCXDIR)$/sfx2/sfx.sdi \ + $(SOLARINCXDIR)$/sfx2/sfxitems.sdi \ + $(SOLARINCXDIR)$/svx/svx.sdi \ + $(SOLARINCXDIR)$/svx/svxitems.sdi \ + $(SOLARINCXDIR)$/svx/xoitems.sdi \ + scalc.sdi \ app.sdi \ auditsh.sdi \ docsh.sdi \ diff --git a/sc/sdi/prevwsh.sdi b/sc/sdi/prevwsh.sdi index 70ca39a816c6..92add2aa2fd1 100644 --- a/sc/sdi/prevwsh.sdi +++ b/sc/sdi/prevwsh.sdi @@ -27,7 +27,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -interface TablePrintPreview : View +interface TablePrintPreview { // von Basic aus nicht erreichbar, darum alles mit Export = FALSE @@ -166,7 +166,7 @@ interface TablePrintPreview : View // =========================================================================== -shell ScPreviewShell : SfxViewShell +shell ScPreviewShell { import TablePrintPreview; } diff --git a/sc/sdi/scslots.sdi b/sc/sdi/scslots.sdi index 3f1ff119873d..e50d282ab60d 100644 --- a/sc/sdi/scslots.sdi +++ b/sc/sdi/scslots.sdi @@ -27,7 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -import "svxslots.ilb" module "ADC7D7A1-2341-101C-A55A-04021C007002" @@ -36,7 +35,6 @@ StarCalc [ HelpText( "StarDivision StarCalc" ), SlotIdFile( "scslots.hrc" ) -TypeLibFile( "scslots.tlb" ) ModulePrefix( "Sc" ) ] { @@ -54,6 +52,11 @@ ModulePrefix( "Sc" ) //---------------------------------------------------------- // bei Problemen ggF. "von Hand" includen (=Copy/Paste) + include "sfx2/sfxitems.sdi" + include "sfx2/sfx.sdi" + include "svx/svxitems.sdi" + include "svx/xoitems.sdi" + include "svx/svx.sdi" include "scalc.sdi" include "docsh.sdi" diff --git a/sc/sdi/tabvwsh.sdi b/sc/sdi/tabvwsh.sdi index 227d91b47998..8e075ee8166c 100644 --- a/sc/sdi/tabvwsh.sdi +++ b/sc/sdi/tabvwsh.sdi @@ -130,7 +130,7 @@ interface BaseSelection } -interface TableEditView : View +interface TableEditView [ uuid ( "16D7E4A0-2FB4-11CF-89CB-008029E4B0B1" ) ] @@ -267,7 +267,7 @@ interface DataPilotField } // =========================================================================== -shell ScTabViewShell : SfxViewShell +shell ScTabViewShell { import TableSelection "ActiveDocument.ActiveTable"; import TableOLEObject "SelectedObject"; -- cgit v1.2.3 From d658b513193e0dfd8c565cacf0fedac2361e59f3 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Wed, 23 Sep 2009 13:05:45 +0000 Subject: trim unwanted patches that crept in while importing stuff from ooo-build --- sc/source/ui/unoobj/docuno.cxx | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 0e6a1f7ca49a..cd63adc33989 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -102,7 +102,6 @@ using namespace com::sun::star; -#define SC_UNO_VBADOCOBJ "ThisVBADocObj" // perhaps we want to actually make this ThisWorkbook ? //------------------------------------------------------------------------ // alles ohne Which-ID, Map nur fuer PropertySetInfo @@ -117,7 +116,6 @@ const SfxItemPropertyMapEntry* lcl_GetDocOptPropertyMap() {MAP_CHAR_LEN(SC_UNO_AUTOCONTFOC), 0, &getBooleanCppuType(), 0, 0}, {MAP_CHAR_LEN(SC_UNO_BASICLIBRARIES), 0, &getCppuType((uno::Reference< script::XLibraryContainer >*)0), beans::PropertyAttribute::READONLY, 0}, {MAP_CHAR_LEN(SC_UNO_DIALOGLIBRARIES), 0, &getCppuType((uno::Reference< script::XLibraryContainer >*)0), beans::PropertyAttribute::READONLY, 0}, - {MAP_CHAR_LEN(SC_UNO_VBADOCOBJ), 0, &getCppuType((beans::PropertyValue*)0), beans::PropertyAttribute::READONLY, 0}, {MAP_CHAR_LEN(SC_UNO_CALCASSHOWN), PROP_UNO_CALCASSHOWN, &getBooleanCppuType(), 0, 0}, {MAP_CHAR_LEN(SC_UNONAME_CLOCAL), 0, &getCppuType((lang::Locale*)0), 0, 0}, {MAP_CHAR_LEN(SC_UNO_CJK_CLOCAL), 0, &getCppuType((lang::Locale*)0), 0, 0}, @@ -1570,13 +1568,6 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const rtl::OUString& aPropertyNa { aRet <<= pDocShell->GetDialogContainer(); } - else if ( aString.EqualsAscii( SC_UNO_VBADOCOBJ ) ) - { - beans::PropertyValue aProp; - aProp.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ThisExcelDoc") ); - aProp.Value <<= pDocShell->GetModel(); - aRet <<= aProp; - } else if ( aString.EqualsAscii( SC_UNO_RUNTIMEUID ) ) { aRet <<= getRuntimeUID(); @@ -1780,12 +1771,6 @@ sal_Int64 SAL_CALL ScModelObj::getSomething( return sal::static_int_cast(reinterpret_cast(this)); } - if ( rId.getLength() == 16 && - 0 == rtl_compareMemory( SfxObjectShell::getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) - { - return sal::static_int_cast(reinterpret_cast(pDocShell )); - } // aggregated number formats supplier has XUnoTunnel, too // interface from aggregated object must be obtained via queryAggregation -- cgit v1.2.3 From ed107e6366ffec1352046998ec9c0f815ece4b53 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Wed, 23 Sep 2009 14:06:30 +0000 Subject: warnings as errors --- sc/source/ui/vba/vbafont.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/sc/source/ui/vba/vbafont.cxx b/sc/source/ui/vba/vbafont.cxx index 7f85f71e76bf..a72e8c4373c0 100644 --- a/sc/source/ui/vba/vbafont.cxx +++ b/sc/source/ui/vba/vbafont.cxx @@ -250,7 +250,6 @@ ScVbaFont::setColorIndex( const uno::Any& _colorindex ) throw( uno::RuntimeExcep uno::Any SAL_CALL ScVbaFont::getColorIndex() throw ( uno::RuntimeException ) { - sal_Int32 nColor = 0; if ( GetDataSet() ) if ( GetDataSet()->GetItemState( ATTR_FONT_COLOR, TRUE, NULL) == SFX_ITEM_DONTCARE ) return aNULL(); -- cgit v1.2.3 From 95507956b2e805e7b40a7f17247bb04daf9a78ee Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Mon, 28 Sep 2009 17:17:07 +0200 Subject: merge problems --- sc/sdi/makefile.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sc/sdi/makefile.mk b/sc/sdi/makefile.mk index 2bd2860b7da1..0ab1b486cd43 100644 --- a/sc/sdi/makefile.mk +++ b/sc/sdi/makefile.mk @@ -71,8 +71,7 @@ SVSDI1DEPEND= \ mediash.sdi \ pgbrksh.sdi \ scslots.hrc \ - $(INC)$/sc.hrc \ - $(SOLARINCXDIR)$/svxslots.ilb + $(INC)$/sc.hrc .ENDIF # --- Targets ------------------------------------------------------- -- cgit v1.2.3 From 4aa9c65e8853a300c0da1ef2e7f544d4ca927359 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Tue, 29 Sep 2009 14:47:18 +0000 Subject: tweak VBAGlobals creation/insertion, also restore overwritten visibility controls bits to moved ( erm delete and created in another director ) file. Add missing bits to enable Application.Quit and use preprocessor to include some uncompiled code --- sc/source/filter/excel/excimp8.cxx | 16 +--------------- sc/source/ui/docshell/docsh.cxx | 18 +++++++++--------- sc/source/ui/docshell/docsh2.cxx | 13 ++++++++++++- 3 files changed, 22 insertions(+), 25 deletions(-) diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index a3de34afacdc..6e307e0a354d 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -266,23 +266,9 @@ void ImportExcel8::ReadBasic( void ) bool bLoadStrg = pFilterOpt->IsLoadExcelBasicStorage(); if( bLoadCode || bLoadStrg ) { - uno::Any aGlobs; - uno::Sequence< uno::Any > aArgs(1); - aArgs[ 0 ] <<= pShell->GetModel(); - aGlobs <<= ::comphelper::getProcessServiceFactory()->createInstanceWithArguments( ::rtl::OUString::createFromAscii( "ooo.vba.excel.Globals"), aArgs ); - pShell->GetBasicManager()->SetGlobalUNOConstant( "VBAGlobals", aGlobs ); SvxImportMSVBasic aBasicImport( *pShell, *xRootStrg, bLoadCode, bLoadStrg ); - bool bAsComment = !bLoadExecutable || !aGlobs.hasValue(); + bool bAsComment = !bLoadExecutable; aBasicImport.Import( EXC_STORAGE_VBA_PROJECT, EXC_STORAGE_VBA, bAsComment ); - // There may be implications setting the current component - // too early :-/ so I will just manually set the Basic Variables - BasicManager* pAppMgr = SFX_APP()->GetBasicManager(); - if ( pAppMgr ) - pAppMgr->SetGlobalUNOConstant( "ThisComponent", makeAny( pShell->GetModel() ) ); - { - uno::Any aModel = uno::makeAny( pShell->GetModel() ); - pAppMgr->SetGlobalUNOConstant( "ThisExcelDoc", aModel ); - } } } } diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index df7cb24e605f..0dbde19943be 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -360,15 +360,15 @@ void ScDocShell::AfterXMLLoading(sal_Bool bRet) else aDocument.SetInsertingFromOtherDoc( FALSE ); // add vba globals ( if they are availabl ) - SfxObjectShell* pShell = aDocument.GetDocumentShell(); - if ( pShell ) - { - uno::Any aGlobs; - uno::Sequence< uno::Any > aArgs(1); - aArgs[ 0 ] <<= pShell->GetModel(); - aGlobs <<= ::comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.excel.Globals" ) ), aArgs ); - pShell->GetBasicManager()->SetGlobalUNOConstant( "VBAGlobals", aGlobs ); - } + uno::Any aGlobs; + uno::Sequence< uno::Any > aArgs(1); + aArgs[ 0 ] <<= GetModel(); + aGlobs <<= ::comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.excel.Globals" ) ), aArgs ); + GetBasicManager()->SetGlobalUNOConstant( "VBAGlobals", aGlobs ); + BasicManager* pAppMgr = SFX_APP()->GetBasicManager(); + if ( pAppMgr ) + pAppMgr->SetGlobalUNOConstant( "ThisExcelDoc", aArgs[ 0 ] ); + aDocument.SetImportingXML( FALSE ); aDocument.EnableExecuteLink( true ); aDocument.EnableUndo( TRUE ); diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx index 7f213175a075..c79be9cb978b 100644 --- a/sc/source/ui/docshell/docsh2.cxx +++ b/sc/source/ui/docshell/docsh2.cxx @@ -53,7 +53,10 @@ #include #include - +#include +#include +#include +#include // INCLUDE --------------------------------------------------------------- /* @@ -102,6 +105,14 @@ BOOL __EXPORT ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xSt InitItems(); CalcOutputFactor(); + uno::Any aGlobs; + uno::Sequence< uno::Any > aArgs(1); + aArgs[ 0 ] <<= GetModel(); + aGlobs <<= ::comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.excel.Globals" ) ), aArgs ); + GetBasicManager()->SetGlobalUNOConstant( "VBAGlobals", aGlobs ); + BasicManager* pAppMgr = SFX_APP()->GetBasicManager(); + if ( pAppMgr ) + pAppMgr->SetGlobalUNOConstant( "ThisExcelDoc", aArgs[ 0 ] ); return bRet; } -- cgit v1.2.3 From 95eeb6c233eb2718399b5ffa69c1e9de86bf6bf5 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Wed, 30 Sep 2009 09:08:19 +0000 Subject: add some comments --- sc/source/ui/docshell/docsh.cxx | 11 +++++++++++ sc/source/ui/docshell/docsh2.cxx | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 0dbde19943be..afc9327f7d8f 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -365,6 +365,17 @@ void ScDocShell::AfterXMLLoading(sal_Bool bRet) aArgs[ 0 ] <<= GetModel(); aGlobs <<= ::comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.excel.Globals" ) ), aArgs ); GetBasicManager()->SetGlobalUNOConstant( "VBAGlobals", aGlobs ); + // Fake ThisComponent being setup by Activate ( which is a view + // related thing ), + // a) if another document is opened then in theory ThisComponent + // will be reset as before, + // b) when this document is 'really' Activated then ThisComponent + // again will be set as before + // The only wrinkle seems if this document is loaded 'InVisible' + // but.. I don't see that this is possible from the vba API + // I could be wrong though + // There may be implications setting the current component + // too early :-/ so I will just manually set the Basic Variables BasicManager* pAppMgr = SFX_APP()->GetBasicManager(); if ( pAppMgr ) pAppMgr->SetGlobalUNOConstant( "ThisExcelDoc", aArgs[ 0 ] ); diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx index c79be9cb978b..742d66e6bcb9 100644 --- a/sc/source/ui/docshell/docsh2.cxx +++ b/sc/source/ui/docshell/docsh2.cxx @@ -110,6 +110,17 @@ BOOL __EXPORT ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xSt aArgs[ 0 ] <<= GetModel(); aGlobs <<= ::comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.excel.Globals" ) ), aArgs ); GetBasicManager()->SetGlobalUNOConstant( "VBAGlobals", aGlobs ); + // Fake ThisComponent being setup by Activate ( which is a view + // related thing ), + // a) if another document is opened then in theory ThisComponent + // will be reset as before, + // b) when this document is 'really' Activated then ThisComponent + // again will be set as before + // The only wrinkle seems if this document is loaded 'InVisible' + // but.. I don't see that this is possible from the vba API + // I could be wrong though + // There may be implications setting the current component + // too early :-/ so I will just manually set the Basic Variables BasicManager* pAppMgr = SFX_APP()->GetBasicManager(); if ( pAppMgr ) pAppMgr->SetGlobalUNOConstant( "ThisExcelDoc", aArgs[ 0 ] ); -- cgit v1.2.3 From 34551159a38cbdef7e254664834c0b793e593d5b Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Thu, 1 Oct 2009 10:29:37 +0000 Subject: CWS-TOOLING: integrate CWS sw32bf04 2009-09-22 Michael Stahl galobj.hxx: do not export SgaObject methods (fixes wntmsci12 build) 2009-09-21 Michael Stahl #i105149# #i93308# svx: unofield.cxx: support field services with proper case 2009-09-21 Michael Stahl #i105149# #i102468# sc: servuno.cxx: support field services with proper case 2009-09-21 Michael Stahl #i105149# txtflde.cxx: support docinfo field services with proper case 2009-09-18 Michael Stahl #i105148# fmtatr2.cxx: SwFmtMeta::Clone(): avoid assert on clone pool default 2009-09-18 Michael Stahl #i105148# fmtatr2.cxx: SwFmtMeta::~SwFmtMeta(): check if m_pMeta != 0 2009-09-18 Michael Stahl #i105179# unocoll.cxx: SwXFrames::getByName(): add missing breaks 2009-09-18 Michael Stahl dbgoutsw.cxx: explicitly convert from SwNodeIndex to SwPosition 2009-09-18 Michael Stahl galobj.hxx: export class SgaObject from svxcore, needed by unogalitem.cxx 2009-09-17 Michael Stahl #i105149# txtflde.cxx: compare text field prefix case-insensitively 2009-09-16 Michael Stahl #i105117# docdde.cxx: fix possible NULL dereference (patch by cmc) 2009-09-16 Michael Stahl #i105124# docdde.cxx: fix use-after-free bug: make _FindItem member String --- sc/source/ui/unoobj/servuno.cxx | 131 ++++++++++++++++++++++++---------------- 1 file changed, 78 insertions(+), 53 deletions(-) diff --git a/sc/source/ui/unoobj/servuno.cxx b/sc/source/ui/unoobj/servuno.cxx index 71f45e6ab12b..1f51bc1646af 100644 --- a/sc/source/ui/unoobj/servuno.cxx +++ b/sc/source/ui/unoobj/servuno.cxx @@ -65,55 +65,71 @@ using namespace ::com::sun::star; //------------------------------------------------------------------------ +// +struct ProvNamesId_Type +{ + const char * pName; + sal_uInt16 nType; +}; -static const sal_Char* __FAR_DATA aProvNames[SC_SERVICE_COUNT] = - { - "com.sun.star.sheet.Spreadsheet", // SC_SERVICE_SHEET - "com.sun.star.text.TextField.URL", // SC_SERVICE_URLFIELD - "com.sun.star.text.TextField.PageNumber", // SC_SERVICE_PAGEFIELD - "com.sun.star.text.TextField.PageCount", // SC_SERVICE_PAGESFIELD - "com.sun.star.text.TextField.Date", // SC_SERVICE_DATEFIELD - "com.sun.star.text.TextField.Time", // SC_SERVICE_TIMEFIELD - "com.sun.star.text.TextField.DocumentTitle",// SC_SERVICE_TITLEFIELD - "com.sun.star.text.TextField.FileName", // SC_SERVICE_FILEFIELD - "com.sun.star.text.TextField.SheetName", // SC_SERVICE_SHEETFIELD - "com.sun.star.style.CellStyle", // SC_SERVICE_CELLSTYLE - "com.sun.star.style.PageStyle", // SC_SERVICE_PAGESTYLE - "com.sun.star.sheet.TableAutoFormat", // SC_SERVICE_AUTOFORMAT - "com.sun.star.sheet.SheetCellRanges", // SC_SERVICE_CELLRANGES - "com.sun.star.drawing.GradientTable", // SC_SERVICE_GRADTAB - "com.sun.star.drawing.HatchTable", // SC_SERVICE_HATCHTAB - "com.sun.star.drawing.BitmapTable", // SC_SERVICE_BITMAPTAB - "com.sun.star.drawing.TransparencyGradientTable", // SC_SERVICE_TRGRADTAB - "com.sun.star.drawing.MarkerTable", // SC_SERVICE_MARKERTAB - "com.sun.star.drawing.DashTable", // SC_SERVICE_DASHTAB - "com.sun.star.text.NumberingRules", // SC_SERVICE_NUMRULES - "com.sun.star.sheet.Defaults", // SC_SERVICE_DOCDEFLTS - "com.sun.star.drawing.Defaults", // SC_SERVICE_DRAWDEFLTS - "com.sun.star.comp.SpreadsheetSettings", // SC_SERVICE_DOCSPRSETT - "com.sun.star.document.Settings", // SC_SERVICE_DOCCONF - "com.sun.star.image.ImageMapRectangleObject",// SC_SERVICE_IMAP_RECT - "com.sun.star.image.ImageMapCircleObject", // SC_SERVICE_IMAP_CIRC - "com.sun.star.image.ImageMapPolygonObject", // SC_SERVICE_IMAP_POLY +static const ProvNamesId_Type __FAR_DATA aProvNamesId[] = +{ + { "com.sun.star.sheet.Spreadsheet", SC_SERVICE_SHEET }, + { "com.sun.star.text.TextField.URL", SC_SERVICE_URLFIELD }, + { "com.sun.star.text.TextField.PageNumber", SC_SERVICE_PAGEFIELD }, + { "com.sun.star.text.TextField.PageCount", SC_SERVICE_PAGESFIELD }, + { "com.sun.star.text.TextField.Date", SC_SERVICE_DATEFIELD }, + { "com.sun.star.text.TextField.Time", SC_SERVICE_TIMEFIELD }, + { "com.sun.star.text.TextField.DocumentTitle", SC_SERVICE_TITLEFIELD }, + { "com.sun.star.text.TextField.FileName", SC_SERVICE_FILEFIELD }, + { "com.sun.star.text.TextField.SheetName", SC_SERVICE_SHEETFIELD }, + { "com.sun.star.style.CellStyle", SC_SERVICE_CELLSTYLE }, + { "com.sun.star.style.PageStyle", SC_SERVICE_PAGESTYLE }, + { "com.sun.star.sheet.TableAutoFormat", SC_SERVICE_AUTOFORMAT }, + { "com.sun.star.sheet.SheetCellRanges", SC_SERVICE_CELLRANGES }, + { "com.sun.star.drawing.GradientTable", SC_SERVICE_GRADTAB }, + { "com.sun.star.drawing.HatchTable", SC_SERVICE_HATCHTAB }, + { "com.sun.star.drawing.BitmapTable", SC_SERVICE_BITMAPTAB }, + { "com.sun.star.drawing.TransparencyGradientTable", SC_SERVICE_TRGRADTAB }, + { "com.sun.star.drawing.MarkerTable", SC_SERVICE_MARKERTAB }, + { "com.sun.star.drawing.DashTable", SC_SERVICE_DASHTAB }, + { "com.sun.star.text.NumberingRules", SC_SERVICE_NUMRULES }, + { "com.sun.star.sheet.Defaults", SC_SERVICE_DOCDEFLTS }, + { "com.sun.star.drawing.Defaults", SC_SERVICE_DRAWDEFLTS }, + { "com.sun.star.comp.SpreadsheetSettings", SC_SERVICE_DOCSPRSETT }, + { "com.sun.star.document.Settings", SC_SERVICE_DOCCONF }, + { "com.sun.star.image.ImageMapRectangleObject", SC_SERVICE_IMAP_RECT }, + { "com.sun.star.image.ImageMapCircleObject", SC_SERVICE_IMAP_CIRC }, + { "com.sun.star.image.ImageMapPolygonObject", SC_SERVICE_IMAP_POLY }, // #100263# Support creation of GraphicObjectResolver and EmbeddedObjectResolver - "com.sun.star.document.ExportGraphicObjectResolver", // SC_SERVICE_EXPORT_GOR - "com.sun.star.document.ImportGraphicObjectResolver", // SC_SERVICE_IMPORT_GOR - "com.sun.star.document.ExportEmbeddedObjectResolver", // SC_SERVICE_EXPORT_EOR - "com.sun.star.document.ImportEmbeddedObjectResolver", // SC_SERVICE_IMPORT_EOR - - SC_SERVICENAME_VALBIND, // SC_SERVICE_VALBIND - SC_SERVICENAME_LISTCELLBIND, // SC_SERVICE_LISTCELLBIND - SC_SERVICENAME_LISTSOURCE, // SC_SERVICE_LISTSOURCE - SC_SERVICENAME_CELLADDRESS, // SC_SERVICE_CELLADDRESS - SC_SERVICENAME_RANGEADDRESS, // SC_SERVICE_RANGEADDRESS - - "com.sun.star.sheet.DocumentSettings", // SC_SERVICE_SHEETDOCSET - - SC_SERVICENAME_CHDATAPROV, // SC_SERVICE_CHDATAPROV - SC_SERVICENAME_FORMULAPARS, // SC_SERVICE_FORMULAPARS - SC_SERVICENAME_OPCODEMAPPER // SC_SERVICE_OPCODEMAPPER - }; + { "com.sun.star.document.ExportGraphicObjectResolver", SC_SERVICE_EXPORT_GOR }, + { "com.sun.star.document.ImportGraphicObjectResolver", SC_SERVICE_IMPORT_GOR }, + { "com.sun.star.document.ExportEmbeddedObjectResolver", SC_SERVICE_EXPORT_EOR }, + { "com.sun.star.document.ImportEmbeddedObjectResolver", SC_SERVICE_IMPORT_EOR }, + + { SC_SERVICENAME_VALBIND, SC_SERVICE_VALBIND }, + { SC_SERVICENAME_LISTCELLBIND, SC_SERVICE_LISTCELLBIND }, + { SC_SERVICENAME_LISTSOURCE, SC_SERVICE_LISTSOURCE }, + { SC_SERVICENAME_CELLADDRESS, SC_SERVICE_CELLADDRESS }, + { SC_SERVICENAME_RANGEADDRESS, SC_SERVICE_RANGEADDRESS }, + + { "com.sun.star.sheet.DocumentSettings",SC_SERVICE_SHEETDOCSET }, + + { SC_SERVICENAME_CHDATAPROV, SC_SERVICE_CHDATAPROV }, + { SC_SERVICENAME_FORMULAPARS, SC_SERVICE_FORMULAPARS }, + { SC_SERVICENAME_OPCODEMAPPER, SC_SERVICE_OPCODEMAPPER }, + + // case-correct versions of the service names (#i102468#) + { "com.sun.star.text.textfield.URL", SC_SERVICE_URLFIELD }, + { "com.sun.star.text.textfield.PageNumber", SC_SERVICE_PAGEFIELD }, + { "com.sun.star.text.textfield.PageCount", SC_SERVICE_PAGESFIELD }, + { "com.sun.star.text.textfield.Date", SC_SERVICE_DATEFIELD }, + { "com.sun.star.text.textfield.Time", SC_SERVICE_TIMEFIELD }, + { "com.sun.star.text.textfield.DocumentTitle", SC_SERVICE_TITLEFIELD }, + { "com.sun.star.text.textfield.FileName", SC_SERVICE_FILEFIELD }, + { "com.sun.star.text.textfield.SheetName", SC_SERVICE_SHEETFIELD }, +}; // // old service names that were in 567 still work in createInstance, @@ -186,11 +202,17 @@ sal_uInt16 ScServiceProvider::GetProviderType(const String& rServiceName) { if (rServiceName.Len()) { - USHORT i; - for (i=0; i crash"); @@ -369,10 +391,13 @@ uno::Reference ScServiceProvider::MakeInstance( uno::Sequence ScServiceProvider::GetAllServiceNames() { - uno::Sequence aRet(SC_SERVICE_COUNT); + const sal_uInt16 nEntries = sizeof(aProvNamesId) / sizeof(aProvNamesId[0]); + uno::Sequence aRet(nEntries); rtl::OUString* pArray = aRet.getArray(); - for (sal_uInt16 i = 0; i < SC_SERVICE_COUNT; i++) - pArray[i] = rtl::OUString::createFromAscii( aProvNames[i] ); + for (sal_uInt16 i = 0; i < nEntries; i++) + { + pArray[i] = rtl::OUString::createFromAscii( aProvNamesId[i].pName ); + } return aRet; } -- cgit v1.2.3 From 20ade6a1d2fc888edec120f09079ed26d3bd80ff Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Tue, 6 Oct 2009 07:38:24 +0200 Subject: #103496#: move VCL free ConfigItems to unotools --- chart2/inc/pch/precompiled_chart2.hxx | 2 +- chart2/source/controller/dialogs/dlg_DataEditor.cxx | 2 +- chart2/source/model/filter/XMLFilter.cxx | 2 +- chart2/source/tools/AxisHelper.cxx | 2 +- chart2/source/tools/CharacterProperties.cxx | 2 +- chart2/source/view/main/DrawModelWrapper.cxx | 2 +- sc/inc/chgtrack.hxx | 8 +++----- sc/inc/pch/precompiled_sc.hxx | 6 +++--- sc/source/core/data/documen8.cxx | 2 +- sc/source/core/data/documen9.cxx | 4 ++-- sc/source/core/data/document.cxx | 2 +- sc/source/core/data/drwlayer.cxx | 2 +- sc/source/core/data/global2.cxx | 4 ++-- sc/source/core/data/globalx.cxx | 2 +- sc/source/core/data/postit.cxx | 2 +- sc/source/core/tool/autoform.cxx | 2 +- sc/source/core/tool/chgtrack.cxx | 13 ++++++------- sc/source/filter/excel/excimp8.cxx | 2 +- sc/source/filter/excel/expop2.cxx | 2 +- sc/source/filter/excel/xeroot.cxx | 2 +- sc/source/filter/excel/xiescher.cxx | 4 ++-- sc/source/filter/starcalc/scfobj.cxx | 2 +- sc/source/filter/xcl97/xcl97rec.cxx | 4 ++-- sc/source/filter/xml/xmlwrap.cxx | 2 +- sc/source/ui/app/scmod.cxx | 2 +- sc/source/ui/app/scmod2.cxx | 2 +- sc/source/ui/dbgui/scendlg.cxx | 2 +- sc/source/ui/docshell/docsh.cxx | 4 ++-- sc/source/ui/drawfunc/fuins2.cxx | 2 +- sc/source/ui/miscdlgs/sharedocdlg.cxx | 2 +- sc/source/ui/pagedlg/scuitphfedit.cxx | 2 +- sc/source/ui/unoobj/chartuno.cxx | 2 +- sc/source/ui/unoobj/docuno.cxx | 2 +- sc/source/ui/view/cellsh.cxx | 2 +- sc/source/ui/view/cellsh1.cxx | 2 +- sc/source/ui/view/cellsh2.cxx | 2 +- sc/source/ui/view/notemark.cxx | 2 +- sc/source/ui/view/tabvwsh2.cxx | 2 +- sc/source/ui/view/tabvwsh4.cxx | 2 +- sc/source/ui/view/tabvwshb.cxx | 2 +- sc/source/ui/view/viewfun5.cxx | 2 +- 41 files changed, 55 insertions(+), 58 deletions(-) diff --git a/chart2/inc/pch/precompiled_chart2.hxx b/chart2/inc/pch/precompiled_chart2.hxx index e8af809b1af2..ca7ab50f7ad7 100644 --- a/chart2/inc/pch/precompiled_chart2.hxx +++ b/chart2/inc/pch/precompiled_chart2.hxx @@ -218,7 +218,7 @@ #include "svtools/itemiter.hxx" #include "svtools/itempool.hxx" #include "svtools/itemset.hxx" -#include "svtools/pathoptions.hxx" +#include "unotools/pathoptions.hxx" #include "svtools/poolitem.hxx" #include "svtools/stritem.hxx" #include "svtools/syslocale.hxx" diff --git a/chart2/source/controller/dialogs/dlg_DataEditor.cxx b/chart2/source/controller/dialogs/dlg_DataEditor.cxx index 6abbf5a8e038..edc431c2c763 100644 --- a/chart2/source/controller/dialogs/dlg_DataEditor.cxx +++ b/chart2/source/controller/dialogs/dlg_DataEditor.cxx @@ -43,7 +43,7 @@ #include #include #include -#include +#include // for SfxBoolItem #include diff --git a/chart2/source/model/filter/XMLFilter.cxx b/chart2/source/model/filter/XMLFilter.cxx index e25cb92d4012..f3971b28d40f 100644 --- a/chart2/source/model/filter/XMLFilter.cxx +++ b/chart2/source/model/filter/XMLFilter.cxx @@ -41,7 +41,7 @@ // header contains only macros #include // header for class SvtSaveOptions -#include +#include #include // header for struct PropertyMapEntry #include diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx index 5e6c0bce8717..b7dfd60f8712 100644 --- a/chart2/source/tools/AxisHelper.cxx +++ b/chart2/source/tools/AxisHelper.cxx @@ -42,7 +42,7 @@ #include "DataSeriesHelper.hxx" #include "Scaling.hxx" -#include +#include #include diff --git a/chart2/source/tools/CharacterProperties.cxx b/chart2/source/tools/CharacterProperties.cxx index 4f558b35df0a..6981d7fab9a2 100644 --- a/chart2/source/tools/CharacterProperties.cxx +++ b/chart2/source/tools/CharacterProperties.cxx @@ -58,7 +58,7 @@ // header for struct SvtLinguConfig #ifndef _SVTOOLS_LINGUCFG_HXX_ -#include +#include #endif #ifndef INCLUDED_I18NPOOL_MSLANGID_HXX #include diff --git a/chart2/source/view/main/DrawModelWrapper.cxx b/chart2/source/view/main/DrawModelWrapper.cxx index 95b5144265ae..edcb8c3eecc9 100644 --- a/chart2/source/view/main/DrawModelWrapper.cxx +++ b/chart2/source/view/main/DrawModelWrapper.cxx @@ -45,7 +45,7 @@ // header for class Svx3DPercentDiagonalItem #include // header for class SvtPathOptions -#include +#include // header E3dObjFactory #include // header for class SdrObjList diff --git a/sc/inc/chgtrack.hxx b/sc/inc/chgtrack.hxx index 6707473f5610..52915e59358a 100644 --- a/sc/inc/chgtrack.hxx +++ b/sc/inc/chgtrack.hxx @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include "global.hxx" #include "bigrange.hxx" #include "collect.hxx" @@ -994,9 +994,7 @@ DECLARE_TABLE( ScChangeActionTable, ScChangeAction* ) // "normalen" Actions in die Quere zu kommen. #define SC_CHGTRACK_GENERATED_START ((UINT32) 0xfffffff0) -// SfxListener an der Applikation, um Aenderungen des Usernamens mitzubekommen - -class ScChangeTrack : public SfxListener +class ScChangeTrack : public utl::ConfigurationListener { friend void ScChangeAction::RejectRestoreContents( ScChangeTrack*, SCsCOL, SCsROW ); friend BOOL ScChangeActionDel::Reject( ScDocument* pDoc ); @@ -1059,7 +1057,6 @@ class ScChangeTrack : public SfxListener const ScBaseCell* pOldCell, const ScBaseCell* pNewCell ); - virtual void Notify( SfxBroadcaster&, const SfxHint& ); void Init(); void DtorClear(); void SetLoadSave( BOOL bVal ) { bLoadSave = bVal; } @@ -1130,6 +1127,7 @@ class ScChangeTrack : public SfxListener #endif // SC_CHGTRACK_CXX void ClearMsgQueue(); + virtual void ConfigurationChanged( utl::ConfigurationBroadcaster* ); public: diff --git a/sc/inc/pch/precompiled_sc.hxx b/sc/inc/pch/precompiled_sc.hxx index b905bb19db03..f1e916f5b568 100644 --- a/sc/inc/pch/precompiled_sc.hxx +++ b/sc/inc/pch/precompiled_sc.hxx @@ -155,13 +155,13 @@ #include #include #include -#include +#include #include #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index 64433a30297a..b12a2783baa9 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -58,7 +58,7 @@ #include #include #include -#include +#include #include #include diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx index de27a80b17ee..772ed496d2e1 100644 --- a/sc/source/core/data/documen9.cxx +++ b/sc/source/core/data/documen9.cxx @@ -56,8 +56,8 @@ #include #include #include -#include -#include +#include +#include #include "document.hxx" #include "docoptio.hxx" diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 8b04d5a0500e..4249efa9d020 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index a5c571026e96..6a3beb940c48 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -64,7 +64,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/core/data/global2.cxx b/sc/source/core/data/global2.cxx index 6af662119f12..67dccac980ae 100644 --- a/sc/source/core/data/global2.cxx +++ b/sc/source/core/data/global2.cxx @@ -38,8 +38,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/sc/source/core/data/globalx.cxx b/sc/source/core/data/globalx.cxx index 03ca187df4d2..a5b14a3cc8c5 100644 --- a/sc/source/core/data/globalx.cxx +++ b/sc/source/core/data/globalx.cxx @@ -40,7 +40,7 @@ #include #include -#include +#include #include #include diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx index 7a08f352ed91..6489b4f21a6a 100644 --- a/sc/source/core/data/postit.cxx +++ b/sc/source/core/data/postit.cxx @@ -34,7 +34,7 @@ #include "postit.hxx" #include -#include +#include #include #include #include diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx index 3b8a88c47e2f..f21a0860d962 100644 --- a/sc/source/core/tool/autoform.cxx +++ b/sc/source/core/tool/autoform.cxx @@ -39,7 +39,7 @@ #include #include -#include +#include #include #include #include diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx index 22d996dd701f..2a9ca186bf85 100644 --- a/sc/source/core/tool/chgtrack.cxx +++ b/sc/source/core/tool/chgtrack.cxx @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include "cell.hxx" @@ -2229,7 +2229,7 @@ ScChangeTrack::ScChangeTrack( ScDocument* pDocP ) : pDoc( pDocP ) { Init(); - StartListening(SC_MOD()->GetUserOptions()); + SC_MOD()->GetUserOptions().AddListener(this); ppContentSlots = new ScChangeActionContent* [ nContentSlots ]; memset( ppContentSlots, 0, nContentSlots * sizeof( ScChangeActionContent* ) ); @@ -2240,13 +2240,14 @@ ScChangeTrack::ScChangeTrack( ScDocument* pDocP, const ScStrCollection& aTempUse pDoc( pDocP ) { Init(); - StartListening(SC_MOD()->GetUserOptions()); + SC_MOD()->GetUserOptions().AddListener(this); ppContentSlots = new ScChangeActionContent* [ nContentSlots ]; memset( ppContentSlots, 0, nContentSlots * sizeof( ScChangeActionContent* ) ); } ScChangeTrack::~ScChangeTrack() { + SC_MOD()->GetUserOptions().RemoveListener(this); DtorClear(); delete [] ppContentSlots; } @@ -2339,11 +2340,9 @@ void ScChangeTrack::Clear() } -void __EXPORT ScChangeTrack::Notify( SfxBroadcaster&, const SfxHint& rHint ) +void __EXPORT ScChangeTrack::ConfigurationChanged( utl::ConfigurationBroadcaster* ) { - if ( !pDoc->IsInDtorClear() && - rHint.ISA(SfxSimpleHint) && - ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_USER_OPTIONS_CHANGED ) + if ( !pDoc->IsInDtorClear() ) { const SvtUserOptions& rUserOptions = SC_MOD()->GetUserOptions(); USHORT nOldCount = aUserCollection.GetCount(); diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index 1d209b91bc68..65ca7d593b3d 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -36,7 +36,7 @@ #include #include -#include +#include #include diff --git a/sc/source/filter/excel/expop2.cxx b/sc/source/filter/excel/expop2.cxx index 677d872fe8e9..69f1d4eb56d2 100644 --- a/sc/source/filter/excel/expop2.cxx +++ b/sc/source/filter/excel/expop2.cxx @@ -35,7 +35,7 @@ //------------------------------------------------------------------------ -#include +#include #include #include diff --git a/sc/source/filter/excel/xeroot.cxx b/sc/source/filter/excel/xeroot.cxx index 7c4974db3029..c4acc89c1ff0 100644 --- a/sc/source/filter/excel/xeroot.cxx +++ b/sc/source/filter/excel/xeroot.cxx @@ -32,7 +32,7 @@ #include "precompiled_sc.hxx" #include #include -#include +#include #include #include #include diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index 599b33f9c8aa..419cbb3d6168 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -56,8 +56,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/sc/source/filter/starcalc/scfobj.cxx b/sc/source/filter/starcalc/scfobj.cxx index a36be98b3d11..d15cb3c5a227 100644 --- a/sc/source/filter/starcalc/scfobj.cxx +++ b/sc/source/filter/starcalc/scfobj.cxx @@ -41,7 +41,7 @@ using namespace com::sun::star; // INCLUDE --------------------------------------------------------------- -#include +#include #include #include #include diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx index ac71dbb01fbb..a11b814643d8 100644 --- a/sc/source/filter/xcl97/xcl97rec.cxx +++ b/sc/source/filter/xcl97/xcl97rec.cxx @@ -57,7 +57,7 @@ #include "scitems.hxx" -#include +#include #include #include #include @@ -65,7 +65,7 @@ #include #include -#include +#include #include #include diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx index 7bc5396fcb5b..d13956fd1ca3 100644 --- a/sc/source/filter/xml/xmlwrap.cxx +++ b/sc/source/filter/xml/xmlwrap.cxx @@ -71,7 +71,7 @@ #include #include -#include +#include #include "document.hxx" #include "xmlwrap.hxx" diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index 5afe9e11c7d5..43041d1be852 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -57,7 +57,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/ui/app/scmod2.cxx b/sc/source/ui/app/scmod2.cxx index 4001ebe62036..7e0b43bdd156 100644 --- a/sc/source/ui/app/scmod2.cxx +++ b/sc/source/ui/app/scmod2.cxx @@ -36,7 +36,7 @@ //------------------------------------------------------------------ #include -#include +#include #include #include #include diff --git a/sc/source/ui/dbgui/scendlg.cxx b/sc/source/ui/dbgui/scendlg.cxx index 60c37ee19381..0065af288783 100644 --- a/sc/source/ui/dbgui/scendlg.cxx +++ b/sc/source/ui/dbgui/scendlg.cxx @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index f7d1e2ccae2f..44d77f5517fa 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -42,7 +42,7 @@ #include -#include +#include #include #include #include @@ -64,7 +64,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx index 93abbd48c9e7..a40bcf32dd30 100644 --- a/sc/source/ui/drawfunc/fuins2.cxx +++ b/sc/source/ui/drawfunc/fuins2.cxx @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/ui/miscdlgs/sharedocdlg.cxx b/sc/source/ui/miscdlgs/sharedocdlg.cxx index ec93346e1fed..e349f18a2c27 100644 --- a/sc/source/ui/miscdlgs/sharedocdlg.cxx +++ b/sc/source/ui/miscdlgs/sharedocdlg.cxx @@ -35,7 +35,7 @@ #include #include -#include +#include #include diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx index 70232e2827f1..9e037fbe7d0e 100644 --- a/sc/source/ui/pagedlg/scuitphfedit.cxx +++ b/sc/source/ui/pagedlg/scuitphfedit.cxx @@ -50,7 +50,7 @@ #include #include #include -#include +#include #define _SVSTDARR_USHORTS #include diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx index 3c584a94a775..d66600df4243 100644 --- a/sc/source/ui/unoobj/chartuno.cxx +++ b/sc/source/ui/unoobj/chartuno.cxx @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include #include diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index cd63adc33989..befb6a6f76e2 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include #include diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index c2d0f68fc6ef..3dfd6e2479c2 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index f610e28b3fc5..cf9cbeb468ad 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -70,7 +70,7 @@ #include #include #include -#include +#include #include #include diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index 039e4dc256ba..d17fa7160834 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include #include diff --git a/sc/source/ui/view/notemark.cxx b/sc/source/ui/view/notemark.cxx index 2c50a8eb0a81..359c789e43de 100644 --- a/sc/source/ui/view/notemark.cxx +++ b/sc/source/ui/view/notemark.cxx @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx index db6ee302a792..20f5250bca00 100644 --- a/sc/source/ui/view/tabvwsh2.cxx +++ b/sc/source/ui/view/tabvwsh2.cxx @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index e34741ba4c6b..8e32b1c9a2af 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -52,7 +52,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index 37dc2c11da7f..6312ff9e3b50 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -65,7 +65,7 @@ #include #include #include -#include +#include #include #include "tabvwsh.hxx" diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx index 35af3ee2a2e3..71e8b4f9ae0b 100644 --- a/sc/source/ui/view/viewfun5.cxx +++ b/sc/source/ui/view/viewfun5.cxx @@ -53,7 +53,7 @@ #include #include #include -#include +#include #include #include #include -- cgit v1.2.3 -- cgit v1.2.3 From e202191f2b4fb8dba1288502dd2fade732638019 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Wed, 7 Oct 2009 14:45:16 +0000 Subject: warning as error fixes --- sc/source/ui/vba/excelvbahelper.hxx | 6 +++--- sc/source/ui/vba/vbaworkbooks.cxx | 6 ++++++ sc/source/ui/vba/vbaworkbooks.hxx | 2 ++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/sc/source/ui/vba/excelvbahelper.hxx b/sc/source/ui/vba/excelvbahelper.hxx index 9306327568f3..bb222688236a 100644 --- a/sc/source/ui/vba/excelvbahelper.hxx +++ b/sc/source/ui/vba/excelvbahelper.hxx @@ -56,7 +56,7 @@ namespace ooo public: static SfxItemSet* GetDataSet( ScCellRangeObj* pRangeObj ); }; -}; -}; -}; +} +} +} #endif diff --git a/sc/source/ui/vba/vbaworkbooks.cxx b/sc/source/ui/vba/vbaworkbooks.cxx index 1686144b4841..b2f194bff6c5 100644 --- a/sc/source/ui/vba/vbaworkbooks.cxx +++ b/sc/source/ui/vba/vbaworkbooks.cxx @@ -259,6 +259,12 @@ ScVbaWorkbooks::Open( const rtl::OUString& rFileName, const uno::Any& /*UpdateLi return aRet; } +uno::Any +ScVbaWorkbooks::Open( const rtl::OUString& Filename, const uno::Any& ReadOnly, const uno::Sequence< beans::PropertyValue >& rProps ) throw (css::uno::RuntimeException) +{ + return VbaDocumentsBase::Open( Filename, ReadOnly, rProps ); +} + rtl::OUString& ScVbaWorkbooks::getServiceImplName() { diff --git a/sc/source/ui/vba/vbaworkbooks.hxx b/sc/source/ui/vba/vbaworkbooks.hxx index 9bca55f77999..891a8a333695 100644 --- a/sc/source/ui/vba/vbaworkbooks.hxx +++ b/sc/source/ui/vba/vbaworkbooks.hxx @@ -67,6 +67,8 @@ public: virtual void SAL_CALL Close( ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Open( const ::rtl::OUString& Filename, const css::uno::Any& UpdateLinks, const css::uno::Any& ReadOnly, const css::uno::Any& Format, const css::uno::Any& Password, const css::uno::Any& WriteResPassword, const css::uno::Any& IgnoreReadOnlyRecommended, const css::uno::Any& Origin, const css::uno::Any& Delimiter, const css::uno::Any& Editable, const css::uno::Any& Notify, const css::uno::Any& Converter, const css::uno::Any& AddToMru ) throw (css::uno::RuntimeException); + // VbaDocumentsBase / XDocumentsBase (to avoid warning C4266 for hiding function on wntmsci) + virtual css::uno::Any SAL_CALL Open( const ::rtl::OUString& Filename, const css::uno::Any& ReadOnly, const css::uno::Sequence< css::beans::PropertyValue >& rProps ) throw (css::uno::RuntimeException); }; #endif /* SC_VBA_WORKBOOKS_HXX */ -- cgit v1.2.3 From 84d1ba201c11ae58874953ab12df6b5aba20d714 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Wed, 7 Oct 2009 14:57:37 +0000 Subject: fix selection issue --- sc/source/ui/vba/vbaapplication.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx index 880a691701ff..953a2aaee74e 100644 --- a/sc/source/ui/vba/vbaapplication.cxx +++ b/sc/source/ui/vba/vbaapplication.cxx @@ -152,7 +152,7 @@ ScVbaApplication::getSelection() throw (uno::RuntimeException) { OSL_TRACE("** ScVbaApplication::getSelection() ** "); uno::Reference< frame::XModel > xModel( getCurrentDocument() ); - uno::Reference< lang::XServiceInfo > xServiceInfo( xModel->getCurrentController(), uno::UNO_QUERY_THROW ); + uno::Reference< lang::XServiceInfo > xServiceInfo( xModel->getCurrentSelection(), uno::UNO_QUERY_THROW ); rtl::OUString sImpementaionName = xServiceInfo->getImplementationName(); if( sImpementaionName.equalsIgnoreAsciiCaseAscii("com.sun.star.drawing.SvxShapeCollection") ) { -- cgit v1.2.3 From 7fc115be4cbdd17397b05efcaa45884eebcfc3ff Mon Sep 17 00:00:00 2001 From: Noel Power Date: Mon, 12 Oct 2009 09:24:30 +0000 Subject: logs should be generated not saved --- sc/source/ui/vba/testvba/Logs/AutoFilter.log | 20 -- sc/source/ui/vba/testvba/Logs/CalcFont.log | 17 -- sc/source/ui/vba/testvba/Logs/MiscRangeTests.log | 45 ---- sc/source/ui/vba/testvba/Logs/PageBreaks.log | 10 - sc/source/ui/vba/testvba/Logs/Ranges-2.log | 68 ----- sc/source/ui/vba/testvba/Logs/Ranges-3.log | 8 - sc/source/ui/vba/testvba/Logs/Ranges.log | 280 --------------------- sc/source/ui/vba/testvba/Logs/Shapes.log | 77 ------ sc/source/ui/vba/testvba/Logs/StrConv-test.log | 9 - sc/source/ui/vba/testvba/Logs/Template.log | 14 -- sc/source/ui/vba/testvba/Logs/TestAddress.log | 67 ----- .../ui/vba/testvba/Logs/TestCalc_Rangetest.log | 60 ----- .../ui/vba/testvba/Logs/TestCalc_Rangetest2.log | 65 ----- sc/source/ui/vba/testvba/Logs/TestIntersection.log | 26 -- sc/source/ui/vba/testvba/Logs/TestUnion.log | 17 -- sc/source/ui/vba/testvba/Logs/Window.log | 46 ---- sc/source/ui/vba/testvba/Logs/bytearraystring.log | 8 - sc/source/ui/vba/testvba/Logs/dateserial.log | 9 - sc/source/ui/vba/testvba/Logs/datevalue.log | 8 - sc/source/ui/vba/testvba/Logs/format.log | 36 --- sc/source/ui/vba/testvba/Logs/pagesetup.log | 77 ------ sc/source/ui/vba/testvba/Logs/partition.log | 11 - sc/source/ui/vba/testvba/Logs/range-4.log | 16 -- sc/source/ui/vba/testvba/Logs/replace.log | 14 -- sc/source/ui/vba/testvba/Logs/stringplusdouble.log | 62 ----- sc/source/ui/vba/testvba/Logs/window2.log | 41 --- 26 files changed, 1111 deletions(-) delete mode 100644 sc/source/ui/vba/testvba/Logs/AutoFilter.log delete mode 100644 sc/source/ui/vba/testvba/Logs/CalcFont.log delete mode 100644 sc/source/ui/vba/testvba/Logs/MiscRangeTests.log delete mode 100644 sc/source/ui/vba/testvba/Logs/PageBreaks.log delete mode 100644 sc/source/ui/vba/testvba/Logs/Ranges-2.log delete mode 100644 sc/source/ui/vba/testvba/Logs/Ranges-3.log delete mode 100644 sc/source/ui/vba/testvba/Logs/Ranges.log delete mode 100644 sc/source/ui/vba/testvba/Logs/Shapes.log delete mode 100644 sc/source/ui/vba/testvba/Logs/StrConv-test.log delete mode 100644 sc/source/ui/vba/testvba/Logs/Template.log delete mode 100644 sc/source/ui/vba/testvba/Logs/TestAddress.log delete mode 100644 sc/source/ui/vba/testvba/Logs/TestCalc_Rangetest.log delete mode 100644 sc/source/ui/vba/testvba/Logs/TestCalc_Rangetest2.log delete mode 100644 sc/source/ui/vba/testvba/Logs/TestIntersection.log delete mode 100644 sc/source/ui/vba/testvba/Logs/TestUnion.log delete mode 100644 sc/source/ui/vba/testvba/Logs/Window.log delete mode 100644 sc/source/ui/vba/testvba/Logs/bytearraystring.log delete mode 100644 sc/source/ui/vba/testvba/Logs/dateserial.log delete mode 100644 sc/source/ui/vba/testvba/Logs/datevalue.log delete mode 100644 sc/source/ui/vba/testvba/Logs/format.log delete mode 100644 sc/source/ui/vba/testvba/Logs/pagesetup.log delete mode 100644 sc/source/ui/vba/testvba/Logs/partition.log delete mode 100644 sc/source/ui/vba/testvba/Logs/range-4.log delete mode 100644 sc/source/ui/vba/testvba/Logs/replace.log delete mode 100644 sc/source/ui/vba/testvba/Logs/stringplusdouble.log delete mode 100644 sc/source/ui/vba/testvba/Logs/window2.log diff --git a/sc/source/ui/vba/testvba/Logs/AutoFilter.log b/sc/source/ui/vba/testvba/Logs/AutoFilter.log deleted file mode 100644 index b98f5c5882b4..000000000000 --- a/sc/source/ui/vba/testvba/Logs/AutoFilter.log +++ /dev/null @@ -1,20 +0,0 @@ -Test run started : 18/09/2009 16:02:14 ----------------------------------------------------------------- -TestAddress - TEST START : TestAddress - ITEM Assertion OK : test1 'starts with' string criteria - ITEM Assertion OK : test2 'not equal to' string criteria - ITEM Assertion OK : test3 'ends with' string criteria - ITEM Assertion OK : test4 field 'all' - ITEM Assertion OK : test5 numeric '<15' - ITEM Assertion OK : test6 numeric '>=15' - ITEM Assertion OK : test7 numeric '<=12' -Test Results -============ - -Tests passed: 7 -Tests failed: 0 - -END 'TestAddress - TEST OK : TestAddress -Test run finished : 18/09/2009 16:02:14 diff --git a/sc/source/ui/vba/testvba/Logs/CalcFont.log b/sc/source/ui/vba/testvba/Logs/CalcFont.log deleted file mode 100644 index bcc07f40d629..000000000000 --- a/sc/source/ui/vba/testvba/Logs/CalcFont.log +++ /dev/null @@ -1,17 +0,0 @@ -Test run started : 18/09/2009 16:02:01 -CalcFont_Format - TEST START : Font_Format - ITEM Assertion OK : correctly set font to Bold - ITEM Assertion OK : correctly set font to Italic - ITEM Assertion OK : correctly read FontStyle - ITEM Assertion OK : correctly set font to Shadow - ITEM Assertion OK : correctly set font color - ITEM Assertion OK : correctly set font color index - ITEM Assertion OK : correctly set font name - ITEM Assertion OK : correctly set font outline - ITEM Assertion OK : correctly set font size - ITEM Assertion OK : correctly set font strikethrough - ITEM Assertion OK : correctly set font underline - TEST Success. : Font_Format -CalcFont_Format -Test run finished : 18/09/2009 16:02:01 diff --git a/sc/source/ui/vba/testvba/Logs/MiscRangeTests.log b/sc/source/ui/vba/testvba/Logs/MiscRangeTests.log deleted file mode 100644 index 47fd4b566f74..000000000000 --- a/sc/source/ui/vba/testvba/Logs/MiscRangeTests.log +++ /dev/null @@ -1,45 +0,0 @@ -Test run started : 18/09/2009 16:01:58 ----------------------------------------------------------------- -MiscRangeTests - TEST START : MiscRangeTests - ITEM Assertion OK : test 1 - ITEM Assertion OK : test 2 - ITEM Assertion OK : test 3 - ITEM Assertion OK : test 4 - ITEM Assertion OK : test 5 - ITEM Assertion OK : test 6 - ITEM Assertion OK : test 7 - ITEM Assertion OK : test 8 - ITEM Assertion OK : test 9 - ITEM Assertion OK : test 10 - ITEM Assertion OK : test 11 - ITEM Assertion OK : test 12 - ITEM Assertion OK : test 13 - ITEM Assertion OK : test 14 - ITEM Assertion OK : test 15 - ITEM Assertion OK : test 16 - ITEM Assertion OK : test 17 - ITEM Assertion OK : test 18 - ITEM Assertion OK : test 19 - ITEM Assertion OK : test 20 - ITEM Assertion OK : test 21 - ITEM Assertion OK : test 22 - ITEM Assertion OK : test 23 - ITEM Assertion OK : test 24 - ITEM Assertion OK : test 25 - ITEM Assertion OK : test 26 - ITEM Assertion OK : test 27 - ITEM Assertion OK : test 28 - ITEM Assertion OK : test 29 - ITEM Assertion OK : test 30 - ITEM Assertion OK : test 31 -No. tests: 31 -Summary -======= -Run: 31 -Passed: 31 -Failed: 0 - -END 'MiscRangeTests - TEST OK : MiscRangeTests -Test run finished : 18/09/2009 16:01:58 diff --git a/sc/source/ui/vba/testvba/Logs/PageBreaks.log b/sc/source/ui/vba/testvba/Logs/PageBreaks.log deleted file mode 100644 index 89f304fee822..000000000000 --- a/sc/source/ui/vba/testvba/Logs/PageBreaks.log +++ /dev/null @@ -1,10 +0,0 @@ -Test run started : 18/09/2009 16:02:17 ----------------------------------------------------------------- - TEST START : PageBreaks-Issue - ITEM Assertion OK : HPageBreaks.Count is 2 - ITEM Assertion OK : HPageBreak.Type is -4135 - ITEM Assertion OK : HPageBreak.Location: Range.Row is 5 - ITEM Assertion OK : HPageBreak.Delete: HPageBreaks.Count is 2 -END 'PageBreaks-Issue' Symbol - TEST OK : PageBreaks-Issue -Test run finished : 18/09/2009 16:02:17 diff --git a/sc/source/ui/vba/testvba/Logs/Ranges-2.log b/sc/source/ui/vba/testvba/Logs/Ranges-2.log deleted file mode 100644 index aa00bcdfdb56..000000000000 --- a/sc/source/ui/vba/testvba/Logs/Ranges-2.log +++ /dev/null @@ -1,68 +0,0 @@ -Test run started : 18/09/2009 16:02:12 ----------------------------------------------------------------- -ClearFormtsIssue - TEST START : ClearFormtsIssue - ITEM Assertion OK : Range.Font.Bold is: True - ITEM Assertion OK : Range.Font.Bold is: False -END 'ClearFormtsIssue' Symbol - TEST OK : ClearFormtsIssue ----------------------------------------------------------------- -VerticalAlignment-Issue - TEST START : VerticalAlignment-Issue - ITEM Assertion OK : - Range.VerticalAlignment (get) - ITEM Assertion OK : - Range.VerticalAlignment (set) - ITEM Assertion OK : - Range.VerticalAlignment (get) - ITEM Assertion OK : - Range.VerticalAlignment (get) - ITEM Assertion OK : - Range.VerticalAlignment (set) - ITEM Assertion OK : - Range.VerticalAlignment (get) - ITEM Assertion OK : - Range.VerticalAlignment (set) - ITEM Assertion OK : Range.VeritcalAlignment is Null -END 'VerticalAlignment-Issue' Symbol - TEST OK : VerticalAlignment-Issue ----------------------------------------------------------------- -HorizontalAlignment-Issue - TEST START : HorizontalAlignment-Issue - ITEM Assertion OK : - Range.HorizontalAlignment (get) - ITEM Assertion OK : - Range.HorizontalAlignment (set) - ITEM Assertion OK : - Range.HorizontalAlignment (get) - ITEM Assertion OK : - Range.HorizontalAlignment (set) - ITEM Assertion OK : - Range.HorizontalAlignment (get) - ITEM Assertion OK : - Range.HorizontalAlignment (set) - ITEM Assertion OK : - Range.HorizontalAlignment (get) - ITEM Assertion OK : - Range.HorizontalAlignment (set) - ITEM Assertion OK : Range.HorizontalAlignment is Null -END 'HorizontalAlignment-Issue' Symbol - TEST OK : HorizontalAlignment-Issue ----------------------------------------------------------------- -WrapText-Issue - TEST START : WrapText-Issue - ITEM Assertion OK : - Range.WrapText (get) - ITEM Assertion OK : - Range.WrapText (get) - ITEM Assertion OK : Range.WrapText is Null -END 'WrapText-Issue' Symbol - TEST OK : WrapText-Issue ----------------------------------------------------------------- -FontBorderIssues - TEST START : FontBorderIssues - ITEM Assertion OK : - = Borders.Color (getColor) - ITEM Assertion OK : - = Font.Color (getColor) -END 'FontBorderIssues' Symbol - TEST OK : FontBorderIssues ----------------------------------------------------------------- -RangeSizeIssues - TEST START : RangeSizeIssues - ITEM Assertion OK : Range.Left is: 120.06225 - ITEM Assertion OK : Range.Top is: 93.29985 - ITEM Assertion OK : Range.Width is: 228.3 - ITEM Assertion OK : Range.Height is: 271.5 -END 'RangeSizeIssues' Symbol - TEST OK : RangeSizeIssues ----------------------------------------------------------------- -ApplicationIssues - TEST START : ApplicationIssues - ITEM Assertion OK : Range.Address is: $E$8:$G$13,$G$13:$K$19 - ITEM Assertion OK : Range.Address is: $E$8:$G$13,$G$13:$K$19 - ITEM Assertion OK : Application.ActiveSheet.Name: Sheet1 -END 'ApplicationIssues' Symbol - TEST OK : ApplicationIssues -Test run finished : 18/09/2009 16:02:13 diff --git a/sc/source/ui/vba/testvba/Logs/Ranges-3.log b/sc/source/ui/vba/testvba/Logs/Ranges-3.log deleted file mode 100644 index 97750c869f2b..000000000000 --- a/sc/source/ui/vba/testvba/Logs/Ranges-3.log +++ /dev/null @@ -1,8 +0,0 @@ -Test run started : 18/09/2009 16:02:14 ----------------------------------------------------------------- -MyGoalseek-Issue - TEST START : MyGoalseek-Issue - ITEM Assertion OK : Variable Range value: 15 -END 'MyGoalseek-Issue' Symbol - TEST OK : MyGoalseek-Issue -Test run finished : 18/09/2009 16:02:14 diff --git a/sc/source/ui/vba/testvba/Logs/Ranges.log b/sc/source/ui/vba/testvba/Logs/Ranges.log deleted file mode 100644 index e5d282dcb379..000000000000 --- a/sc/source/ui/vba/testvba/Logs/Ranges.log +++ /dev/null @@ -1,280 +0,0 @@ -Test run started : 18/09/2009 16:02:02 ----------------------------------------------------------------- -ApplicationMethods - TEST START : ApplicationMethods - ITEM Assertion OK : Name of Workbook is: Ranges.xls - ITEM Assertion OK : Address of Application.Columns is: $A:$A - ITEM Assertion OK : Address of Application.Rows is: $1:$1 - ITEM Assertion OK : Address of Application.Range is: $1:$1,$5:$7 - ITEM Assertion OK : Please check manually: DefaultFilePath is: /data4/home/npower/Documents - ITEM Assertion OK : Please check manually: Library Path is: /data4/CWS/INSTALL_TEST/opt/UserInstallation/user/basic - ITEM Assertion OK : Please check manually: Template Path is: /data4/CWS/INSTALL_TEST/opt/UserInstallation/user/template - ITEM Assertion OK : FileSeparator is / - ITEM Assertion OK : Name of ActiveWorkbook is: Ranges.xls -END 'ApplicationMethods' Symbol - TEST OK : ApplicationMethods ----------------------------------------------------------------- -Insert-Issue - TEST START : Insert-Issue - ITEM Assertion OK : Insert with xlShiftToRight: 10 -END 'Insert-Issue' Symbol - TEST OK : Insert-Issue ----------------------------------------------------------------- -MergeCells-Issue - TEST START : MergeCells-Issue - ITEM Assertion OK : Range.MergeCells is True - ITEM Assertion FAIL : MergeCells is null: False - ITEM Assertion OK : RowCount after Merge: 13 - ITEM Assertion OK : Range.MergeCells is False - ITEM Assertion OK : MergeCells is null: False - ITEM Assertion FAIL : MergeCells of Second Area is null : False - ITEM Assertion FAIL : MergeCells of Ranges is Null: False - ITEM Assertion OK : RowCount after Merge: 7 - ITEM Assertion OK : Range.MergeCells is False - ITEM Assertion OK : MergeCells is null: False - ITEM Assertion OK : RowCount after Merge: 7 -END 'MergeCells-Issue' Symbol - TEST OK : MergeCells-Issue ----------------------------------------------------------------- -Areas-Issue - TEST START : Areas-Issue - ITEM Assertion OK : Range Areas Count is2 - ITEM Assertion OK : First Range Address is: $E$8:$G$13 - ITEM Assertion OK : First Row is: 8 - ITEM Assertion OK : First Column is: 5 - ITEM Assertion OK : EntireRow Address is: $8:$13,$13:$19 - ITEM Assertion OK : EntireColumn Address is: $E:$G,$G:$K - ITEM Assertion OK : Range Count:53 -END 'Areas-Issue' Symbol - TEST OK : Areas-Issue ----------------------------------------------------------------- -Fill-Methods-Issue - TEST START : Fill-Methods-Issue - ITEM Assertion OK : Range Value after FillDown: MyFillValue - ITEM Assertion OK : Range Value after FillDown: MyFillValue - ITEM Assertion OK : Range Value after FillDown: MyRightFillValue - ITEM Assertion OK : Range Value after FillDown: MyBottomFillValue -END 'Fill-Methods-Issue' Symbol - TEST OK : Fill-Methods-Issue ----------------------------------------------------------------- -Range/Item-Method-Issue - TEST START : Range/Item-Method-Issue - ITEM Assertion OK : Range of multiple columns is: $A:$A,$C:$C - ITEM Assertion OK : Range of multiple rows is: $1:$1,$5:$7 - ITEM Assertion OK : Range of several columns is: $C:$E,$D:$D - ITEM Assertion OK : Range of several rows is: $5:$8,$6:$10 - ITEM Assertion OK : Range of several single cells is: $C$5,$E$8 - ITEM Assertion OK : Range of several named ranges is: $L$1:$M$6,$E$8:$G$13,$G$13:$K$19 - ITEM Assertion OK : Range of a single Item Cell is: $E$21 - ITEM Assertion OK : Range of a single Item Cell is: $F$21 - ITEM Assertion OK : Range of a single Item Cell is: $F$10 -END 'Range/Item-Method-Issue' Symbol - TEST OK : Range/Item-Method-Issue ----------------------------------------------------------------- -R1C1-Formulas-Issue - TEST START : R1C1-Formulas-Issue - ITEM Assertion OK : R1C1 Range.Formula is: =IF(OR(R[-2]C[1]=0,RC[2]="YES"),"") - ITEM Assertion OK : Range.Formula is: =IF(OR(J8=0,K10="YES"),"") -END 'R1C1-Formulas-Issue' Symbol - TEST OK : R1C1-Formulas-Issue ----------------------------------------------------------------- -Verify_Delete - TEST START : Verify_Delete - ITEM Assertion OK : Ranges are intersecting: $G$13 - ITEM Assertion OK : Delete with Default: $AJ$4 - ITEM Assertion OK : Delete with ShifttoLeft: $AJ$4 - ITEM Assertion OK : Delete with ShiftUp: $M$22 -END 'Verify_Delete' Symbol - TEST OK : Verify_Delete ----------------------------------------------------------------- -Value-Issue - TEST START : Value-Issue - ITEM Assertion OK : Value of Range is: 12.3 - ITEM Assertion OK : Text of Range is: 12.3 - ITEM Assertion OK : Range has Formula: False - ITEM Assertion OK : Cell has Formula: False - ITEM Assertion FAIL : Text of Range is null: False - ITEM Assertion OK : Range has Formula: True - ITEM Assertion OK : Cell has Formula: True - ITEM Assertion OK : Value of Cell is: 12 - ITEM Assertion OK : Application.Calculation is : -4135 - ITEM Assertion OK : Calculation is automated: True - ITEM Assertion OK : Range has Formula: True - ITEM Assertion OK : Value of Cell is: 16 - ITEM Assertion OK : Text of Cell is: 16 - ITEM Assertion OK : Text of Cell is: 16 - ITEM Assertion OK : Range has Formula after 'ClearContents: False - ITEM Assertion OK : Text of Cell is: - ITEM Assertion OK : Text of Cell is: -END 'Value-Issue' Symbol - TEST OK : Value-Issue ----------------------------------------------------------------- -AutoFit issue - TEST START : AutoFit issue - ITEM Assertion OK : Columns.AutoFit: CurrentWidth is 679 - ITEM Assertion OK : Rows.AutoFit: CurrentHeight is 546 -END 'AutoFit issue' Symbol - TEST OK : AutoFit issue ----------------------------------------------------------------- -Selections - TEST START : Selections - ITEM Assertion OK : ActiveCell is : $E$8 - ITEM Assertion OK : Active Cell is : $E$8 - ITEM Assertion OK : Number of Cells in Range: 52 - ITEM Assertion OK : Number of Cells in Range: 52 - ITEM Assertion OK : Number of Cells in Range: 52 -END 'Selections' Symbol - TEST OK : Selections ----------------------------------------------------------------- -Offset-Resize - TEST START : Offset-Resize - ITEM Assertion OK : Offset is : $G$10:$I$15,$I$15:$M$21 - ITEM Assertion OK : Offset is : $G$7:$I$12,$I$12:$M$18 - ITEM Assertion OK : Resized Range is : $A$20:$D$23 -END 'Offset-Resize' Symbol - TEST OK : Offset-Resize ----------------------------------------------------------------- -Ranges-Address - TEST START : Ranges-Address - ITEM Assertion OK : Range Address is: $E$8:$G$13,$G$13:$K$19 - ITEM Assertion OK : Range Address is: $E8:$G13,$G13:$K19 - ITEM Assertion OK : Range Address is: E$8:G$13,G$13:K$19 - ITEM Assertion OK : Range Address is: R8C5:R13C7,R13C7:R19C11 - ITEM Assertion FAIL : Range Address is: R8C5:R13C7,R13C7:R19C11 - ITEM Assertion OK : Range Address is: R8C5:R13C7,R13C7:R19C11 - ITEM Assertion OK : Range Address is: R[6]C[3]:R[11]C[5],R[11]C[5]:R[17]C[9] - ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$E$8:$G$13,$G$13:$K$19 -END 'Ranges-Address' Symbol - TEST OK : Ranges-Address ----------------------------------------------------------------- -Range-Address - TEST START : Range-Address - ITEM Assertion OK : Range Address is: $E$8:$G$13 - ITEM Assertion OK : Range Address is: $E8:$G13 - ITEM Assertion OK : Range Address is: E$8:G$13 - ITEM Assertion OK : Range Address is: R8C5:R13C7 - ITEM Assertion FAIL : Range Address is: R8C5:R13C7 - ITEM Assertion OK : Range Address is: R8C5:R13C7 - ITEM Assertion OK : Range Address is: R[6]C[3]:R[11]C[5] - ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$E$8:$G$13 -END 'Range-Address' Symbol - TEST OK : Range-Address ----------------------------------------------------------------- -Column-Address - TEST START : Column-Address - ITEM Assertion OK : Range Address is: $F$8:$F$13 - ITEM Assertion OK : Range Address is: $F8:$F13 - ITEM Assertion OK : Range Address is: F$8:F$13 - ITEM Assertion OK : Range Address is: R8C6:R13C6 - ITEM Assertion FAIL : Range Address is: R8C6:R13C6 - ITEM Assertion OK : Range Address is: R8C6:R13C6 - ITEM Assertion OK : Range Address is: R[6]C[4]:R[11]C[4] - ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$F$8:$F$13 -END 'Column-Address' Symbol - TEST OK : Column-Address ----------------------------------------------------------------- -Row-Address - TEST START : Row-Address - ITEM Assertion OK : Range Address is: $E$9:$G$9 - ITEM Assertion OK : Range Address is: $E9:$G9 - ITEM Assertion OK : Range Address is: E$9:G$9 - ITEM Assertion OK : Range Address is: R9C5:R9C7 - ITEM Assertion FAIL : Range Address is: R9C5:R9C7 - ITEM Assertion OK : Range Address is: R9C5:R9C7 - ITEM Assertion OK : Range Address is: R[7]C[3]:R[7]C[5] - ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$E$9:$G$9 -END 'Row-Address' Symbol - TEST OK : Row-Address ----------------------------------------------------------------- -SingleCell-Address - TEST START : SingleCell-Address - ITEM Assertion OK : Range Address is: $F$9 - ITEM Assertion OK : Range Address is: $F9 - ITEM Assertion OK : Range Address is: F$9 - ITEM Assertion OK : Range Address is: R9C6 - ITEM Assertion FAIL : Range Address is: R9C6 - ITEM Assertion OK : Range Address is: R9C6 - ITEM Assertion OK : Range Address is: R[7]C[4] - ITEM Assertion OK : RangeAddress is [Ranges.xls]Sheet1!$F$9 -END 'SingleCell-Address' Symbol - TEST OK : SingleCell-Address ----------------------------------------------------------------- -Heights and Widths - TEST START : Heights and Widths - ITEM Assertion OK : Range RowHeight is 40 - ITEM Assertion OK : Range ColumnWidth is 50 - ITEM Assertion OK : Range Height is 240 - ITEM Assertion OK : Range Width is 787.5 - ITEM Assertion OK : Range RowHeight is 50 - ITEM Assertion OK : Range ColumnWidth is 50 - ITEM Assertion OK : Range Height is 300 - ITEM Assertion OK : Range Width is 787.5 - ITEM Assertion OK : RowHeight is null: True - ITEM Assertion OK : ColumnWidth is null: True -END 'Heights and Widths' Symbol - TEST OK : Heights and Widths ----------------------------------------------------------------- -RangeRowColumn-Issue - TEST START : RangeRowColumn-Issue - ITEM Assertion OK : Row is: 8 - ITEM Assertion OK : Column is: 5 - ITEM Assertion OK : EntireRow.Columns.Count = 1024 - ITEM Assertion OK : EntireColumn.Rows.Count = 131072 -END 'RangeRowColumn-Issue' Symbol - TEST OK : RangeRowColumn-Issue ----------------------------------------------------------------- -Replace-Issue - TEST START : Replace-Issue - ITEM Assertion OK : Value after Replace: YourValue - ITEM Assertion OK : Value after Replace: YourValue - ITEM Assertion OK : Value after Replace: ReplaceValue - ITEM Assertion OK : Value after Replace: New ReplaceValue - ITEM Assertion OK : Value after Replace: New ReplaceValue - ITEM Assertion OK : Value after Replace: New Replace - ITEM Assertion OK : Value after Replace: -END 'Replace-Issue' Symbol - TEST OK : Replace-Issue ----------------------------------------------------------------- -Hidden-Issue - TEST START : Hidden-Issue - ITEM Assertion OK : - Range.Rows.Hidden (set) - ITEM Assertion OK : - Range.Rows.Hidden (get) - ITEM Assertion OK : - Range.Rows.Item(1).Hidden (set) - ITEM Assertion OK : - Range.Rows.Item(1).Hidden (get) - ITEM Assertion OK : - Range.Columns.Hidden (set) - ITEM Assertion OK : - Range.Columns.Hidden (get) - ITEM Assertion OK : - Range.Columns.Item(1).Hidden (set) - ITEM Assertion OK : - Range.Columns.Item(1).Hidden (get) -END 'Hidden-Issue' Symbol - TEST OK : Hidden-Issue ----------------------------------------------------------------- -End issue - TEST START : End issue - ITEM Assertion OK : - = $E$48 - ITEM Assertion OK : - = $E$1 - ITEM Assertion OK : - = $E$3 - ITEM Assertion OK : - = $A$8 - ITEM Assertion OK : - = $B$8 - ITEM Assertion OK : - = $AMJ$8 - ITEM Assertion OK : - = $Z$8 -END 'End issue' Symbol - TEST OK : End issue ----------------------------------------------------------------- -Outline issue - TEST START : Outline issue - ITEM Assertion OK : - Range.clearOutline - please check visually - ITEM Assertion OK : - Range.AutoOutline - please check visually - ITEM Assertion OK : - Range.AutoOutline - please check visually -END 'Outline issue' Symbol - TEST OK : Outline issue ----------------------------------------------------------------- -Validation - TEST START : Validation - ITEM Assertion OK : Validation Input Message is : Attention! - ITEM Assertion OK : Validation Input Message is : Enter an integer from five to ten - ITEM Assertion OK : Validation Error Title is : You must enter a number from five to ten - ITEM Assertion OK : Validation Error Message is : An Error occured - ITEM Assertion OK : Validation Error Title is : Microsoft Excel -END 'Validation' Symbol - TEST OK : Validation -Test run finished : 18/09/2009 16:02:06 diff --git a/sc/source/ui/vba/testvba/Logs/Shapes.log b/sc/source/ui/vba/testvba/Logs/Shapes.log deleted file mode 100644 index 94b6ef29f02b..000000000000 --- a/sc/source/ui/vba/testvba/Logs/Shapes.log +++ /dev/null @@ -1,77 +0,0 @@ -Test run started : 18/09/2009 16:01:55 -BEGIN Shapes_Collection_Behaviour - TEST START : Shapes_Collection_Behaviour - ITEM Assertion OK : Name of indexed shape should be 'Sheet2Shape1' - ITEM Assertion OK : Name of indexed shape should be 'Sheet2Shape2' - TEST Success. : Shapes_Collection_Behaviour -END Shapes_Collection_Behaviour -BEGIN Shapes_Select_Item - TEST START : Shapes_Select_Item - ITEM Assertion OK : Correctly selected shape through Range - ITEM Assertion OK : Correctly selected shape through Item - ITEM Assertion OK : Needs to be visually checked. Is there a line on the document? - ITEM Assertion OK : Needs to be visually checked. Are All Shapes Selected? - TEST Success. : Shapes_Select_Item -END Shapes_Select_Item -BEGIN Shapes_Fill - TEST START : Shapes_Fill - ITEM Assertion OK : correctly set visibility of shape fill - ITEM Assertion OK : correctly set transparency of shape line - ITEM Assertion OK : correctly set forecolor of shape fill - ITEM Assertion FAIL : correctly set backcolor of shape fill - ITEM Assertion OK : the success of the TwoColorGradient method needs to be verified visually! - ITEM Assertion OK : correctly set forecolor of shape fill - ITEM Assertion FAIL : correctly set forecolor of shape fill - TEST Success. : Shapes_Fill -END Shapes_Fill -BEGIN Shapes_Line - TEST START : Shapes_Line - ITEM Assertion FAIL : correctly set weight of shape line - ITEM Assertion OK : correctly set visibility of shape line - ITEM Assertion OK : correctly set transparency of shape line - ITEM Assertion OK : correctly set dash style of shape line - ITEM Assertion OK : correctly set dash style of shape line - ITEM Assertion OK : correctly set forecolor of shape line - ITEM Assertion FAIL : correctly set backcolor of shape line - TEST Success. : Shapes_Line -END Shapes_Line -BEGIN Shapes_TextFrame - TEST START : Shapes_TextFrame - ITEM Assertion OK : correctly set Autosize of Shape TextFrame - TEST Success. : Shapes_TextFrame -END Shapes_TextFrame -BEGIN Shapes_SimpleGeometry - TEST START : Shapes_SimpleGeometery - ITEM Assertion OK : shape height should be 46.7023593888278 and got 46.6866112323395 - ITEM Assertion OK : shape width should be 101.496056724658 and got 101.48030856817 - ITEM Assertion OK : shape left should be 68.5574761223637 and got 68.5417279658754 - ITEM Assertion OK : shape top should be 41.6850368702339 and got 41.6692887137456 - ITEM Assertion OK : shape rotation should be 0 and got 0 - ITEM Assertion OK : shape rotation should be 25 and got 25 - ITEM Assertion OK : shape incrementrotation should be 50 and got 50 - ITEM Assertion OK : shape incrementleft should be 70.7968460600412 and got 70.7810979035529 - ITEM Assertion OK : shape incrementtop should be 90.8944825893239 and got 90.8787344328356 - TEST Success. : Shapes_SimpleGeometery -END Shapes_SimpleGeometry -BEGIN Shapes_Range - TEST START : Shapes_Range - ITEM Assertion OK : expected Sheets(2).Shapes.Range(1) to contain 1 element, it contains 1 - ITEM Assertion OK : expected Sheets(2).Shapes.Range(1) to return Sheet2Shape1 got Sheet2Shape1 - ITEM Assertion OK : expected Sheets(2).Shapes.Range(Sheet2Shape3) to contain 1 element, it contains 1 - ITEM Assertion OK : expected Sheets(2).Shapes.Range(Sheet2Shape3) to return Sheet2Shape3 got Sheet2Shape3 - ITEM Assertion OK : expected Sheets(2).Shapes.Range(Array(3, 1) to contain 2 elements, it contains 2 - ITEM Assertion OK : expected Sheets(2).Shapes.Range(Array(3, 1) to return concated element/shape names Sheet2Shape3Sheet2Shape1 and got Sheet2Shape3Sheet2Shape1 - ITEM Assertion OK : expected Sheets(2).Shapes.Range(Array('Sheet2Shape3', 1, 'Sheet2Shape2')) to contain 3 elements, it contains 3 - ITEM Assertion OK : expected Sheets(2).Shapes.Range(Array('Sheet2Shape3', 1, 'Sheet2Shape2')) to return concated element/shape names Sheet2Shape3Sheet2Shape1Sheet2Shape2 and got Sheet2Shape3Sheet2Shape1Sheet2Shape2 - TEST Success. : Shapes_Range -END Shapes_Range -BEGIN Shapes_ShapeRange - TEST START : Shapes_ShapeRange - ITEM Assertion OK : ShapeRange.IncrementLeft shp1.left should be 90.7810979035529 and got 90.7653486132064 - ITEM Assertion OK : ShapeRange.IncrementLeft shp2.left should be 240.02518299054 and got 240.009433700193 - ITEM Assertion OK : ShapeRange.IncrementTop shp1.Top should be 110.878734432836 and got 110.862985142489 - ITEM Assertion OK : ShapeRange.IncrementTop shp2.Top should be 64.6740129339204 and got 64.6582636435739 - ITEM Assertion OK : ShapeRange.IncrementRotation shp1.Rotation should be 70 and got 70 - ITEM Assertion OK : ShapeRange.IncrementRotation shp2.Rotation should be 20 and got 20 -END Shapes_ShapeRange -Test run finished : 18/09/2009 16:01:55 diff --git a/sc/source/ui/vba/testvba/Logs/StrConv-test.log b/sc/source/ui/vba/testvba/Logs/StrConv-test.log deleted file mode 100644 index 78526d4c3fe3..000000000000 --- a/sc/source/ui/vba/testvba/Logs/StrConv-test.log +++ /dev/null @@ -1,9 +0,0 @@ -Test run started : 18/09/2009 16:02:09 -BEGIN StrConv - TEST START : Test StrConv function - ITEM Assertion OK : Converts the string to uppercase characters:ABC EFG HIJ - ITEM Assertion OK : Converts the string to lowercase characters:abc efg hij - ITEM Assertion OK : Converts the first letter of every word in string to uppercase:Abc Efg Hij - TEST OK : Test StrConv function -END StrConv -Test run finished : 18/09/2009 16:02:09 diff --git a/sc/source/ui/vba/testvba/Logs/Template.log b/sc/source/ui/vba/testvba/Logs/Template.log deleted file mode 100644 index db96c7fef904..000000000000 --- a/sc/source/ui/vba/testvba/Logs/Template.log +++ /dev/null @@ -1,14 +0,0 @@ -Test run started : 18/09/2009 16:02:00 ----------------------------------------------------------------- -TestCaseName - TEST START : TestCaseName - ITEM Assertion OK : Something has been done. -Test Results -============ - -Tests passed: 1 -Tests failed: 0 - -END 'TestCaseName - TEST OK : TestCaseName -Test run finished : 18/09/2009 16:02:00 diff --git a/sc/source/ui/vba/testvba/Logs/TestAddress.log b/sc/source/ui/vba/testvba/Logs/TestAddress.log deleted file mode 100644 index 0f942fd347a3..000000000000 --- a/sc/source/ui/vba/testvba/Logs/TestAddress.log +++ /dev/null @@ -1,67 +0,0 @@ -Test run started : 18/09/2009 16:02:09 ----------------------------------------------------------------- -TestAddress - TEST START : TestAddress - ITEM Assertion OK : test1 Range('e3:f3') A1 style addressing - ITEM Assertion OK : test2 Range('e3:f3') R1C1 style addressing - ITEM Assertion OK : test3 Range ('e:f') A1 style addressing - ITEM Assertion OK : test4 Range ('e:f') R1C1 style addressing - ITEM Assertion OK : test5 Columns A1 style addressing - ITEM Assertion OK : test6 Columns R1C1 style addressing - ITEM Assertion OK : test7 Columns(3) A1 style addressing - ITEM Assertion OK : test8 Columns(3) R1C1 style addressing - ITEM Assertion OK : test9 Columns('e') A1 style addressing - ITEM Assertion OK : test10 Columns('e') R1C1 style addressing - ITEM Assertion OK : test11 Columns('b:d') A1 style addressing - ITEM Assertion OK : test12 Columns('b:d') R1C1 style addressing - ITEM Assertion OK : test13 Range('c1:g10').Columns A1 style addressing - ITEM Assertion OK : test14 Range('c1:g10').Columns R1C1 style addressing - ITEM Assertion OK : test15 Range('c1:g10').Columns(1) A1 style addressing - ITEM Assertion OK : test16 Range('c1:g10').Columns(1) R1C1 style addressing - ITEM Assertion OK : test17 Range('c1:g10').Columns('a') A1 style addressing - ITEM Assertion OK : test18 Range('c1:g10').Columns('a') R1C1 style addressing - ITEM Assertion OK : test19 Range('c1:g10').Columns('c') A1 style addressing - ITEM Assertion OK : test20 Range('c1:g10').Columns('c') R1C1 style addressing - ITEM Assertion OK : test21 Range('c1:g10').Columns('x:z') A1 style addressing - ITEM Assertion OK : test22 Range('c1:g10').Columns('x:z') R1C1 style addressing - ITEM Assertion OK : test23 Range('c1:g10').Columns(30) A1 style addressing - ITEM Assertion OK : test24 Range('c1:g10').Columns(30) R1C1 style addressing - ITEM Assertion OK : test25 Worksheets('Sheet2').Cells(1, 1) A1 style addressing - ITEM Assertion OK : test26 Worksheets('Sheet2').Cells(1, 1) A1 style addressing, RowAddressAbsolute is false - ITEM Assertion OK : test27 Worksheets('Sheet2').Cells(1, 1) A1 style addressing, ColAddressAbsolute is false - ITEM Assertion OK : test28 Worksheets('Sheet2').Cells(1, 1) R1C1 style addressing - ITEM Assertion OK : test29 Worksheets('Sheet2').Range('A1:E5').EntireColumn A1 style addressing - ITEM Assertion OK : test30 Worksheets('Sheet2').Range('A1').EntireColumn A1 style addressing - ITEM Assertion OK : test31 Worksheets('Sheet2').Range('A1:E5').EntireRow A1 style addressing - ITEM Assertion OK : test32 Worksheets('Sheet2').Range('A1') A1 style addressing - ITEM Assertion OK : test33 Worksheets('Sheet2').Range('IV65536').EntireRow A1 style addressing - ITEM Assertion OK : test34 Worksheets('Sheet2').Range('IU2:IV65536') A1 style addressing - ITEM Assertion OK : test35 Range('c1:g10').Columns('x:z') R1C1 style addressing - ITEM Assertion OK : test36 Worksheets('Sheet2').Range('A1') A1 style addressing - ITEM Assertion OK : test37 Worksheets('Sheet2').Range('A1:E5').EntireColumn A1 style addressing - ITEM Assertion OK : test38 Worksheets('Sheet2').Range('10:12') A1 style addressing - ITEM Assertion OK : test39 Worksheets('Sheet2').Range('10:12') R1C1 style addressing - ITEM Assertion OK : test40 Range('Sheet3!A1:B4') A1 style addressing - ITEM Assertion OK : test41 Range('Sheet3!A1,B1,D4:F20') A1 style addressing - ITEM Assertion OK : test42 Range('g20:h40').Columns('c:c') - ITEM Assertion OK : test43 Range('g20:h40').Columns('c:f') - ITEM Assertion OK : test44 Range('g20:h40').Columns(-1) - ITEM Assertion OK : test45 Range('c4:g10').Rows(-1) - ITEM Assertion OK : test46 Range('a2:b4').Rows('1:1') - ITEM Assertion OK : test47 Range('a2:b4').Rows('1:2') - ITEM Assertion OK : test48 Range('a2:b4').Rows('2:2') - ITEM Assertion OK : test49 Range('a2:b4').Rows('2:3') - ITEM Assertion OK : test50 Range(' A2:B4 ') - ITEM Assertion OK : test51 Range('A 2:B 4') - ITEM Assertion OK : test52 Range('A2 : B4 ') - ITEM Assertion OK : test53 Range('Sheet1 !A2 : B4 ') - ITEM Assertion OK : test54 Range('Sheet1! A2 : B4 ') -Test Results -============ - -Tests passed: 54 -Tests failed: 0 - -END 'TestAddress - TEST OK : TestAddress -Test run finished : 18/09/2009 16:02:09 diff --git a/sc/source/ui/vba/testvba/Logs/TestCalc_Rangetest.log b/sc/source/ui/vba/testvba/Logs/TestCalc_Rangetest.log deleted file mode 100644 index be8065f61efc..000000000000 --- a/sc/source/ui/vba/testvba/Logs/TestCalc_Rangetest.log +++ /dev/null @@ -1,60 +0,0 @@ -Test run started : 18/09/2009 16:02:23 -BEGIN TestCalc - TEST START : RangeTest2 - ITEM Assertion OK : - Range("D15").Row - ITEM Assertion OK : - WorkSheet("D15").Range.Row - ITEM Assertion OK : - Range("D15").Column - ITEM Assertion OK : - Worksheet.Range("D15").Column - ITEM Assertion OK : - Range("D1").EntireRow.Valuer - ITEM Assertion OK : - Range("D1").EntireRow.Valuer - ITEM Assertion OK : - Range("D1").EntireRow.Columns.Count - ITEM Assertion OK : - Range("D1").EntireColumn.Rows.Count - ITEM Assertion OK : - Range("D15").ClearContent - ITEM Assertion OK : - Range("M1:N2").Rows.Hidden (set) - ITEM Assertion OK : - Range("M1:N2").Rows.Hidden (get) - ITEM Assertion OK : - Range("M1:N2").Rows(1).Hidden (set) - ITEM Assertion OK : - Range("M1:N2").Rows(1).Hidden (get) - ITEM Assertion OK : - Range("M1:N2").Columns.Hidden (set) - ITEM Assertion OK : - Range("M1:N2").Columns.Hidden (get) - ITEM Assertion OK : - Range("M1:N2").Columns(1).Hidden (set) - ITEM Assertion OK : - Range("M1:N2").Columns(1).Hidden (get) - ITEM Assertion OK : - Range("B38").Orientation (get) - ITEM Assertion OK : - Range("B38").Orientation (set) - ITEM Assertion OK : - Range("B38").Orientation (set = xlDownward) - ITEM Assertion OK : - Range("B38").Orientation (set) - ITEM Assertion OK : - Range("B38").Orientation (set = xlUpward) - ITEM Assertion OK : - Range("B38").Orientation (set) - ITEM Assertion OK : - Range("B38").Orientation (set = xlVertical) - ITEM Assertion OK : - Range("B38").Orientation (set) - ITEM Assertion OK : - Range("B38").Orientation (set = xlVertical) - ITEM Assertion OK : - Range("B39").WrapText (get) - ITEM Assertion OK : - Range("B39").WrapText (set) - ITEM Assertion OK : - Range("B39").WrapText (set) - ITEM Assertion OK : - Range("E39").MergeCells (get) - ITEM Assertion OK : - Range("F39").MergeCells (get) - ITEM Assertion OK : - Range("E39").MergeCells (set) - ITEM Assertion FAIL : - Range("F39").MergeCells (set) - ITEM Assertion OK : - Range("E39").MergeCells (set) - ITEM Assertion OK : - Range("F39").MergeCells (set) - ITEM Assertion OK : - Range("C41:C42").Replace MatchCase:=True - ITEM Assertion OK : - Range("C41:C42").Replace MatchCase:=True - ITEM Assertion OK : - Range("D41:D42").Replace MatchCase:=False - ITEM Assertion OK : - Range("B39").VerticalAlignment (get) - ITEM Assertion OK : - Range("B39").VerticalAlignment (set) - ITEM Assertion OK : - Range("B39").VerticalAlignment (get) - ITEM Assertion OK : - Range("B39").VerticalAlignment (get) - ITEM Assertion OK : - Range("B39").VerticalAlignment (set) - ITEM Assertion OK : - Range("B39").VerticalAlignment (get) - ITEM Assertion OK : - Range("B39").VerticalAlignment (set) - ITEM Assertion OK : - Range("B39").HorizontalAlignment (get) - ITEM Assertion OK : - Range("B39").HorizontalAlignment (set) - ITEM Assertion OK : - Range("B39").HorizontalAlignment (get) - ITEM Assertion OK : - Range("B39").HorizontalAlignment (set) - ITEM Assertion OK : - Range("B39").HorizontalAlignment (get) - ITEM Assertion OK : - Range("B39").HorizontalAlignment (set) - ITEM Assertion OK : - Range("B39").HorizontalAlignment (get) - ITEM Assertion OK : - Range("B39").HorizontalAlignment (set) - ITEM FAIL (RangeTest2) - TEST Not succesfully completed : RangeTest2 -END TestCalc -Test run finished : 18/09/2009 16:02:26 diff --git a/sc/source/ui/vba/testvba/Logs/TestCalc_Rangetest2.log b/sc/source/ui/vba/testvba/Logs/TestCalc_Rangetest2.log deleted file mode 100644 index cc034b2b8226..000000000000 --- a/sc/source/ui/vba/testvba/Logs/TestCalc_Rangetest2.log +++ /dev/null @@ -1,65 +0,0 @@ -Test run started : 18/09/2009 16:02:18 -BEGIN TestCalc - TEST START : RangeTest3 - ITEM Assertion OK : - setFormulaR1C1 - ITEM Assertion OK : - getFormulaR1C1 - ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial() - ITEM Assertion OK : - Range.Copy(Range("I10")) - ITEM Assertion OK : PasteSpecial Paste:=xlPasteValues - ITEM Assertion OK : PasteSpecial Paste:=xlPasteFormulas - ITEM Assertion OK : PasteSpecial Paste:=xlPasteFormats - ITEM Assertion OK : PasteSpecial - ITEM Assertion OK : PasteSpecial SkipBlanks:=True - ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationAdd - ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationSubtract - ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationMultiply - ITEM Assertion OK : PasteSpecial Operation:=xlPasteSpecialOperationDivide - ITEM Assertion OK : PasteSpecial Transpose:=True - ITEM Assertion FAIL : ActiveWorkbook.FileFormat - ITEM Assertion OK : ActiveWorkbook.Name - ITEM Assertion OK : ActiveWorkbook.FullName und ActiveWorkbook.Path - ITEM Assertion FAIL : - = ActiveWorkbook.Colors(3) set - ITEM Assertion OK : - = ActiveWorkbook.ResetColors - ITEM Assertion OK : - = ActiveWorkbook.Colors(3) get - ITEM Assertion OK : - = Range("K22").End (xlDown) - ITEM Assertion OK : - = Range("K22").End (xlUo) - ITEM Assertion OK : - = Range("K22").End (xlToLeft) - ITEM Assertion OK : - = Range("K22").End (xlRight) - ITEM Assertion OK : - ActiveSpreadsheet.Next - ITEM Assertion OK : - ActiveSpreadsheet.Next - ITEM Assertion OK : - ActiveSpreadsheet.Previous - ITEM Assertion OK : - ActiveSpreadsheet.Previous - ITEM Assertion OK : - Range("J4:J11").AutoFilter field:=1, Criteria1:="x" - ITEM Assertion OK : - Range("J4:J11").AutoFilter field:=1, Criteria1:="<>" - ITEM Assertion OK : - Range("J4:J11").AutoFilter field:=1, Criteria1:="=" - ITEM Assertion OK : - Range("J4:J11").AutoFilter - ITEM Assertion OK : - ActiveSheet.Resize.Select - ITEM Assertion OK : - Application.GoTo Reference:="R8C2" - ITEM Assertion FAIL : - Application.GoTo Reference:="R[8]C[2]" - ITEM Assertion OK : - Application.GoTo Reference:="R8C2" - ITEM Assertion OK : - Range.Group - please check visually - ITEM Assertion OK : - Range.Group - please check visually - ITEM Assertion OK : - Range.Ungroup- please check visually - ITEM Assertion OK : - Range.Ungroup - please check visually - ITEM Assertion OK : - Range.Group - please check visually - ITEM Assertion OK : - Range.Group - please check visually - ITEM Assertion OK : - Range.clearOutline - please check visually - ITEM Assertion OK : - Range.AutoOutline - please check visually - ITEM Assertion OK : - Range.AutoOutline - please check visually - ITEM Assertion OK : - ActiveSheet.UsedRange.Select - ITEM Assertion OK : - Range("A13").AddIndent - ITEM Assertion OK : - Range("A13").IndentLevel set - ITEM Assertion OK : - Range("A13").IndentLevel get - ITEM Assertion OK : - Range("A13").IndentLevel get - ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial() - ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial() - ITEM Assertion OK : - Range.Copy() and Range.PasteSpecial() - ITEM Assertion OK : - Range.Calculate - ITEM Assertion OK : Worksheet.Calculate - ITEM Assertion OK : - Application.Calculate - ITEM Assertion OK : Global.Calculate - ITEM Assertion OK : Calculation set - ITEM FAIL (RangeTest3) - TEST Not succesfully completed : RangeTest3 -END TestCalc -Test run finished : 18/09/2009 16:02:21 diff --git a/sc/source/ui/vba/testvba/Logs/TestIntersection.log b/sc/source/ui/vba/testvba/Logs/TestIntersection.log deleted file mode 100644 index 420a58697150..000000000000 --- a/sc/source/ui/vba/testvba/Logs/TestIntersection.log +++ /dev/null @@ -1,26 +0,0 @@ -Test run started : 18/09/2009 16:01:56 ----------------------------------------------------------------- -TestIntersection - TEST START : TestIntersection - ITEM Assertion OK : test1 Application.Intersect( Range('A2:D10'), Range('C4:E6')) - ITEM Assertion OK : test2 Application.Intersect( Range('A2:D10'), Range('A4:G10')) - ITEM Assertion OK : test3 Application.Intersect( Range('A2:c8,d2:f8,g2:i8'), Range('A4:G10')) - ITEM Assertion OK : test4 Application.Intersect( Range('A4:G10'), Range('A2:c8,d2:f8,g2:i8')) - ITEM Assertion OK : test5 Application.Intersect( Range('A2:c8,d2:f8,g2:i8'), Range('g4:i10,A4:G10')) - ITEM Assertion OK : test6 Application.Intersect( Range('g4:i10,A4:G10'), Range('A2:c8,d2:f8,g2:i8')) - ITEM Assertion OK : test7 Application.Intersect( Range('a2:d10,b5:e10'), Range('a5:i10')) - ITEM Assertion OK : test8 Application.Intersect( Range('a2:c8,d2:f8'), Range('b6:e9,a6:f9')) - ITEM Assertion OK : test9 Application.Intersect( Range('a2:c8,e2:f8'), Range('b6:e9,a6:f9')) - ITEM Assertion OK : test10 Application.Intersect( Range('a1:a3,c1:c3'), Range('a2:c3')) - ITEM Assertion OK : test11 Application.Intersect( Range('a1:a3,b1:b3'), Range('a2:c3')) - ITEM Assertion OK : test12 Application.Intersect( Range('a2:d5,b3:f7,c1:g4'), Range('b2:e6')) - ITEM Assertion OK : test13 Range(" a2:d10,b5:e10,g13:j32 "), Range(" a5:i10,b6:e9 "), Range("b2:r5,f10:h19") -Test Results -============ - -Tests passed: 13 -Tests failed: 0 - -END 'TestIntersection - TEST OK : TestIntersection -Test run finished : 18/09/2009 16:01:56 diff --git a/sc/source/ui/vba/testvba/Logs/TestUnion.log b/sc/source/ui/vba/testvba/Logs/TestUnion.log deleted file mode 100644 index 0b5e71952c4d..000000000000 --- a/sc/source/ui/vba/testvba/Logs/TestUnion.log +++ /dev/null @@ -1,17 +0,0 @@ -Test run started : 18/09/2009 16:02:27 ----------------------------------------------------------------- -TestUnion - TEST START : TestUnion - ITEM Assertion OK : test1Application.Range('A2:D10'), Range('C4:E6') - ITEM Assertion OK : test2Application.Range('A2:D5,a3:d4'), Range('A4:G10') - ITEM Assertion OK : test3Application.Range('A4:G10,A1:B6'), Range('A2:D5,A3:D4') - ITEM Assertion OK : test4Application.Range('A5:D10'), Range('B5:E10') -Test Results -============ - -Tests passed: 4 -Tests failed: 0 - -END 'TestUnion - TEST OK : TestUnion -Test run finished : 18/09/2009 16:02:27 diff --git a/sc/source/ui/vba/testvba/Logs/Window.log b/sc/source/ui/vba/testvba/Logs/Window.log deleted file mode 100644 index e23cb32ade89..000000000000 --- a/sc/source/ui/vba/testvba/Logs/Window.log +++ /dev/null @@ -1,46 +0,0 @@ -Test run started : 18/09/2009 16:02:27 ----------------------------------------------------------------- - TEST START : Window-Issue - ITEM Assertion OK : Window.Left is: 0 (Test only applies to maximized Window) - ITEM Assertion OK : Window.Top is: 46 (Test only applies to maximized Window) - ITEM Assertion OK : Window.Width is: 1280 (Test only applies to maximized Window) - ITEM Assertion OK : Window.Height is: 753 (Test only applies to maximized Window) - ITEM Assertion OK : Window.ScrollColumn is: 100 - ITEM Assertion OK : Window.ScrollColumn is: 1 - ITEM Assertion OK : Window.ScrollRow is: 100 - ITEM Assertion OK : Window.ScrollRow is: 1 - ITEM Assertion OK : Window.LargeScroll(Down): ScrollRow is: 106 (Test may only apply to maximized Window) - ITEM Assertion OK : Window.LargeScroll(Up): ScrollRow is: 1 - ITEM Assertion OK : Window.LargeScroll(ToRight): ScrollColumn is: 58 (Test may only apply to maximized Window) - ITEM Assertion OK : Window.LargeScroll(ToLeft): ScrollColumn is: 1 - ITEM Assertion OK : Window.SmallScroll(ToRight): ScrollColumn is: 4 (Test may only apply to maximized Window) - ITEM Assertion OK : Window.SmallScroll(ToLeft): ScrollColumn is: 1 - ITEM Assertion OK : Window.DisplayWorkBookTabs is: False - ITEM Assertion OK : Window.DisplayWorkBookTabs is: True - ITEM Assertion OK : Window.DisplayVerticalScrollBar is: True - ITEM Assertion OK : Window.DisplayVerticalScrollBar is: False - ITEM Assertion OK : Window.DisplayHorizontalScrollBar is: False - ITEM Assertion OK : Window.DisplayHorizontalScrollBar is: True - ITEM Assertion OK : Window.DisplayHeadings is: False - ITEM Assertion OK : Window.DisplayHeadings is: True - ITEM Assertion OK : Window.DisplayOutline is: False - ITEM Assertion OK : Window.DisplayOutline is: True - ITEM Assertion OK : Window.Visible is: False - ITEM Assertion OK : Window.Visible is: True - ITEM Assertion OK : Window.Caption is: MyCaption - ITEM Assertion OK : Pane.ScrollColumn is: 100 - ITEM Assertion OK : Pane.ScrollColumn is: 1 - ITEM Assertion OK : Pane.ScrollRow is: 100 - ITEM Assertion OK : Pane.ScrollRow is: 1 - ITEM Assertion OK : Pane.LargeScroll(Down): ScrollRow is: 106 (Test may only apply to maximized Window) - ITEM Assertion OK : Pane.LargeScroll(Up): ScrollRow is: 1 - ITEM Assertion OK : Pane.LargeScroll(ToRight): ScrollColumn is: 58 (Test may only apply to maximized Window) - ITEM Assertion OK : Pane.LargeScroll(ToLeft): ScrollColumn is: 1 - ITEM Assertion OK : Pane.SmallScroll(ToRight): ScrollColumn is: 4 (Test may only apply to maximized Window) - ITEM Assertion OK : Pane.SmallScroll(ToLeft): ScrollColumn is: 1 - ITEM Assertion OK : Window Selection: $A$2:$D$5 - ITEM Assertion OK : ActiveSheet name of Window: Sheet1 - ITEM Assertion OK : Window ActiveCell: $A$1 -END 'Window-Issue' Symbol - TEST OK : Window-Issue -Test run finished : 18/09/2009 16:02:28 diff --git a/sc/source/ui/vba/testvba/Logs/bytearraystring.log b/sc/source/ui/vba/testvba/Logs/bytearraystring.log deleted file mode 100644 index 27d4fc32b214..000000000000 --- a/sc/source/ui/vba/testvba/Logs/bytearraystring.log +++ /dev/null @@ -1,8 +0,0 @@ -Test run started : 18/09/2009 16:02:11 -BEGIN Bytearray To String - TEST START : Test the conversion between bytearray and string - ITEM Assertion OK : The number of byte is:6 - ITEM Assertion OK : the return string is: abc - TEST OK : Test the conversion between bytearray and string -END Bytearray To String -Test run finished : 18/09/2009 16:02:11 diff --git a/sc/source/ui/vba/testvba/Logs/dateserial.log b/sc/source/ui/vba/testvba/Logs/dateserial.log deleted file mode 100644 index ae14372c11b8..000000000000 --- a/sc/source/ui/vba/testvba/Logs/dateserial.log +++ /dev/null @@ -1,9 +0,0 @@ -Test run started : 18/09/2009 16:01:54 -BEGIN DateSerial - TEST START : Test DateSerial function - ITEM Assertion OK : the return date is: 15/06/1999 - ITEM Assertion OK : the return date is: 15/06/1999 - ITEM Assertion OK : the return date is: 15/06/1999 - TEST OK : Test DateSerial function -END DateSerial -Test run finished : 18/09/2009 16:01:54 diff --git a/sc/source/ui/vba/testvba/Logs/datevalue.log b/sc/source/ui/vba/testvba/Logs/datevalue.log deleted file mode 100644 index 74dd6444617b..000000000000 --- a/sc/source/ui/vba/testvba/Logs/datevalue.log +++ /dev/null @@ -1,8 +0,0 @@ -Test run started : 18/09/2009 16:02:29 -BEGIN DateValue - TEST START : Test DateValue function - ITEM Assertion OK : the return date is: 12/02/1969 - ITEM Assertion OK : the return date is: 21/01/2008 - TEST OK : Test DateValue function -END DateValue -Test run finished : 18/09/2009 16:02:29 diff --git a/sc/source/ui/vba/testvba/Logs/format.log b/sc/source/ui/vba/testvba/Logs/format.log deleted file mode 100644 index 0eb6c532999e..000000000000 --- a/sc/source/ui/vba/testvba/Logs/format.log +++ /dev/null @@ -1,36 +0,0 @@ -Test run started : 18/09/2009 16:02:15 -BEGIN Format - TEST START : Test Predefined_Number_Format_Sample function - ITEM Assertion OK : General Number: 562486.2356 - ITEM Assertion OK : Fixed: 0.20 - ITEM Assertion OK : Standard: 562,486.24 - ITEM Assertion OK : Percent: 75.21% - ITEM Assertion OK : Scientific: 5.62E+05 - ITEM Assertion OK : Scientific: -3.46E+03 - ITEM Assertion OK : Yes/No: No - ITEM Assertion OK : Yes/No: Yes - ITEM Assertion OK : True/False: False - ITEM Assertion OK : True/False: True - ITEM Assertion OK : On/Off: Off - ITEM Assertion OK : On/Off: On - TEST OK : Test Predefined_Number_Format_Sample function - TEST START : Test Custom_Number_Format_Sample function - ITEM Assertion OK : 00.0000: 23.6750 - ITEM Assertion OK : 00.00: 23.68 - ITEM Assertion OK : 00000: 02658 - ITEM Assertion OK : 00.00: 2658.00 - ITEM Assertion OK : ##.####: 23.675 - ITEM Assertion OK : ##.##: 23.68 - ITEM Assertion OK : #,###.##: 12,345.25 - ITEM Assertion OK : ##.00%: 25.00% - ITEM Assertion OK : #,###: 1,000,000 - ITEM Assertion OK : ######E-###: 109838E-5 - ITEM Assertion OK : $#,###.##: $2,345.25 - ITEM Assertion OK : ##.###\%: .25% - TEST OK : Test Custom_Number_Format_Sample function - TEST START : Test Custom_Text_Format_Sample function - ITEM Assertion OK : <: vba - ITEM Assertion OK : >: VBA - TEST OK : Test Custom_Text_Format_Sample function -END Format -Test run finished : 18/09/2009 16:02:15 diff --git a/sc/source/ui/vba/testvba/Logs/pagesetup.log b/sc/source/ui/vba/testvba/Logs/pagesetup.log deleted file mode 100644 index 66201a9097e7..000000000000 --- a/sc/source/ui/vba/testvba/Logs/pagesetup.log +++ /dev/null @@ -1,77 +0,0 @@ -Test run started : 18/09/2009 16:01:57 -BEGIN PageSetup - TEST START : Sheet_PrintArea - ITEM Assertion OK : PrintArea has changed as expected - TEST OK : Sheet_PrintArea - TEST START : Test margins (no headers) - ITEM Assertion OK : PageSetup.LeftMargin set/get - ITEM Assertion OK : PageSetup.RightMargin set/get - ITEM Assertion OK : PageSetup.TopMargin set/get - ITEM Assertion OK : PageSetup.BottomMargin set/get -Verify that page margins on sheet 1 are all 0.5inch - TEST OK : Test margins (no headers) - TEST START : Test margins (headers) - ITEM Assertion OK : PageSetup.HeaderMargin set/get - ITEM Assertion OK : PageSetup.FooterMargin set/get - ITEM Assertion OK : PageSetup.LeftMargin set/get - ITEM Assertion OK : PageSetup.LeftMargin set/get -Verify that top/bottom/header/footer page margins on sheet 2 are all 0.5inch - TEST OK : Test margins (headers) - TEST START : Test header/footer text - ITEM Assertion OK : PageSetup.LeftHeader set - ITEM Assertion OK : PageSetup.LeftHeader set/get - ITEM Assertion OK : PageSetup.CenterHeader set - ITEM Assertion OK : PageSetup.CenterHeader set/get - ITEM Assertion OK : PageSetup.RightHeader set - ITEM Assertion OK : PageSetup.RightHeader set/get - ITEM Assertion OK : PageSetup.LeftFooter set - ITEM Assertion OK : PageSetup.LeftFooter set/get - ITEM Assertion OK : PageSetup.CenterFooter set - ITEM Assertion OK : PageSetup.CenterFooter set/get - ITEM Assertion OK : PageSetup.RightFooter set - ITEM Assertion OK : PageSetup.RightFooter set/get -Verify that headers on sheet 2 are Ready,to,go -Verify that footers on sheet 2 are This,now,Works - TEST OK : Test header/footer text - TEST START : Test zoom - ITEM Assertion OK : PageSetup.Zoom set - ITEM Assertion OK : PageSetup.Zoom set/get -Verify that sheet 1 zoom is 10% - TEST OK : Test zoom - TEST START : Test orientation - ITEM Assertion OK : PageSetup.Zoom set - ITEM Assertion OK : PageSetup.Orientation set/get -Verify that sheet 1 orientation is now landscape - TEST OK : Test orientation - TEST START : Test order - ITEM Assertion OK : PageSetup.Order get - ITEM Assertion OK : PageSetup.Order set/get -Verify that order on sheet 1 is now over, then down. - TEST OK : Test order - TEST START : Test first page number - ITEM Assertion OK : PageSetup.FirstPageNumber get - ITEM Assertion OK : PageSetup.FirstPageNumber set/get -Verify that first page number on sheet 1 is now 2. - TEST OK : Test first page number - TEST START : Test center vertically - ITEM Assertion OK : PageSetup.CenterVertically get - ITEM Assertion OK : PageSetup.CenterVertically set/get -Verify that CenterVertically on sheet 1 is now true. - TEST OK : Test center vertically - TEST START : Test center horizontally - ITEM Assertion OK : PageSetup.CenterHorizontally get - ITEM Assertion OK : PageSetup.CenterHorizontally set/get -Verify that CenterHorizontally on sheet 1 is now true. - TEST OK : Test center horizontally - TEST START : Test FitToPagesTall - ITEM Assertion OK : PageSetup.FitToPagesTall set/get - TEST OK : Test FitToPagesTall - TEST START : Test FitToPagesWide - ITEM Assertion OK : PageSetup.FitToPagesWide set/get - TEST OK : Test FitToPagesWide - TEST START : Test PrintHeadings - ITEM Assertion OK : PageSetup.PrintHeadings set/get - ITEM Assertion OK : PageSetup.PrintHeadings set/get - TEST OK : Test PrintHeadings -END PageSetup -Test run finished : 18/09/2009 16:01:57 diff --git a/sc/source/ui/vba/testvba/Logs/partition.log b/sc/source/ui/vba/testvba/Logs/partition.log deleted file mode 100644 index 73c515bcfbf2..000000000000 --- a/sc/source/ui/vba/testvba/Logs/partition.log +++ /dev/null @@ -1,11 +0,0 @@ -Test run started : 18/09/2009 16:02:10 -BEGIN Partition - TEST START : Test Partition function - ITEM Assertion OK : the number 20 occurs in the range:20:24 - ITEM Assertion OK : the number 20 occurs in the range: 20: 20 - ITEM Assertion OK : the number 120 occurs in the range:100: - ITEM Assertion OK : the number -5 occurs in the range: : -1 - ITEM Assertion OK : the number 2 occurs in the range: 2: 3 - TEST OK : Test Partition function -END Partition -Test run finished : 18/09/2009 16:02:10 diff --git a/sc/source/ui/vba/testvba/Logs/range-4.log b/sc/source/ui/vba/testvba/Logs/range-4.log deleted file mode 100644 index 427b3846a871..000000000000 --- a/sc/source/ui/vba/testvba/Logs/range-4.log +++ /dev/null @@ -1,16 +0,0 @@ -Test run started : 18/09/2009 16:02:07 ----------------------------------------------------------------- -ShowDetail-Issue - TEST START : ShowDetail-Issue - ITEM Assertion OK : Range.ShowDetail is True - ITEM Assertion OK : Range.ShowDetail is False -END 'ShowDetail-Issue' Symbol - TEST OK : ShowDetail-Issue ----------------------------------------------------------------- -RangeMerged-Issue - TEST START : RangeMerged-Issue - ITEM Assertion OK : Range.RangeMerged is $F$2:$H$5 - ITEM Assertion OK : The first address of Range.RangeMerged is $F$2 -END 'RangeMerged-Issue' Symbol - TEST OK : RangeMerged-Issue -Test run finished : 18/09/2009 16:02:07 diff --git a/sc/source/ui/vba/testvba/Logs/replace.log b/sc/source/ui/vba/testvba/Logs/replace.log deleted file mode 100644 index 557d1bdfd69c..000000000000 --- a/sc/source/ui/vba/testvba/Logs/replace.log +++ /dev/null @@ -1,14 +0,0 @@ -Test run started : 18/09/2009 16:02:22 -BEGIN Replace - TEST START : Test Replace function - ITEM Assertion OK : common string:aefefdBc - ITEM Assertion OK : expression string:aefefdef - ITEM Assertion OK : binanary compare:aefefdBc - ITEM Assertion OK : text compare:aefefdef - ITEM Assertion OK : text compare:aefefdef - ITEM Assertion OK : start = 3:cefdBc - ITEM Assertion OK : count = 2: aefefdBc - ITEM Assertion OK : start = 1, count = 0, not support in Unix: abcbcdBc - TEST OK : Test Replace function -END Replace -Test run finished : 18/09/2009 16:02:22 diff --git a/sc/source/ui/vba/testvba/Logs/stringplusdouble.log b/sc/source/ui/vba/testvba/Logs/stringplusdouble.log deleted file mode 100644 index 6b83c91775e8..000000000000 --- a/sc/source/ui/vba/testvba/Logs/stringplusdouble.log +++ /dev/null @@ -1,62 +0,0 @@ -Test run started : 18/09/2009 16:01:59 -BEGIN String Plus Double - TEST START : double = string + double -The next compute raises error: s = null, d = null, r = s + d - ITEM Assertion OK : s = null, d = null, r = s + d .The result is: -1 - ITEM Assertion OK : s = null, d = null, r = s & d .The result is: 0 -The next compute raises error: s = null, d = 20, r = s + d - ITEM Assertion OK : s = null, d = 20, r = s + d .The result is: -1 - ITEM Assertion OK : s = null, d = 20, r = s & d .The result is: 20 - ITEM Assertion OK : s = '10', d = null, r = s + d .The result is: 10 - ITEM Assertion OK : s = '10', d = null, r = s & d .The result is: 100 - ITEM Assertion OK : s = '10', d = 20, r = s + d .The result is: 30 - ITEM Assertion OK : s = '10', d = 20, r = s & d .The result is: 1020 -The next compute raises error: s = 'abc', d = null, r = s + d - ITEM Assertion OK : s = 'abc', d = null, r = s + d .The result is: -1 -The next compute raises error: s = 'abc', d = null, r = s & d - ITEM Assertion OK : s = 'abc', d = null, r = s & d .The result is: -1 -The next compute raises error: s = 'abc', d = 20, r = s + d - ITEM Assertion OK : s = 'abc', d = 20, r = s + d .The result is: -1 -The next compute raises error: s = 'abc', d = 20, r = s & d - ITEM Assertion OK : s = 'abc', d = 20, r = s & d .The result is: -1 - TEST OK : double = string + double - TEST START : string = string + double -The next compute raises error: s = null, d = null, r = s + d - ITEM Assertion OK : s = null, d = null, r = s + d .The result is: -1 - ITEM Assertion OK : s = null, d = null, r = s & d .The result is: 0 -The next compute raises error: s = null, d = 20, r = s + d - ITEM Assertion OK : s = null, d = 20, r = s + d .The result is: -1 - ITEM Assertion OK : s = null, d = 20, r = s & d .The result is: 20 - ITEM Assertion OK : s = '10', d = null, r = s + d .The result is: 10 - ITEM Assertion OK : s = '10', d = null, r = s & d .The result is: 100 - ITEM Assertion OK : s = '10', d = 20, r = s + d .The result is: 30 - ITEM Assertion OK : s = '10', d = 20, r = s & d .The result is: 1020 -The next compute raises error: s = 'abc', d = null, r = s + d - ITEM Assertion OK : s = 'abc', d = null, r = s + d .The result is: -1 - ITEM Assertion OK : s = 'abc', d = null, r = s & d .The result is: abc0 -The next compute raises error: s = 'abc', d = 20, r = s + d - ITEM Assertion OK : s = 'abc', d = 20, r = s + d .The result is: -1 - ITEM Assertion OK : s = 'abc', d = 20, r = s & d .The result is: abc20 - TEST OK : string = string + double - TEST START : double = string + string -The next compute raises error: s = null, d = null, r = s + d - ITEM Assertion OK : s = null, d = null, r = s + d .The result is: -1 -The next compute raises error: s = null, d = null, r = s & d - ITEM Assertion OK : s = null, d = null, r = s & d .The result is: -1 - ITEM Assertion OK : s = null, d = 20, r = s + d .The result is: 20 - ITEM Assertion OK : s = null, d = 20, r = s & d .The result is: 20 - ITEM Assertion OK : s = '10', d = null, r = s + d .The result is: 10 - ITEM Assertion OK : s = '10', d = null, r = s & d .The result is: 10 - ITEM Assertion OK : s = '10', d = 20, r = s + d .The result is: 1020 - ITEM Assertion OK : s = '10', d = 20, r = s & d .The result is: 1020 -The next compute raises error: s = 'abc', d = null, r = s + d - ITEM Assertion OK : s = 'abc', d = null, r = s + d .The result is: -1 -The next compute raises error: s = 'abc', d = null, r = s & d - ITEM Assertion OK : s = 'abc', d = null, r = s & d .The result is: -1 -The next compute raises error: s = 'abc', d = 20, r = s + d - ITEM Assertion OK : s = 'abc', d = 20, r = s + d .The result is: -1 -The next compute raises error: s = 'abc', d = 20, r = s & d - ITEM Assertion OK : s = 'abc', d = 20, r = s & d .The result is: -1 - TEST OK : double = string + string -END String Plus Double -Test run finished : 18/09/2009 16:01:59 diff --git a/sc/source/ui/vba/testvba/Logs/window2.log b/sc/source/ui/vba/testvba/Logs/window2.log deleted file mode 100644 index c81c9ef45191..000000000000 --- a/sc/source/ui/vba/testvba/Logs/window2.log +++ /dev/null @@ -1,41 +0,0 @@ -Test run started : 18/09/2009 16:02:16 -BEGIN Window2 - TEST START : Test Window.SplitRow - ITEM Assertion OK : Test SplitColumn: 2 (Test only applies to maximized Window and at least has 800*600 solotion) - ITEM Assertion OK : Test SplitRow: 2 (Test only applies to maximized Window and at least has 800*600 solotion) - ITEM Assertion OK : Test SplitVertical: 242.283803521067 - ITEM Assertion OK : Test SplitHorizontal: 242.283803521067 - ITEM Assertion OK : Test SplitRow: 4 (Test only applies to maximized Window and at least has 800*600 solotion) - ITEM Assertion OK : Test SplitColumn: 3 (Test only applies to maximized Window and at least has 800*600 solotion) - ITEM Assertion OK : Test SplitColumn: 0 - ITEM Assertion OK : Test SplitRow: 0 - TEST OK : Test Window.SplitRow - TEST START : Test Window.DisplayGridlines - ITEM Assertion OK : Test gridlines are on - ITEM Assertion OK : Test gridlines are off - TEST OK : Test Window.DisplayGridlines - TEST START : Test Window.DisplayHeadings - ITEM Assertion OK : Test Headings are on - ITEM Assertion OK : Test Headings are off - TEST OK : Test Window.DisplayHeadings - TEST START : Test Window.Visibility - ITEM Assertion OK : Window is visible - ITEM Assertion OK : Window is not visible - TEST OK : Test Window.Visibility - TEST START : Test Window.FreezePanes - ITEM Assertion OK : Test no panes frozen - ITEM Assertion OK : Test panes frozen at center - ITEM Assertion OK : Test panes frozen at split - TEST OK : Test Window.FreezePanes - TEST START : Test Window.View - TEST OK : Test Window.View - TEST START : Test Window.Zoom - ITEM Assertion OK : Test zoom=100% - ITEM Assertion OK : Test zoom=150% - TEST OK : Test Window.Zoom - TEST START : Test Windows.Count - ITEM Assertion OK : Windows Count: 1 - ITEM Assertion OK : Application.Windows Count: 1 - TEST OK : Test Windows.Count -END Window2 -Test run finished : 18/09/2009 16:02:16 -- cgit v1.2.3 From 95277b86bb7b55eb13e72aa2594174d96901476d Mon Sep 17 00:00:00 2001 From: Frank Schönheit Date: Tue, 13 Oct 2009 20:07:56 +0000 Subject: #i10000# --- sc/source/ui/inc/privsplt.hxx | 1 + 1 file changed, 1 insertion(+) diff --git a/sc/source/ui/inc/privsplt.hxx b/sc/source/ui/inc/privsplt.hxx index d3b7c9ad96b8..901fa6c87eb9 100644 --- a/sc/source/ui/inc/privsplt.hxx +++ b/sc/source/ui/inc/privsplt.hxx @@ -54,6 +54,7 @@ class ScPrivatSplit : public Control short nDeltaX; short nDeltaY; + using Control::ImplInitSettings; void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground ); -- cgit v1.2.3 From 458b43715fe289804a0bd8889e8709a72a8ac90e Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Wed, 14 Oct 2009 15:49:17 +0000 Subject: CWS-TOOLING: integrate CWS calc32stopper2 2009-10-01 12:42:16 +0200 dr r276592 : #i104992# and more typos... 2009-10-01 12:42:13 +0200 nn r276591 : #i105512# SetDocOptions: update number formatter if it already exists 2009-09-30 19:03:58 +0200 dr r276573 : #104992# oops, forgotten to skip a byte 2009-09-30 16:07:17 +0200 dr r276560 : #i103540# check valid vector size 2009-09-29 14:20:45 +0200 dr r276529 : dump some more BIFF records 2009-09-29 13:00:22 +0200 dr r276526 : dump some more BIFF records 2009-09-28 14:34:14 +0200 dr r276490 : #i104057# missing exception file 2009-09-28 10:35:42 +0200 dr r276483 : #i105325# set correct format while opening zip package 2009-09-25 19:07:32 +0200 dr r276475 : #i104992# handle cell styles built-in in Calc correctly 2009-09-25 19:06:46 +0200 dr r276474 : #i104992# handle cell styles built-in in Calc correctly 2009-09-25 17:37:28 +0200 dr r276472 : #i105219# missing include 2009-09-25 12:32:24 +0200 dr r276435 : #i10000# rebase error: renamed variable 2009-09-25 11:34:53 +0200 dr r276431 : CWS-TOOLING: rebase CWS calc32stopper2 to trunk@276429 (milestone: DEV300:m60) 2009-09-24 18:59:23 +0200 dr r276427 : 160550# preserve write-protection password in roundtrip 2009-09-24 18:54:43 +0200 dr r276426 : 160550# preserve write-protection password in roundtrip 2009-09-22 11:38:17 +0200 dr r276353 : #160550# the property has to be integer of course 2009-09-21 18:52:06 +0200 dr r276342 : #160550# new internal property WriteProtectinPassword 2009-09-21 18:22:40 +0200 dr r276340 : #i104057# load sheets substreams according to offsets in SHEET records 2009-09-21 18:11:00 +0200 dr r276338 : #i104057# load sheets substreams according to offsets in SHEET records 2009-09-17 20:07:33 +0200 dr r276255 : #i104057# BIFF5/BIFF8: order of sheet substreams may be different to sheet order, use stream offset provided in SHEET records --- sc/inc/docuno.hxx | 1 + sc/source/core/data/documen3.cxx | 3 - sc/source/core/data/poolhelp.cxx | 17 +- sc/source/core/inc/poolhelp.hxx | 4 +- sc/source/filter/excel/excdoc.cxx | 59 ++++-- sc/source/filter/excel/excimp8.cxx | 6 +- sc/source/filter/excel/excrecds.cxx | 32 +-- sc/source/filter/excel/exctools.cxx | 2 - sc/source/filter/excel/impop.cxx | 17 +- sc/source/filter/excel/makefile.mk | 1 + sc/source/filter/excel/read.cxx | 49 ++++- sc/source/filter/excel/xeformula.cxx | 13 +- sc/source/filter/excel/xichart.cxx | 4 +- sc/source/filter/excel/xilink.cxx | 40 ++-- sc/source/filter/excel/xistream.cxx | 6 + sc/source/filter/excel/xistyle.cxx | 377 +++++++++++++++++++---------------- sc/source/filter/excel/xlformula.cxx | 7 +- sc/source/filter/excel/xlroot.cxx | 6 + sc/source/filter/excel/xltools.cxx | 44 ++-- sc/source/filter/inc/excrecds.hxx | 12 -- sc/source/filter/inc/ftools.hxx | 4 +- sc/source/filter/inc/imp_op.hxx | 2 + sc/source/filter/inc/root.hxx | 1 - sc/source/filter/inc/xcl97rec.hxx | 85 ++------ sc/source/filter/inc/xistream.hxx | 4 + sc/source/filter/inc/xistyle.hxx | 75 ++++--- sc/source/filter/inc/xlconst.hxx | 27 +++ sc/source/filter/inc/xlroot.hxx | 3 + sc/source/filter/inc/xlstyle.hxx | 2 + sc/source/filter/inc/xltools.hxx | 7 +- sc/source/filter/xcl97/xcl97rec.cxx | 134 +++---------- sc/source/ui/unoobj/chart2uno.cxx | 8 + sc/source/ui/unoobj/docuno.cxx | 19 +- 33 files changed, 559 insertions(+), 512 deletions(-) diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx index 0d69c9f68670..5966e446d0c3 100644 --- a/sc/inc/docuno.hxx +++ b/sc/inc/docuno.hxx @@ -114,6 +114,7 @@ private: com::sun::star::uno::Reference GetFormatter(); rtl::OUString maBuildId; + sal_Int32 mnXlsWriteProtPass; protected: const SfxItemPropertySet& GetPropertySet() const { return aPropSet; } diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index 9fc4b09f21af..17650028db70 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -1734,11 +1734,8 @@ const ScDocOptions& ScDocument::GetDocOptions() const void ScDocument::SetDocOptions( const ScDocOptions& rOpt ) { - USHORT d,m,y; - DBG_ASSERT( pDocOptions, "No DocOptions! :-(" ); *pDocOptions = rOpt; - rOpt.GetDate( d,m,y ); xPoolHelper->SetFormTableOpt(rOpt); } diff --git a/sc/source/core/data/poolhelp.cxx b/sc/source/core/data/poolhelp.cxx index ff8f7bb76c5c..d85e16ad135f 100644 --- a/sc/source/core/data/poolhelp.cxx +++ b/sc/source/core/data/poolhelp.cxx @@ -95,14 +95,29 @@ SvNumberFormatter* ScPoolHelper::GetFormTable() const pFormTable->SetColorLink( LINK( m_pSourceDoc, ScDocument, GetUserDefinedColor ) ); pFormTable->SetEvalDateFormat( NF_EVALDATEFORMAT_INTL_FORMAT ); + UseDocOptions(); // null date, year2000, std precision + } + return pFormTable; +} + +void ScPoolHelper::UseDocOptions() const +{ + if (pFormTable) + { USHORT d,m,y; aOpt.GetDate( d,m,y ); pFormTable->ChangeNullDate( d,m,y ); pFormTable->ChangeStandardPrec( (USHORT)aOpt.GetStdPrecision() ); pFormTable->SetYear2000( aOpt.GetYear2000() ); } - return pFormTable; } + +void ScPoolHelper::SetFormTableOpt(const ScDocOptions& rOpt) +{ + aOpt = rOpt; + UseDocOptions(); // #i105512# if the number formatter exists, update its settings +} + void ScPoolHelper::SourceDocumentGone() { // reset all pointers to the source document diff --git a/sc/source/core/inc/poolhelp.hxx b/sc/source/core/inc/poolhelp.hxx index a60b8db462ab..00474d63c080 100644 --- a/sc/source/core/inc/poolhelp.hxx +++ b/sc/source/core/inc/poolhelp.hxx @@ -54,6 +54,8 @@ private: mutable SfxItemPool* pEnginePool; // EditEnginePool ScDocument* m_pSourceDoc; + void UseDocOptions() const; + public: ScPoolHelper( ScDocument* pSourceDoc ); virtual ~ScPoolHelper(); @@ -68,7 +70,7 @@ public: SfxItemPool* GetEditPool() const; SfxItemPool* GetEnginePool() const; - void SetFormTableOpt(const ScDocOptions& rOpt) { aOpt = rOpt; } + void SetFormTableOpt(const ScDocOptions& rOpt); }; #endif diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx index d1b08b9cfc68..c72d165c7972 100644 --- a/sc/source/filter/excel/excdoc.cxx +++ b/sc/source/filter/excel/excdoc.cxx @@ -144,12 +144,12 @@ static void lcl_AddWorkbookProtection( XclExpRecordList<>& aRecList, ExcTable& s } #endif -static void lcl_AddScenariosAndFilters( XclExpRecordList<>& aRecList, ExcTable& self, SCTAB mnScTab ) +static void lcl_AddScenariosAndFilters( XclExpRecordList<>& aRecList, const XclExpRoot& rRoot, SCTAB nScTab ) { // Scenarios - aRecList.AppendNewRecord( new ExcEScenarioManager( self.GetDoc(), mnScTab ) ); + aRecList.AppendNewRecord( new ExcEScenarioManager( rRoot, nScTab ) ); // filter - aRecList.AppendRecord( self.GetFilterManager().CreateRecord( mnScTab ) ); + aRecList.AppendRecord( rRoot.GetFilterManager().CreateRecord( nScTab ) ); } @@ -205,20 +205,47 @@ void ExcTable::FillAsHeader( ExcBoundsheetList& rBoundsheetList ) rR.pObjRecs = NULL; // per sheet + sal_uInt16 nWriteProtHash = 0; + if( SfxObjectShell* pDocShell = GetDocShell() ) + { + ScfPropertySet aPropSet( pDocShell->GetModel() ); + sal_Int32 nApiHash = 0; + if( aPropSet.GetProperty( nApiHash, CREATE_OUSTRING( "WriteProtectionPassword" ) ) && (0 < nApiHash) && (nApiHash <= SAL_MAX_UINT16) ) + { + nWriteProtHash = static_cast< sal_uInt16 >( nApiHash ); + Add( new XclExpEmptyRecord( EXC_ID_WRITEPROT ) ); + } + } + + // TODO: correct codepage for BIFF5? + sal_uInt16 nCodePage = XclTools::GetXclCodePage( (GetBiff() <= EXC_BIFF5) ? RTL_TEXTENCODING_MS_1252 : RTL_TEXTENCODING_UNICODE ); + if( GetBiff() <= EXC_BIFF5 ) + { + Add( new XclExpEmptyRecord( EXC_ID_INTERFACEHDR ) ); + Add( new XclExpUInt16Record( EXC_ID_MMS, 0 ) ); + Add( new XclExpEmptyRecord( EXC_ID_TOOLBARHDR ) ); + Add( new XclExpEmptyRecord( EXC_ID_TOOLBAREND ) ); + Add( new XclExpEmptyRecord( EXC_ID_INTERFACEEND ) ); Add( new ExcDummy_00 ); + } else { - if ( IsDocumentEncrypted() ) - Add( new XclExpFilePass(GetRoot()) ); - - Add( new XclExpInterfaceHdr ); - Add( new XclExpMMS ); - Add( new XclExpInterfaceEnd ); + if( IsDocumentEncrypted() ) + Add( new XclExpFilePass( GetRoot() ) ); + Add( new XclExpInterfaceHdr( nCodePage ) ); + Add( new XclExpUInt16Record( EXC_ID_MMS, 0 ) ); + Add( new XclExpEmptyRecord( EXC_ID_INTERFACEEND ) ); Add( new XclExpWriteAccess ); - Add( new XclExpCodePage ); - Add( new XclExpDSF ); - Add( new XclExpExcel9File ); + } + + Add( new XclExpFileSharing( GetRoot(), nWriteProtHash ) ); + Add( new XclExpUInt16Record( EXC_ID_CODEPAGE, nCodePage ) ); + + if( GetBiff() == EXC_BIFF8 ) + { + Add( new XclExpBoolRecord( EXC_ID_DSF, false ) ); + Add( new XclExpEmptyRecord( EXC_ID_XL9FILE ) ); rR.pTabId = new XclExpChTrTabId( Max( nExcTabCount, nCodenames ) ); Add( rR.pTabId ); if( HasVbaStorage() ) @@ -228,10 +255,10 @@ void ExcTable::FillAsHeader( ExcBoundsheetList& rBoundsheetList ) if( rCodeName.Len() ) Add( new XclCodename( rCodeName ) ); } - - Add( new XclExpFnGroupCount ); } + Add( new XclExpUInt16Record( EXC_ID_FNGROUPCOUNT, 14 ) ); + // erst Namen- und Tabellen-Eintraege aufbauen String aName; @@ -473,7 +500,7 @@ void ExcTable::FillAsTable( size_t nCodeNameIdx ) aRecList.AppendRecord( CreateRecord( EXC_ID_EXTERNSHEET ) ); if ( eBiff == EXC_BIFF8 ) - lcl_AddScenariosAndFilters( aRecList, *this, mnScTab ); + lcl_AddScenariosAndFilters( aRecList, GetRoot(), mnScTab ); // cell table: DEFCOLWIDTH, COLINFO, DIMENSIONS, ROW, cell records aRecList.AppendRecord( mxCellTable ); @@ -585,7 +612,7 @@ void ExcTable::FillAsXmlTable( size_t nCodeNameIdx ) // web queries Add( new XclExpWebQueryBuffer( GetRoot() ) ); - lcl_AddScenariosAndFilters( aRecList, *this, mnScTab ); + lcl_AddScenariosAndFilters( aRecList, GetRoot(), mnScTab ); // MERGEDCELLS record, generated by the cell table aRecList.AppendRecord( mxCellTable->CreateRecord( EXC_ID_MERGEDCELLS ) ); diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index 1d209b91bc68..deaa3b375c6d 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -165,14 +165,14 @@ void ImportExcel8::Boundsheet( void ) UINT8 nLen; UINT16 nGrbit; - aIn.Ignore( 4 ); + aIn.DisableDecryption(); + maSheetOffsets.push_back( aIn.ReaduInt32() ); + aIn.EnableDecryption(); aIn >> nGrbit >> nLen; String aName( aIn.ReadUniString( nLen ) ); GetTabInfo().AppendXclTabName( aName, nBdshtTab ); - *pExcRoot->pTabNameBuff << aName; - SCTAB nScTab = static_cast< SCTAB >( nBdshtTab ); if( nScTab > 0 ) { diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx index bff8d4cba246..4ee5f70dc938 100644 --- a/sc/source/filter/excel/excrecds.cxx +++ b/sc/source/filter/excel/excrecds.cxx @@ -107,17 +107,10 @@ using ::rtl::OString; //--------------------------------------------------------- class ExcDummy_00 - const BYTE ExcDummy_00::pMyData[] = { - 0xe1, 0x00, 0x00, 0x00, // INTERFACEHDR - 0xc1, 0x00, 0x02, 0x00, 0x00, 0x00, // MMS - 0xbf, 0x00, 0x00, 0x00, // TOOLBARHDR - 0xc0, 0x00, 0x00, 0x00, // TOOLBAREND - 0xe2, 0x00, 0x00, 0x00, // INTERFACEEND - 0x5c, 0x00, 0x20, 0x00, 0x04, 0x4d, 0x72, 0x20, 0x58, // WRITEACCESS + 0x5c, 0x00, 0x20, 0x00, 0x04, 'C', 'a', 'l', 'c', // WRITEACCESS 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x42, 0x00, 0x02, 0x00, 0xe4, 0x04, // CODEPAGE - 0x9c, 0x00, 0x02, 0x00, 0x0e, 0x00 // FNGROUPCOUNT + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }; const sal_Size ExcDummy_00::nMyLen = sizeof( ExcDummy_00::pMyData ); @@ -315,27 +308,6 @@ sal_Size ExcEof::GetLen( void ) const -//----------------------------------------------------- class ExcFngroupcount - - -void ExcFngroupcount::SaveCont( XclExpStream& rStrm ) -{ - rStrm << ( UINT16 ) 0x000E; // copied from Excel -} - - -UINT16 ExcFngroupcount::GetNum( void ) const -{ - return 0x009C; -} - - -sal_Size ExcFngroupcount::GetLen( void ) const -{ - return 2; -} - - - //--------------------------------------------------------- class ExcDummy_00 - sal_Size ExcDummy_00::GetLen( void ) const diff --git a/sc/source/filter/excel/exctools.cxx b/sc/source/filter/excel/exctools.cxx index 11400ca20742..d698278d9d3c 100644 --- a/sc/source/filter/excel/exctools.cxx +++ b/sc/source/filter/excel/exctools.cxx @@ -68,7 +68,6 @@ RootData::RootData( void ) { eDateiTyp = BiffX; pExtSheetBuff = NULL; - pTabNameBuff = NULL; pShrfmlaBuff = NULL; pExtNameBuff = NULL; pFmlaConverter = NULL; @@ -90,7 +89,6 @@ RootData::RootData( void ) RootData::~RootData() { delete pExtSheetBuff; - delete pTabNameBuff; delete pShrfmlaBuff; delete pExtNameBuff; delete pAutoFilterBuffer; diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx index 5a0ae1f9a972..9b868f4d3268 100644 --- a/sc/source/filter/excel/impop.cxx +++ b/sc/source/filter/excel/impop.cxx @@ -136,7 +136,6 @@ ImportExcel::ImportExcel( XclImpRootData& rImpData, SvStream& rStrm ): pExcRoot->pIR = this; // ExcRoot -> XclImpRoot pExcRoot->eDateiTyp = BiffX; pExcRoot->pExtSheetBuff = new ExtSheetBuffer( pExcRoot ); //&aExtSheetBuff; - pExcRoot->pTabNameBuff = new NameBuffer( pExcRoot ); //&aTabNameBuff; pExcRoot->pShrfmlaBuff = new ShrfmlaBuffer( pExcRoot ); //&aShrfrmlaBuff; pExcRoot->pExtNameBuff = new ExtNameBuff ( *this ); @@ -180,9 +179,19 @@ void ImportExcel::ReadFileSharing() { sal_uInt16 nRecommendReadOnly, nPasswordHash; maStrm >> nRecommendReadOnly >> nPasswordHash; + if( (nRecommendReadOnly != 0) || (nPasswordHash != 0) ) if( SfxItemSet* pItemSet = GetMedium().GetItemSet() ) pItemSet->Put( SfxBoolItem( SID_DOC_READONLY, TRUE ) ); + + if( nPasswordHash != 0 ) + { + if( SfxObjectShell* pDocShell = GetDocShell() ) + { + ScfPropertySet aPropSet( pDocShell->GetModel() ); + aPropSet.SetProperty( CREATE_OUSTRING( "WriteProtectionPassword" ), static_cast< sal_Int32 >( nPasswordHash ) ); + } + } } sal_uInt16 ImportExcel::ReadXFIndex( bool bBiff2 ) @@ -688,14 +697,14 @@ void ImportExcel::Boundsheet( void ) if( GetBiff() == EXC_BIFF5 ) { - aIn.Ignore( 4 ); + aIn.DisableDecryption(); + maSheetOffsets.push_back( aIn.ReaduInt32() ); + aIn.EnableDecryption(); aIn >> nGrbit; } String aName( aIn.ReadByteString( FALSE ) ); - *pExcRoot->pTabNameBuff << aName; - SCTAB nScTab = static_cast< SCTAB >( nBdshtTab ); if( nScTab > 0 ) { diff --git a/sc/source/filter/excel/makefile.mk b/sc/source/filter/excel/makefile.mk index 5b483f04729d..4c94b0712d89 100644 --- a/sc/source/filter/excel/makefile.mk +++ b/sc/source/filter/excel/makefile.mk @@ -121,6 +121,7 @@ EXCEPTIONSFILES = \ $(SLO)$/excimp8.obj \ $(SLO)$/excrecds.obj \ $(SLO)$/expop2.obj \ + $(SLO)$/impop.obj \ $(SLO)$/namebuff.obj \ $(SLO)$/tokstack.obj \ $(SLO)$/xecontent.obj \ diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx index a4a286d27171..afa66422ca44 100644 --- a/sc/source/filter/excel/read.cxx +++ b/sc/source/filter/excel/read.cxx @@ -99,9 +99,28 @@ FltError ImportExcel::Read( void ) ::std::auto_ptr< ScfSimpleProgressBar > pProgress( new ScfSimpleProgressBar( aIn.GetSvStreamSize(), GetDocShell(), STR_LOAD_DOC ) ); + /* #i104057# Need to track a base position for progress bar calculation, + because sheet substreams may not be in order of sheets. */ + sal_Size nProgressBasePos = 0; + sal_Size nProgressBaseSize = 0; + while( eAkt != Z_Ende ) { - aIn.StartNextRecord(); + if( eAkt == Z_Biff5E ) + { + sal_uInt16 nScTab = GetCurrScTab(); + if( nScTab < maSheetOffsets.size() ) + { + nProgressBaseSize += (aIn.GetSvStreamPos() - nProgressBasePos); + nProgressBasePos = maSheetOffsets[ nScTab ]; + aIn.StartNextRecord( nProgressBasePos ); + } + else + eAkt = Z_Ende; + } + else + aIn.StartNextRecord(); + nOpcode = aIn.GetRecId(); if( !aIn.IsValid() ) @@ -124,8 +143,11 @@ FltError ImportExcel::Read( void ) break; } + if( eAkt == Z_Ende ) + break; + if( eAkt != Z_Biff5TPre && eAkt != Z_Biff5WPre ) - pProgress->ProgressAbs( aIn.GetSvStreamPos() ); + pProgress->ProgressAbs( nProgressBaseSize + aIn.GetSvStreamPos() - nProgressBasePos ); switch( eAkt ) { @@ -804,9 +826,28 @@ FltError ImportExcel8::Read( void ) ::std::auto_ptr< ScfSimpleProgressBar > pProgress( new ScfSimpleProgressBar( aIn.GetSvStreamSize(), GetDocShell(), STR_LOAD_DOC ) ); + /* #i104057# Need to track a base position for progress bar calculation, + because sheet substreams may not be in order of sheets. */ + sal_Size nProgressBasePos = 0; + sal_Size nProgressBaseSize = 0; + while( eAkt != EXC_STATE_END ) { - aIn.StartNextRecord(); + if( eAkt == EXC_STATE_BEFORE_SHEET ) + { + sal_uInt16 nScTab = GetCurrScTab(); + if( nScTab < maSheetOffsets.size() ) + { + nProgressBaseSize += (aIn.GetSvStreamPos() - nProgressBasePos); + nProgressBasePos = maSheetOffsets[ nScTab ]; + aIn.StartNextRecord( nProgressBasePos ); + } + else + eAkt = EXC_STATE_END; + } + else + aIn.StartNextRecord(); + if( !aIn.IsValid() ) { // #124240# #i63591# finalize table if EOF is missing @@ -830,7 +871,7 @@ FltError ImportExcel8::Read( void ) break; if( eAkt != EXC_STATE_SHEET_PRE && eAkt != EXC_STATE_GLOBALS_PRE ) - pProgress->ProgressAbs( aIn.GetSvStreamPos() ); + pProgress->ProgressAbs( nProgressBaseSize + aIn.GetSvStreamPos() - nProgressBasePos ); sal_uInt16 nRecId = aIn.GetRecId(); diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx index ef15b16030cf..849ac080bb1d 100644 --- a/sc/source/filter/excel/xeformula.cxx +++ b/sc/source/filter/excel/xeformula.cxx @@ -2170,10 +2170,15 @@ void XclExpFmlaCompImpl::PushOperatorPos( sal_uInt16 nTokPos, const XclExpOperan sal_uInt16 XclExpFmlaCompImpl::PopOperandPos() { - DBG_ASSERT( !mxData->maOpPosStack.empty(), "XclExpFmlaCompImpl::PopOperandPos - token stack broken" ); - sal_uInt16 nTokPos = mxData->maOpPosStack.back(); - mxData->maOpPosStack.pop_back(); - return nTokPos; + DBG_ASSERT( !mxData->mbOk || !mxData->maOpPosStack.empty(), "XclExpFmlaCompImpl::PopOperandPos - token stack broken" ); + mxData->mbOk &= !mxData->maOpPosStack.empty(); + if( mxData->mbOk ) + { + sal_uInt16 nTokPos = mxData->maOpPosStack.back(); + mxData->maOpPosStack.pop_back(); + return nTokPos; + } + return 0; } namespace { diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index 2d920b0a0bd4..dc542a1c1eeb 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -2159,7 +2159,9 @@ void XclImpChChart3d::ReadChChart3d( XclImpStream& rStrm ) void XclImpChChart3d::Convert( ScfPropertySet& rPropSet, bool b3dWallChart ) const { namespace cssd = ::com::sun::star::drawing; - DBG_ASSERT( ::get_flag( maData.mnFlags, EXC_CHCHART3D_HASWALLS ) == b3dWallChart, "XclImpChChart3d::Convert - wrong wall flag" ); + +// #i104057# do not assert this, written by broken external generators +// DBG_ASSERT( ::get_flag( maData.mnFlags, EXC_CHCHART3D_HASWALLS ) == b3dWallChart, "XclImpChChart3d::Convert - wrong wall flag" ); sal_Int32 nRotationY = 0; sal_Int32 nRotationX = 0; diff --git a/sc/source/filter/excel/xilink.cxx b/sc/source/filter/excel/xilink.cxx index 9033ecc125bd..00268215a5dc 100644 --- a/sc/source/filter/excel/xilink.cxx +++ b/sc/source/filter/excel/xilink.cxx @@ -153,6 +153,7 @@ struct XclImpXti sal_uInt16 mnSupbook; /// Index to SUPBOOK record. sal_uInt16 mnSBTabFirst; /// Index to the first sheet of the range in the SUPBOOK. sal_uInt16 mnSBTabLast; /// Index to the last sheet of the range in the SUPBOOK. + inline explicit XclImpXti() : mnSupbook( SAL_MAX_UINT16 ), mnSBTabFirst( SAL_MAX_UINT16 ), mnSBTabLast( SAL_MAX_UINT16 ) {} }; inline XclImpStream& operator>>( XclImpStream& rStrm, XclImpXti& rXti ) @@ -204,8 +205,10 @@ public: const String& GetMacroName( sal_uInt16 nExtSheet, sal_uInt16 nExtName ) const; private: + /** Returns the specified XTI (link entry from BIFF8 EXTERNSHEET record). */ + const XclImpXti* GetXti( sal_uInt16 nXtiIndex ) const; /** Returns the specified SUPBOOK (external document). */ - const XclImpSupbook* GetSupbook( sal_uInt32 nXtiIndex ) const; + const XclImpSupbook* GetSupbook( sal_uInt16 nXtiIndex ) const; //UNUSED2009-05 /** Returns the SUPBOOK (external workbook) specified by its URL. */ //UNUSED2009-05 const XclImpSupbook* GetSupbook( const String& rUrl ) const; @@ -222,10 +225,10 @@ private: //UNUSED2009-05 sal_uInt16 nSupbook, sal_uInt16 nSBTabStart ) const; private: - typedef ScfDelList< XclImpXti > XclImpXtiList; + typedef ::std::vector< XclImpXti > XclImpXtiVector; typedef ScfDelList< XclImpSupbook > XclImpSupbookList; - XclImpXtiList maXtiList; /// List of all XTI structures. + XclImpXtiVector maXtiList; /// List of all XTI structures. XclImpSupbookList maSupbookList; /// List of external documents. bool mbCreated; /// true = Calc sheets already created. }; @@ -582,15 +585,17 @@ void XclImpLinkManagerImpl::ReadExternsheet( XclImpStream& rStrm ) { sal_uInt16 nXtiCount; rStrm >> nXtiCount; - - XclImpXti* pXti; - while( nXtiCount ) - { - pXti = new XclImpXti; - rStrm >> *pXti; - maXtiList.Append( pXti ); - --nXtiCount; - } + DBG_ASSERT( static_cast< sal_Size >( nXtiCount * 6 ) == rStrm.GetRecLeft(), "XclImpLinkManagerImpl::ReadExternsheet - invalid count" ); + nXtiCount = static_cast< sal_uInt16 >( ::std::min< sal_Size >( nXtiCount, rStrm.GetRecLeft() / 6 ) ); + + /* #i104057# A weird external XLS generator writes multiple EXTERNSHEET + records instead of only one as expected. Surprisingly, Excel seems to + insert the entries of the second record before the entries of the first + record. */ + XclImpXtiVector aNewEntries( nXtiCount ); + for( XclImpXtiVector::iterator aIt = aNewEntries.begin(), aEnd = aNewEntries.end(); rStrm.IsValid() && (aIt != aEnd); ++aIt ) + rStrm >> *aIt; + maXtiList.insert( maXtiList.begin(), aNewEntries.begin(), aNewEntries.end() ); LoadCachedValues(); } @@ -627,7 +632,7 @@ bool XclImpLinkManagerImpl::IsSelfRef( sal_uInt16 nXtiIndex ) const bool XclImpLinkManagerImpl::GetScTabRange( SCTAB& rnFirstScTab, SCTAB& rnLastScTab, sal_uInt16 nXtiIndex ) const { - if( const XclImpXti* pXti = maXtiList.GetObject( nXtiIndex ) ) + if( const XclImpXti* pXti = GetXti( nXtiIndex ) ) { if (maSupbookList.GetObject(pXti->mnSupbook)) { @@ -671,9 +676,14 @@ const String& XclImpLinkManagerImpl::GetMacroName( sal_uInt16 nExtSheet, sal_uIn return pSupbook ? pSupbook->GetMacroName( nExtName ) : EMPTY_STRING; } -const XclImpSupbook* XclImpLinkManagerImpl::GetSupbook( sal_uInt32 nXtiIndex ) const +const XclImpXti* XclImpLinkManagerImpl::GetXti( sal_uInt16 nXtiIndex ) const +{ + return (nXtiIndex < maXtiList.size()) ? &maXtiList[ nXtiIndex ] : 0; +} + +const XclImpSupbook* XclImpLinkManagerImpl::GetSupbook( sal_uInt16 nXtiIndex ) const { - const XclImpXti* pXti = maXtiList.GetObject( nXtiIndex ); + const XclImpXti* pXti = GetXti( nXtiIndex ); return pXti ? maSupbookList.GetObject( pXti->mnSupbook ) : 0; } diff --git a/sc/source/filter/excel/xistream.cxx b/sc/source/filter/excel/xistream.cxx index b168c4389c4c..a040f21b1c4f 100644 --- a/sc/source/filter/excel/xistream.cxx +++ b/sc/source/filter/excel/xistream.cxx @@ -414,6 +414,12 @@ bool XclImpStream::StartNextRecord() return mbValidRec; } +bool XclImpStream::StartNextRecord( sal_Size nNextRecPos ) +{ + mnNextRecPos = nNextRecPos; + return StartNextRecord(); +} + void XclImpStream::ResetRecord( bool bContLookup, sal_uInt16 nAltContId ) { if( mbValidRec ) diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx index a83e203c167d..07368f6db680 100644 --- a/sc/source/filter/excel/xistyle.cxx +++ b/sc/source/filter/excel/xistyle.cxx @@ -968,9 +968,7 @@ XclImpXF::XclImpXF( const XclImpRoot& rRoot ) : XclImpRoot( rRoot ), mpStyleSheet( 0 ), mnXclNumFmt( 0 ), - mnXclFont( 0 ), - mbWasBuiltIn( false ), - mbForceCreate( false ) + mnXclFont( 0 ) { } @@ -1088,31 +1086,61 @@ void XclImpXF::ReadXF( XclImpStream& rStrm ) } } -void XclImpXF::SetStyleName( const String& rStyleName, bool bBuiltIn, bool bForceCreate ) +const ScPatternAttr& XclImpXF::CreatePattern( bool bSkipPoolDefs ) { - DBG_ASSERT( IsStyleXF(), "XclImpXF::SetStyleName - not a style XF" ); - DBG_ASSERT( rStyleName.Len() > 0, "XclImpXF::SetStyleName - style name empty" ); - if( IsStyleXF() && (rStyleName.Len() > 0) ) + if( mpPattern.get() ) + return *mpPattern; + + // create new pattern attribute set + mpPattern.reset( new ScPatternAttr( GetDoc().GetPool() ) ); + SfxItemSet& rItemSet = mpPattern->GetItemSet(); + + // parent cell style + if( IsCellXF() && !mpStyleSheet ) { - maStyleName = rStyleName; - mbWasBuiltIn = bBuiltIn; - mbForceCreate = bForceCreate; + mpStyleSheet = GetXFBuffer().CreateStyleSheet( mnParent ); + if( XclImpXF* pParentXF = GetXFBuffer().GetXF( mnParent ) ) + UpdateUsedFlags( *pParentXF ); } -} -void XclImpXF::ChangeStyleName( const String& rStyleName ) -{ - DBG_ASSERT( IsStyleXF(), "XclImpXF::ChangeStyleName - not a style XF" ); - DBG_ASSERT( rStyleName.Len() > 0, "XclImpXF::ChangeStyleName - new style name empty" ); - DBG_ASSERT( maStyleName.Len() > 0, "XclImpXF::ChangeStyleName - old style name empty" ); - if( IsStyleXF() && (rStyleName.Len() > 0) ) - maStyleName = rStyleName; -} + // cell protection + if( mbProtUsed ) + maProtection.FillToItemSet( rItemSet, bSkipPoolDefs ); -void XclImpXF::CreateUserStyle() -{ - if( IsStyleXF() && mbForceCreate ) - CreateStyleSheet(); + // font + if( mbFontUsed ) + GetFontBuffer().FillToItemSet( rItemSet, EXC_FONTITEM_CELL, mnXclFont, bSkipPoolDefs ); + + // value format + if( mbFmtUsed ) + { + GetNumFmtBuffer().FillToItemSet( rItemSet, mnXclNumFmt, bSkipPoolDefs ); + // Trace occurrences of Windows date formats + GetTracer().TraceDates( mnXclNumFmt ); + } + + // alignment + if( mbAlignUsed ) + maAlignment.FillToItemSet( rItemSet, GetFontBuffer().GetFont( mnXclFont ), bSkipPoolDefs ); + + // border + if( mbBorderUsed ) + { + maBorder.FillToItemSet( rItemSet, GetPalette(), bSkipPoolDefs ); + GetTracer().TraceBorderLineStyle(maBorder.mnLeftLine > EXC_LINE_HAIR || + maBorder.mnRightLine > EXC_LINE_HAIR || maBorder.mnTopLine > EXC_LINE_HAIR || + maBorder.mnBottomLine > EXC_LINE_HAIR ); + } + + // area + if( mbAreaUsed ) + { + maArea.FillToItemSet( rItemSet, GetPalette(), bSkipPoolDefs ); + GetTracer().TraceFillPattern(maArea.mnPattern != EXC_PATT_NONE && + maArea.mnPattern != EXC_PATT_SOLID); + } + + return *mpPattern; } void XclImpXF::ApplyPattern( @@ -1175,80 +1203,71 @@ void XclImpXF::UpdateUsedFlags( const XclImpXF& rParentXF ) mbAreaUsed = !rParentXF.mbAreaUsed || !(maArea == rParentXF.maArea); } -const ScPatternAttr& XclImpXF::CreatePattern( bool bSkipPoolDefs ) -{ - if( mpPattern.get() ) - return *mpPattern; - - // create new pattern attribute set - mpPattern.reset( new ScPatternAttr( GetDoc().GetPool() ) ); - SfxItemSet& rItemSet = mpPattern->GetItemSet(); - - // parent cell style - if( IsCellXF() ) - { - if( XclImpXF* pParentXF = GetXFBuffer().GetXF( mnParent ) ) - { - mpStyleSheet = pParentXF->CreateStyleSheet(); - UpdateUsedFlags( *pParentXF ); - } - } - - // cell protection - if( mbProtUsed ) - maProtection.FillToItemSet( rItemSet, bSkipPoolDefs ); +// ---------------------------------------------------------------------------- - // font - if( mbFontUsed ) - GetFontBuffer().FillToItemSet( rItemSet, EXC_FONTITEM_CELL, mnXclFont, bSkipPoolDefs ); +XclImpStyle::XclImpStyle( const XclImpRoot& rRoot ) : + XclImpRoot( rRoot ), + mnXfId( EXC_XF_NOTFOUND ), + mnBuiltinId( EXC_STYLE_USERDEF ), + mnLevel( EXC_STYLE_NOLEVEL ), + mbBuiltin( false ), + mbCustom( false ), + mbHidden( false ), + mpStyleSheet( 0 ) +{ +} - // value format - if( mbFmtUsed ) - { - GetNumFmtBuffer().FillToItemSet( rItemSet, mnXclNumFmt, bSkipPoolDefs ); - // Trace occurrences of Windows date formats - GetTracer().TraceDates( mnXclNumFmt ); - } +void XclImpStyle::ReadStyle( XclImpStream& rStrm ) +{ + DBG_ASSERT_BIFF( GetBiff() >= EXC_BIFF3 ); - // alignment - if( mbAlignUsed ) - maAlignment.FillToItemSet( rItemSet, GetFontBuffer().GetFont( mnXclFont ), bSkipPoolDefs ); + sal_uInt16 nXFIndex; + rStrm >> nXFIndex; + mnXfId = nXFIndex & EXC_STYLE_XFMASK; + mbBuiltin = ::get_flag( nXFIndex, EXC_STYLE_BUILTIN ); - // border - if( mbBorderUsed ) + if( mbBuiltin ) { - maBorder.FillToItemSet( rItemSet, GetPalette(), bSkipPoolDefs ); - GetTracer().TraceBorderLineStyle(maBorder.mnLeftLine > EXC_LINE_HAIR || - maBorder.mnRightLine > EXC_LINE_HAIR || maBorder.mnTopLine > EXC_LINE_HAIR || - maBorder.mnBottomLine > EXC_LINE_HAIR ); + rStrm >> mnBuiltinId >> mnLevel; } - - // area - if( mbAreaUsed ) + else { - maArea.FillToItemSet( rItemSet, GetPalette(), bSkipPoolDefs ); - GetTracer().TraceFillPattern(maArea.mnPattern != EXC_PATT_NONE && - maArea.mnPattern != EXC_PATT_SOLID); + maName = (GetBiff() <= EXC_BIFF5) ? rStrm.ReadByteString( false ) : rStrm.ReadUniString(); + // #i103281# check if this is a new built-in style introduced in XL2007 + if( (GetBiff() == EXC_BIFF8) && (rStrm.GetNextRecId() == EXC_ID_STYLEEXT) && rStrm.StartNextRecord() ) + { + sal_uInt8 nExtFlags; + rStrm.Ignore( 12 ); + rStrm >> nExtFlags; + mbBuiltin = ::get_flag( nExtFlags, EXC_STYLEEXT_BUILTIN ); + mbCustom = ::get_flag( nExtFlags, EXC_STYLEEXT_CUSTOM ); + mbHidden = ::get_flag( nExtFlags, EXC_STYLEEXT_HIDDEN ); + if( mbBuiltin ) + { + rStrm.Ignore( 1 ); // category + rStrm >> mnBuiltinId >> mnLevel; + } + } } - - return *mpPattern; } -ScStyleSheet* XclImpXF::CreateStyleSheet() +ScStyleSheet* XclImpStyle::CreateStyleSheet() { - if( !mpStyleSheet && maStyleName.Len() ) // valid name implies style XF + // #i1624# #i1768# ignore unnamed user styles + if( !mpStyleSheet && (maFinalName.Len() > 0) ) { bool bCreatePattern = false; - // there may be a user-defined "Default" - test on built-in too! - bool bDefStyle = mbWasBuiltIn && (maStyleName == ScGlobal::GetRscString( STR_STYLENAME_STANDARD )); + XclImpXF* pXF = GetXFBuffer().GetXF( mnXfId ); + + bool bDefStyle = mbBuiltin && (mnBuiltinId == EXC_STYLE_NORMAL); if( bDefStyle ) { - // set all flags to true to get all items in CreatePattern() - SetAllUsedFlags( true ); + // set all flags to true to get all items in XclImpXF::CreatePattern() + if( pXF ) pXF->SetAllUsedFlags( true ); // use existing "Default" style sheet mpStyleSheet = static_cast< ScStyleSheet* >( GetStyleSheetPool().Find( ScGlobal::GetRscString( STR_STYLENAME_STANDARD ), SFX_STYLE_FAMILY_PARA ) ); - DBG_ASSERT( mpStyleSheet, "XclImpXF::CreateStyleSheet - Default style not found" ); + DBG_ASSERT( mpStyleSheet, "XclImpStyle::CreateStyleSheet - Default style not found" ); bCreatePattern = true; } else @@ -1256,21 +1275,28 @@ ScStyleSheet* XclImpXF::CreateStyleSheet() /* #i103281# do not create another style sheet of the same name, if it exists already. This is needed to prevent that styles pasted from clipboard get duplicated over and over. */ - mpStyleSheet = static_cast< ScStyleSheet* >( GetStyleSheetPool().Find( maStyleName, SFX_STYLE_FAMILY_PARA ) ); + mpStyleSheet = static_cast< ScStyleSheet* >( GetStyleSheetPool().Find( maFinalName, SFX_STYLE_FAMILY_PARA ) ); if( !mpStyleSheet ) { - mpStyleSheet = &static_cast< ScStyleSheet& >( GetStyleSheetPool().Make( maStyleName, SFX_STYLE_FAMILY_PARA, SFXSTYLEBIT_USERDEF ) ); + mpStyleSheet = &static_cast< ScStyleSheet& >( GetStyleSheetPool().Make( maFinalName, SFX_STYLE_FAMILY_PARA, SFXSTYLEBIT_USERDEF ) ); bCreatePattern = true; } } // bDefStyle==true omits default pool items in CreatePattern() - if( bCreatePattern && mpStyleSheet ) - mpStyleSheet->GetItemSet().Put( CreatePattern( bDefStyle ).GetItemSet() ); + if( bCreatePattern && mpStyleSheet && pXF ) + mpStyleSheet->GetItemSet().Put( pXF->CreatePattern( bDefStyle ).GetItemSet() ); } return mpStyleSheet; } +void XclImpStyle::CreateUserStyle( const String& rFinalName ) +{ + maFinalName = rFinalName; + if( !IsBuiltin() || mbCustom ) + CreateStyleSheet(); +} + // ---------------------------------------------------------------------------- XclImpXFBuffer::XclImpXFBuffer( const XclImpRoot& rRoot ) : @@ -1281,16 +1307,9 @@ XclImpXFBuffer::XclImpXFBuffer( const XclImpRoot& rRoot ) : void XclImpXFBuffer::Initialize() { maXFList.Clear(); - maStyleXFs.clear(); - /* Reserve style names that are built-in in Calc. For BIFF4 workbooks - which contain a separate list of styles per sheet, reserve all existing - names if current sheet is not the first sheet. This will create unique - names for styles in different sheets with the same name. */ - bool bReserveAll = (GetBiff() == EXC_BIFF4) && (GetCurrScTab() > 0); - SfxStyleSheetIterator aStyleIter( GetDoc().GetStyleSheetPool(), SFX_STYLE_FAMILY_PARA ); - for( SfxStyleSheetBase* pStyleSheet = aStyleIter.First(); pStyleSheet; pStyleSheet = aStyleIter.Next() ) - if( bReserveAll || !pStyleSheet->IsUserDefined() ) - maStyleXFs[ pStyleSheet->GetName() ] = 0; + maBuiltinStyles.Clear(); + maUserStyles.Clear(); + maStylesByXf.clear(); } void XclImpXFBuffer::ReadXF( XclImpStream& rStrm ) @@ -1298,51 +1317,15 @@ void XclImpXFBuffer::ReadXF( XclImpStream& rStrm ) XclImpXF* pXF = new XclImpXF( GetRoot() ); pXF->ReadXF( rStrm ); maXFList.Append( pXF ); - - // set the name of the "Default" cell style (always the first XF in an Excel file) - if( (GetBiff() >= EXC_BIFF3) && (maXFList.Count() == 1) ) - CalcStyleName( *pXF, EXC_STYLE_NORMAL, 0 ); } void XclImpXFBuffer::ReadStyle( XclImpStream& rStrm ) { - DBG_ASSERT_BIFF( GetBiff() >= EXC_BIFF3 ); - - sal_uInt16 nXFIndex; - rStrm >> nXFIndex; - - XclImpXF* pXF = GetXF( nXFIndex & EXC_STYLE_XFMASK ); // bits 0...11 are used for XF index - if( pXF && pXF->IsStyleXF() ) - { - if( ::get_flag( nXFIndex, EXC_STYLE_BUILTIN ) ) // built-in styles - { - sal_uInt8 nStyleId, nLevel; - rStrm >> nStyleId >> nLevel; - CalcStyleName( *pXF, nStyleId, nLevel ); - } - else // user-defined styles - { - String aStyleName; - if( GetBiff() <= EXC_BIFF5 ) - aStyleName = rStrm.ReadByteString( false ); // 8 bit length - else - aStyleName = rStrm.ReadUniString(); - - if( aStyleName.Len() > 0 ) // #i1624# #i1768# ignore unnamed styles - { - // #i103281# check if this is a new built-in style introduced in XL2007 - bool bBuiltIn = false; - if( (GetBiff() == EXC_BIFF8) && (rStrm.GetNextRecId() == EXC_ID_STYLEEXT) && rStrm.StartNextRecord() ) - { - sal_uInt8 nExtFlags; - rStrm.Ignore( 12 ); - rStrm >> nExtFlags; - bBuiltIn = ::get_flag( nExtFlags, EXC_STYLEEXT_BUILTIN ); - } - CalcStyleName( *pXF, aStyleName, bBuiltIn ); - } - } - } + XclImpStyle* pStyle = new XclImpStyle( GetRoot() ); + pStyle->ReadStyle( rStrm ); + (pStyle->IsBuiltin() ? maBuiltinStyles : maUserStyles).Append( pStyle ); + DBG_ASSERT( maStylesByXf.count( pStyle->GetXfId() ) == 0, "XclImpXFBuffer::ReadStyle - multiple styles with equal XF identifier" ); + maStylesByXf[ pStyle->GetXfId() ] = pStyle; } sal_uInt16 XclImpXFBuffer::GetFontIndex( sal_uInt16 nXFIndex ) const @@ -1356,64 +1339,104 @@ const XclImpFont* XclImpXFBuffer::GetFont( sal_uInt16 nXFIndex ) const return GetFontBuffer().GetFont( GetFontIndex( nXFIndex ) ); } -void XclImpXFBuffer::CreateUserStyles() +namespace { + +/** Functor for case-insensitive string comparison, usable in maps etc. */ +struct IgnoreCaseCompare { - for( XclImpXF* pXF = maXFList.First(); pXF; pXF = maXFList.Next() ) - pXF->CreateUserStyle(); -} + inline bool operator()( const String& rName1, const String& rName2 ) const + { return rName1.CompareIgnoreCaseToAscii( rName2 ) == COMPARE_LESS; } +}; -void XclImpXFBuffer::ApplyPattern( - SCCOL nScCol1, SCROW nScRow1, SCCOL nScCol2, SCROW nScRow2, - SCTAB nScTab, const XclImpXFIndex& rXFIndex ) +} // namespace + +void XclImpXFBuffer::CreateUserStyles() { - if( XclImpXF* pXF = GetXF( rXFIndex.GetXFIndex() ) ) + // calculate final names of all styles + typedef ::std::map< String, XclImpStyle*, IgnoreCaseCompare > CellStyleNameMap; + typedef ::std::vector< XclImpStyle* > XclImpStyleVector; + + CellStyleNameMap aCellStyles; + XclImpStyleVector aConflictNameStyles; + + /* First, reserve style names that are built-in in Calc. This causes that + imported cell styles get different unused names and thus do not try to + overwrite these built-in styles. For BIFF4 workbooks (which contain a + separate list of cell styles per sheet), reserve all existing styles if + current sheet is not the first sheet (this styles buffer will be + initialized again for every new sheet). This will create unique names + for styles in different sheets with the same name. Assuming that the + BIFF4W import filter is never used to import from clipboard... */ + bool bReserveAll = (GetBiff() == EXC_BIFF4) && (GetCurrScTab() > 0); + SfxStyleSheetIterator aStyleIter( GetDoc().GetStyleSheetPool(), SFX_STYLE_FAMILY_PARA ); + String aStandardName = ScGlobal::GetRscString( STR_STYLENAME_STANDARD ); + for( SfxStyleSheetBase* pStyleSheet = aStyleIter.First(); pStyleSheet; pStyleSheet = aStyleIter.Next() ) + if( (pStyleSheet->GetName() != aStandardName) && (bReserveAll || !pStyleSheet->IsUserDefined()) ) + if( aCellStyles.count( pStyleSheet->GetName() ) == 0 ) + aCellStyles[ pStyleSheet->GetName() ] = 0; + + /* Calculate names of built-in styles. Store styles with reserved names + in the aConflictNameStyles list. */ + for( XclImpStyle* pStyle = maBuiltinStyles.First(); pStyle; pStyle = maBuiltinStyles.Next() ) { - // #108770# set 'Standard' number format for all Boolean cells - ULONG nForceScNumFmt = rXFIndex.IsBoolCell() ? GetNumFmtBuffer().GetStdScNumFmt() : NUMBERFORMAT_ENTRY_NOT_FOUND; - pXF->ApplyPattern( nScCol1, nScRow1, nScCol2, nScRow2, nScTab, nForceScNumFmt ); + String aStyleName = XclTools::GetBuiltInStyleName( pStyle->GetBuiltinId(), pStyle->GetName(), pStyle->GetLevel() ); + DBG_ASSERT( bReserveAll || (aCellStyles.count( aStyleName ) == 0), + "XclImpXFBuffer::CreateUserStyles - multiple styles with equal built-in identifier" ); + if( aCellStyles.count( aStyleName ) > 0 ) + aConflictNameStyles.push_back( pStyle ); + else + aCellStyles[ aStyleName ] = pStyle; } -} -void XclImpXFBuffer::CalcStyleName( XclImpXF& rXF, const String& rStyleName, bool bBuiltIn ) -{ - DBG_ASSERT( rStyleName.Len() > 0, "XclImpXFBuffer::CalcStyleName - style name empty" ); - if( rStyleName.Len() > 0 ) + /* Calculate names of user defined styles. Store styles with reserved + names in the aConflictNameStyles list. */ + for( XclImpStyle* pStyle = maUserStyles.First(); pStyle; pStyle = maUserStyles.Next() ) { - String aStyleName = bBuiltIn ? XclTools::GetBuiltInStyleName( rStyleName ) : rStyleName; - SetStyleName( rXF, aStyleName, bBuiltIn, !bBuiltIn ); + // #i1624# #i1768# ignore unnamed user styles + if( pStyle->GetName().Len() > 0 ) + { + if( aCellStyles.count( pStyle->GetName() ) > 0 ) + aConflictNameStyles.push_back( pStyle ); + else + aCellStyles[ pStyle->GetName() ] = pStyle; + } } + + // find unused names for all styles with conflicting names + for( XclImpStyleVector::iterator aIt = aConflictNameStyles.begin(), aEnd = aConflictNameStyles.end(); aIt != aEnd; ++aIt ) + { + XclImpStyle* pStyle = *aIt; + String aUnusedName; + sal_Int32 nIndex = 0; + do + { + aUnusedName.Assign( pStyle->GetName() ).Append( ' ' ).Append( String::CreateFromInt32( ++nIndex ) ); + } + while( aCellStyles.count( aUnusedName ) > 0 ); + aCellStyles[ aUnusedName ] = pStyle; + } + + // set final names and create user-defined and modified built-in cell styles + for( CellStyleNameMap::iterator aIt = aCellStyles.begin(), aEnd = aCellStyles.end(); aIt != aEnd; ++aIt ) + if( aIt->second ) + aIt->second->CreateUserStyle( aIt->first ); } -void XclImpXFBuffer::CalcStyleName( XclImpXF& rXF, sal_uInt8 nStyleId, sal_uInt8 nLevel ) +ScStyleSheet* XclImpXFBuffer::CreateStyleSheet( sal_uInt16 nXFIndex ) { - // force creation of "Default" style - SetStyleName( rXF, XclTools::GetBuiltInStyleName( nStyleId, nLevel ), true, nStyleId == EXC_STYLE_NORMAL ); + XclImpStyleMap::iterator aIt = maStylesByXf.find( nXFIndex ); + return (aIt == maStylesByXf.end()) ? 0 : aIt->second->CreateStyleSheet(); } -void XclImpXFBuffer::SetStyleName( XclImpXF& rXF, const String& rStyleName, bool bBuiltIn, bool bForceCreate ) +void XclImpXFBuffer::ApplyPattern( + SCCOL nScCol1, SCROW nScRow1, SCCOL nScCol2, SCROW nScRow2, + SCTAB nScTab, const XclImpXFIndex& rXFIndex ) { - DBG_ASSERT( rXF.IsStyleXF(), "XclImpXFBuffer::SetStyleName - not a style XF" ); - if( rXF.IsStyleXF() ) + if( XclImpXF* pXF = GetXF( rXFIndex.GetXFIndex() ) ) { - // find an unused name - String aUnusedName( rStyleName ); - sal_Int32 nIndex = 0; - while( maStyleXFs.count( aUnusedName ) > 0 ) - aUnusedName.Assign( rStyleName ).Append( ' ' ).Append( String::CreateFromInt32( ++nIndex ) ); - - // move old style to new name, if new style is built-in - if( bBuiltIn && (aUnusedName != rStyleName) ) - { - XclImpXF*& rpXF = maStyleXFs[ aUnusedName ]; - rpXF = maStyleXFs[ rStyleName ]; - if( rpXF ) - rpXF->ChangeStyleName( aUnusedName ); - aUnusedName = rStyleName; - } - - // insert new style - maStyleXFs[ aUnusedName ] = &rXF; - rXF.SetStyleName( aUnusedName, bBuiltIn, bForceCreate ); + // #108770# set 'Standard' number format for all Boolean cells + ULONG nForceScNumFmt = rXFIndex.IsBoolCell() ? GetNumFmtBuffer().GetStdScNumFmt() : NUMBERFORMAT_ENTRY_NOT_FOUND; + pXF->ApplyPattern( nScCol1, nScRow1, nScCol2, nScRow2, nScTab, nForceScNumFmt ); } } diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx index 5e6c85b49077..b8c18eb3e7c0 100644 --- a/sc/source/filter/excel/xlformula.cxx +++ b/sc/source/filter/excel/xlformula.cxx @@ -30,18 +30,13 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sc.hxx" - -// XXX xestream.hxx MUST be included before xlformula.hxx because of the -// redifinition of the CREATE_OUSTRING() macro, which is in oox/helper.hxx -// (indirectly included via xestream.hxx) and ../inc/ftools.hxx (indirectly -// included via xlformula.hxx) that does an undef first. Ugly. -#include "xestream.hxx" #include "xlformula.hxx" #include "compiler.hxx" #include "rangenam.hxx" #include "token.hxx" #include "tokenarray.hxx" +#include "xestream.hxx" #include "xistream.hxx" #include "xlroot.hxx" diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx index 29522f4f50ff..0b6af9da2e63 100644 --- a/sc/source/filter/excel/xlroot.cxx +++ b/sc/source/filter/excel/xlroot.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -95,6 +96,11 @@ XclRootData::XclRootData( XclBiff eBiff, SfxMedium& rMedium, mnScTab( 0 ), mbExport( bExport ) { + // user name + maUserName = SvtUserOptions().GetLastName(); + if( maUserName.Len() == 0 ) + maUserName = CREATE_STRING( "Calc" ); + // default script type, e.g. for empty cells switch( ScGlobal::GetDefaultScriptType() ) { diff --git a/sc/source/filter/excel/xltools.cxx b/sc/source/filter/excel/xltools.cxx index a84aaba82b90..6398e25b9be7 100644 --- a/sc/source/filter/excel/xltools.cxx +++ b/sc/source/filter/excel/xltools.cxx @@ -426,16 +426,19 @@ rtl_TextEncoding XclTools::GetTextEncoding( sal_uInt16 nCodePage ) return pEntry->meTextEnc; } -//UNUSED2008-05 sal_uInt16 XclTools::GetXclCodePage( rtl_TextEncoding eTextEnc ) -//UNUSED2008-05 { -//UNUSED2008-05 const XclCodePageEntry* pEntry = ::std::find_if( pCodePageTable, pCodePageTableEnd, XclCodePageEntry_TEPred( eTextEnc ) ); -//UNUSED2008-05 if( pEntry == pCodePageTableEnd ) -//UNUSED2008-05 { -//UNUSED2008-05 DBG_ERROR1( "XclTools::GetXclCodePage - unsupported text encoding: %d", eTextEnc ); -//UNUSED2008-05 return 1252; -//UNUSED2008-05 } -//UNUSED2008-05 return pEntry->mnCodePage; -//UNUSED2008-05 } +sal_uInt16 XclTools::GetXclCodePage( rtl_TextEncoding eTextEnc ) +{ + if( eTextEnc == RTL_TEXTENCODING_UNICODE ) + return 1200; // for BIFF8 + + const XclCodePageEntry* pEntry = ::std::find_if( pCodePageTable, pCodePageTableEnd, XclCodePageEntry_TEPred( eTextEnc ) ); + if( pEntry == pCodePageTableEnd ) + { + DBG_ERROR1( "XclTools::GetXclCodePage - unsupported text encoding: %d", eTextEnc ); + return 1252; + } + return pEntry->mnCodePage; +} // font names ----------------------------------------------------------------- @@ -528,17 +531,26 @@ static const sal_Char* const ppcStyleNames[] = "Followed_Hyperlink" }; -String XclTools::GetBuiltInStyleName( sal_uInt8 nStyleId, sal_uInt8 nLevel ) +String XclTools::GetBuiltInStyleName( sal_uInt8 nStyleId, const String& rName, sal_uInt8 nLevel ) { String aStyleName; if( nStyleId == EXC_STYLE_NORMAL ) // "Normal" becomes "Default" style + { aStyleName = ScGlobal::GetRscString( STR_STYLENAME_STANDARD ); - else if( nStyleId < STATIC_TABLE_SIZE( ppcStyleNames ) ) - aStyleName.Assign( maStyleNamePrefix1 ).AppendAscii( ppcStyleNames[ nStyleId ] ); - - if( (nStyleId == EXC_STYLE_ROWLEVEL) || (nStyleId == EXC_STYLE_COLLEVEL) ) - aStyleName.Append( String::CreateFromInt32( nLevel + 1 ) ); + } + else + { + aStyleName = maStyleNamePrefix1; + if( nStyleId < STATIC_TABLE_SIZE( ppcStyleNames ) ) + aStyleName.AppendAscii( ppcStyleNames[ nStyleId ] ); + else if( rName.Len() > 0 ) + aStyleName.Append( rName ); + else + aStyleName.Append( String::CreateFromInt32( nStyleId ) ); + if( (nStyleId == EXC_STYLE_ROWLEVEL) || (nStyleId == EXC_STYLE_COLLEVEL) ) + aStyleName.Append( String::CreateFromInt32( nLevel + 1 ) ); + } return aStyleName; } diff --git a/sc/source/filter/inc/excrecds.hxx b/sc/source/filter/inc/excrecds.hxx index 568032aa317f..79607802ccdc 100644 --- a/sc/source/filter/inc/excrecds.hxx +++ b/sc/source/filter/inc/excrecds.hxx @@ -210,18 +210,6 @@ public: }; -//----------------------------------------------------- class ExcFngroupcount - - -class ExcFngroupcount : public ExcRecord -{ -private: - virtual void SaveCont( XclExpStream& rStrm ); -public: - virtual UINT16 GetNum( void ) const; - virtual sal_Size GetLen( void ) const; -}; - - //--------------------------------------------------------- class ExcDummy_00 - // INTERFACEHDR to FNGROUPCOUNT (see excrecds.cxx) diff --git a/sc/source/filter/inc/ftools.hxx b/sc/source/filter/inc/ftools.hxx index 393775e721f7..5fd338a73bb5 100644 --- a/sc/source/filter/inc/ftools.hxx +++ b/sc/source/filter/inc/ftools.hxx @@ -38,6 +38,7 @@ #include #include #include +#include #include "filter.hxx" #include "scdllapi.h" @@ -50,9 +51,6 @@ /** Expands to a temporary String, created from an ASCII character array. */ #define CREATE_STRING( ascii ) String( RTL_CONSTASCII_USTRINGPARAM( ascii ) ) -/** Expands to a temporary ::rtl::OUString, created from an ASCII character array. */ -#undef CREATE_OUSTRING -#define CREATE_OUSTRING( ascii ) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ascii ) ) // items and item sets -------------------------------------------------------- diff --git a/sc/source/filter/inc/imp_op.hxx b/sc/source/filter/inc/imp_op.hxx index ab5513ead1ed..fa0e6b7f5074 100644 --- a/sc/source/filter/inc/imp_op.hxx +++ b/sc/source/filter/inc/imp_op.hxx @@ -99,6 +99,8 @@ protected: XclImpStream maStrm; // input stream XclImpStream& aIn; // input stream + ScfUInt32Vec maSheetOffsets; + NameBuffer* pExtNameBuff; // ... externe Namen (Ind.-Basis=1) ExcelToSc* pFormConv; // Formel-Konverter diff --git a/sc/source/filter/inc/root.hxx b/sc/source/filter/inc/root.hxx index 3aa94ca542b1..ffff5dd9ff94 100644 --- a/sc/source/filter/inc/root.hxx +++ b/sc/source/filter/inc/root.hxx @@ -67,7 +67,6 @@ struct RootData // -> Inkarnation jeweils im ImportExcel-Objekt! { BiffTyp eDateiTyp; // feine Differenzierung ExtSheetBuffer* pExtSheetBuff; - NameBuffer* pTabNameBuff; ShrfmlaBuffer* pShrfmlaBuff; ExtNameBuff* pExtNameBuff; ExcelToSc* pFmlaConverter; diff --git a/sc/source/filter/inc/xcl97rec.hxx b/sc/source/filter/inc/xcl97rec.hxx index 649a7bd02702..ef97a60a8a8e 100644 --- a/sc/source/filter/inc/xcl97rec.hxx +++ b/sc/source/filter/inc/xcl97rec.hxx @@ -412,7 +412,7 @@ private: sal_Size nRecLen; XclExpString sName; XclExpString sComment; - static XclExpString sUsername; + XclExpString sUserName; UINT8 nProtected; inline ExcEScenarioCell* _First() { return (ExcEScenarioCell*) List::First(); } @@ -424,7 +424,7 @@ private: protected: public: - ExcEScenario( ScDocument& rDoc, SCTAB nTab ); + ExcEScenario( const XclExpRoot& rRoot, SCTAB nTab ); virtual ~ExcEScenario(); virtual UINT16 GetNum() const; @@ -450,7 +450,7 @@ private: protected: public: - ExcEScenarioManager( ScDocument& rDoc, SCTAB nTab ); + ExcEScenarioManager( const XclExpRoot& rRoot, SCTAB nTab ); virtual ~ExcEScenarioManager(); virtual void Save( XclExpStream& rStrm ); @@ -558,53 +558,14 @@ private: // ============================================================================ -class XclExpFnGroupCount : public XclExpRecord -{ -public: - explicit XclExpFnGroupCount(); - virtual ~XclExpFnGroupCount(); - -private: - virtual void WriteBody( XclExpStream& rStrm ); -}; - -// ============================================================================ - /** Beginning of User Interface Records */ -class XclExpInterfaceHdr : public XclExpRecord +class XclExpInterfaceHdr : public XclExpUInt16Record { public: - explicit XclExpInterfaceHdr(); - virtual ~XclExpInterfaceHdr(); + explicit XclExpInterfaceHdr( sal_uInt16 nCodePage ); private: - virtual void WriteBody( XclExpStream& rStrm ); -}; - -// ============================================================================ - -/** Beginning of User Interface Records */ -class XclExpInterfaceEnd : public XclExpRecord -{ -public: - explicit XclExpInterfaceEnd(); - virtual ~XclExpInterfaceEnd(); - -private: - virtual void WriteBody( XclExpStream& rStrm ); -}; - -// ============================================================================ - -/** ADDMENU/DELMENU Record Group Count */ -class XclExpMMS : public XclExpRecord -{ -public: - explicit XclExpMMS(); - virtual ~XclExpMMS(); - -private: - virtual void WriteBody( XclExpStream& rStrm ); + virtual void WriteBody( XclExpStream& rStrm ); }; // ============================================================================ @@ -623,26 +584,19 @@ private: // ============================================================================ -class XclExpCodePage : public XclExpRecord +class XclExpFileSharing : public XclExpRecord { public: - explicit XclExpCodePage(); - virtual ~XclExpCodePage(); - -private: - virtual void WriteBody( XclExpStream& rStrm ); -}; + explicit XclExpFileSharing( const XclExpRoot& rRoot, sal_uInt16 nPasswordHash ); -// ============================================================================ + virtual void Save( XclExpStream& rStrm ); -class XclExpDSF : public XclExpRecord -{ -public: - explicit XclExpDSF(); - virtual ~XclExpDSF(); +private: + virtual void WriteBody( XclExpStream& rStrm ); private: - virtual void WriteBody( XclExpStream& rStrm ); + XclExpString maUserName; + sal_uInt16 mnPasswordHash; }; // ============================================================================ @@ -671,19 +625,6 @@ private: // ============================================================================ -/** What's this record for? It is a zero-byte record. */ -class XclExpExcel9File : public XclExpRecord -{ -public: - explicit XclExpExcel9File(); - virtual ~XclExpExcel9File(); - -private: - virtual void WriteBody( XclExpStream& rStrm ); -}; - -// ============================================================================ - class XclExpRecalcId : public XclExpDummyRecord { public: diff --git a/sc/source/filter/inc/xistream.hxx b/sc/source/filter/inc/xistream.hxx index 3ee461f163fe..bbc1cc04fde5 100644 --- a/sc/source/filter/inc/xistream.hxx +++ b/sc/source/filter/inc/xistream.hxx @@ -269,6 +269,10 @@ public: CONTINUE usage is switched on. @return false = no record found (end of stream). */ bool StartNextRecord(); + /** Sets stream pointer to the start of the record content for the record + at the passed absolute stream position. + @return false = no record found (end of stream). */ + bool StartNextRecord( sal_Size nNextRecPos ); /** Sets stream pointer to begin of record content. @param bContLookup Automatic CONTINUE lookup on/off. In difference to other stream settings, this setting is persistent until next call of diff --git a/sc/source/filter/inc/xistyle.hxx b/sc/source/filter/inc/xistyle.hxx index 2fe3a6ecbc15..a67458366057 100644 --- a/sc/source/filter/inc/xistyle.hxx +++ b/sc/source/filter/inc/xistyle.hxx @@ -397,19 +397,14 @@ public: /** Reads an XF record. */ void ReadXF( XclImpStream& rStrm ); - /** Sets the style name of this XF, if it is a style XF. */ - void SetStyleName( const String& rStyleName, bool bBuiltIn, bool bForceCreate ); - /** Changes the style name of this XF, if it is a style XF. */ - void ChangeStyleName( const String& rStyleName ); - /** Returns the style name of this XF, if it is a style XF. */ - inline const String& GetStyleName() const { return maStyleName; } - inline sal_uInt8 GetHorAlign() const { return maAlignment.mnHorAlign; } inline sal_uInt8 GetVerAlign() const { return maAlignment.mnVerAlign; } inline sal_uInt16 GetFontIndex() const { return mnXclFont; } - /** Creates the Calc style sheet, if this is a user-defined style. */ - void CreateUserStyle(); + /** Creates a Calc item set containing an item set with all cell properties. + @param bSkipPoolDefs true = Do not put items equal to pool default; false = Put all items. + @return A read-only reference to the item set stored internally. */ + const ScPatternAttr& CreatePattern( bool bSkipPoolDefs = false ); /** Inserts all formatting attributes to the specified area in the Calc document. @param nForcedNumFmt If not set to NUMBERFORMAT_ENTRY_NOT_FOUND, it will overwrite @@ -434,20 +429,10 @@ private: /** Sets own "attribute used" flags, if attributes are different from passed parent XF. */ void UpdateUsedFlags( const XclImpXF& rParentXF ); - /** Creates a Calc item set containing an item set with all cell properties. - @param bSkipPoolDefs true = Do not put items equal to pool default; false = Put all items. - @return A read-only reference to the item set stored internally. */ - const ScPatternAttr& CreatePattern( bool bSkipPoolDefs = false ); - /** Creates a cell style sheet and inserts it into the Calc document. - @descr Creates a style sheet only for style XFs with a valid style name. - @return The pointer to the cell style sheet, or 0, if there is no style sheet. */ - ScStyleSheet* CreateStyleSheet(); - private: typedef ::std::auto_ptr< ScPatternAttr > ScPatternAttrPtr; ScPatternAttrPtr mpPattern; /// Calc item set. - String maStyleName; /// Name of the style sheet. ScStyleSheet* mpStyleSheet; /// Calc cell style sheet. XclImpCellProt maProtection; /// Cell protection flags. @@ -456,9 +441,42 @@ private: XclImpCellArea maArea; /// Background area style. sal_uInt16 mnXclNumFmt; /// Index to number format. sal_uInt16 mnXclFont; /// Index to font record. +}; + +// ---------------------------------------------------------------------------- - bool mbWasBuiltIn; /// true = XF was an Excel built-in style. - bool mbForceCreate; /// true = Force creation of style sheet. +/** Contains all data of a cell style associated with an XF record. */ +class XclImpStyle : protected XclImpRoot +{ +public: + explicit XclImpStyle( const XclImpRoot& rRoot ); + + /** Reads a STYLE record. */ + void ReadStyle( XclImpStream& rStrm ); + + inline const String& GetName() const { return maName; } + inline sal_uInt16 GetXfId() const { return mnXfId; } + inline bool IsBuiltin() const { return mbBuiltin && (mnBuiltinId != EXC_STYLE_USERDEF); } + inline sal_uInt8 GetBuiltinId() const { return mnBuiltinId; } + inline sal_uInt8 GetLevel() const { return mnLevel; } + + /** Creates a cell style sheet and inserts it into the Calc document. + @return The pointer to the cell style sheet, or 0, if there is no style sheet. */ + ScStyleSheet* CreateStyleSheet(); + /** Creates the Calc style sheet, if this is a user-defined style. */ + void CreateUserStyle( const String& rFinalName ); + +private: + String maName; /// Cell style name. + sal_uInt16 mnXfId; /// Formatting for this cell style. + sal_uInt8 mnBuiltinId; /// Identifier for builtin styles. + sal_uInt8 mnLevel; /// Level for builtin column/row styles. + bool mbBuiltin; /// True = builtin style. + bool mbCustom; /// True = customized builtin style. + bool mbHidden; /// True = style not visible in GUI. + + String maFinalName; /// Final name used in the Calc document. + ScStyleSheet* mpStyleSheet; /// Calc cell style sheet. }; // ---------------------------------------------------------------------------- @@ -489,6 +507,9 @@ public: /** Creates all user defined style sheets. */ void CreateUserStyles(); + /** Creates a cell style sheet of the passed XF and inserts it into the Calc document. + @return The pointer to the cell style sheet, or 0, if there is no style sheet. */ + ScStyleSheet* CreateStyleSheet( sal_uInt16 nXFIndex ); /** Inserts formatting attributes from an XF to the specified area in the Calc document. @param nForcedNumFmt If not set to NUMBERFORMAT_ENTRY_NOT_FOUND, it will overwrite @@ -499,15 +520,13 @@ public: SCTAB nScTab, const XclImpXFIndex& rXFIndex ); private: - void CalcStyleName( XclImpXF& rXF, const String& rStyleName, bool bBuiltIn ); - void CalcStyleName( XclImpXF& rXF, sal_uInt8 nStyleId, sal_uInt8 nLevel ); - void SetStyleName( XclImpXF& rXF, const String& rStyleName, bool bBuiltIn, bool bForceCreate ); - -private: - typedef ::std::map< String, XclImpXF* > XclImpStyleXFMap; + typedef ScfDelList< XclImpStyle > XclImpStyleList; + typedef ::std::map< sal_uInt16, XclImpStyle* > XclImpStyleMap; ScfDelList< XclImpXF > maXFList; /// List of contents of all XF record. - XclImpStyleXFMap maStyleXFs; /// Maps style names to style XF records. + XclImpStyleList maBuiltinStyles; /// List of built-in cell styles. + XclImpStyleList maUserStyles; /// List of user defined cell styles. + XclImpStyleMap maStylesByXf; /// Maps XF records to cell styles. }; // Buffer for XF indexes in cells ============================================= diff --git a/sc/source/filter/inc/xlconst.hxx b/sc/source/filter/inc/xlconst.hxx index eebaa76e4702..eeb3fb3982b9 100644 --- a/sc/source/filter/inc/xlconst.hxx +++ b/sc/source/filter/inc/xlconst.hxx @@ -205,6 +205,10 @@ const sal_uInt16 EXC_WSBOOL_FITTOPAGE = 0x0100; const sal_uInt16 EXC_WSBOOL_DEFAULTFLAGS = 0x04C1; +// (0x0086) WRITEPROT --------------------------------------------------------- + +const sal_uInt16 EXC_ID_WRITEPROT = 0x0086; + // (0x008C) COUNTRY ----------------------------------------------------------- const sal_uInt16 EXC_ID_COUNTRY = 0x008C; @@ -213,6 +217,10 @@ const sal_uInt16 EXC_ID_COUNTRY = 0x008C; const sal_uInt16 EXC_ID_FILTERMODE = 0x009B; +// (0x009C) FNGROUPCOUNT ------------------------------------------------------ + +const sal_uInt16 EXC_ID_FNGROUPCOUNT = 0x009C; + // (0x009D) AUTOFILTERINFO ---------------------------------------------------- const sal_uInt16 EXC_ID_AUTOFILTERINFO = 0x009D; @@ -221,15 +229,34 @@ const sal_uInt16 EXC_ID_AUTOFILTERINFO = 0x009D; const sal_uInt16 EXC_ID_AUTOFILTER = 0x009E; +// (0x00BF, 0x00C0, 0x00C1) TOOLBARHDR, TOOLBAREND, MMS ----------------------- + +const sal_uInt16 EXC_ID_TOOLBARHDR = 0x00BF; +const sal_uInt16 EXC_ID_TOOLBAREND = 0x00C0; +const sal_uInt16 EXC_ID_MMS = 0x00C1; + +// (0x00E1, 0x00E2) INTERFACEHDR, INTERFACEEND -------------------------------- + +const sal_uInt16 EXC_ID_INTERFACEHDR = 0x00E1; +const sal_uInt16 EXC_ID_INTERFACEEND = 0x00E2; + // (0x0160) USESELFS ---------------------------------------------------------- const sal_uInt16 EXC_ID_USESELFS = 0x0160; +// (0x0161) DSF --------------------------------------------------------------- + +const sal_uInt16 EXC_ID_DSF = 0x0161; + // (0x01AA,0x01AB) USERSVIEWBEGIN, USERSVIEWEND ------------------------------- const sal_uInt16 EXC_ID_USERSVIEWBEGIN = 0x01AA; const sal_uInt16 EXC_ID_USERSVIEWEND = 0x01AB; +// (0x01C0) XL9FILE -------------------------------------------------------- + +const sal_uInt16 EXC_ID_XL9FILE = 0x01C0; + // (0x8xx) Future records ----------------------------------------------------- /** Enumerates different header types of future records. */ diff --git a/sc/source/filter/inc/xlroot.hxx b/sc/source/filter/inc/xlroot.hxx index 8571dafcbc74..8b0873b25475 100644 --- a/sc/source/filter/inc/xlroot.hxx +++ b/sc/source/filter/inc/xlroot.hxx @@ -94,6 +94,7 @@ struct XclRootData ScDocument& mrDoc; /// The source or destination document. String maDocUrl; /// Document URL of imported/exported file. String maBasePath; /// Base path of imported/exported file (path of maDocUrl). + String maUserName; /// Current user name. const String maDefPassword; /// The default password used for stream encryption. rtl_TextEncoding meTextEnc; /// Text encoding to import/export byte strings. LanguageType meSysLang; /// System language. @@ -185,6 +186,8 @@ public: inline const String& GetDocUrl() const { return mrData.maDocUrl; } /** Returns the base path of the imported/exported file. */ inline const String& GetBasePath() const { return mrData.maBasePath; } + /** Returns the current user name. */ + inline const String& GetUserName() const { return mrData.maUserName; } /** Returns the default password used for stream encryption. */ inline const String& GetDefaultPassword() const { return mrData.maDefPassword; } diff --git a/sc/source/filter/inc/xlstyle.hxx b/sc/source/filter/inc/xlstyle.hxx index ebb22c2cb05f..9613abfc8725 100644 --- a/sc/source/filter/inc/xlstyle.hxx +++ b/sc/source/filter/inc/xlstyle.hxx @@ -247,6 +247,8 @@ const sal_uInt8 EXC_STYLE_NOLEVEL = 0xFF; /// Default value fo const sal_uInt16 EXC_ID_STYLEEXT = 0x0892; const sal_uInt8 EXC_STYLEEXT_BUILTIN = 0x01; +const sal_uInt8 EXC_STYLEEXT_HIDDEN = 0x02; +const sal_uInt8 EXC_STYLEEXT_CUSTOM = 0x04; // Structs and classes ======================================================== diff --git a/sc/source/filter/inc/xltools.hxx b/sc/source/filter/inc/xltools.hxx index d818fa9e0a89..392b0a2ae1fc 100644 --- a/sc/source/filter/inc/xltools.hxx +++ b/sc/source/filter/inc/xltools.hxx @@ -167,8 +167,8 @@ public: @return The corresponding text encoding or RTL_TEXTENCODING_DONTKNOW. */ static rtl_TextEncoding GetTextEncoding( sal_uInt16 nCodePage ); -//UNUSED2008-05 /** Returns an Excel code page from a text encoding. */ -//UNUSED2008-05 static sal_uInt16 GetXclCodePage( rtl_TextEncoding eTextEnc ); + /** Returns an Excel code page from a text encoding. */ + static sal_uInt16 GetXclCodePage( rtl_TextEncoding eTextEnc ); // font names ------------------------------------------------------------- @@ -194,9 +194,10 @@ public: /** Returns the specified built-in cell style name. @param nStyleId The identifier of the built-in style. + @param rName Default name for unknown styles. @param nLevel The zero-based outline level for RowLevel and ColLevel styles. @return The style name or an empty string, if the parameters are not valid. */ - static String GetBuiltInStyleName( sal_uInt8 nStyleId, sal_uInt8 nLevel ); + static String GetBuiltInStyleName( sal_uInt8 nStyleId, const String& rName, sal_uInt8 nLevel ); /** Returns the passed style name with a special built-in prefix. */ static String GetBuiltInStyleName( const String& rStyleName ); /** Returns true, if the passed string is a name of an Excel built-in style. diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx index ac71dbb01fbb..608b13c49ac3 100644 --- a/sc/source/filter/xcl97/xcl97rec.cxx +++ b/sc/source/filter/xcl97/xcl97rec.cxx @@ -65,7 +65,6 @@ #include #include -#include #include #include @@ -1033,15 +1032,14 @@ void ExcEScenarioCell::SaveXml( XclExpXmlStream& rStrm ) -XclExpString ExcEScenario::sUsername; - -ExcEScenario::ExcEScenario( ScDocument& rDoc, SCTAB nTab ) +ExcEScenario::ExcEScenario( const XclExpRoot& rRoot, SCTAB nTab ) { String sTmpName; String sTmpComm; Color aDummyCol; USHORT nFlags; + ScDocument& rDoc = rRoot.GetDoc(); rDoc.GetName( nTab, sTmpName ); sName.Assign( sTmpName, EXC_STR_8BITLENGTH ); nRecLen = 8 + sName.GetBufferSize(); @@ -1052,14 +1050,8 @@ ExcEScenario::ExcEScenario( ScDocument& rDoc, SCTAB nTab ) nRecLen += sComment.GetSize(); nProtected = (nFlags & SC_SCENARIO_PROTECT) ? 1 : 0; - if( !sUsername.Len() ) - { - SvtUserOptions aUserOpt; - sUsername.Assign( aUserOpt.GetLastName(), EXC_STR_DEFAULT, 255 ); - } - if( !sUsername.Len() ) - sUsername.Assign( String::CreateFromAscii( "SC" ) ); - nRecLen += sUsername.GetSize(); + sUserName.Assign( rRoot.GetUserName(), EXC_STR_DEFAULT, 255 ); + nRecLen += sUserName.GetSize(); const ScRangeList* pRList = rDoc.GetScenarioRanges( nTab ); if( !pRList ) @@ -1118,11 +1110,11 @@ void ExcEScenario::SaveCont( XclExpStream& rStrm ) << (UINT8) 0 // fHidden << (UINT8) sName.Len() // length of scen name << (UINT8) sComment.Len() // length of comment - << (UINT8) sUsername.Len(); // length of user name + << (UINT8) sUserName.Len(); // length of user name sName.WriteFlagField( rStrm ); sName.WriteBuffer( rStrm ); - rStrm << sUsername; + rStrm << sUserName; if( sComment.Len() ) rStrm << sComment; @@ -1154,7 +1146,7 @@ void ExcEScenario::SaveXml( XclExpXmlStream& rStrm ) XML_locked, XclXmlUtils::ToPsz( nProtected ), // OOXTODO: XML_hidden, XML_count, OString::valueOf( (sal_Int32) List::Count() ).getStr(), - XML_user, XESTRING_TO_PSZ( sUsername ), + XML_user, XESTRING_TO_PSZ( sUserName ), XML_comment, XESTRING_TO_PSZ( sComment ), FSEND ); @@ -1167,9 +1159,10 @@ void ExcEScenario::SaveXml( XclExpXmlStream& rStrm ) -ExcEScenarioManager::ExcEScenarioManager( ScDocument& rDoc, SCTAB nTab ) : +ExcEScenarioManager::ExcEScenarioManager( const XclExpRoot& rRoot, SCTAB nTab ) : nActive( 0 ) { + ScDocument& rDoc = rRoot.GetDoc(); if( rDoc.IsScenario( nTab ) ) return; @@ -1178,7 +1171,7 @@ ExcEScenarioManager::ExcEScenarioManager( ScDocument& rDoc, SCTAB nTab ) : while( rDoc.IsScenario( nNewTab ) ) { - Append( new ExcEScenario( rDoc, nNewTab ) ); + Append( new ExcEScenario( rRoot, nNewTab ) ); if( rDoc.IsActiveScenario( nNewTab ) ) nActive = static_cast(nNewTab - nFirstTab); @@ -1453,67 +1446,15 @@ void XclExpFilePass::WriteBody( XclExpStream& rStrm ) // ============================================================================ -XclExpFnGroupCount::XclExpFnGroupCount() : - XclExpRecord(0x009C, 2) -{ -} - -XclExpFnGroupCount::~XclExpFnGroupCount() -{ -} - -void XclExpFnGroupCount::WriteBody( XclExpStream& rStrm ) -{ - rStrm << static_cast(14); -} - -// ============================================================================ - -XclExpInterfaceHdr::XclExpInterfaceHdr() : - XclExpRecord(0x00E1, 2) -{ -} - -XclExpInterfaceHdr::~XclExpInterfaceHdr() +XclExpInterfaceHdr::XclExpInterfaceHdr( sal_uInt16 nCodePage ) : + XclExpUInt16Record( EXC_ID_INTERFACEHDR, nCodePage ) { } void XclExpInterfaceHdr::WriteBody( XclExpStream& rStrm ) { - // The value must be the same value as the CODEPAGE record. rStrm.DisableEncryption(); - rStrm << static_cast(0x04B0); -} - -// ============================================================================ - -XclExpInterfaceEnd::XclExpInterfaceEnd() : - XclExpRecord(0x00E2, 0) -{ -} - -XclExpInterfaceEnd::~XclExpInterfaceEnd() -{ -} - -void XclExpInterfaceEnd::WriteBody( XclExpStream& /*rStrm*/ ) -{ -} - -// ============================================================================ - -XclExpMMS::XclExpMMS() : - XclExpRecord(0x00C1, 2) -{ -} - -XclExpMMS::~XclExpMMS() -{ -} - -void XclExpMMS::WriteBody( XclExpStream& rStrm ) -{ - rStrm << static_cast(0x0000); + rStrm << GetValue(); } // ============================================================================ @@ -1552,35 +1493,25 @@ void XclExpWriteAccess::WriteBody( XclExpStream& rStrm ) // ============================================================================ -XclExpCodePage::XclExpCodePage() : - XclExpRecord(0x0042, 2) -{ -} - -XclExpCodePage::~XclExpCodePage() -{ -} - -void XclExpCodePage::WriteBody( XclExpStream& rStrm ) -{ - // 0x04B0 : UTF-16 (BIFF8) - rStrm << static_cast(0x04B0); -} - -// ============================================================================ - -XclExpDSF::XclExpDSF() : - XclExpRecord(0x0161, 2) +XclExpFileSharing::XclExpFileSharing( const XclExpRoot& rRoot, sal_uInt16 nPasswordHash ) : + XclExpRecord( EXC_ID_FILESHARING ), + mnPasswordHash( nPasswordHash ) { + if( rRoot.GetBiff() <= EXC_BIFF5 ) + maUserName.AssignByte( rRoot.GetUserName(), rRoot.GetTextEncoding(), EXC_STR_8BITLENGTH ); + else + maUserName.Assign( rRoot.GetUserName() ); } -XclExpDSF::~XclExpDSF() +void XclExpFileSharing::Save( XclExpStream& rStrm ) { + if( mnPasswordHash != 0 ) + XclExpRecord::Save( rStrm ); } -void XclExpDSF::WriteBody( XclExpStream& rStrm ) +void XclExpFileSharing::WriteBody( XclExpStream& rStrm ) { - rStrm << static_cast(0x0000); + rStrm << sal_uInt16( 0 ) << mnPasswordHash << maUserName; } // ============================================================================ @@ -1617,21 +1548,6 @@ void XclExpProt4RevPass::WriteBody( XclExpStream& rStrm ) // ============================================================================ -XclExpExcel9File::XclExpExcel9File() : - XclExpRecord(0x01C0, 0) -{ -} - -XclExpExcel9File::~XclExpExcel9File() -{ -} - -void XclExpExcel9File::WriteBody( XclExpStream& /*rStrm*/ ) -{ -} - -// ============================================================================ - static const sal_uInt8 nDataRecalcId[] = { 0xC1, 0x01, 0x00, 0x00, 0x54, 0x8D, 0x01, 0x00 }; diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index bdf5317da1bc..07ed8709ab01 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -542,6 +542,14 @@ void Chart2Positioner::glueState() meGlue = GLUETYPE_COLS; return; } + // #i103540# prevent invalid vector size + if ((nC <= 0) || (nR <= 0)) + { + invalidateGlue(); + mnStartCol = 0; + mnStartRow = 0; + return; + } sal_uInt32 nCR = static_cast(nC*nR); const sal_uInt8 nHole = 0; diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index cd63adc33989..3e2295d73471 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -221,7 +221,8 @@ ScModelObj::ScModelObj( ScDocShell* pDocSh ) : aPropSet( lcl_GetDocOptPropertyMap() ), pDocShell( pDocSh ), pPrintFuncCache( NULL ), - maChangesListeners( m_aMutex ) + maChangesListeners( m_aMutex ), + mnXlsWriteProtPass( 0 ) { // pDocShell may be NULL if this is the base of a ScDocOptionsObj if ( pDocShell ) @@ -1448,6 +1449,14 @@ void SAL_CALL ScModelObj::setPropertyValue( if ( aObjName.getLength() ) pDoc->RestoreChartListener( aObjName ); } + else if ( aString.EqualsAscii( "WriteProtectionPassword" ) ) + { + /* This is a hack for #160550# to preserve the write-protection + password in an XLS roundtrip. This property MUST NOT be used + for any other purpose. This property will be deleted when the + feature "Write Protection With Password" will be implemented. */ + aValue >>= mnXlsWriteProtPass; + } if ( aNewOpt != rOldOpt ) { @@ -1610,6 +1619,14 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const rtl::OUString& aPropertyNa { ScUnoHelpFunctions::SetBoolInAny( aRet, (pDocShell->GetCreateMode() == SFX_CREATE_MODE_INTERNAL) ); } + else if ( aString.EqualsAscii( "WriteProtectionPassword" ) ) + { + /* This is a hack for #160550# to preserve the write-protection + password in an XLS roundtrip. This property MUST NOT be used + for any other purpose. This property will be deleted when the + feature "Write Protection With Password" will be implemented. */ + aRet <<= mnXlsWriteProtPass; + } } return aRet; -- cgit v1.2.3 From a293d0a7b13c0294a202e0e332961f85359d611d Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Fri, 16 Oct 2009 00:05:16 +0200 Subject: #i103496#: split svtools; improve ConfitItems --- chart2/inc/pch/precompiled_chart2.hxx | 20 +- .../controller/accessibility/AccessibleBase.cxx | 2 +- chart2/source/controller/dialogs/Bitmaps.hrc | 2 +- chart2/source/controller/dialogs/Bitmaps_HC.hrc | 4 +- chart2/source/controller/dialogs/DataBrowser.cxx | 4 +- .../controller/dialogs/ObjectNameProvider.cxx | 2 +- .../controller/dialogs/TextDirectionListBox.cxx | 2 +- .../source/controller/dialogs/dlg_DataEditor.cxx | 2 +- .../controller/dialogs/dlg_InsertAxis_Grid.cxx | 2 +- .../source/controller/dialogs/dlg_InsertLegend.cxx | 2 +- .../source/controller/dialogs/dlg_NumberFormat.cxx | 4 +- .../controller/dialogs/dlg_ObjectProperties.cxx | 8 +- chart2/source/controller/dialogs/res_DataLabel.cxx | 10 +- chart2/source/controller/dialogs/res_DataLabel.hxx | 2 +- chart2/source/controller/dialogs/res_ErrorBar.cxx | 2 +- .../controller/dialogs/res_LegendPosition.cxx | 2 +- .../controller/dialogs/res_LegendPosition.hxx | 2 +- chart2/source/controller/dialogs/res_Trendline.hxx | 2 +- chart2/source/controller/dialogs/tp_AxisLabel.cxx | 2 +- .../source/controller/dialogs/tp_AxisPositions.cxx | 6 +- .../source/controller/dialogs/tp_PointGeometry.cxx | 2 +- .../source/controller/dialogs/tp_PolarOptions.cxx | 4 +- chart2/source/controller/dialogs/tp_Scale.cxx | 6 +- .../source/controller/dialogs/tp_SeriesToAxis.cxx | 6 +- .../source/controller/dialogs/tp_TitleRotation.cxx | 2 +- .../drawinglayer/ViewElementListProvider.cxx | 2 +- chart2/source/controller/inc/HelpIds.hrc | 2 +- chart2/source/controller/inc/ItemConverter.hxx | 4 +- chart2/source/controller/inc/dlg_DataEditor.hxx | 2 +- .../source/controller/inc/dlg_InsertDataLabel.hxx | 2 +- .../source/controller/inc/dlg_InsertErrorBars.hxx | 2 +- .../source/controller/inc/dlg_InsertTrendline.hxx | 2 +- chart2/source/controller/inc/res_ErrorBar.hxx | 2 +- .../itemsetwrapper/AxisItemConverter.cxx | 4 +- .../CharacterPropertyItemConverter.cxx | 2 +- .../itemsetwrapper/DataPointItemConverter.cxx | 8 +- .../itemsetwrapper/ErrorBarItemConverter.cxx | 4 +- .../GraphicPropertyItemConverter.cxx | 4 +- .../controller/itemsetwrapper/ItemConverter.cxx | 6 +- .../RegressionCurveItemConverter.cxx | 2 +- .../RegressionEquationItemConverter.cxx | 2 +- .../itemsetwrapper/SeriesOptionsItemConverter.cxx | 8 +- .../itemsetwrapper/StatisticsItemConverter.cxx | 4 +- .../itemsetwrapper/TitleItemConverter.cxx | 2 +- .../controller/main/ChartController_Position.cxx | 2 +- .../controller/main/ChartController_TextEdit.cxx | 2 +- .../source/controller/main/ConfigurationAccess.cxx | 7 +- chart2/source/inc/Strings.hrc | 2 +- .../inc/chartview/NumberFormatterWrapper.hxx | 2 +- chart2/source/model/main/ChartModel.cxx | 2 +- chart2/source/model/main/ImplChartModel.cxx | 4 +- chart2/source/tools/ConfigColorScheme.cxx | 4 + chart2/source/tools/ImplUndoManager.cxx | 4 + chart2/source/tools/ImplUndoManager.hxx | 1 + chart2/source/view/main/ChartItemPool.cxx | 8 +- chart2/source/view/main/ChartItemPool.hxx | 4 +- chart2/source/view/main/ChartView.cxx | 2 +- chart2/source/view/main/ChartView.hxx | 2 +- chart2/source/view/main/DrawModelWrapper.cxx | 4 +- chart2/source/view/main/NumberFormatterWrapper.cxx | 4 +- chart2/source/view/main/VLegend.cxx | 2 +- sc/inc/addruno.hxx | 2 +- sc/inc/afmtuno.hxx | 4 +- sc/inc/appluno.hxx | 2 +- sc/inc/attrib.hxx | 6 +- sc/inc/autoform.hxx | 2 +- sc/inc/brdcst.hxx | 4 +- sc/inc/cell.hxx | 2 +- sc/inc/cellsuno.hxx | 6 +- sc/inc/chart2uno.hxx | 4 +- sc/inc/chartlis.hxx | 2 +- sc/inc/chartuno.hxx | 2 +- sc/inc/chgtrack.hxx | 2 +- sc/inc/conditio.hxx | 2 +- sc/inc/confuno.hxx | 4 +- sc/inc/dapiuno.hxx | 4 +- sc/inc/datauno.hxx | 4 +- sc/inc/defltuno.hxx | 4 +- sc/inc/detdata.hxx | 2 +- sc/inc/dispuno.hxx | 4 +- sc/inc/docoptio.hxx | 4 +- sc/inc/docpool.hxx | 2 +- sc/inc/document.hxx | 2 +- sc/inc/docuno.hxx | 4 +- sc/inc/dptabres.hxx | 2 +- sc/inc/drawattr.hxx | 2 +- sc/inc/drdefuno.hxx | 2 +- sc/inc/editsrc.hxx | 2 +- sc/inc/externalrefmgr.hxx | 2 +- sc/inc/fielduno.hxx | 4 +- sc/inc/fmtuno.hxx | 2 +- sc/inc/forbiuno.hxx | 2 +- sc/inc/funcuno.hxx | 2 +- sc/inc/hints.hxx | 2 +- sc/inc/linkuno.hxx | 4 +- sc/inc/lookupcache.hxx | 2 +- sc/inc/nameuno.hxx | 2 +- sc/inc/notesuno.hxx | 2 +- sc/inc/patattr.hxx | 4 +- sc/inc/pch/precompiled_sc.hxx | 14 +- sc/inc/printopt.hxx | 3 +- sc/inc/scmod.hxx | 7 +- sc/inc/srchuno.hxx | 2 +- sc/inc/stlpool.hxx | 2 +- sc/inc/stlsheet.hxx | 2 +- sc/inc/styleuno.hxx | 4 +- sc/inc/targuno.hxx | 2 +- sc/inc/textuno.hxx | 4 +- sc/inc/tokenuno.hxx | 2 +- sc/inc/unoreflist.hxx | 2 +- sc/inc/viewuno.hxx | 4 +- sc/source/core/data/attarray.cxx | 2 +- sc/source/core/data/bcaslot.cxx | 4 +- sc/source/core/data/cell.cxx | 6 +- sc/source/core/data/column.cxx | 4 +- sc/source/core/data/column2.cxx | 6 +- sc/source/core/data/column3.cxx | 4 +- sc/source/core/data/conditio.cxx | 4 +- sc/source/core/data/dbdocutl.cxx | 2 +- sc/source/core/data/dociter.cxx | 2 +- sc/source/core/data/docpool.cxx | 4 +- sc/source/core/data/documen2.cxx | 6 +- sc/source/core/data/documen3.cxx | 4 +- sc/source/core/data/documen4.cxx | 4 +- sc/source/core/data/documen8.cxx | 58 +++--- sc/source/core/data/document.cxx | 4 +- sc/source/core/data/dpdimsave.cxx | 2 +- sc/source/core/data/dpgroup.cxx | 2 +- sc/source/core/data/dpobject.cxx | 2 +- sc/source/core/data/dpsdbtab.cxx | 2 +- sc/source/core/data/dpshttab.cxx | 2 +- sc/source/core/data/dptabsrc.cxx | 4 +- sc/source/core/data/drwlayer.cxx | 2 +- sc/source/core/data/global.cxx | 8 +- sc/source/core/data/global2.cxx | 2 +- sc/source/core/data/patattr.cxx | 4 +- sc/source/core/data/poolhelp.cxx | 2 +- sc/source/core/data/stlpool.cxx | 4 +- sc/source/core/data/stlsheet.cxx | 6 +- sc/source/core/data/table2.cxx | 4 +- sc/source/core/data/table3.cxx | 2 +- sc/source/core/data/table4.cxx | 2 +- sc/source/core/data/tabprotection.cxx | 2 +- sc/source/core/data/validat.cxx | 2 +- sc/source/core/inc/adiasync.hxx | 4 +- sc/source/core/inc/bcaslot.hxx | 4 +- sc/source/core/inc/core_pch.hxx | 44 ++--- sc/source/core/inc/ddelink.hxx | 2 +- sc/source/core/tool/autoform.cxx | 2 +- sc/source/core/tool/cellform.cxx | 4 +- sc/source/core/tool/chartarr.cxx | 4 +- sc/source/core/tool/chgtrack.cxx | 10 +- sc/source/core/tool/compiler.cxx | 2 +- sc/source/core/tool/ddelink.cxx | 2 +- sc/source/core/tool/detfunc.cxx | 2 +- sc/source/core/tool/docoptio.cxx | 2 +- sc/source/core/tool/editutil.cxx | 6 +- sc/source/core/tool/interpr1.cxx | 4 +- sc/source/core/tool/interpr2.cxx | 4 +- sc/source/core/tool/interpr4.cxx | 2 +- sc/source/core/tool/interpr5.cxx | 2 +- sc/source/core/tool/optutil.cxx | 2 +- sc/source/core/tool/printopt.cxx | 1 + sc/source/core/tool/progress.cxx | 4 +- sc/source/core/tool/rangeseq.cxx | 2 +- sc/source/core/tool/scmatrix.cxx | 2 +- sc/source/core/tool/zforauto.cxx | 4 +- sc/source/filter/dif/difimp.cxx | 2 +- sc/source/filter/excel/excdoc.cxx | 4 +- sc/source/filter/excel/excel.cxx | 2 +- sc/source/filter/excel/excrecds.cxx | 8 +- sc/source/filter/excel/impop.cxx | 2 +- sc/source/filter/excel/xecontent.cxx | 2 +- sc/source/filter/excel/xehelper.cxx | 4 +- sc/source/filter/excel/xelink.cxx | 2 +- sc/source/filter/excel/xepage.cxx | 6 +- sc/source/filter/excel/xepivot.cxx | 2 +- sc/source/filter/excel/xeroot.cxx | 6 +- sc/source/filter/excel/xestyle.cxx | 4 +- sc/source/filter/excel/xetable.cxx | 2 +- sc/source/filter/excel/xicontent.cxx | 6 +- sc/source/filter/excel/xihelper.cxx | 2 +- sc/source/filter/excel/xipage.cxx | 6 +- sc/source/filter/excel/xipivot.cxx | 4 +- sc/source/filter/excel/xlchart.cxx | 2 +- sc/source/filter/excel/xlroot.cxx | 4 +- sc/source/filter/ftools/fapihelper.cxx | 4 +- sc/source/filter/ftools/ftools.cxx | 6 +- sc/source/filter/html/htmlexp.cxx | 10 +- sc/source/filter/html/htmlexp2.cxx | 2 +- sc/source/filter/html/htmlpars.cxx | 2 +- sc/source/filter/inc/eeparser.hxx | 2 +- sc/source/filter/inc/excrecds.hxx | 2 +- sc/source/filter/inc/filt_pch.hxx | 32 ++-- sc/source/filter/inc/xestyle.hxx | 4 +- sc/source/filter/inc/xichart.hxx | 2 +- sc/source/filter/inc/xlstyle.hxx | 2 +- sc/source/filter/lotus/tool.cxx | 2 +- sc/source/filter/rtf/eeimpars.cxx | 4 +- sc/source/filter/rtf/rtfexp.cxx | 2 +- sc/source/filter/starcalc/scflt.cxx | 4 +- sc/source/filter/xcl97/XclImpChangeTrack.cxx | 2 +- sc/source/filter/xcl97/xcl97rec.cxx | 4 +- .../filter/xml/XMLChangeTrackingExportHelper.cxx | 2 +- .../filter/xml/XMLChangeTrackingImportHelper.cxx | 2 +- sc/source/filter/xml/XMLTrackedChangesContext.cxx | 2 +- sc/source/filter/xml/xmlcelli.cxx | 4 +- sc/source/filter/xml/xmlexprt.cxx | 2 +- sc/source/filter/xml/xmlimprt.cxx | 8 +- sc/source/filter/xml/xmlwrap.cxx | 4 +- .../ui/Accessibility/AccessibleContextBase.cxx | 2 +- .../ui/Accessibility/AccessiblePageHeader.cxx | 6 +- .../Accessibility/AccessiblePreviewHeaderCell.cxx | 2 +- .../ui/Accessibility/AccessiblePreviewTable.cxx | 2 +- sc/source/ui/app/drwtrans.cxx | 4 +- sc/source/ui/app/inputhdl.cxx | 2 +- sc/source/ui/app/inputwin.cxx | 2 +- sc/source/ui/app/lnktrans.cxx | 2 +- sc/source/ui/app/scmod.cxx | 209 +++++++++++---------- sc/source/ui/app/transobj.cxx | 4 +- sc/source/ui/app/typemap.cxx | 12 +- sc/source/ui/attrdlg/attrdlg.cxx | 2 +- sc/source/ui/attrdlg/condfrmt.cxx | 2 +- sc/source/ui/cctrl/tbinsert.cxx | 2 +- sc/source/ui/cctrl/tbzoomsliderctrl.cxx | 2 +- sc/source/ui/dbgui/csvgrid.cxx | 18 +- sc/source/ui/dbgui/pfiltdlg.cxx | 2 +- sc/source/ui/dbgui/validate.cxx | 8 +- sc/source/ui/docshell/arealink.cxx | 2 +- sc/source/ui/docshell/docfunc.cxx | 4 +- sc/source/ui/docshell/docsh.cxx | 6 +- sc/source/ui/docshell/docsh2.cxx | 2 +- sc/source/ui/docshell/docsh3.cxx | 6 +- sc/source/ui/docshell/docsh4.cxx | 8 +- sc/source/ui/docshell/docsh5.cxx | 2 +- sc/source/ui/docshell/docsh8.cxx | 4 +- sc/source/ui/docshell/externalrefmgr.cxx | 12 +- sc/source/ui/docshell/impex.cxx | 4 +- sc/source/ui/docshell/tablink.cxx | 4 +- sc/source/ui/drawfunc/chartsh.cxx | 2 +- sc/source/ui/drawfunc/drawsh.cxx | 4 +- sc/source/ui/drawfunc/drawsh2.cxx | 4 +- sc/source/ui/drawfunc/drformsh.cxx | 2 +- sc/source/ui/drawfunc/drtxtob.cxx | 4 +- sc/source/ui/drawfunc/drtxtob2.cxx | 2 +- sc/source/ui/drawfunc/fuconcustomshape.cxx | 2 +- sc/source/ui/drawfunc/fuins1.cxx | 2 +- sc/source/ui/drawfunc/fuins2.cxx | 6 +- sc/source/ui/drawfunc/futext.cxx | 2 +- sc/source/ui/drawfunc/graphsh.cxx | 2 +- sc/source/ui/drawfunc/mediash.cxx | 2 +- sc/source/ui/drawfunc/oleobjsh.cxx | 2 +- sc/source/ui/formdlg/formula.cxx | 4 +- sc/source/ui/inc/AccessibilityHints.hxx | 4 +- sc/source/ui/inc/AccessibleContextBase.hxx | 2 +- sc/source/ui/inc/DrawModelBroadcaster.hxx | 2 +- sc/source/ui/inc/acredlin.hxx | 2 +- sc/source/ui/inc/csvgrid.hxx | 9 +- sc/source/ui/inc/dwfunctr.hxx | 2 +- sc/source/ui/inc/formula.hxx | 2 +- sc/source/ui/inc/funcpage.hxx | 2 +- sc/source/ui/inc/inputwin.hxx | 2 +- sc/source/ui/inc/msgpool.hxx | 6 +- sc/source/ui/inc/navipi.hxx | 4 +- sc/source/ui/inc/parawin.hxx | 2 +- sc/source/ui/inc/servobj.hxx | 4 +- sc/source/ui/inc/target.hxx | 2 +- sc/source/ui/inc/tbzoomsliderctrl.hxx | 2 +- sc/source/ui/inc/ui_pch.hxx | 48 ++--- sc/source/ui/inc/uiitems.hxx | 2 +- sc/source/ui/inc/undobase.hxx | 2 +- sc/source/ui/inc/undodraw.hxx | 2 +- sc/source/ui/inc/undotab.hxx | 4 +- sc/source/ui/inc/viewfunc.hxx | 4 +- sc/source/ui/miscdlgs/acredlin.cxx | 2 +- sc/source/ui/miscdlgs/autofmt.cxx | 2 +- sc/source/ui/miscdlgs/filldlg.cxx | 2 +- sc/source/ui/miscdlgs/optsolver.cxx | 2 +- sc/source/ui/miscdlgs/scuiautofmt.cxx | 2 +- sc/source/ui/miscdlgs/sharedocdlg.cxx | 2 +- sc/source/ui/miscdlgs/solvrdlg.cxx | 2 +- sc/source/ui/miscdlgs/textdlgs.cxx | 4 +- sc/source/ui/navipi/content.cxx | 2 +- sc/source/ui/navipi/navcitem.cxx | 4 +- sc/source/ui/navipi/navipi.cxx | 4 +- sc/source/ui/navipi/scenwnd.cxx | 4 +- sc/source/ui/optdlg/tpprint.cxx | 2 +- sc/source/ui/pagedlg/areasdlg.cxx | 2 +- sc/source/ui/pagedlg/hfedtdlg.cxx | 2 +- sc/source/ui/pagedlg/scuitphfedit.cxx | 2 +- sc/source/ui/pagedlg/tphf.cxx | 2 +- sc/source/ui/styleui/scstyles.src | 2 +- sc/source/ui/styleui/styledlg.cxx | 8 +- sc/source/ui/undo/undocell.cxx | 2 +- sc/source/ui/undo/undostyl.cxx | 2 +- sc/source/ui/undo/undotab.cxx | 2 +- sc/source/ui/unoobj/addruno.cxx | 2 +- sc/source/ui/unoobj/afmtuno.cxx | 2 +- sc/source/ui/unoobj/cellsuno.cxx | 4 +- sc/source/ui/unoobj/cursuno.cxx | 4 +- sc/source/ui/unoobj/dapiuno.cxx | 2 +- sc/source/ui/unoobj/datauno.cxx | 4 +- sc/source/ui/unoobj/defltuno.cxx | 4 +- sc/source/ui/unoobj/dispuno.cxx | 2 +- sc/source/ui/unoobj/docuno.cxx | 4 +- sc/source/ui/unoobj/fielduno.cxx | 2 +- sc/source/ui/unoobj/funcuno.cxx | 2 +- sc/source/ui/unoobj/linkuno.cxx | 2 +- sc/source/ui/unoobj/nameuno.cxx | 2 +- sc/source/ui/unoobj/notesuno.cxx | 2 +- sc/source/ui/unoobj/optuno.cxx | 2 +- sc/source/ui/unoobj/scdetect.cxx | 6 +- sc/source/ui/unoobj/styleuno.cxx | 8 +- sc/source/ui/unoobj/targuno.cxx | 4 +- sc/source/ui/unoobj/tokenuno.cxx | 2 +- sc/source/ui/unoobj/warnpassword.cxx | 2 +- sc/source/ui/vba/vbafont.cxx | 2 +- sc/source/ui/vba/vbahelper.cxx | 2 +- sc/source/ui/vba/vbaworksheets.cxx | 4 +- sc/source/ui/view/cellsh.cxx | 6 +- sc/source/ui/view/cellsh1.cxx | 8 +- sc/source/ui/view/cellsh2.cxx | 10 +- sc/source/ui/view/cellsh3.cxx | 2 +- sc/source/ui/view/dbfunc3.cxx | 2 +- sc/source/ui/view/editsh.cxx | 4 +- sc/source/ui/view/formatsh.cxx | 8 +- sc/source/ui/view/gridwin.cxx | 4 +- sc/source/ui/view/gridwin3.cxx | 2 +- sc/source/ui/view/notemark.cxx | 2 +- sc/source/ui/view/output2.cxx | 4 +- sc/source/ui/view/pgbrksh.cxx | 2 +- sc/source/ui/view/pivotsh.cxx | 2 +- sc/source/ui/view/preview.cxx | 2 +- sc/source/ui/view/prevwsh.cxx | 4 +- sc/source/ui/view/prevwsh2.cxx | 2 +- sc/source/ui/view/tabvwsh2.cxx | 8 +- sc/source/ui/view/tabvwsh3.cxx | 8 +- sc/source/ui/view/tabvwsh4.cxx | 2 +- sc/source/ui/view/tabvwsh5.cxx | 4 +- sc/source/ui/view/tabvwsh9.cxx | 2 +- sc/source/ui/view/tabvwsha.cxx | 8 +- sc/source/ui/view/tabvwshb.cxx | 4 +- sc/source/ui/view/tabvwshe.cxx | 2 +- sc/source/ui/view/tabvwshf.cxx | 6 +- sc/source/ui/view/tabvwshh.cxx | 2 +- sc/source/ui/view/viewfun2.cxx | 6 +- sc/source/ui/view/viewfun3.cxx | 6 +- sc/source/ui/view/viewfun4.cxx | 4 +- sc/source/ui/view/viewfun5.cxx | 4 +- sc/source/ui/view/viewfunc.cxx | 4 +- sc/source/ui/view/viewutil.cxx | 12 +- sc/workben/addin.cxx | 2 +- sc/workben/result.hxx | 2 +- 353 files changed, 806 insertions(+), 801 deletions(-) diff --git a/chart2/inc/pch/precompiled_chart2.hxx b/chart2/inc/pch/precompiled_chart2.hxx index ca7ab50f7ad7..53b88ebc28ad 100644 --- a/chart2/inc/pch/precompiled_chart2.hxx +++ b/chart2/inc/pch/precompiled_chart2.hxx @@ -213,17 +213,17 @@ #include "sot/clsids.hxx" -#include "svtools/eitem.hxx" -#include "svtools/intitem.hxx" -#include "svtools/itemiter.hxx" -#include "svtools/itempool.hxx" -#include "svtools/itemset.hxx" +#include "svl/eitem.hxx" +#include "svl/intitem.hxx" +#include "svl/itemiter.hxx" +#include "svl/itempool.hxx" +#include "svl/itemset.hxx" #include "unotools/pathoptions.hxx" -#include "svtools/poolitem.hxx" -#include "svtools/stritem.hxx" -#include "svtools/syslocale.hxx" -#include "svtools/urihelper.hxx" -#include "svtools/whiter.hxx" +#include "svl/poolitem.hxx" +#include "svl/stritem.hxx" +#include "unotools/syslocale.hxx" +#include "svl/urihelper.hxx" +#include "svl/whiter.hxx" #include "svx/brshitem.hxx" #include "svx/crsditem.hxx" diff --git a/chart2/source/controller/accessibility/AccessibleBase.cxx b/chart2/source/controller/accessibility/AccessibleBase.cxx index df3cab9e39b4..81b85cfacf34 100644 --- a/chart2/source/controller/accessibility/AccessibleBase.cxx +++ b/chart2/source/controller/accessibility/AccessibleBase.cxx @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/chart2/source/controller/dialogs/Bitmaps.hrc b/chart2/source/controller/dialogs/Bitmaps.hrc index 8823b582a28e..d3aa3ebbff2f 100644 --- a/chart2/source/controller/dialogs/Bitmaps.hrc +++ b/chart2/source/controller/dialogs/Bitmaps.hrc @@ -31,7 +31,7 @@ #define CHART_BITMAPS_HRC #ifndef _SOLAR_HRC -#include +#include #endif #ifndef STD_MASKCOLOR diff --git a/chart2/source/controller/dialogs/Bitmaps_HC.hrc b/chart2/source/controller/dialogs/Bitmaps_HC.hrc index 8dd4acaffd15..71a181b92559 100644 --- a/chart2/source/controller/dialogs/Bitmaps_HC.hrc +++ b/chart2/source/controller/dialogs/Bitmaps_HC.hrc @@ -28,10 +28,10 @@ * ************************************************************************/ #ifndef _SOLAR_HRC -#include +#include #endif -// RID_SCH_START is 30512 (see svtools/solar.hrc) +// RID_SCH_START is 30512 (see svl/solar.hrc) // next free: 100 diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx index 56ef98b159ba..d83159862705 100644 --- a/chart2/source/controller/dialogs/DataBrowser.cxx +++ b/chart2/source/controller/dialogs/DataBrowser.cxx @@ -36,10 +36,10 @@ #ifndef _ZFORLIST_DECLARE_TABLE #define _ZFORLIST_DECLARE_TABLE #endif -#include +#include #endif // header for SvNumberFormatter -#include +#include #include "DataBrowser.hxx" #include "DataBrowserModel.hxx" diff --git a/chart2/source/controller/dialogs/ObjectNameProvider.cxx b/chart2/source/controller/dialogs/ObjectNameProvider.cxx index 24b717adba7f..fbbbca7fd826 100644 --- a/chart2/source/controller/dialogs/ObjectNameProvider.cxx +++ b/chart2/source/controller/dialogs/ObjectNameProvider.cxx @@ -49,7 +49,7 @@ #include #include -// #include +// #include #include #include diff --git a/chart2/source/controller/dialogs/TextDirectionListBox.cxx b/chart2/source/controller/dialogs/TextDirectionListBox.cxx index d1365b908eac..f049f77ee312 100644 --- a/chart2/source/controller/dialogs/TextDirectionListBox.cxx +++ b/chart2/source/controller/dialogs/TextDirectionListBox.cxx @@ -34,7 +34,7 @@ #include "TextDirectionListBox.hxx" #include "ResId.hxx" #include "Strings.hrc" -#include +#include #include namespace chart diff --git a/chart2/source/controller/dialogs/dlg_DataEditor.cxx b/chart2/source/controller/dialogs/dlg_DataEditor.cxx index edc431c2c763..05a38b87e382 100644 --- a/chart2/source/controller/dialogs/dlg_DataEditor.cxx +++ b/chart2/source/controller/dialogs/dlg_DataEditor.cxx @@ -46,7 +46,7 @@ #include // for SfxBoolItem -#include +#include #include diff --git a/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx b/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx index 99b88b956c88..859465e3fd0d 100644 --- a/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx +++ b/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx @@ -41,7 +41,7 @@ #include "ObjectNameProvider.hxx" // header for class SfxBoolItem -#include +#include //............................................................................. namespace chart diff --git a/chart2/source/controller/dialogs/dlg_InsertLegend.cxx b/chart2/source/controller/dialogs/dlg_InsertLegend.cxx index 9ffaa2b28490..036ad921679d 100644 --- a/chart2/source/controller/dialogs/dlg_InsertLegend.cxx +++ b/chart2/source/controller/dialogs/dlg_InsertLegend.cxx @@ -41,7 +41,7 @@ // header for enum SvxChartLegendPos #include // header for class SfxItemPool -#include +#include //............................................................................. namespace chart diff --git a/chart2/source/controller/dialogs/dlg_NumberFormat.cxx b/chart2/source/controller/dialogs/dlg_NumberFormat.cxx index c8684bdaecbc..184214d3c5b0 100644 --- a/chart2/source/controller/dialogs/dlg_NumberFormat.cxx +++ b/chart2/source/controller/dialogs/dlg_NumberFormat.cxx @@ -34,7 +34,7 @@ #include "dlg_NumberFormat.hxx" // header for class SfxItemSet -#include +#include // header for class SvxNumberInfoItem #define ITEMID_NUMBERINFO SID_ATTR_NUMBERFORMAT_INFO @@ -45,7 +45,7 @@ #include // header for SvNumberFormatter -#include +#include //............................................................................. namespace chart diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx index 097c6c1d0107..ec8a0eaaa784 100644 --- a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx +++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx @@ -34,7 +34,7 @@ #ifndef _ZFORLIST_DECLARE_TABLE #define _ZFORLIST_DECLARE_TABLE #endif -#include +#include #endif #include "dlg_ObjectProperties.hxx" @@ -66,8 +66,8 @@ #include #include #include -#include -#include +#include +#include #include @@ -82,7 +82,7 @@ #include #include -#include +#include //............................................................................. namespace chart diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx b/chart2/source/controller/dialogs/res_DataLabel.cxx index c6129629a51a..44fd27f7d09a 100644 --- a/chart2/source/controller/dialogs/res_DataLabel.cxx +++ b/chart2/source/controller/dialogs/res_DataLabel.cxx @@ -42,13 +42,13 @@ // header for class SvxNumberInfoItem #include -#include +#include // for SfxUInt32Item -#include +#include // header for class SfxStringItem -#include +#include //SfxIntegerListItem -#include +#include #include #include @@ -56,7 +56,7 @@ #include #include // header for SvNumberFormatter -#include +#include #include diff --git a/chart2/source/controller/dialogs/res_DataLabel.hxx b/chart2/source/controller/dialogs/res_DataLabel.hxx index e560eed9f573..9d887f7fbc33 100644 --- a/chart2/source/controller/dialogs/res_DataLabel.hxx +++ b/chart2/source/controller/dialogs/res_DataLabel.hxx @@ -34,7 +34,7 @@ // header for class CheckBox #include // header for class SfxItemSet -#include +#include #include "TextDirectionListBox.hxx" #include diff --git a/chart2/source/controller/dialogs/res_ErrorBar.cxx b/chart2/source/controller/dialogs/res_ErrorBar.cxx index 48bf877ae2b2..4b22b5352afe 100644 --- a/chart2/source/controller/dialogs/res_ErrorBar.cxx +++ b/chart2/source/controller/dialogs/res_ErrorBar.cxx @@ -43,7 +43,7 @@ #include #include -#include +#include using namespace ::com::sun::star; diff --git a/chart2/source/controller/dialogs/res_LegendPosition.cxx b/chart2/source/controller/dialogs/res_LegendPosition.cxx index 45623ebad3c5..4bbe7344c78d 100644 --- a/chart2/source/controller/dialogs/res_LegendPosition.cxx +++ b/chart2/source/controller/dialogs/res_LegendPosition.cxx @@ -50,7 +50,7 @@ #include "chartview/ChartSfxItemIds.hxx" #include // header for class SfxItemPool -#include +#include //............................................................................. namespace chart diff --git a/chart2/source/controller/dialogs/res_LegendPosition.hxx b/chart2/source/controller/dialogs/res_LegendPosition.hxx index 571a0dfc33ff..81d30eb7b294 100644 --- a/chart2/source/controller/dialogs/res_LegendPosition.hxx +++ b/chart2/source/controller/dialogs/res_LegendPosition.hxx @@ -36,7 +36,7 @@ #endif #include // header for class SfxItemSet -#include +#include #include #include diff --git a/chart2/source/controller/dialogs/res_Trendline.hxx b/chart2/source/controller/dialogs/res_Trendline.hxx index e1becbf8631f..181341f5c55e 100644 --- a/chart2/source/controller/dialogs/res_Trendline.hxx +++ b/chart2/source/controller/dialogs/res_Trendline.hxx @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include namespace chart diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.cxx b/chart2/source/controller/dialogs/tp_AxisLabel.cxx index ae20b1db1d2b..a7407b4781ee 100644 --- a/chart2/source/controller/dialogs/tp_AxisLabel.cxx +++ b/chart2/source/controller/dialogs/tp_AxisLabel.cxx @@ -41,7 +41,7 @@ #include // header for SfxInt32Item -#include +#include #include #include diff --git a/chart2/source/controller/dialogs/tp_AxisPositions.cxx b/chart2/source/controller/dialogs/tp_AxisPositions.cxx index d1e17f677646..0b10204c54bc 100644 --- a/chart2/source/controller/dialogs/tp_AxisPositions.cxx +++ b/chart2/source/controller/dialogs/tp_AxisPositions.cxx @@ -46,9 +46,9 @@ // header for class SvxDoubleItem #include // header for class SfxBoolItem -#include +#include // header for SfxInt32Item -#include +#include // header for class WarningBox #include @@ -58,7 +58,7 @@ #ifndef _ZFORLIST_DECLARE_TABLE #define _ZFORLIST_DECLARE_TABLE #endif -#include +#include #endif #include diff --git a/chart2/source/controller/dialogs/tp_PointGeometry.cxx b/chart2/source/controller/dialogs/tp_PointGeometry.cxx index 7e2fa80dd556..d5dcad1eb02d 100644 --- a/chart2/source/controller/dialogs/tp_PointGeometry.cxx +++ b/chart2/source/controller/dialogs/tp_PointGeometry.cxx @@ -38,7 +38,7 @@ #include "chartview/ChartSfxItemIds.hxx" // header for SfxInt32Item -#include +#include // header for class Svx3DHorizontalSegmentsItem #include diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.cxx b/chart2/source/controller/dialogs/tp_PolarOptions.cxx index 38d36d032921..1681962eb5fe 100644 --- a/chart2/source/controller/dialogs/tp_PolarOptions.cxx +++ b/chart2/source/controller/dialogs/tp_PolarOptions.cxx @@ -35,8 +35,8 @@ #include "chartview/ChartSfxItemIds.hxx" #include "NoWarningThisInCTOR.hxx" -#include -#include +#include +#include #include //............................................................................. diff --git a/chart2/source/controller/dialogs/tp_Scale.cxx b/chart2/source/controller/dialogs/tp_Scale.cxx index a2c3694a8469..dc2c1f156bcb 100644 --- a/chart2/source/controller/dialogs/tp_Scale.cxx +++ b/chart2/source/controller/dialogs/tp_Scale.cxx @@ -46,9 +46,9 @@ // header for class SvxDoubleItem #include // header for class SfxBoolItem -#include +#include // header for SfxInt32Item -#include +#include // header for class WarningBox #include @@ -58,7 +58,7 @@ #ifndef _ZFORLIST_DECLARE_TABLE #define _ZFORLIST_DECLARE_TABLE #endif -#include +#include #endif #include diff --git a/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx b/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx index cc8ac2139639..a5247e47ad1e 100644 --- a/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx +++ b/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx @@ -38,11 +38,11 @@ #include "NoWarningThisInCTOR.hxx" // header for class SfxBoolItem -#include +#include // header for SfxInt32Item -#include +#include //SfxIntegerListItem -#include +#include #include #include diff --git a/chart2/source/controller/dialogs/tp_TitleRotation.cxx b/chart2/source/controller/dialogs/tp_TitleRotation.cxx index 6733d9e08c3a..d04f43c7031b 100644 --- a/chart2/source/controller/dialogs/tp_TitleRotation.cxx +++ b/chart2/source/controller/dialogs/tp_TitleRotation.cxx @@ -40,7 +40,7 @@ #include // header for class SfxInt32Item -#include +#include //............................................................................. namespace chart diff --git a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx index 92b37e8b4195..c1ba3ed3ed6c 100644 --- a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx +++ b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx @@ -57,7 +57,7 @@ //oldChartModelWrapper // header for class SfxItemPool -#include +#include // header for class FontList #include // header for class Application diff --git a/chart2/source/controller/inc/HelpIds.hrc b/chart2/source/controller/inc/HelpIds.hrc index ccff9e913f97..89010d2bc8b5 100644 --- a/chart2/source/controller/inc/HelpIds.hrc +++ b/chart2/source/controller/inc/HelpIds.hrc @@ -30,7 +30,7 @@ #ifndef CHART_HELPIDS_HRC #define CHART_HELPIDS_HRC -#include +#include //next is 120 //see old chart: schhids.h diff --git a/chart2/source/controller/inc/ItemConverter.hxx b/chart2/source/controller/inc/ItemConverter.hxx index e55456519cd1..52d98132ea82 100644 --- a/chart2/source/controller/inc/ItemConverter.hxx +++ b/chart2/source/controller/inc/ItemConverter.hxx @@ -31,8 +31,8 @@ #define CHART_ITEMCONVERTER_HXX #include -#include -#include +#include +#include #include // for pair diff --git a/chart2/source/controller/inc/dlg_DataEditor.hxx b/chart2/source/controller/inc/dlg_DataEditor.hxx index fd565aba081b..cd82c4a7f46d 100644 --- a/chart2/source/controller/inc/dlg_DataEditor.hxx +++ b/chart2/source/controller/inc/dlg_DataEditor.hxx @@ -31,7 +31,7 @@ #ifndef _SCH_DGRDATA_HXX #define _SCH_DGRDATA_HXX -#include +#include #include #include #include diff --git a/chart2/source/controller/inc/dlg_InsertDataLabel.hxx b/chart2/source/controller/inc/dlg_InsertDataLabel.hxx index d5748a3e990f..d5e19b6de40c 100644 --- a/chart2/source/controller/inc/dlg_InsertDataLabel.hxx +++ b/chart2/source/controller/inc/dlg_InsertDataLabel.hxx @@ -37,7 +37,7 @@ #include #endif // header for class SfxItemSet -#include +#include //for auto_ptr #include diff --git a/chart2/source/controller/inc/dlg_InsertErrorBars.hxx b/chart2/source/controller/inc/dlg_InsertErrorBars.hxx index 13382ff9bffa..f463fc1e854f 100644 --- a/chart2/source/controller/inc/dlg_InsertErrorBars.hxx +++ b/chart2/source/controller/inc/dlg_InsertErrorBars.hxx @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include diff --git a/chart2/source/controller/inc/dlg_InsertTrendline.hxx b/chart2/source/controller/inc/dlg_InsertTrendline.hxx index 517da8fb6930..44f660373b41 100644 --- a/chart2/source/controller/inc/dlg_InsertTrendline.hxx +++ b/chart2/source/controller/inc/dlg_InsertTrendline.hxx @@ -32,7 +32,7 @@ #include #include -#include +#include #include //............................................................................. diff --git a/chart2/source/controller/inc/res_ErrorBar.hxx b/chart2/source/controller/inc/res_ErrorBar.hxx index e1490f5b7e50..a37ed80cbd30 100644 --- a/chart2/source/controller/inc/res_ErrorBar.hxx +++ b/chart2/source/controller/inc/res_ErrorBar.hxx @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include "chartview/ChartSfxItemIds.hxx" #include "RangeSelectionButton.hxx" diff --git a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx index 0c7ff467a91b..07cc3191b906 100644 --- a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx @@ -49,11 +49,11 @@ #include // for SfxBoolItem -#include +#include // for SvxDoubleItem #include // for SfxInt32Item -#include +#include #include #include diff --git a/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx b/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx index ad2aab714757..ee83459d4429 100644 --- a/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include diff --git a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx index af062cf3b93c..c27fa016d00d 100644 --- a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx @@ -49,15 +49,15 @@ // header for class XFillColorItem #include -#include +#include #include // header for class SfxStringItem -#include +#include #include //SfxIntegerListItem -#include +#include #define _SVSTDARR_ULONGS -#include +#include #include #include diff --git a/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx b/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx index fff6d87be9ab..7b05b72bb53f 100755 --- a/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx @@ -42,9 +42,9 @@ #include "GraphicPropertyItemConverter.hxx" -#include +#include #include -#include +#include #include #include diff --git a/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx b/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx index 593b523316e3..1c7273f44c89 100644 --- a/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx @@ -38,7 +38,7 @@ #include "CommonConverters.hxx" // #ifndef _SFXINTITEM_HXX -// #include +// #include // #endif #include #include @@ -53,7 +53,7 @@ #include #include // for SfxBoolItem -#include +#include // for XFillGradientStepCountItem #include #include diff --git a/chart2/source/controller/itemsetwrapper/ItemConverter.cxx b/chart2/source/controller/itemsetwrapper/ItemConverter.cxx index e0a7b20bfa6f..04b35f275618 100644 --- a/chart2/source/controller/itemsetwrapper/ItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/ItemConverter.cxx @@ -33,10 +33,10 @@ #include "ItemConverter.hxx" #include "macros.hxx" #include -#include -#include +#include +#include // header for class SfxWhichIter -#include +#include #include using namespace ::com::sun::star; diff --git a/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx b/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx index c62fa6735512..69209884fbdb 100644 --- a/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx @@ -40,7 +40,7 @@ #include // for SfxBoolItem -#include +#include #include #include diff --git a/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx b/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx index 6ac0d87b3e5f..439aa84c0073 100644 --- a/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx @@ -39,7 +39,7 @@ #include "CharacterPropertyItemConverter.hxx" #include "MultipleItemConverter.hxx" -#include +#include #include #include diff --git a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx index f30bb4aeda57..d74eff927bc4 100644 --- a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx @@ -48,13 +48,13 @@ #include // for SfxBoolItem -#include -#include +#include +#include //SfxIntegerListItem -#include +#include #define _SVSTDARR_ULONGS -#include +#include #include #include diff --git a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx index eed9235aff9b..acaf493836bc 100644 --- a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx @@ -43,9 +43,9 @@ #include "GraphicPropertyItemConverter.hxx" -#include +#include #include -#include +#include #include #include diff --git a/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx b/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx index 96f6e01cadb5..a94c1f07909f 100644 --- a/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx @@ -37,7 +37,7 @@ #include "GraphicPropertyItemConverter.hxx" #include "CharacterPropertyItemConverter.hxx" #include "MultipleItemConverter.hxx" -#include +#include #include #include diff --git a/chart2/source/controller/main/ChartController_Position.cxx b/chart2/source/controller/main/ChartController_Position.cxx index 4cf4de81480b..4cbb6db76bd4 100644 --- a/chart2/source/controller/main/ChartController_Position.cxx +++ b/chart2/source/controller/main/ChartController_Position.cxx @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/chart2/source/controller/main/ChartController_TextEdit.cxx b/chart2/source/controller/main/ChartController_TextEdit.cxx index e1f83550bd5d..855357ce701b 100644 --- a/chart2/source/controller/main/ChartController_TextEdit.cxx +++ b/chart2/source/controller/main/ChartController_TextEdit.cxx @@ -54,7 +54,7 @@ #include #include #include -#include +#include #include //............................................................................. diff --git a/chart2/source/controller/main/ConfigurationAccess.cxx b/chart2/source/controller/main/ConfigurationAccess.cxx index f71d26b7b3c2..2cb5a7c6800c 100644 --- a/chart2/source/controller/main/ConfigurationAccess.cxx +++ b/chart2/source/controller/main/ConfigurationAccess.cxx @@ -35,7 +35,7 @@ #include "macros.hxx" // header for class SvtSysLocale -#include +#include // header for class ConfigItem #include // header for rtl::Static @@ -69,6 +69,8 @@ public: virtual ~CalcConfigItem(); FieldUnit getFieldUnit(); + virtual void Commit(); + virtual void Notify( const uno::Sequence& aPropertyNames); }; CalcConfigItem::CalcConfigItem() @@ -80,6 +82,9 @@ CalcConfigItem::~CalcConfigItem() { } +void CalcConfigItem::Commit() {} +void CalcConfigItem::Notify( const uno::Sequence& aPropertyNames) {} + FieldUnit CalcConfigItem::getFieldUnit() { FieldUnit eResult( FUNIT_CM ); diff --git a/chart2/source/inc/Strings.hrc b/chart2/source/inc/Strings.hrc index fea8bb867057..3353e48e9238 100644 --- a/chart2/source/inc/Strings.hrc +++ b/chart2/source/inc/Strings.hrc @@ -31,7 +31,7 @@ #define CHART_STRINGS_HRC // this includes no link dependency -#include +#include //next free is 290 //single free is: 134 diff --git a/chart2/source/inc/chartview/NumberFormatterWrapper.hxx b/chart2/source/inc/chartview/NumberFormatterWrapper.hxx index 5077541abe2c..03c182229d45 100644 --- a/chart2/source/inc/chartview/NumberFormatterWrapper.hxx +++ b/chart2/source/inc/chartview/NumberFormatterWrapper.hxx @@ -30,7 +30,7 @@ #ifndef _CHART2_VIEW_NUMBERFORMATTERWRAPPER_HXX #define _CHART2_VIEW_NUMBERFORMATTERWRAPPER_HXX -#include +#include #include #include "chartviewdllapi.hxx" diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx index 4882ecef72de..1286a6e553cc 100644 --- a/chart2/source/model/main/ChartModel.cxx +++ b/chart2/source/model/main/ChartModel.cxx @@ -49,7 +49,7 @@ #include // header for class SvNumberFormatsSupplierObj -#include +#include #include #include #include diff --git a/chart2/source/model/main/ImplChartModel.cxx b/chart2/source/model/main/ImplChartModel.cxx index 87383dcf5817..4c8e3bdfc8c9 100644 --- a/chart2/source/model/main/ImplChartModel.cxx +++ b/chart2/source/model/main/ImplChartModel.cxx @@ -45,9 +45,9 @@ #include "AxisHelper.hxx" // header for class SvNumberFormatter -#include +#include // header for class SvNumberFormatsSupplierObj -#include +#include #include #include diff --git a/chart2/source/tools/ConfigColorScheme.cxx b/chart2/source/tools/ConfigColorScheme.cxx index 835872aad8e4..648aca20bc77 100644 --- a/chart2/source/tools/ConfigColorScheme.cxx +++ b/chart2/source/tools/ConfigColorScheme.cxx @@ -76,6 +76,7 @@ public: protected: // ____ ::utl::ConfigItem ____ + virtual void Commit(); virtual void Notify( const Sequence< OUString > & aPropertyNames ); private: @@ -100,6 +101,9 @@ void ChartConfigItem::Notify( const Sequence< OUString > & aPropertyNames ) } } +void ChartConfigItem::Commit() +{} + void ChartConfigItem::addPropertyNotification( const OUString & rPropertyName ) { m_aPropertiesToNotify.insert( rPropertyName ); diff --git a/chart2/source/tools/ImplUndoManager.cxx b/chart2/source/tools/ImplUndoManager.cxx index 91d5f869bc53..e6c87ae16f9e 100644 --- a/chart2/source/tools/ImplUndoManager.cxx +++ b/chart2/source/tools/ImplUndoManager.cxx @@ -463,6 +463,10 @@ void UndoStepsConfigItem::Notify( const Sequence< OUString > & aPropertyNames ) } } +void UndoStepsConfigItem::Commit() +{ +} + // mtehod is not const, because GetProperties is not const sal_Int32 UndoStepsConfigItem::getUndoSteps() { diff --git a/chart2/source/tools/ImplUndoManager.hxx b/chart2/source/tools/ImplUndoManager.hxx index 94d04b69a5a4..35a90becbcf2 100644 --- a/chart2/source/tools/ImplUndoManager.hxx +++ b/chart2/source/tools/ImplUndoManager.hxx @@ -200,6 +200,7 @@ public: protected: // ____ ::utl::ConfigItem ____ virtual void Notify( const ::com::sun::star::uno::Sequence< ::rtl::OUString > & aPropertyNames ); + virtual void Commit(); private: ConfigItemListener & m_rListener; diff --git a/chart2/source/view/main/ChartItemPool.cxx b/chart2/source/view/main/ChartItemPool.cxx index f3024a10e958..3da8fe225f8c 100644 --- a/chart2/source/view/main/ChartItemPool.cxx +++ b/chart2/source/view/main/ChartItemPool.cxx @@ -36,15 +36,15 @@ #include "chartview/ChartSfxItemIds.hxx" #include -#include +#include #include #include // header for class SfxStringItem -#include +#include //SfxIntegerListItem -#include +#include #define _SVSTDARR_ULONGS -#include +#include namespace chart { diff --git a/chart2/source/view/main/ChartItemPool.hxx b/chart2/source/view/main/ChartItemPool.hxx index 00c813ed4922..22bc5b900d06 100644 --- a/chart2/source/view/main/ChartItemPool.hxx +++ b/chart2/source/view/main/ChartItemPool.hxx @@ -30,8 +30,8 @@ #ifndef _CHART2_ITEMPOOL_HXX #define _CHART2_ITEMPOOL_HXX -#include -#include +#include +#include namespace chart { diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index dfd57f9bce92..fed4b52f3b5f 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -103,7 +103,7 @@ #include #include #include -#include +#include #include //............................................................................. diff --git a/chart2/source/view/main/ChartView.hxx b/chart2/source/view/main/ChartView.hxx index b536998fd5bd..b1d7c5eede78 100644 --- a/chart2/source/view/main/ChartView.hxx +++ b/chart2/source/view/main/ChartView.hxx @@ -36,7 +36,7 @@ #include // header for class SfxListener -#include +#include #include #include #include diff --git a/chart2/source/view/main/DrawModelWrapper.cxx b/chart2/source/view/main/DrawModelWrapper.cxx index edcb8c3eecc9..4212640033ac 100644 --- a/chart2/source/view/main/DrawModelWrapper.cxx +++ b/chart2/source/view/main/DrawModelWrapper.cxx @@ -37,9 +37,9 @@ #include "ChartItemPool.hxx" #include "ObjectIdentifier.hxx" #include -#include +#include // header for class SfxBoolItem -#include +#include // header for define EE_PARA_HYPHENATE #include // header for class Svx3DPercentDiagonalItem diff --git a/chart2/source/view/main/NumberFormatterWrapper.cxx b/chart2/source/view/main/NumberFormatterWrapper.cxx index 2a01d2f1cde3..b947894c77bb 100644 --- a/chart2/source/view/main/NumberFormatterWrapper.cxx +++ b/chart2/source/view/main/NumberFormatterWrapper.cxx @@ -34,9 +34,9 @@ #include "macros.hxx" #include // header for class SvNumberFormatsSupplierObj -#include +#include // header for class SvNumberformat -#include +#include #include #include #include diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx index b9fa4b3aba84..8e65dd6c2458 100644 --- a/chart2/source/view/main/VLegend.cxx +++ b/chart2/source/view/main/VLegend.cxx @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include #include diff --git a/sc/inc/addruno.hxx b/sc/inc/addruno.hxx index 1427d9b14a75..c9089ba48d2e 100644 --- a/sc/inc/addruno.hxx +++ b/sc/inc/addruno.hxx @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include "global.hxx" #include "address.hxx" diff --git a/sc/inc/afmtuno.hxx b/sc/inc/afmtuno.hxx index ac7d444ca561..843fa673543f 100644 --- a/sc/inc/afmtuno.hxx +++ b/sc/inc/afmtuno.hxx @@ -31,8 +31,8 @@ #ifndef SC_AFMTUNO_HXX #define SC_AFMTUNO_HXX -#include -#include +#include +#include #include #include #include diff --git a/sc/inc/appluno.hxx b/sc/inc/appluno.hxx index 09a1e9ced9ba..05de5a22cc90 100644 --- a/sc/inc/appluno.hxx +++ b/sc/inc/appluno.hxx @@ -31,7 +31,7 @@ #ifndef SC_APPLUNO_HXX #define SC_APPLUNO_HXX -#include +#include #include #include #include diff --git a/sc/inc/attrib.hxx b/sc/inc/attrib.hxx index 8dd77cf68c3f..55bb707f4edb 100644 --- a/sc/inc/attrib.hxx +++ b/sc/inc/attrib.hxx @@ -31,9 +31,9 @@ #ifndef SC_SCATTR_HXX #define SC_SCATTR_HXX -#include -#include -#include +#include +#include +#include #include "scdllapi.h" #include "global.hxx" #include "address.hxx" diff --git a/sc/inc/autoform.hxx b/sc/inc/autoform.hxx index f8df5e9fa236..8ec139ffa2d5 100644 --- a/sc/inc/autoform.hxx +++ b/sc/inc/autoform.hxx @@ -64,7 +64,7 @@ JP 20.07.95: #include #include #include -#include +#include #include #include "scdllapi.h" #include "collect.hxx" diff --git a/sc/inc/brdcst.hxx b/sc/inc/brdcst.hxx index 0d4b9aac9fa7..e7418c8dedfe 100644 --- a/sc/inc/brdcst.hxx +++ b/sc/inc/brdcst.hxx @@ -33,8 +33,8 @@ #include "global.hxx" #include "address.hxx" #include -#include -#include +#include +#include class ScBaseCell; #define SC_HINT_DYING SFX_HINT_DYING diff --git a/sc/inc/cell.hxx b/sc/inc/cell.hxx index 1f2bff35ce98..6bc1716529a3 100644 --- a/sc/inc/cell.hxx +++ b/sc/inc/cell.hxx @@ -35,7 +35,7 @@ #include #include -#include +#include #include "global.hxx" #include "rangenam.hxx" #include "formula/grammar.hxx" diff --git a/sc/inc/cellsuno.hxx b/sc/inc/cellsuno.hxx index 2dd0bd6cc16e..8def9591d5b9 100644 --- a/sc/inc/cellsuno.hxx +++ b/sc/inc/cellsuno.hxx @@ -35,9 +35,9 @@ #include "rangelst.hxx" // ScRangeList #include "formula/grammar.hxx" -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/sc/inc/chart2uno.hxx b/sc/inc/chart2uno.hxx index dc0244dfcdb8..32dc3a777086 100644 --- a/sc/inc/chart2uno.hxx +++ b/sc/inc/chart2uno.hxx @@ -37,7 +37,7 @@ #include "token.hxx" #include "chartlis.hxx" -#include +#include #include #include #include @@ -59,7 +59,7 @@ #include #include #include -#include +#include #include #include diff --git a/sc/inc/chartlis.hxx b/sc/inc/chartlis.hxx index 490c62743fb4..0ebc84268f74 100644 --- a/sc/inc/chartlis.hxx +++ b/sc/inc/chartlis.hxx @@ -33,7 +33,7 @@ #include -#include +#include #include "collect.hxx" #include "rangelst.hxx" #include "token.hxx" diff --git a/sc/inc/chartuno.hxx b/sc/inc/chartuno.hxx index 914c48393573..7c82b4874fca 100644 --- a/sc/inc/chartuno.hxx +++ b/sc/inc/chartuno.hxx @@ -32,7 +32,7 @@ #define SC_CHARTUNO_HXX #include "address.hxx" -#include +#include #include #include diff --git a/sc/inc/chgtrack.hxx b/sc/inc/chgtrack.hxx index 52915e59358a..0018f8b2ac3c 100644 --- a/sc/inc/chgtrack.hxx +++ b/sc/inc/chgtrack.hxx @@ -1127,7 +1127,7 @@ class ScChangeTrack : public utl::ConfigurationListener #endif // SC_CHGTRACK_CXX void ClearMsgQueue(); - virtual void ConfigurationChanged( utl::ConfigurationBroadcaster* ); + virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 ); public: diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx index 141cb5706515..f659c52d0892 100644 --- a/sc/inc/conditio.hxx +++ b/sc/inc/conditio.hxx @@ -34,7 +34,7 @@ #include "global.hxx" #include "address.hxx" #include "formula/grammar.hxx" -#include +#include #include "scdllapi.h" class ScBaseCell; diff --git a/sc/inc/confuno.hxx b/sc/inc/confuno.hxx index a7327402e5e0..a82e4fad1a09 100644 --- a/sc/inc/confuno.hxx +++ b/sc/inc/confuno.hxx @@ -31,8 +31,8 @@ #ifndef SC_CONFUNO_HXX #define SC_CONFUNO_HXX -#include -#include +#include +#include #include #include #include diff --git a/sc/inc/dapiuno.hxx b/sc/inc/dapiuno.hxx index c3d5db0bc72b..86f395f525ca 100644 --- a/sc/inc/dapiuno.hxx +++ b/sc/inc/dapiuno.hxx @@ -34,8 +34,8 @@ #include "global.hxx" #include "dpobject.hxx" #include "rangeutl.hxx" // ScArea -#include -#include +#include +#include #include #include diff --git a/sc/inc/datauno.hxx b/sc/inc/datauno.hxx index a93bfc341573..6cd2d1555bdf 100644 --- a/sc/inc/datauno.hxx +++ b/sc/inc/datauno.hxx @@ -32,8 +32,8 @@ #define SC_DATAUNO_HXX #include "global.hxx" -#include -#include +#include +#include #include #include #include diff --git a/sc/inc/defltuno.hxx b/sc/inc/defltuno.hxx index 2f33dcdb3f48..b93c386a77f0 100644 --- a/sc/inc/defltuno.hxx +++ b/sc/inc/defltuno.hxx @@ -31,12 +31,12 @@ #ifndef SC_DEFLTUNO_HXX #define SC_DEFLTUNO_HXX -#include +#include #include #include #include #include -#include +#include class ScDocShell; diff --git a/sc/inc/detdata.hxx b/sc/inc/detdata.hxx index 06beb91790f1..b16b5a05778c 100644 --- a/sc/inc/detdata.hxx +++ b/sc/inc/detdata.hxx @@ -31,7 +31,7 @@ #ifndef SC_DETDATA_HXX #define SC_DETDATA_HXX -#include +#include #include "global.hxx" #include "address.hxx" diff --git a/sc/inc/dispuno.hxx b/sc/inc/dispuno.hxx index 34578c64bacf..b09a064ee797 100644 --- a/sc/inc/dispuno.hxx +++ b/sc/inc/dispuno.hxx @@ -34,8 +34,8 @@ #include #include #include -#include -#include +#include +#include #include "global.hxx" // ScImportParam diff --git a/sc/inc/docoptio.hxx b/sc/inc/docoptio.hxx index 325060f0c05a..f102b5ea966d 100644 --- a/sc/inc/docoptio.hxx +++ b/sc/inc/docoptio.hxx @@ -32,8 +32,8 @@ #define SC_DOCOPTIO_HXX #include -#include -#include +#include +#include #include "scdllapi.h" #include "optutil.hxx" diff --git a/sc/inc/docpool.hxx b/sc/inc/docpool.hxx index c81a68afe63d..52cf1a968163 100644 --- a/sc/inc/docpool.hxx +++ b/sc/inc/docpool.hxx @@ -31,7 +31,7 @@ #ifndef SC_SCDOCPOL_HXX #define SC_SCDOCPOL_HXX -#include +#include #include "scdllapi.h" class ScStyleSheet; diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 5f75108c2ebf..116d25ee901e 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -155,7 +155,7 @@ namespace com { namespace sun { namespace star { } } } } -#include +#include /* #ifdef _ZFORLIST_DECLARE_TABLE class SvNumberFormatterIndexTable; diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx index 0d69c9f68670..3ed1d5f147ac 100644 --- a/sc/inc/docuno.hxx +++ b/sc/inc/docuno.hxx @@ -33,7 +33,7 @@ #include "address.hxx" #include -#include +#include #include #include #include @@ -61,7 +61,7 @@ #include #include #include -#include +#include #include "drwlayer.hxx" class ScDocShell; diff --git a/sc/inc/dptabres.hxx b/sc/inc/dptabres.hxx index 6dfb782b2313..b18ea8e56b76 100644 --- a/sc/inc/dptabres.hxx +++ b/sc/inc/dptabres.hxx @@ -31,7 +31,7 @@ #ifndef SC_DPTABRES_HXX #define SC_DPTABRES_HXX -#include +#include #include #include #include diff --git a/sc/inc/drawattr.hxx b/sc/inc/drawattr.hxx index 174b675ebcae..ad0ce37e35c3 100644 --- a/sc/inc/drawattr.hxx +++ b/sc/inc/drawattr.hxx @@ -30,7 +30,7 @@ #ifndef _IDLITEMS_HXX #define _IDLITEMS_HXX -#include +#include #include diff --git a/sc/inc/drdefuno.hxx b/sc/inc/drdefuno.hxx index 7eb45d3ea355..4b0a534dc655 100644 --- a/sc/inc/drdefuno.hxx +++ b/sc/inc/drdefuno.hxx @@ -32,7 +32,7 @@ #define SC_DRDEFUNO_HXX #include -#include +#include class ScDocShell; diff --git a/sc/inc/editsrc.hxx b/sc/inc/editsrc.hxx index 950c3533e44a..3dd928384fe8 100644 --- a/sc/inc/editsrc.hxx +++ b/sc/inc/editsrc.hxx @@ -33,7 +33,7 @@ #include "address.hxx" #include -#include +#include #include diff --git a/sc/inc/externalrefmgr.hxx b/sc/inc/externalrefmgr.hxx index bf795f04fe1c..90adedd6d346 100644 --- a/sc/inc/externalrefmgr.hxx +++ b/sc/inc/externalrefmgr.hxx @@ -37,7 +37,7 @@ #include "sfx2/lnkbase.hxx" #include "tools/time.hxx" #include "vcl/timer.hxx" -#include "svtools/zforlist.hxx" +#include "svl/zforlist.hxx" #include "scmatrix.hxx" #include diff --git a/sc/inc/fielduno.hxx b/sc/inc/fielduno.hxx index d4319bcba50e..6d777b38424a 100644 --- a/sc/inc/fielduno.hxx +++ b/sc/inc/fielduno.hxx @@ -34,8 +34,8 @@ #include "address.hxx" #include "mutexhlp.hxx" -#include -#include +#include +#include #include #include #include diff --git a/sc/inc/fmtuno.hxx b/sc/inc/fmtuno.hxx index 6005a849fb0f..ccd93d982bdf 100644 --- a/sc/inc/fmtuno.hxx +++ b/sc/inc/fmtuno.hxx @@ -35,7 +35,7 @@ #include "conditio.hxx" #include #include -#include +#include #include #include #include diff --git a/sc/inc/forbiuno.hxx b/sc/inc/forbiuno.hxx index eb142b2166a1..305d818a299d 100644 --- a/sc/inc/forbiuno.hxx +++ b/sc/inc/forbiuno.hxx @@ -32,7 +32,7 @@ #define SC_FORBIUNO_HXX #include -#include +#include class ScDocShell; diff --git a/sc/inc/funcuno.hxx b/sc/inc/funcuno.hxx index 2e5e167bc988..4c45cdb627bc 100644 --- a/sc/inc/funcuno.hxx +++ b/sc/inc/funcuno.hxx @@ -35,7 +35,7 @@ #include #include #include -#include +#include class ScDocument; class ScDocOptions; diff --git a/sc/inc/hints.hxx b/sc/inc/hints.hxx index 92c17caf9641..889dc302fcf6 100644 --- a/sc/inc/hints.hxx +++ b/sc/inc/hints.hxx @@ -33,7 +33,7 @@ #include "global.hxx" #include "address.hxx" -#include +#include // --------------------------------------------------------------------------- diff --git a/sc/inc/linkuno.hxx b/sc/inc/linkuno.hxx index c45da4f35e27..1a9479dff278 100644 --- a/sc/inc/linkuno.hxx +++ b/sc/inc/linkuno.hxx @@ -31,8 +31,8 @@ #ifndef SC_LINKUNO_HXX #define SC_LINKUNO_HXX -#include -#include +#include +#include #include #include #include diff --git a/sc/inc/lookupcache.hxx b/sc/inc/lookupcache.hxx index 12b85d54cc49..9261a6db0395 100644 --- a/sc/inc/lookupcache.hxx +++ b/sc/inc/lookupcache.hxx @@ -34,7 +34,7 @@ #include "address.hxx" #include "global.hxx" #include "formula/token.hxx" -#include +#include #include #include diff --git a/sc/inc/nameuno.hxx b/sc/inc/nameuno.hxx index bac1dd9711d5..240cead3be83 100644 --- a/sc/inc/nameuno.hxx +++ b/sc/inc/nameuno.hxx @@ -31,7 +31,7 @@ #ifndef SC_NAMEUNO_HXX #define SC_NAMEUNO_HXX -#include +#include #include "address.hxx" #include "formula/grammar.hxx" #include diff --git a/sc/inc/notesuno.hxx b/sc/inc/notesuno.hxx index 3907f3d20967..4cf8148eff17 100644 --- a/sc/inc/notesuno.hxx +++ b/sc/inc/notesuno.hxx @@ -32,7 +32,7 @@ #define SC_NOTESUNO_HXX #include "address.hxx" -#include +#include #include #include #include diff --git a/sc/inc/patattr.hxx b/sc/inc/patattr.hxx index 86506d7ccdb8..c1fb936c90fe 100644 --- a/sc/inc/patattr.hxx +++ b/sc/inc/patattr.hxx @@ -31,8 +31,8 @@ #ifndef SC_SCPATATR_HXX #define SC_SCPATATR_HXX -#include -#include +#include +#include #include #include #include "scdllapi.h" diff --git a/sc/inc/pch/precompiled_sc.hxx b/sc/inc/pch/precompiled_sc.hxx index f1e916f5b568..dbb86fdf7484 100644 --- a/sc/inc/pch/precompiled_sc.hxx +++ b/sc/inc/pch/precompiled_sc.hxx @@ -152,15 +152,15 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include #include -#include +#include #include #include #include diff --git a/sc/inc/printopt.hxx b/sc/inc/printopt.hxx index 6c4a88d9df60..0c90ba4497fc 100644 --- a/sc/inc/printopt.hxx +++ b/sc/inc/printopt.hxx @@ -31,7 +31,7 @@ #ifndef SC_PRINTOPT_HXX #define SC_PRINTOPT_HXX -#include +#include #include #include "scdllapi.h" @@ -96,6 +96,7 @@ public: void SetOptions( const ScPrintOptions& rNew ); virtual void Commit(); + virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); }; #endif diff --git a/sc/inc/scmod.hxx b/sc/inc/scmod.hxx index 69f3def3efc5..86d1d5b789aa 100644 --- a/sc/inc/scmod.hxx +++ b/sc/inc/scmod.hxx @@ -34,11 +34,11 @@ #include "scdllapi.h" #include "scdll.hxx" #include -#include +#include #include "global.hxx" // ScInputMode #include "markdata.hxx" //ScMarkData #include "shellids.hxx" - +#include #include @@ -113,7 +113,7 @@ struct ScClipData //================================================================== -class ScModule: public SfxModule, public SfxListener +class ScModule: public SfxModule, public SfxListener, utl::ConfigurationListener { Timer aIdleTimer; Timer aSpellTimer; @@ -153,6 +153,7 @@ public: virtual void FillStatusBar(StatusBar &rBar); virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 ); void DeleteCfg(); // von der Applikation verschoben: diff --git a/sc/inc/srchuno.hxx b/sc/inc/srchuno.hxx index d486d8b7e298..ffa54cf29d70 100644 --- a/sc/inc/srchuno.hxx +++ b/sc/inc/srchuno.hxx @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include diff --git a/sc/inc/stlpool.hxx b/sc/inc/stlpool.hxx index 1028bb5f7673..ce1d643cd27f 100644 --- a/sc/inc/stlpool.hxx +++ b/sc/inc/stlpool.hxx @@ -31,7 +31,7 @@ #ifndef SC_STLPOOL_HXX #define SC_STLPOOL_HXX -#include +#include class ScStyleSheet; diff --git a/sc/inc/stlsheet.hxx b/sc/inc/stlsheet.hxx index 06786dfff69d..ddbbc41b4f80 100644 --- a/sc/inc/stlsheet.hxx +++ b/sc/inc/stlsheet.hxx @@ -31,7 +31,7 @@ #ifndef SC_STLSHEET_HXX #define SC_STLSHEET_HXX -#include +#include //------------------------------------------------------------------------ diff --git a/sc/inc/styleuno.hxx b/sc/inc/styleuno.hxx index 5fb28db3239a..34d1b8d3302c 100644 --- a/sc/inc/styleuno.hxx +++ b/sc/inc/styleuno.hxx @@ -31,8 +31,8 @@ #ifndef SC_STYLEUNO_HXX #define SC_STYLEUNO_HXX -#include -#include +#include +#include #include #include #include diff --git a/sc/inc/targuno.hxx b/sc/inc/targuno.hxx index 3dc549656fa1..db8670521c25 100644 --- a/sc/inc/targuno.hxx +++ b/sc/inc/targuno.hxx @@ -31,7 +31,7 @@ #ifndef SC_TARGUNO_HXX #define SC_TARGUNO_HXX -#include +#include #include #include #include diff --git a/sc/inc/textuno.hxx b/sc/inc/textuno.hxx index 8ec7707874be..64eb2aaba696 100644 --- a/sc/inc/textuno.hxx +++ b/sc/inc/textuno.hxx @@ -34,8 +34,8 @@ #include "global.hxx" // ScRange, ScAddress #include "address.hxx" #include -#include -#include +#include +#include #include #include #include diff --git a/sc/inc/tokenuno.hxx b/sc/inc/tokenuno.hxx index bcd3435668be..0c573c6961c1 100644 --- a/sc/inc/tokenuno.hxx +++ b/sc/inc/tokenuno.hxx @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include "address.hxx" #include "compiler.hxx" diff --git a/sc/inc/unoreflist.hxx b/sc/inc/unoreflist.hxx index 42486071adef..08223d546c57 100644 --- a/sc/inc/unoreflist.hxx +++ b/sc/inc/unoreflist.hxx @@ -32,7 +32,7 @@ #define SC_UNOREFLIST_HXX #include -#include +#include #include "rangelst.hxx" diff --git a/sc/inc/viewuno.hxx b/sc/inc/viewuno.hxx index e489cb718163..bb322424a9a6 100644 --- a/sc/inc/viewuno.hxx +++ b/sc/inc/viewuno.hxx @@ -32,8 +32,8 @@ #define SC_VIEWUNO_HXX #include -#include -#include +#include +#include #include #include #include diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index 1a466d231459..dcc4ce2580d2 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx index 85f8a4921242..e3bf0b527578 100644 --- a/sc/source/core/data/bcaslot.cxx +++ b/sc/source/core/data/bcaslot.cxx @@ -34,8 +34,8 @@ #include -#include -#include +#include +#include #include "document.hxx" #include "brdcst.hxx" diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx index aea2bf4ff276..8b441628686e 100644 --- a/sc/source/core/data/cell.cxx +++ b/sc/source/core/data/cell.cxx @@ -33,7 +33,7 @@ // INCLUDE --------------------------------------------------------------- -#include +#include #include "scitems.hxx" #include "attrib.hxx" @@ -55,9 +55,9 @@ #include "postit.hxx" #include "externalrefmgr.hxx" #include -#include +#include #include -#include +#include using namespace formula; // More or less arbitrary, of course all recursions must fit into available diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 0afc4fb1347c..ef8bd9bde2c0 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -37,8 +37,8 @@ #include -#include -#include +#include +#include #include #include diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 01c72ab4e0c4..4205c0f59dcc 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -47,9 +47,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include "column.hxx" diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 5726862366cf..e94cfca12ab7 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -35,8 +35,8 @@ #include -#include -#include +#include +#include #include "scitems.hxx" #include "column.hxx" diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index 45ead48d0f35..857c149476b7 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -37,8 +37,8 @@ #include "scitems.hxx" #include -#include -#include +#include +#include #include #include diff --git a/sc/source/core/data/dbdocutl.cxx b/sc/source/core/data/dbdocutl.cxx index 6a849282a642..215f2d34aab1 100644 --- a/sc/source/core/data/dbdocutl.cxx +++ b/sc/source/core/data/dbdocutl.cxx @@ -38,7 +38,7 @@ #include #include -#include +#include #include "dbdocutl.hxx" #include "document.hxx" diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx index b88cd49a6a8c..4548f1f7a1b5 100644 --- a/sc/source/core/data/dociter.cxx +++ b/sc/source/core/data/dociter.cxx @@ -33,7 +33,7 @@ // INCLUDE --------------------------------------------------------------- -#include +#include #include "scitems.hxx" #include "global.hxx" diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx index fce83f25cd93..662e524b2bfc 100644 --- a/sc/source/core/data/docpool.cxx +++ b/sc/source/core/data/docpool.cxx @@ -36,8 +36,8 @@ #include "scitems.hxx" #include #include -#include -#include +#include +#include #include #include #include diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index 3404866446fe..09477e5a7eb4 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -45,11 +45,11 @@ #include #include #include -#include -#include +#include +#include #include #include -#include +#include #include #include #include diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index 9fc4b09f21af..14f3a566eb9f 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -39,8 +39,8 @@ #include #include #include -#include -#include +#include +#include #include #include "document.hxx" #include "attrib.hxx" diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx index 7313ebbf83f5..b47f55124041 100644 --- a/sc/source/core/data/documen4.cxx +++ b/sc/source/core/data/documen4.cxx @@ -35,8 +35,8 @@ // INCLUDE --------------------------------------------------------------- -#include -#include +#include +#include #include #include diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index b12a2783baa9..2b0b3821dcc2 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -49,13 +49,13 @@ #include #include #include -#include -#include +#include +#include #define _SVSTDARR_USHORTS -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -137,17 +137,14 @@ SfxPrinter* ScDocument::GetPrinter(BOOL bCreateIfNotExist) SID_SCPRINTOPTIONS, SID_SCPRINTOPTIONS, NULL ); - SfxMiscCfg* pOffCfg = SFX_APP()->GetMiscConfig(); - if ( pOffCfg ) - { - USHORT nFlags = 0; - if ( pOffCfg->IsPaperOrientationWarning() ) - nFlags |= SFX_PRINTER_CHG_ORIENTATION; - if ( pOffCfg->IsPaperSizeWarning() ) - nFlags |= SFX_PRINTER_CHG_SIZE; - pSet->Put( SfxFlagItem( SID_PRINTER_CHANGESTODOC, nFlags ) ); - pSet->Put( SfxBoolItem( SID_PRINTER_NOTFOUND_WARN, pOffCfg->IsNotFoundWarning() ) ); - } + ::utl::MiscCfg aMisc; + USHORT nFlags = 0; + if ( aMisc.IsPaperOrientationWarning() ) + nFlags |= SFX_PRINTER_CHG_ORIENTATION; + if ( aMisc.IsPaperSizeWarning() ) + nFlags |= SFX_PRINTER_CHG_SIZE; + pSet->Put( SfxFlagItem( SID_PRINTER_CHANGESTODOC, nFlags ) ); + pSet->Put( SfxBoolItem( SID_PRINTER_NOTFOUND_WARN, aMisc.IsNotFoundWarning() ) ); pPrinter = new SfxPrinter( pSet ); pPrinter->SetMapMode( MAP_100TH_MM ); @@ -189,21 +186,18 @@ void ScDocument::SetPrintOptions() if ( pPrinter ) { - SfxMiscCfg* pOffCfg = SFX_APP()->GetMiscConfig(); - if ( pOffCfg ) - { - SfxItemSet aOptSet( pPrinter->GetOptions() ); - - USHORT nFlags = 0; - if ( pOffCfg->IsPaperOrientationWarning() ) - nFlags |= SFX_PRINTER_CHG_ORIENTATION; - if ( pOffCfg->IsPaperSizeWarning() ) - nFlags |= SFX_PRINTER_CHG_SIZE; - aOptSet.Put( SfxFlagItem( SID_PRINTER_CHANGESTODOC, nFlags ) ); - aOptSet.Put( SfxBoolItem( SID_PRINTER_NOTFOUND_WARN, pOffCfg->IsNotFoundWarning() ) ); - - pPrinter->SetOptions( aOptSet ); - } + ::utl::MiscCfg aMisc; + SfxItemSet aOptSet( pPrinter->GetOptions() ); + + USHORT nFlags = 0; + if ( aMisc.IsPaperOrientationWarning() ) + nFlags |= SFX_PRINTER_CHG_ORIENTATION; + if ( aMisc.IsPaperSizeWarning() ) + nFlags |= SFX_PRINTER_CHG_SIZE; + aOptSet.Put( SfxFlagItem( SID_PRINTER_CHANGESTODOC, nFlags ) ); + aOptSet.Put( SfxBoolItem( SID_PRINTER_NOTFOUND_WARN, aMisc.IsNotFoundWarning() ) ); + + pPrinter->SetOptions( aOptSet ); } } diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 4249efa9d020..2c54b603e911 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -46,9 +46,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/sc/source/core/data/dpdimsave.cxx b/sc/source/core/data/dpdimsave.cxx index 7e1bc0389eaf..49e2c5b09c94 100644 --- a/sc/source/core/data/dpdimsave.cxx +++ b/sc/source/core/data/dpdimsave.cxx @@ -38,7 +38,7 @@ #include -#include +#include #include #include #include diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx index a2d21079826d..09f32b4ba1b1 100644 --- a/sc/source/core/data/dpgroup.cxx +++ b/sc/source/core/data/dpgroup.cxx @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include "dpgroup.hxx" #include "collect.hxx" diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 787875fcb5ff..ad9795d11c4d 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -72,7 +72,7 @@ #include #include -#include // IsNumberFormat +#include // IsNumberFormat #include diff --git a/sc/source/core/data/dpsdbtab.cxx b/sc/source/core/data/dpsdbtab.cxx index cfc98af5af99..01f63f0cbaa9 100644 --- a/sc/source/core/data/dpsdbtab.cxx +++ b/sc/source/core/data/dpsdbtab.cxx @@ -37,7 +37,7 @@ #include #include -#include +#include #include #include diff --git a/sc/source/core/data/dpshttab.cxx b/sc/source/core/data/dpshttab.cxx index 7956b68ad03f..29fe2dc7b6e5 100644 --- a/sc/source/core/data/dpshttab.cxx +++ b/sc/source/core/data/dpshttab.cxx @@ -36,7 +36,7 @@ // INCLUDE -------------------------------------------------------------- #include -#include +#include #include "dpshttab.hxx" #include "dptabres.hxx" diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx index 3e9a7586fd1a..e123e74a20e6 100644 --- a/sc/source/core/data/dptabsrc.cxx +++ b/sc/source/core/data/dptabsrc.cxx @@ -44,8 +44,8 @@ #include #include -#include -#include +#include +#include #include "scitems.hxx" #include "document.hxx" diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 6a3beb940c48..cb82ede30dca 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -65,7 +65,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index 88ff065572b4..d49e8e1aa139 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -47,9 +47,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -67,7 +67,7 @@ #include #include #include -#include +#include #include #include "global.hxx" diff --git a/sc/source/core/data/global2.cxx b/sc/source/core/data/global2.cxx index 67dccac980ae..e6f8523a3c42 100644 --- a/sc/source/core/data/global2.cxx +++ b/sc/source/core/data/global2.cxx @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include "global.hxx" #include "rangeutl.hxx" diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index ee74a66bcc3b..dbc5bbf50c63 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -60,8 +60,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/sc/source/core/data/poolhelp.cxx b/sc/source/core/data/poolhelp.cxx index ff8f7bb76c5c..ada3e5515590 100644 --- a/sc/source/core/data/poolhelp.cxx +++ b/sc/source/core/data/poolhelp.cxx @@ -35,7 +35,7 @@ // INCLUDE --------------------------------------------------------------- -#include +#include #include #include "poolhelp.hxx" diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx index 260385d6feac..8b6f9a89edd3 100644 --- a/sc/source/core/data/stlpool.cxx +++ b/sc/source/core/data/stlpool.cxx @@ -49,8 +49,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx index 4452cd357132..277a7ce9f326 100644 --- a/sc/source/core/data/stlsheet.cxx +++ b/sc/source/core/data/stlsheet.cxx @@ -48,9 +48,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include "attrib.hxx" diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index c8a25fbe0ec1..31f9c18e3d3a 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -36,10 +36,10 @@ #include "scitems.hxx" #include #include -#include +#include #include #include -#include +#include #include #include "patattr.hxx" diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index 01dc74f8644e..b85b910795a5 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -33,7 +33,7 @@ #include #include -#include +#include #include #include #include diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index fd725e96d124..b10741f46c3f 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -61,7 +61,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/core/data/tabprotection.cxx b/sc/source/core/data/tabprotection.cxx index 1620c5194e92..c19cd8cf6b21 100644 --- a/sc/source/core/data/tabprotection.cxx +++ b/sc/source/core/data/tabprotection.cxx @@ -35,7 +35,7 @@ #include "tabprotection.hxx" #include "tools/debug.hxx" -#include "svtools/PasswordHelper.hxx" +#include "svl/PasswordHelper.hxx" #include "document.hxx" #define DEBUG_TAB_PROTECTION 0 diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx index 443474060c3e..9b0970611254 100644 --- a/sc/source/core/data/validat.cxx +++ b/sc/source/core/data/validat.cxx @@ -45,7 +45,7 @@ #include #include -#include +#include #include #include #include diff --git a/sc/source/core/inc/adiasync.hxx b/sc/source/core/inc/adiasync.hxx index 9d1b4e89e1c3..cc696499d025 100644 --- a/sc/source/core/inc/adiasync.hxx +++ b/sc/source/core/inc/adiasync.hxx @@ -31,8 +31,8 @@ #ifndef SC_ADIASYNC_HXX #define SC_ADIASYNC_HXX -#include -#include +#include +#include #include "callform.hxx" diff --git a/sc/source/core/inc/bcaslot.hxx b/sc/source/core/inc/bcaslot.hxx index ef2f77b55684..1c94b648c7fb 100644 --- a/sc/source/core/inc/bcaslot.hxx +++ b/sc/source/core/inc/bcaslot.hxx @@ -34,8 +34,8 @@ #include #include #include -#include -#include +#include +#include #include "global.hxx" #include "brdcst.hxx" diff --git a/sc/source/core/inc/core_pch.hxx b/sc/source/core/inc/core_pch.hxx index d756d1a91246..19d0463e7871 100644 --- a/sc/source/core/inc/core_pch.hxx +++ b/sc/source/core/inc/core_pch.hxx @@ -59,7 +59,7 @@ #include #include #include -#include +#include #include #include #include @@ -67,18 +67,18 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include -#include +#include #include -#include +#include #include -#include +#include #include #include -#include +#include #include #include #include @@ -87,7 +87,7 @@ #include #include #include -#include +#include #include #include #include @@ -100,8 +100,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -117,12 +117,12 @@ #include #include #include -#include +#include #include #include #include #include -#include +#include #include #include #include @@ -131,7 +131,7 @@ #include #include #include -#include +#include #include #include #include @@ -143,8 +143,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -157,11 +157,11 @@ #include #include #include -#include +#include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -200,7 +200,7 @@ #include #include #include -#include +#include #include #include #include @@ -225,7 +225,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/core/inc/ddelink.hxx b/sc/source/core/inc/ddelink.hxx index b8b44a568110..465c58afb823 100644 --- a/sc/source/core/inc/ddelink.hxx +++ b/sc/source/core/inc/ddelink.hxx @@ -33,7 +33,7 @@ #include "address.hxx" #include -#include +#include #include "scmatrix.hxx" class ScDocument; diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx index f21a0860d962..f9a9f0bd51a0 100644 --- a/sc/source/core/tool/autoform.cxx +++ b/sc/source/core/tool/autoform.cxx @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx index 238d0f943367..5305db490f8d 100644 --- a/sc/source/core/tool/cellform.cxx +++ b/sc/source/core/tool/cellform.cxx @@ -33,8 +33,8 @@ // INCLUDE --------------------------------------------------------------- #include -#include -#include +#include +#include #include "cellform.hxx" #include "cell.hxx" diff --git a/sc/source/core/tool/chartarr.cxx b/sc/source/core/tool/chartarr.cxx index bd2b06001726..e4def00c10b0 100644 --- a/sc/source/core/tool/chartarr.cxx +++ b/sc/source/core/tool/chartarr.cxx @@ -36,8 +36,8 @@ // INCLUDE --------------------------------------------------------------- #include "scitems.hxx" -#include -#include +#include +#include #include // DBL_MIN #include "chartarr.hxx" diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx index 2a9ca186bf85..7dfd75206a9f 100644 --- a/sc/source/core/tool/chgtrack.cxx +++ b/sc/source/core/tool/chgtrack.cxx @@ -36,10 +36,10 @@ #include // SHL_CALC #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -2340,7 +2340,7 @@ void ScChangeTrack::Clear() } -void __EXPORT ScChangeTrack::ConfigurationChanged( utl::ConfigurationBroadcaster* ) +void __EXPORT ScChangeTrack::ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 ) { if ( !pDoc->IsInDtorClear() ) { diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index a8ca4be2b5b6..949326d35091 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/core/tool/ddelink.cxx b/sc/source/core/tool/ddelink.cxx index cab3322401a8..446f892452fc 100644 --- a/sc/source/core/tool/ddelink.cxx +++ b/sc/source/core/tool/ddelink.cxx @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include "ddelink.hxx" #include "brdcst.hxx" diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx index a08b81a1917c..fed4a3b0ae40 100644 --- a/sc/source/core/tool/detfunc.cxx +++ b/sc/source/core/tool/detfunc.cxx @@ -61,7 +61,7 @@ #include #include #include -#include +#include #include #include diff --git a/sc/source/core/tool/docoptio.cxx b/sc/source/core/tool/docoptio.cxx index 13934914a3f3..37e6c68fbf03 100644 --- a/sc/source/core/tool/docoptio.cxx +++ b/sc/source/core/tool/docoptio.cxx @@ -34,7 +34,7 @@ #include -#include +#include #include #include diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx index 5519c679f84e..e4f2c07a3c57 100644 --- a/sc/source/core/tool/editutil.cxx +++ b/sc/source/core/tool/editutil.cxx @@ -49,11 +49,11 @@ #include #include #include -#include -#include +#include +#include #ifndef _SVSTDARR_USHORTS #define _SVSTDARR_USHORTS -#include +#include #endif #include "editutil.hxx" diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 904c2625730c..488bb818d615 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -37,8 +37,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index fc0f085706c5..cb418476e9d9 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -36,8 +36,8 @@ #include #include #include -#include -#include +#include +#include #include #include "interpre.hxx" diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index 11fd414c81f2..2880d7708b10 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx index 7da4778bfe1a..482748cbb547 100644 --- a/sc/source/core/tool/interpr5.cxx +++ b/sc/source/core/tool/interpr5.cxx @@ -45,7 +45,7 @@ #include #endif #include -#include +#include #include "interpre.hxx" #include "global.hxx" diff --git a/sc/source/core/tool/optutil.cxx b/sc/source/core/tool/optutil.cxx index 3f3d2886dfa7..36fea8a5e899 100644 --- a/sc/source/core/tool/optutil.cxx +++ b/sc/source/core/tool/optutil.cxx @@ -37,7 +37,7 @@ #include "optutil.hxx" #include "global.hxx" // for pSysLocale -#include +#include //------------------------------------------------------------------ diff --git a/sc/source/core/tool/printopt.cxx b/sc/source/core/tool/printopt.cxx index dae055b5f47e..157375f32c91 100644 --- a/sc/source/core/tool/printopt.cxx +++ b/sc/source/core/tool/printopt.cxx @@ -210,4 +210,5 @@ void ScPrintCfg::SetOptions( const ScPrintOptions& rNew ) SetModified(); } +void ScPrintCfg::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} diff --git a/sc/source/core/tool/progress.cxx b/sc/source/core/tool/progress.cxx index 450736997c2d..a24c33cf6255 100644 --- a/sc/source/core/tool/progress.cxx +++ b/sc/source/core/tool/progress.cxx @@ -40,8 +40,8 @@ #include #include #include -#include -#include +#include +#include #define SC_PROGRESS_CXX #include "progress.hxx" diff --git a/sc/source/core/tool/rangeseq.cxx b/sc/source/core/tool/rangeseq.cxx index 499dbf0a6ba1..078f9a774c09 100644 --- a/sc/source/core/tool/rangeseq.cxx +++ b/sc/source/core/tool/rangeseq.cxx @@ -33,7 +33,7 @@ -#include +#include #include #include diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index ad7147ccb14d..6195164e34fa 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -38,7 +38,7 @@ #include "address.hxx" #include "formula/errorcodes.hxx" #include "interpre.hxx" -#include +#include #include #include diff --git a/sc/source/core/tool/zforauto.cxx b/sc/source/core/tool/zforauto.cxx index f8d2bd3f1906..62a6b48c4da0 100644 --- a/sc/source/core/tool/zforauto.cxx +++ b/sc/source/core/tool/zforauto.cxx @@ -31,8 +31,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sc.hxx" -#include -#include +#include +#include #include #include diff --git a/sc/source/filter/dif/difimp.cxx b/sc/source/filter/dif/difimp.cxx index cf0ccf5447a3..77803d338788 100644 --- a/sc/source/filter/dif/difimp.cxx +++ b/sc/source/filter/dif/difimp.cxx @@ -34,7 +34,7 @@ //------------------------------------------------------------------------ #include "scitems.hxx" -#include +#include #include "dif.hxx" #include "filter.hxx" diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx index d1b08b9cfc68..06ffaea3c6f4 100644 --- a/sc/source/filter/excel/excdoc.cxx +++ b/sc/source/filter/excel/excdoc.cxx @@ -42,8 +42,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx index 8365ef0db3f9..41529b66346f 100644 --- a/sc/source/filter/excel/excel.cxx +++ b/sc/source/filter/excel/excel.cxx @@ -43,7 +43,7 @@ #include #include #include "scitems.hxx" -#include +#include #include "filter.hxx" #include "document.hxx" #include "xistream.hxx" diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx index bff8d4cba246..34d51f0f9df5 100644 --- a/sc/source/filter/excel/excrecds.cxx +++ b/sc/source/filter/excel/excrecds.cxx @@ -62,13 +62,13 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #define _SVSTDARR_USHORTS -#include +#include #include diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx index 5a0ae1f9a972..8258cbbc12db 100644 --- a/sc/source/filter/excel/impop.cxx +++ b/sc/source/filter/excel/impop.cxx @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include #include "docuno.hxx" diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index 1d09082ede82..ad51304b3e3e 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include "scitems.hxx" #include diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index 45a44b2c88d1..23a559d9bc83 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include @@ -49,7 +49,7 @@ #include #define _SVSTDARR_USHORTS -#include +#include #include "document.hxx" #include "docpool.hxx" #include "cell.hxx" diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx index 47f101f4c351..46fcd166ecf1 100644 --- a/sc/source/filter/excel/xelink.cxx +++ b/sc/source/filter/excel/xelink.cxx @@ -34,7 +34,7 @@ #include #include -#include +#include #include "document.hxx" #include "cell.hxx" #include "scextopt.hxx" diff --git a/sc/source/filter/excel/xepage.cxx b/sc/source/filter/excel/xepage.cxx index 36d7a9dc31b7..47414c07bec8 100644 --- a/sc/source/filter/excel/xepage.cxx +++ b/sc/source/filter/excel/xepage.cxx @@ -32,10 +32,10 @@ #include "precompiled_sc.hxx" #include "xepage.hxx" -#include +#include #include "scitems.hxx" -#include -#include +#include +#include #include #include #include diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx index 69b323e1e718..bc694d01725e 100644 --- a/sc/source/filter/excel/xepivot.cxx +++ b/sc/source/filter/excel/xepivot.cxx @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include "document.hxx" #include "dpobject.hxx" diff --git a/sc/source/filter/excel/xeroot.cxx b/sc/source/filter/excel/xeroot.cxx index c4acc89c1ff0..45f90732b070 100644 --- a/sc/source/filter/excel/xeroot.cxx +++ b/sc/source/filter/excel/xeroot.cxx @@ -33,9 +33,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include "xecontent.hxx" #include "xltracer.hxx" #include "xehelper.hxx" diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index 2172a7678763..6356aba5e932 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -37,8 +37,8 @@ #include #include #include -#include -#include +#include +#include #include #include "scitems.hxx" #include diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index ef30e9a78f6d..1583828706cc 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -35,7 +35,7 @@ #include #include #include "scitems.hxx" -#include +#include #include "document.hxx" #include "dociter.hxx" #include "olinetab.hxx" diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx index 7b5fb222a12b..444cf4c848d1 100644 --- a/sc/source/filter/excel/xicontent.cxx +++ b/sc/source/filter/excel/xicontent.cxx @@ -37,11 +37,11 @@ #include #include #include -#include +#include #include "scitems.hxx" #include -#include -#include +#include +#include #include #include #include diff --git a/sc/source/filter/excel/xihelper.cxx b/sc/source/filter/excel/xihelper.cxx index 47b42ad51e93..99dd5632443b 100644 --- a/sc/source/filter/excel/xihelper.cxx +++ b/sc/source/filter/excel/xihelper.cxx @@ -31,7 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sc.hxx" #include "xihelper.hxx" -#include +#include #include #include #include "scitems.hxx" diff --git a/sc/source/filter/excel/xipage.cxx b/sc/source/filter/excel/xipage.cxx index 2a5252193728..4d5b5c1ce56b 100644 --- a/sc/source/filter/excel/xipage.cxx +++ b/sc/source/filter/excel/xipage.cxx @@ -31,11 +31,11 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sc.hxx" #include "xipage.hxx" -#include +#include #include #include "scitems.hxx" -#include -#include +#include +#include #include #include #include diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx index acd371f43f7d..56532f1281cc 100644 --- a/sc/source/filter/excel/xipivot.cxx +++ b/sc/source/filter/excel/xipivot.cxx @@ -39,8 +39,8 @@ #include #include -#include -#include +#include +#include #include "document.hxx" #include "cell.hxx" diff --git a/sc/source/filter/excel/xlchart.cxx b/sc/source/filter/excel/xlchart.cxx index d5664c088e29..e15adca249c5 100644 --- a/sc/source/filter/excel/xlchart.cxx +++ b/sc/source/filter/excel/xlchart.cxx @@ -48,7 +48,7 @@ #include #include -#include +#include #include #include #include diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx index 29522f4f50ff..e02a2f149327 100644 --- a/sc/source/filter/excel/xlroot.cxx +++ b/sc/source/filter/excel/xlroot.cxx @@ -33,8 +33,8 @@ #include "xlroot.hxx" #include #include -#include -#include +#include +#include #include #include #include diff --git a/sc/source/filter/ftools/fapihelper.cxx b/sc/source/filter/ftools/fapihelper.cxx index 31190b6407b1..299708d2e11c 100644 --- a/sc/source/filter/ftools/fapihelper.cxx +++ b/sc/source/filter/ftools/fapihelper.cxx @@ -42,8 +42,8 @@ #include #include #include -#include -#include +#include +#include #include "miscuno.hxx" using ::rtl::OUString; diff --git a/sc/source/filter/ftools/ftools.cxx b/sc/source/filter/ftools/ftools.cxx index 2271a8f35d4d..917cba6c34ce 100644 --- a/sc/source/filter/ftools/ftools.cxx +++ b/sc/source/filter/ftools/ftools.cxx @@ -33,9 +33,9 @@ #include "ftools.hxx" #include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx index ac6a5ac5705f..8d6486fca38d 100644 --- a/sc/source/filter/html/htmlexp.cxx +++ b/sc/source/filter/html/htmlexp.cxx @@ -57,13 +57,13 @@ #include #include #include -#include -#include +#include +#include #ifndef _SVSTDARR_USHORTS #define _SVSTDARR_USHORTS #endif -#include -#include +#include +#include #include #include #include @@ -88,7 +88,7 @@ #include #include -#include +#include // ohne sc.hrc: error C2679: binary '=' : no operator defined which takes a diff --git a/sc/source/filter/html/htmlexp2.cxx b/sc/source/filter/html/htmlexp2.cxx index b9705e66936d..6793cb879751 100644 --- a/sc/source/filter/html/htmlexp2.cxx +++ b/sc/source/filter/html/htmlexp2.cxx @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include "htmlexp.hxx" diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index 36bbfe1d2787..99b5150621ef 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/filter/inc/eeparser.hxx b/sc/source/filter/inc/eeparser.hxx index ce1848d25cd9..a5398fb8fa84 100644 --- a/sc/source/filter/inc/eeparser.hxx +++ b/sc/source/filter/inc/eeparser.hxx @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include diff --git a/sc/source/filter/inc/excrecds.hxx b/sc/source/filter/inc/excrecds.hxx index 568032aa317f..071b5b4b9380 100644 --- a/sc/source/filter/inc/excrecds.hxx +++ b/sc/source/filter/inc/excrecds.hxx @@ -32,7 +32,7 @@ #define SC_EXCRECDS_HXX #include -#include +#include #include #include #include diff --git a/sc/source/filter/inc/filt_pch.hxx b/sc/source/filter/inc/filt_pch.hxx index b0ef236519a3..606cc2c98482 100644 --- a/sc/source/filter/inc/filt_pch.hxx +++ b/sc/source/filter/inc/filt_pch.hxx @@ -67,7 +67,7 @@ #include #include #include -#include +#include #include #include #include @@ -99,8 +99,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -108,9 +108,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include @@ -118,8 +118,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -131,14 +131,14 @@ #include #include #include -#include +#include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include @@ -170,7 +170,7 @@ #include #include #include -#include +#include #include #include #include @@ -243,11 +243,11 @@ #include #include #include -#include +#include #include #include #include -#include +#include #include #include #include diff --git a/sc/source/filter/inc/xestyle.hxx b/sc/source/filter/inc/xestyle.hxx index fb2ea876c279..50073950511b 100644 --- a/sc/source/filter/inc/xestyle.hxx +++ b/sc/source/filter/inc/xestyle.hxx @@ -34,8 +34,8 @@ #include #include #include -#include -#include +#include +#include #include #include "xerecord.hxx" #include "xlstyle.hxx" diff --git a/sc/source/filter/inc/xichart.hxx b/sc/source/filter/inc/xichart.hxx index 1798242df3c6..e09530083965 100644 --- a/sc/source/filter/inc/xichart.hxx +++ b/sc/source/filter/inc/xichart.hxx @@ -36,7 +36,7 @@ #include #include -#include +#include #include "rangelst.hxx" #include "xlchart.hxx" diff --git a/sc/source/filter/inc/xlstyle.hxx b/sc/source/filter/inc/xlstyle.hxx index ebb22c2cb05f..126087ad1e89 100644 --- a/sc/source/filter/inc/xlstyle.hxx +++ b/sc/source/filter/inc/xlstyle.hxx @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include "fapihelper.hxx" class XclRoot; diff --git a/sc/source/filter/lotus/tool.cxx b/sc/source/filter/lotus/tool.cxx index b413384064c4..a0c9a25d58d9 100644 --- a/sc/source/filter/lotus/tool.cxx +++ b/sc/source/filter/lotus/tool.cxx @@ -37,7 +37,7 @@ #include "scitems.hxx" #include -#include +#include #include #include "cell.hxx" diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx index 9c28cf49d729..c3650e882973 100644 --- a/sc/source/filter/rtf/eeimpars.cxx +++ b/sc/source/filter/rtf/eeimpars.cxx @@ -50,10 +50,10 @@ #include #include #include -#include +#include #include #include -#include +#include #include #include "eeimport.hxx" diff --git a/sc/source/filter/rtf/rtfexp.cxx b/sc/source/filter/rtf/rtfexp.cxx index aee41be1a441..88611ca72283 100644 --- a/sc/source/filter/rtf/rtfexp.cxx +++ b/sc/source/filter/rtf/rtfexp.cxx @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include diff --git a/sc/source/filter/starcalc/scflt.cxx b/sc/source/filter/starcalc/scflt.cxx index e2a7d9e4d538..b54e3bb97fab 100644 --- a/sc/source/filter/starcalc/scflt.cxx +++ b/sc/source/filter/starcalc/scflt.cxx @@ -55,8 +55,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/sc/source/filter/xcl97/XclImpChangeTrack.cxx b/sc/source/filter/xcl97/XclImpChangeTrack.cxx index 2f546e323179..1a8480a5e758 100644 --- a/sc/source/filter/xcl97/XclImpChangeTrack.cxx +++ b/sc/source/filter/xcl97/XclImpChangeTrack.cxx @@ -34,7 +34,7 @@ #include "XclImpChangeTrack.hxx" #include #include -#include +#include #include "chgviset.hxx" #include "cell.hxx" #include "chgtrack.hxx" diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx index a11b814643d8..04458f5b55be 100644 --- a/sc/source/filter/xcl97/xcl97rec.cxx +++ b/sc/source/filter/xcl97/xcl97rec.cxx @@ -37,14 +37,14 @@ #include #include #include -#include +#include #include #include #include #include #include #include -#include +#include #include "cell.hxx" #include "drwlayer.hxx" diff --git a/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx index ac09f19a6dbe..da3c6c29bc30 100644 --- a/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx +++ b/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx @@ -45,7 +45,7 @@ #include #include #include -#include +#include #define SC_CHANGE_ID_PREFIX "ct" diff --git a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx index 2b16d33f1376..33a77df4f4dd 100644 --- a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx +++ b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx @@ -38,7 +38,7 @@ #include "rangeutl.hxx" #include #include -#include +#include #include #define SC_CHANGE_ID_PREFIX "ct" diff --git a/sc/source/filter/xml/XMLTrackedChangesContext.cxx b/sc/source/filter/xml/XMLTrackedChangesContext.cxx index 2d8eac1dfc76..74b0518a6c62 100644 --- a/sc/source/filter/xml/XMLTrackedChangesContext.cxx +++ b/sc/source/filter/xml/XMLTrackedChangesContext.cxx @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 6a42d505cdc8..2f3f847c6c58 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -65,12 +65,12 @@ #include #include #include -#include +#include #include #include #include #include -#include +#include #include #include diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 2dc19e428ad9..94613379a32d 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -88,7 +88,7 @@ #include #include -#include +#include #include #include #include diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index 8e3f4b421a6c..5d07670f53a2 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -33,7 +33,7 @@ // INCLUDE --------------------------------------------------------------- -#include +#include #include #include @@ -51,9 +51,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "xmlimprt.hxx" #include "document.hxx" diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx index d13956fd1ca3..98e8b2e1e83f 100644 --- a/sc/source/filter/xml/xmlwrap.cxx +++ b/sc/source/filter/xml/xmlwrap.cxx @@ -45,8 +45,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/sc/source/ui/Accessibility/AccessibleContextBase.cxx b/sc/source/ui/Accessibility/AccessibleContextBase.cxx index 8774ef74f86d..b611198974de 100644 --- a/sc/source/ui/Accessibility/AccessibleContextBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleContextBase.cxx @@ -47,7 +47,7 @@ #include #endif #include -#include +#include #include #include #include diff --git a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx index fdb7696f7f6c..960e58760512 100644 --- a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx +++ b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx @@ -52,10 +52,10 @@ #include #include -#include +#include #include -#include -#include +#include +#include #include #include diff --git a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx index ddb317ccc1b0..fabd1fc932cc 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx @@ -51,7 +51,7 @@ #include #include -#include +#include #include #include #include diff --git a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx index f4196896083b..0746495ca099 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx @@ -52,7 +52,7 @@ #include #include -#include +#include #include #include diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx index 53f063db0e66..88b3d42996f6 100644 --- a/sc/source/ui/app/drwtrans.cxx +++ b/sc/source/ui/app/drwtrans.cxx @@ -60,8 +60,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 46987c88636f..c6901707d2c3 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -57,7 +57,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 5a3fd605b08f..f1d64074ea33 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -54,7 +54,7 @@ #include #include #include -#include +#include #include "inputwin.hxx" #include "scmod.hxx" diff --git a/sc/source/ui/app/lnktrans.cxx b/sc/source/ui/app/lnktrans.cxx index 314f051881f1..89a51cd2b2b0 100644 --- a/sc/source/ui/app/lnktrans.cxx +++ b/sc/source/ui/app/lnktrans.cxx @@ -35,7 +35,7 @@ -#include +#include #include "lnktrans.hxx" #include "scmod.hxx" diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index 43041d1be852..d72c94022123 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -56,7 +56,7 @@ #include #include -#include +#include #include #include #include @@ -66,7 +66,7 @@ #include #include -#include +#include #include #include #include @@ -74,7 +74,7 @@ #include #include #include -#include +#include #include #include @@ -217,125 +217,128 @@ ScModule::~ScModule() } //------------------------------------------------------------------ - -void ScModule::Notify( SfxBroadcaster&, const SfxHint& rHint ) +void ScModule::ConfigurationChanged( utl::ConfigurationBroadcaster* p, sal_uInt32 ) { - if ( rHint.ISA(SfxSimpleHint) ) + if ( p == pColorConfig || p == pAccessOptions ) { - ULONG nHintId = ((SfxSimpleHint&)rHint).GetId(); - if ( nHintId == SFX_HINT_DEINITIALIZING ) - { - // ConfigItems must be removed before ConfigManager - DeleteCfg(); - } - else if ( nHintId == SFX_HINT_COLORS_CHANGED || nHintId == SFX_HINT_ACCESSIBILITY_CHANGED ) + // Test if detective objects have to be updated with new colors + // (if the detective colors haven't been used yet, there's nothing to update) + if ( ScDetectiveFunc::IsColorsInitialized() ) { - // Test if detective objects have to be updated with new colors - // (if the detective colors haven't been used yet, there's nothing to update) - if ( ScDetectiveFunc::IsColorsInitialized() ) + const svtools::ColorConfig& rColors = GetColorConfig(); + BOOL bArrows = + ( ScDetectiveFunc::GetArrowColor() != (ColorData)rColors.GetColorValue(svtools::CALCDETECTIVE).nColor || + ScDetectiveFunc::GetErrorColor() != (ColorData)rColors.GetColorValue(svtools::CALCDETECTIVEERROR).nColor ); + BOOL bComments = + ( ScDetectiveFunc::GetCommentColor() != (ColorData)rColors.GetColorValue(svtools::CALCNOTESBACKGROUND).nColor ); + if ( bArrows || bComments ) { - const svtools::ColorConfig& rColors = GetColorConfig(); - BOOL bArrows = - ( ScDetectiveFunc::GetArrowColor() != (ColorData)rColors.GetColorValue(svtools::CALCDETECTIVE).nColor || - ScDetectiveFunc::GetErrorColor() != (ColorData)rColors.GetColorValue(svtools::CALCDETECTIVEERROR).nColor ); - BOOL bComments = - ( ScDetectiveFunc::GetCommentColor() != (ColorData)rColors.GetColorValue(svtools::CALCNOTESBACKGROUND).nColor ); - if ( bArrows || bComments ) - { - ScDetectiveFunc::InitializeColors(); // get the new colors + ScDetectiveFunc::InitializeColors(); // get the new colors - // update detective objects in all open documents - SfxObjectShell* pObjSh = SfxObjectShell::GetFirst(); - while ( pObjSh ) + // update detective objects in all open documents + SfxObjectShell* pObjSh = SfxObjectShell::GetFirst(); + while ( pObjSh ) + { + if ( pObjSh->Type() == TYPE(ScDocShell) ) { - if ( pObjSh->Type() == TYPE(ScDocShell) ) - { - ScDocShell* pDocSh = ((ScDocShell*)pObjSh); - if ( bArrows ) - ScDetectiveFunc( pDocSh->GetDocument(), 0 ).UpdateAllArrowColors(); - if ( bComments ) - ScDetectiveFunc::UpdateAllComments( *pDocSh->GetDocument() ); - } - pObjSh = SfxObjectShell::GetNext( *pObjSh ); + ScDocShell* pDocSh = ((ScDocShell*)pObjSh); + if ( bArrows ) + ScDetectiveFunc( pDocSh->GetDocument(), 0 ).UpdateAllArrowColors(); + if ( bComments ) + ScDetectiveFunc::UpdateAllComments( *pDocSh->GetDocument() ); } + pObjSh = SfxObjectShell::GetNext( *pObjSh ); } } + } - // force all views to repaint, using the new options + // force all views to repaint, using the new options - SfxViewShell* pViewShell = SfxViewShell::GetFirst(); - while(pViewShell) + SfxViewShell* pViewShell = SfxViewShell::GetFirst(); + while(pViewShell) + { + if ( pViewShell->ISA(ScTabViewShell) ) { - if ( pViewShell->ISA(ScTabViewShell) ) - { - ScTabViewShell* pViewSh = (ScTabViewShell*)pViewShell; - pViewSh->PaintGrid(); - pViewSh->PaintTop(); - pViewSh->PaintLeft(); - pViewSh->PaintExtras(); - - ScInputHandler* pHdl = pViewSh->GetInputHandler(); - if ( pHdl ) - pHdl->ForgetLastPattern(); // EditEngine BackgroundColor may change - } - else if ( pViewShell->ISA(ScPreviewShell) ) - { - Window* pWin = pViewShell->GetWindow(); - if (pWin) - pWin->Invalidate(); - } - pViewShell = SfxViewShell::GetNext( *pViewShell ); + ScTabViewShell* pViewSh = (ScTabViewShell*)pViewShell; + pViewSh->PaintGrid(); + pViewSh->PaintTop(); + pViewSh->PaintLeft(); + pViewSh->PaintExtras(); + + ScInputHandler* pHdl = pViewSh->GetInputHandler(); + if ( pHdl ) + pHdl->ForgetLastPattern(); // EditEngine BackgroundColor may change + } + else if ( pViewShell->ISA(ScPreviewShell) ) + { + Window* pWin = pViewShell->GetWindow(); + if (pWin) + pWin->Invalidate(); } + pViewShell = SfxViewShell::GetNext( *pViewShell ); } - else if ( nHintId == SFX_HINT_CTL_SETTINGS_CHANGED ) + } + else if ( p == pCTLOptions ) + { + // for all documents: set digit language for printer, recalc output factor, update row heights + SfxObjectShell* pObjSh = SfxObjectShell::GetFirst(); + while ( pObjSh ) { - // for all documents: set digit language for printer, recalc output factor, update row heights - SfxObjectShell* pObjSh = SfxObjectShell::GetFirst(); - while ( pObjSh ) + if ( pObjSh->Type() == TYPE(ScDocShell) ) { - if ( pObjSh->Type() == TYPE(ScDocShell) ) - { - ScDocShell* pDocSh = ((ScDocShell*)pObjSh); - OutputDevice* pPrinter = pDocSh->GetPrinter(); - if ( pPrinter ) - pPrinter->SetDigitLanguage( GetOptDigitLanguage() ); + ScDocShell* pDocSh = ((ScDocShell*)pObjSh); + OutputDevice* pPrinter = pDocSh->GetPrinter(); + if ( pPrinter ) + pPrinter->SetDigitLanguage( GetOptDigitLanguage() ); - pDocSh->CalcOutputFactor(); + pDocSh->CalcOutputFactor(); - SCTAB nTabCount = pDocSh->GetDocument()->GetTableCount(); - for (SCTAB nTab=0; nTabAdjustRowHeight( 0, MAXROW, nTab ); - } - pObjSh = SfxObjectShell::GetNext( *pObjSh ); + SCTAB nTabCount = pDocSh->GetDocument()->GetTableCount(); + for (SCTAB nTab=0; nTabAdjustRowHeight( 0, MAXROW, nTab ); } + pObjSh = SfxObjectShell::GetNext( *pObjSh ); + } - // for all views (table and preview): update digit language - SfxViewShell* pSh = SfxViewShell::GetFirst(); - while ( pSh ) + // for all views (table and preview): update digit language + SfxViewShell* pSh = SfxViewShell::GetFirst(); + while ( pSh ) + { + if ( pSh->ISA( ScTabViewShell ) ) { - if ( pSh->ISA( ScTabViewShell ) ) - { - ScTabViewShell* pViewSh = (ScTabViewShell*)pSh; + ScTabViewShell* pViewSh = (ScTabViewShell*)pSh; - // set ref-device for EditEngine (re-evaluates digit settings) - ScInputHandler* pHdl = GetInputHdl(pViewSh); - if (pHdl) - pHdl->UpdateRefDevice(); - - pViewSh->DigitLanguageChanged(); - pViewSh->PaintGrid(); - } - else if ( pSh->ISA( ScPreviewShell ) ) - { - ScPreviewShell* pPreviewSh = (ScPreviewShell*)pSh; - ScPreview* pPreview = pPreviewSh->GetPreview(); + // set ref-device for EditEngine (re-evaluates digit settings) + ScInputHandler* pHdl = GetInputHdl(pViewSh); + if (pHdl) + pHdl->UpdateRefDevice(); - pPreview->SetDigitLanguage( GetOptDigitLanguage() ); - pPreview->Invalidate(); - } + pViewSh->DigitLanguageChanged(); + pViewSh->PaintGrid(); + } + else if ( pSh->ISA( ScPreviewShell ) ) + { + ScPreviewShell* pPreviewSh = (ScPreviewShell*)pSh; + ScPreview* pPreview = pPreviewSh->GetPreview(); - pSh = SfxViewShell::GetNext( *pSh ); + pPreview->SetDigitLanguage( GetOptDigitLanguage() ); + pPreview->Invalidate(); } + + pSh = SfxViewShell::GetNext( *pSh ); + } + } +} + +void ScModule::Notify( SfxBroadcaster&, const SfxHint& rHint ) +{ + if ( rHint.ISA(SfxSimpleHint) ) + { + ULONG nHintId = ((SfxSimpleHint&)rHint).GetId(); + if ( nHintId == SFX_HINT_DEINITIALIZING ) + { + // ConfigItems must be removed before ConfigManager + DeleteCfg(); } } } @@ -354,17 +357,17 @@ void ScModule::DeleteCfg() if ( pColorConfig ) { - EndListening(*pColorConfig); + pColorConfig->RemoveListener(this); DELETEZ( pColorConfig ); } if ( pAccessOptions ) { - EndListening(*pAccessOptions); + pAccessOptions->RemoveListener(this); DELETEZ( pAccessOptions ); } if ( pCTLOptions ) { - EndListening(*pCTLOptions); + pCTLOptions->RemoveListener(this); DELETEZ( pCTLOptions ); } if( pUserOptions ) @@ -967,7 +970,7 @@ svtools::ColorConfig& ScModule::GetColorConfig() if ( !pColorConfig ) { pColorConfig = new svtools::ColorConfig; - StartListening(*pColorConfig); + pColorConfig->AddListener(this); } return *pColorConfig; @@ -978,7 +981,7 @@ SvtAccessibilityOptions& ScModule::GetAccessOptions() if ( !pAccessOptions ) { pAccessOptions = new SvtAccessibilityOptions; - StartListening(*pAccessOptions); + pAccessOptions->AddListener(this); } return *pAccessOptions; @@ -989,7 +992,7 @@ SvtCTLOptions& ScModule::GetCTLOptions() if ( !pCTLOptions ) { pCTLOptions = new SvtCTLOptions; - StartListening(*pCTLOptions); + pCTLOptions->AddListener(this); } return *pCTLOptions; diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index 94a2cdfc3324..c37fced30109 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -66,8 +66,8 @@ #include #include #include -#include -#include +#include +#include #include "docsh.hxx" #include "markdata.hxx" #include "stlpool.hxx" diff --git a/sc/source/ui/app/typemap.cxx b/sc/source/ui/app/typemap.cxx index eedfab338844..1a36b8ca5125 100644 --- a/sc/source/ui/app/typemap.cxx +++ b/sc/source/ui/app/typemap.cxx @@ -64,8 +64,8 @@ #include -#include -#include +#include +#include #include #include #include @@ -80,7 +80,7 @@ #include #include #include -#include +#include #include #include #include @@ -117,15 +117,15 @@ #include #include #include -#include -#include +#include +#include #include #include // #i25616# #include -#include +#include #include #include "attrib.hxx" diff --git a/sc/source/ui/attrdlg/attrdlg.cxx b/sc/source/ui/attrdlg/attrdlg.cxx index 9fd600409211..05bcf624a1b3 100644 --- a/sc/source/ui/attrdlg/attrdlg.cxx +++ b/sc/source/ui/attrdlg/attrdlg.cxx @@ -45,7 +45,7 @@ //CHINA001 #include //CHINA001 #include //CHINA001 #include -#include +#include #include "tabpages.hxx" #include "attrdlg.hxx" diff --git a/sc/source/ui/attrdlg/condfrmt.cxx b/sc/source/ui/attrdlg/condfrmt.cxx index 704546d76bf6..c08f8fa2dcea 100644 --- a/sc/source/ui/attrdlg/condfrmt.cxx +++ b/sc/source/ui/attrdlg/condfrmt.cxx @@ -33,7 +33,7 @@ #include -#include +#include #include "tabvwsh.hxx" #include "reffact.hxx" diff --git a/sc/source/ui/cctrl/tbinsert.cxx b/sc/source/ui/cctrl/tbinsert.cxx index 07505476aa16..4e0689eb13fd 100644 --- a/sc/source/ui/cctrl/tbinsert.cxx +++ b/sc/source/ui/cctrl/tbinsert.cxx @@ -40,7 +40,7 @@ // INCLUDE --------------------------------------------------------------- #include -#include +#include #include #include #include diff --git a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx index bf957b889d82..45a48ac21c07 100644 --- a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx +++ b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx @@ -48,7 +48,7 @@ #ifndef _SV_GRADIENT_HXX #include #endif -#include +#include #include #include #include diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx index ddbfb4426df8..e33ecde514a4 100644 --- a/sc/source/ui/dbgui/csvgrid.cxx +++ b/sc/source/ui/dbgui/csvgrid.cxx @@ -37,7 +37,7 @@ #include #include -#include +#include #include #include "scmod.hxx" #include "asciiopt.hxx" @@ -52,7 +52,7 @@ #include #include #include -#include +#include #include "editutil.hxx" // *** edit engine *** @@ -96,12 +96,12 @@ ScCsvGrid::ScCsvGrid( ScCsvControl& rParent ) : InitColors(); InitFonts(); ImplClearSplits(); - StartListening( mrColorConfig ); + mrColorConfig.AddListener(this); } ScCsvGrid::~ScCsvGrid() { - EndListening( mrColorConfig ); + mrColorConfig.RemoveListener(this); } @@ -995,14 +995,10 @@ void ScCsvGrid::DataChanged( const DataChangedEvent& rDCEvt ) ScCsvControl::DataChanged( rDCEvt ); } -void ScCsvGrid::Notify( SfxBroadcaster&, const SfxHint& rHint ) +void ScCsvGrid::ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 ) { - if( rHint.ISA( SfxSimpleHint ) && - (static_cast< const SfxSimpleHint& >( rHint ).GetId() == SFX_HINT_COLORS_CHANGED) ) - { - InitColors(); - Repaint(); - } + InitColors(); + Repaint(); } diff --git a/sc/source/ui/dbgui/pfiltdlg.cxx b/sc/source/ui/dbgui/pfiltdlg.cxx index d6bd29c7fddf..8a44d512cbe6 100644 --- a/sc/source/ui/dbgui/pfiltdlg.cxx +++ b/sc/source/ui/dbgui/pfiltdlg.cxx @@ -55,7 +55,7 @@ #define _PFILTDLG_CXX #include "pfiltdlg.hxx" #undef _PFILTDLG_CXX -#include +#include //================================================================== diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx index 8700c936e0f5..b23836d44cda 100644 --- a/sc/source/ui/dbgui/validate.cxx +++ b/sc/source/ui/dbgui/validate.cxx @@ -36,10 +36,10 @@ #endif #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx index fd3a562ecb42..31dc491e3981 100644 --- a/sc/source/ui/docshell/arealink.cxx +++ b/sc/source/ui/docshell/arealink.cxx @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include "arealink.hxx" diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index cb5d2ead509f..a0c972712568 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -48,8 +48,8 @@ #include #include #include -#include -#include +#include +#include #include diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 44d77f5517fa..810140545118 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -51,7 +51,7 @@ #include #include #include -#include +#include #include #include #include @@ -65,8 +65,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include "chgtrack.hxx" diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx index 7f213175a075..9ac98af7b043 100644 --- a/sc/source/ui/docshell/docsh2.cxx +++ b/sc/source/ui/docshell/docsh2.cxx @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index 418dfa65fff2..1416c57f1165 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -44,13 +44,11 @@ #include #include #include -//#include #include - +#include #include #include #include -#include #include #include #include @@ -443,7 +441,7 @@ void ScDocShell::InitOptions() // Fortsetzung von InitNew (CLOOKs) aDocOpt.SetAutoSpell( bAutoSpell ); // zweistellige Jahreszahleneingabe aus Extras->Optionen->Allgemein->Sonstiges - aDocOpt.SetYear2000( sal::static_int_cast( SFX_APP()->GetMiscConfig()->GetYear2000() ) ); + aDocOpt.SetYear2000( sal::static_int_cast( ::utl::MiscCfg().GetYear2000() ) ); aDocument.SetDocOptions( aDocOpt ); aDocument.SetViewOptions( aViewOpt ); diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 80b0c76a64be..4827366d3924 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -60,7 +60,7 @@ using namespace ::com::sun::star; #include #include #include -#include +#include #include #include #include @@ -73,9 +73,9 @@ using namespace ::com::sun::star; #include #include #include -#include -#include -#include +#include +#include +#include #include #include "docuno.hxx" diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx index b7c726deeb71..4855ceefb7a1 100644 --- a/sc/source/ui/docshell/docsh5.cxx +++ b/sc/source/ui/docshell/docsh5.cxx @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index d58777b9b5d5..174207bbf673 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -37,8 +37,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index 5cfc833be5dd..2abfd900b21e 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -55,12 +55,12 @@ #include "sfx2/fcontnr.hxx" #include "sfx2/sfxsids.hrc" #include "sfx2/objsh.hxx" -#include "svtools/broadcast.hxx" -#include "svtools/smplhint.hxx" -#include "svtools/itemset.hxx" -#include "svtools/stritem.hxx" -#include "svtools/urihelper.hxx" -#include "svtools/zformat.hxx" +#include "svl/broadcast.hxx" +#include "svl/smplhint.hxx" +#include "svl/itemset.hxx" +#include "svl/stritem.hxx" +#include "svl/urihelper.hxx" +#include "svl/zformat.hxx" #include "svx/linkmgr.hxx" #include "tools/urlobj.hxx" #include "unotools/ucbhelper.hxx" diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index 1561e4c6efeb..25a1c867b0e3 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -53,9 +53,9 @@ class StarBASIC; #include #include #include -#include +#include #define _SVSTDARR_ULONGS -#include +#include #include #include #include diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx index 570d41f7885d..c86c7591cd36 100644 --- a/sc/source/ui/docshell/tablink.cxx +++ b/sc/source/ui/docshell/tablink.cxx @@ -42,8 +42,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/sc/source/ui/drawfunc/chartsh.cxx b/sc/source/ui/drawfunc/chartsh.cxx index 7bb3c92dbc9c..e4d39e21d7be 100644 --- a/sc/source/ui/drawfunc/chartsh.cxx +++ b/sc/source/ui/drawfunc/chartsh.cxx @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include #include "chartsh.hxx" diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx index 63f958763479..08ef8a54b1a8 100644 --- a/sc/source/ui/drawfunc/drawsh.cxx +++ b/sc/source/ui/drawfunc/drawsh.cxx @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include #include "drawsh.hxx" @@ -71,7 +71,7 @@ #include "userdat.hxx" #include -#include +#include #include #include #include diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx index 4507bc471ebc..ad36ad72e796 100644 --- a/sc/source/ui/drawfunc/drawsh2.cxx +++ b/sc/source/ui/drawfunc/drawsh2.cxx @@ -42,8 +42,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/sc/source/ui/drawfunc/drformsh.cxx b/sc/source/ui/drawfunc/drformsh.cxx index 5e4d5640f74a..8987c9194cb2 100644 --- a/sc/source/ui/drawfunc/drformsh.cxx +++ b/sc/source/ui/drawfunc/drformsh.cxx @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include "drformsh.hxx" diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index d241843f9745..b85724d37e39 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -65,8 +65,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/sc/source/ui/drawfunc/drtxtob2.cxx b/sc/source/ui/drawfunc/drtxtob2.cxx index d05e0568c1ca..3389c362901b 100644 --- a/sc/source/ui/drawfunc/drtxtob2.cxx +++ b/sc/source/ui/drawfunc/drtxtob2.cxx @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include "sc.hrc" #include "drtxtob.hxx" diff --git a/sc/source/ui/drawfunc/fuconcustomshape.cxx b/sc/source/ui/drawfunc/fuconcustomshape.cxx index fd6fc1ff3e41..0398d5a63b43 100644 --- a/sc/source/ui/drawfunc/fuconcustomshape.cxx +++ b/sc/source/ui/drawfunc/fuconcustomshape.cxx @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx index 3274b6752c95..35d46f234182 100644 --- a/sc/source/ui/drawfunc/fuins1.cxx +++ b/sc/source/ui/drawfunc/fuins1.cxx @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx index a40bcf32dd30..1f7534a7fcb4 100644 --- a/sc/source/ui/drawfunc/fuins2.cxx +++ b/sc/source/ui/drawfunc/fuins2.cxx @@ -40,15 +40,15 @@ #include #include -#include +#include #include #include -#include +#include #include #include #include #include -#include +#include #include #include #include diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx index ebcb2ad30802..a96ce6c18980 100644 --- a/sc/source/ui/drawfunc/futext.cxx +++ b/sc/source/ui/drawfunc/futext.cxx @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include "futext.hxx" #include "drwlayer.hxx" diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx index 39b27609e3a8..34c32fb8bc08 100644 --- a/sc/source/ui/drawfunc/graphsh.cxx +++ b/sc/source/ui/drawfunc/graphsh.cxx @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/ui/drawfunc/mediash.cxx b/sc/source/ui/drawfunc/mediash.cxx index 16dcfd9f1cf7..9469cd43c96e 100644 --- a/sc/source/ui/drawfunc/mediash.cxx +++ b/sc/source/ui/drawfunc/mediash.cxx @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include diff --git a/sc/source/ui/drawfunc/oleobjsh.cxx b/sc/source/ui/drawfunc/oleobjsh.cxx index a0c5bd6d818f..c9da807019c9 100644 --- a/sc/source/ui/drawfunc/oleobjsh.cxx +++ b/sc/source/ui/drawfunc/oleobjsh.cxx @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include "oleobjsh.hxx" diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx index 8d631a9f0609..f9146b96c04c 100644 --- a/sc/source/ui/formdlg/formula.cxx +++ b/sc/source/ui/formdlg/formula.cxx @@ -39,8 +39,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/sc/source/ui/inc/AccessibilityHints.hxx b/sc/source/ui/inc/AccessibilityHints.hxx index 8448654014c7..e89069ade49a 100644 --- a/sc/source/ui/inc/AccessibilityHints.hxx +++ b/sc/source/ui/inc/AccessibilityHints.hxx @@ -33,8 +33,8 @@ #include "viewdata.hxx" #include -#include -#include +#include +#include #define SC_HINT_ACC_SIMPLE_START SFX_HINT_USER00 #define SC_HINT_ACC_TABLECHANGED SC_HINT_ACC_SIMPLE_START + 1 diff --git a/sc/source/ui/inc/AccessibleContextBase.hxx b/sc/source/ui/inc/AccessibleContextBase.hxx index 8d312a0d13d9..98f2afc8e88d 100644 --- a/sc/source/ui/inc/AccessibleContextBase.hxx +++ b/sc/source/ui/inc/AccessibleContextBase.hxx @@ -50,7 +50,7 @@ #include -#include +#include #include #include #include diff --git a/sc/source/ui/inc/DrawModelBroadcaster.hxx b/sc/source/ui/inc/DrawModelBroadcaster.hxx index 7bb71854443c..fac00ea550e4 100644 --- a/sc/source/ui/inc/DrawModelBroadcaster.hxx +++ b/sc/source/ui/inc/DrawModelBroadcaster.hxx @@ -32,7 +32,7 @@ #define _SC_DRAWMODELBROADCASTER_HXX -#include +#include #include #include #include diff --git a/sc/source/ui/inc/acredlin.hxx b/sc/source/ui/inc/acredlin.hxx index 7986935ae9c3..cdde064fc588 100644 --- a/sc/source/ui/inc/acredlin.hxx +++ b/sc/source/ui/inc/acredlin.hxx @@ -55,7 +55,7 @@ #ifndef _SVARRAY_HXX #define _SVARRAY_HXX -#include +#include #endif #include "chgtrack.hxx" #include "chgviset.hxx" diff --git a/sc/source/ui/inc/csvgrid.hxx b/sc/source/ui/inc/csvgrid.hxx index c8c633060852..583c4fd2c414 100644 --- a/sc/source/ui/inc/csvgrid.hxx +++ b/sc/source/ui/inc/csvgrid.hxx @@ -34,10 +34,8 @@ #define _SC_CSVGRID_HXX #include -#ifndef _MENU_HXX #include -#endif -#include +#include #include #include @@ -100,7 +98,7 @@ typedef ::std::vector< ScCsvColState > ScCsvColStateVec; /** A data grid control for the CSV import dialog. The design of this control simulates a Calc spreadsheet with row and column headers. */ -class SC_DLLPUBLIC ScCsvGrid : public ScCsvControl, public SfxListener +class SC_DLLPUBLIC ScCsvGrid : public ScCsvControl, public utl::ConfigurationListener { private: typedef ::std::auto_ptr< ScEditEngineDefaulter > ScEditEnginePtr; @@ -299,8 +297,7 @@ protected: virtual void DataChanged( const DataChangedEvent& rDCEvt ); - using Control::Notify; - virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + virtual void ConfigurationChanged( ::utl::ConfigurationBroadcaster*, sal_uInt32 ); // painting --------------------------------------------------------------- protected: diff --git a/sc/source/ui/inc/dwfunctr.hxx b/sc/source/ui/inc/dwfunctr.hxx index 068a05d57711..6a468a415b44 100644 --- a/sc/source/ui/inc/dwfunctr.hxx +++ b/sc/source/ui/inc/dwfunctr.hxx @@ -32,7 +32,7 @@ #include #include -#include +#include #include #ifndef _LSTBOX_HXX //autogen diff --git a/sc/source/ui/inc/formula.hxx b/sc/source/ui/inc/formula.hxx index b25811eb9220..d490e37b93ca 100644 --- a/sc/source/ui/inc/formula.hxx +++ b/sc/source/ui/inc/formula.hxx @@ -44,7 +44,7 @@ #ifndef _SVSTDARR_STRINGS #define _SVSTDARR_STRINGS -#include +#include #endif #include "compiler.hxx" diff --git a/sc/source/ui/inc/funcpage.hxx b/sc/source/ui/inc/funcpage.hxx index 753000e290ab..fc8f1813be56 100644 --- a/sc/source/ui/inc/funcpage.hxx +++ b/sc/source/ui/inc/funcpage.hxx @@ -44,7 +44,7 @@ #ifndef _SVSTDARR_STRINGS #define _SVSTDARR_STRINGS -#include +#include #endif #include diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx index 48a2a41b0fbc..99d03f2bfa2c 100644 --- a/sc/source/ui/inc/inputwin.hxx +++ b/sc/source/ui/inc/inputwin.hxx @@ -36,7 +36,7 @@ #include #endif #include -#include +#include #ifndef _COMBOBOX_HXX //autogen #include #endif diff --git a/sc/source/ui/inc/msgpool.hxx b/sc/source/ui/inc/msgpool.hxx index 954d0d7a5d47..44514766601d 100644 --- a/sc/source/ui/inc/msgpool.hxx +++ b/sc/source/ui/inc/msgpool.hxx @@ -35,9 +35,9 @@ #include -#include -#include -#include +#include +#include +#include //#include #include "uiitems.hxx" diff --git a/sc/source/ui/inc/navipi.hxx b/sc/source/ui/inc/navipi.hxx index 54434427d459..b14e668fabd0 100644 --- a/sc/source/ui/inc/navipi.hxx +++ b/sc/source/ui/inc/navipi.hxx @@ -36,8 +36,8 @@ #include #include #include -#include -#include +#include +#include #include #include "content.hxx" #include diff --git a/sc/source/ui/inc/parawin.hxx b/sc/source/ui/inc/parawin.hxx index 3835f94157ca..087c8937de9d 100644 --- a/sc/source/ui/inc/parawin.hxx +++ b/sc/source/ui/inc/parawin.hxx @@ -44,7 +44,7 @@ #ifndef _SVSTDARR_STRINGS #define _SVSTDARR_STRINGS -#include +#include #endif #include diff --git a/sc/source/ui/inc/servobj.hxx b/sc/source/ui/inc/servobj.hxx index 0eca2cfafaf1..7cd6c04bc91e 100644 --- a/sc/source/ui/inc/servobj.hxx +++ b/sc/source/ui/inc/servobj.hxx @@ -31,8 +31,8 @@ #ifndef SC_SERVOBJ_HXX #define SC_SERVOBJ_HXX -#include -#include +#include +#include #include #include "global.hxx" #include "address.hxx" diff --git a/sc/source/ui/inc/target.hxx b/sc/source/ui/inc/target.hxx index eb3b5f346ccb..1e65821915f3 100644 --- a/sc/source/ui/inc/target.hxx +++ b/sc/source/ui/inc/target.hxx @@ -31,7 +31,7 @@ #ifndef SC_TARGET_HXX #define SC_TARGET_HXX -#include +#include class ScTabViewShell; diff --git a/sc/source/ui/inc/tbzoomsliderctrl.hxx b/sc/source/ui/inc/tbzoomsliderctrl.hxx index 0132ec844233..ba1370b1960f 100644 --- a/sc/source/ui/inc/tbzoomsliderctrl.hxx +++ b/sc/source/ui/inc/tbzoomsliderctrl.hxx @@ -39,7 +39,7 @@ #include #endif #ifndef _SFXPOOLITEM_HXX //autogen -#include +#include #endif #ifndef _SFXTBXCTRL_HXX //autogen #include diff --git a/sc/source/ui/inc/ui_pch.hxx b/sc/source/ui/inc/ui_pch.hxx index 335f7e917505..d9b21fd2f0d4 100644 --- a/sc/source/ui/inc/ui_pch.hxx +++ b/sc/source/ui/inc/ui_pch.hxx @@ -43,7 +43,7 @@ #include #include -#include +#include #include #include #include @@ -53,9 +53,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include @@ -95,28 +95,28 @@ #include #include #include -#include +#include #include -#include -#include +#include +#include #include #include #include #include #include -#include +#include #include #include #include #include #include -#include +#include #include #include #include #include #include -#include +#include #include #include #include @@ -127,15 +127,15 @@ #include #include #include -#include -#include +#include +#include #include #include #include #include #include #include -#include +#include #include #include #include @@ -150,7 +150,7 @@ #include #include #include -#include +#include #include #include #include @@ -165,23 +165,23 @@ #include #include #include -#include +#include #include #include #include #include #include -#include -#include +#include +#include #include -#include +#include #include -#include +#include #include #include #include #include -#include +#include #include #include #include @@ -207,9 +207,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include @@ -300,7 +300,7 @@ #include #include #include -#include +#include #include #include #include @@ -310,7 +310,7 @@ #include #include #include -#include +#include #include #include #include @@ -326,7 +326,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/ui/inc/uiitems.hxx b/sc/source/ui/inc/uiitems.hxx index 868e772a2e68..bfa1603adb80 100644 --- a/sc/source/ui/inc/uiitems.hxx +++ b/sc/source/ui/inc/uiitems.hxx @@ -35,7 +35,7 @@ #include "conditio.hxx" #include "sortparam.hxx" #include "paramisc.hxx" -#include +#include class ScEditEngineDefaulter; class EditTextObject; diff --git a/sc/source/ui/inc/undobase.hxx b/sc/source/ui/inc/undobase.hxx index 2d3ee1d14dd7..8398b030ed68 100644 --- a/sc/source/ui/inc/undobase.hxx +++ b/sc/source/ui/inc/undobase.hxx @@ -31,7 +31,7 @@ #ifndef SC_UNDOBASE_HXX #define SC_UNDOBASE_HXX -#include +#include #include "global.hxx" #include "address.hxx" diff --git a/sc/source/ui/inc/undodraw.hxx b/sc/source/ui/inc/undodraw.hxx index 7b5d59fbb620..5ded731d5105 100644 --- a/sc/source/ui/inc/undodraw.hxx +++ b/sc/source/ui/inc/undodraw.hxx @@ -31,7 +31,7 @@ #ifndef SC_UNDODRAW_HXX #define SC_UNDODRAW_HXX -#include +#include class ScDocShell; diff --git a/sc/source/ui/inc/undotab.hxx b/sc/source/ui/inc/undotab.hxx index a7cf0d094d6b..40177a31e68e 100644 --- a/sc/source/ui/inc/undotab.hxx +++ b/sc/source/ui/inc/undotab.hxx @@ -39,14 +39,14 @@ #ifndef _SVSTDARR_SHORTS #define _SVSTDARR_SHORTS -#include +#include #endif #ifndef _SVSTDARR_STRINGS #define _SVSTDARR_STRINGS -#include +#include #endif diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx index 066aadca817a..82ddc0bad026 100644 --- a/sc/source/ui/inc/viewfunc.hxx +++ b/sc/source/ui/inc/viewfunc.hxx @@ -34,14 +34,14 @@ #ifndef _SVSTDARR_SHORTS #define _SVSTDARR_SHORTS -#include +#include #endif #ifndef _SVSTDARR_STRINGS #define _SVSTDARR_STRINGS -#include +#include #endif #include diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx index 76330036b1f5..ab2cdaba3b69 100644 --- a/sc/source/ui/miscdlgs/acredlin.cxx +++ b/sc/source/ui/miscdlgs/acredlin.cxx @@ -35,7 +35,7 @@ -#include +#include #include #include #include diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx index b4fe1f83b220..fb29b6d673ca 100644 --- a/sc/source/ui/miscdlgs/autofmt.cxx +++ b/sc/source/ui/miscdlgs/autofmt.cxx @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include #include diff --git a/sc/source/ui/miscdlgs/filldlg.cxx b/sc/source/ui/miscdlgs/filldlg.cxx index e6a8746a01be..f013c334bf37 100644 --- a/sc/source/ui/miscdlgs/filldlg.cxx +++ b/sc/source/ui/miscdlgs/filldlg.cxx @@ -37,7 +37,7 @@ //---------------------------------------------------------------------------- -#include +#include #include #include diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx index 97cc29ac3e54..8783df43d3df 100644 --- a/sc/source/ui/miscdlgs/optsolver.cxx +++ b/sc/source/ui/miscdlgs/optsolver.cxx @@ -37,7 +37,7 @@ #include "scitems.hxx" #include #include -#include +#include #include #include diff --git a/sc/source/ui/miscdlgs/scuiautofmt.cxx b/sc/source/ui/miscdlgs/scuiautofmt.cxx index e1ec71344034..32c49cf2a3ad 100644 --- a/sc/source/ui/miscdlgs/scuiautofmt.cxx +++ b/sc/source/ui/miscdlgs/scuiautofmt.cxx @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include #include diff --git a/sc/source/ui/miscdlgs/sharedocdlg.cxx b/sc/source/ui/miscdlgs/sharedocdlg.cxx index e349f18a2c27..f9893f1d3faa 100644 --- a/sc/source/ui/miscdlgs/sharedocdlg.cxx +++ b/sc/source/ui/miscdlgs/sharedocdlg.cxx @@ -34,7 +34,7 @@ //----------------------------------------------------------------------------- #include -#include +#include #include #include diff --git a/sc/source/ui/miscdlgs/solvrdlg.cxx b/sc/source/ui/miscdlgs/solvrdlg.cxx index b5fc7d8d322a..091329f1d03b 100644 --- a/sc/source/ui/miscdlgs/solvrdlg.cxx +++ b/sc/source/ui/miscdlgs/solvrdlg.cxx @@ -38,7 +38,7 @@ #include "rangelst.hxx" #include "scitems.hxx" #include -#include +#include #include #include "uiitems.hxx" diff --git a/sc/source/ui/miscdlgs/textdlgs.cxx b/sc/source/ui/miscdlgs/textdlgs.cxx index c204266bbb60..a12ad4992bff 100644 --- a/sc/source/ui/miscdlgs/textdlgs.cxx +++ b/sc/source/ui/miscdlgs/textdlgs.cxx @@ -46,13 +46,13 @@ //CHINA001 #include //CHINA001 #include #include -#include +#include #include "textdlgs.hxx" #include "scresid.hxx" #include "sc.hrc" #include //add CHINA001 -#include //add CHINA001 +#include //add CHINA001 #include //CHINA001 // ----------------------------------------------------------------------- diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index af3b5f0dee5e..8198e6adb0f4 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include "content.hxx" diff --git a/sc/source/ui/navipi/navcitem.cxx b/sc/source/ui/navipi/navcitem.cxx index 60f6c708e08c..c3807844270a 100644 --- a/sc/source/ui/navipi/navcitem.cxx +++ b/sc/source/ui/navipi/navcitem.cxx @@ -35,8 +35,8 @@ // INCLUDE --------------------------------------------------------------- -#include -#include +#include +#include #include "navcitem.hxx" #include "global.hxx" diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx index 9bba01960b32..767fec025df0 100644 --- a/sc/source/ui/navipi/navipi.cxx +++ b/sc/source/ui/navipi/navipi.cxx @@ -41,8 +41,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/sc/source/ui/navipi/scenwnd.cxx b/sc/source/ui/navipi/scenwnd.cxx index 55f26b682034..c03e5efc82bd 100644 --- a/sc/source/ui/navipi/scenwnd.cxx +++ b/sc/source/ui/navipi/scenwnd.cxx @@ -38,8 +38,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include "navipi.hxx" diff --git a/sc/source/ui/optdlg/tpprint.cxx b/sc/source/ui/optdlg/tpprint.cxx index 498dbed85285..d6e8a3ae5009 100644 --- a/sc/source/ui/optdlg/tpprint.cxx +++ b/sc/source/ui/optdlg/tpprint.cxx @@ -33,7 +33,7 @@ #undef SC_DLLIMPLEMENTATION -#include +#include #include "tpprint.hxx" #include "printopt.hxx" diff --git a/sc/source/ui/pagedlg/areasdlg.cxx b/sc/source/ui/pagedlg/areasdlg.cxx index 17c00948d3bd..f65105b0a687 100644 --- a/sc/source/ui/pagedlg/areasdlg.cxx +++ b/sc/source/ui/pagedlg/areasdlg.cxx @@ -37,7 +37,7 @@ #include #include -#include +#include #include #include #include diff --git a/sc/source/ui/pagedlg/hfedtdlg.cxx b/sc/source/ui/pagedlg/hfedtdlg.cxx index 695ede732edd..7ab719e3e10b 100644 --- a/sc/source/ui/pagedlg/hfedtdlg.cxx +++ b/sc/source/ui/pagedlg/hfedtdlg.cxx @@ -38,7 +38,7 @@ //------------------------------------------------------------------ #include "scitems.hxx" -#include +#include #include "hfedtdlg.hxx" #include "global.hxx" diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx index 9e037fbe7d0e..e55c8405fc34 100644 --- a/sc/source/ui/pagedlg/scuitphfedit.cxx +++ b/sc/source/ui/pagedlg/scuitphfedit.cxx @@ -52,7 +52,7 @@ #include #include #define _SVSTDARR_USHORTS -#include +#include //CHINA001 #include "tphfedit.hxx" #include "editutil.hxx" diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx index 5ba7a485ede8..58e5570aa01b 100644 --- a/sc/source/ui/pagedlg/tphf.cxx +++ b/sc/source/ui/pagedlg/tphf.cxx @@ -40,7 +40,7 @@ #define _TPHF_CXX #include "scitems.hxx" #include -#include +#include #include #include diff --git a/sc/source/ui/styleui/scstyles.src b/sc/source/ui/styleui/scstyles.src index 4eead4a953f2..9c367b9daf7f 100644 --- a/sc/source/ui/styleui/scstyles.src +++ b/sc/source/ui/styleui/scstyles.src @@ -29,7 +29,7 @@ ************************************************************************/ #include "sc.hrc" -#include +#include #define IMPL_FAMILY(family,filter) \ StyleFamily = family; \ FilterList = { filter } diff --git a/sc/source/ui/styleui/styledlg.cxx b/sc/source/ui/styleui/styledlg.cxx index 71066ec27ec3..ea94566b918f 100644 --- a/sc/source/ui/styleui/styledlg.cxx +++ b/sc/source/ui/styleui/styledlg.cxx @@ -47,8 +47,8 @@ //CHINA001 #include //CHINA001 #include #include -#include -#include +#include +#include #include "styledlg.hxx" #include "tabpages.hxx" // Zellvorlagen @@ -60,9 +60,9 @@ #include //CHINA001 #include //CHINA001 #include //CHINA001 -#include //CHINA001 +#include //CHINA001 #include //CHINA001 -#include //CHINA001 +#include //CHINA001 #include //CHINA001 //================================================================== diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx index eb23516cafeb..87f83ce7a932 100644 --- a/sc/source/ui/undo/undocell.cxx +++ b/sc/source/ui/undo/undocell.cxx @@ -35,7 +35,7 @@ #include #include -#include +#include #include #include "undocell.hxx" diff --git a/sc/source/ui/undo/undostyl.cxx b/sc/source/ui/undo/undostyl.cxx index 01c561e96c83..7e7f3db1d42c 100644 --- a/sc/source/ui/undo/undostyl.cxx +++ b/sc/source/ui/undo/undostyl.cxx @@ -35,7 +35,7 @@ // INCLUDE --------------------------------------------------------------- -#include +#include #include #include "undostyl.hxx" diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx index ce428311d3f8..0fc638b7825e 100644 --- a/sc/source/ui/undo/undotab.cxx +++ b/sc/source/ui/undo/undotab.cxx @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include "undotab.hxx" #include "document.hxx" diff --git a/sc/source/ui/unoobj/addruno.cxx b/sc/source/ui/unoobj/addruno.cxx index a3b026396942..9661335bbf35 100644 --- a/sc/source/ui/unoobj/addruno.cxx +++ b/sc/source/ui/unoobj/addruno.cxx @@ -36,7 +36,7 @@ #include #include -#include +#include #include "docsh.hxx" #include "unonames.hxx" diff --git a/sc/source/ui/unoobj/afmtuno.cxx b/sc/source/ui/unoobj/afmtuno.cxx index d7f1eb13c1b2..e4b9ef8a8765 100644 --- a/sc/source/ui/unoobj/afmtuno.cxx +++ b/sc/source/ui/unoobj/afmtuno.cxx @@ -36,7 +36,7 @@ #include "scitems.hxx" #include #include -#include +#include #include #include "unowids.hxx" #include diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index f3418a84e2ef..babccf9a7053 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -50,8 +50,8 @@ #include #include #include -#include -#include +#include +#include #include #include // DBL_MIN diff --git a/sc/source/ui/unoobj/cursuno.cxx b/sc/source/ui/unoobj/cursuno.cxx index b6dacccec334..99c907113bb8 100644 --- a/sc/source/ui/unoobj/cursuno.cxx +++ b/sc/source/ui/unoobj/cursuno.cxx @@ -34,8 +34,8 @@ #include "scitems.hxx" -#include -#include +#include +#include #include #include "cursuno.hxx" diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index c68baf36ba2b..ed40d2f5c96a 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -32,7 +32,7 @@ #include "precompiled_sc.hxx" #include -#include +#include #include #include "dapiuno.hxx" diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx index 13f2c26c6e47..0dd364812d48 100644 --- a/sc/source/ui/unoobj/datauno.cxx +++ b/sc/source/ui/unoobj/datauno.cxx @@ -34,8 +34,8 @@ #include -#include -#include +#include +#include #include #include diff --git a/sc/source/ui/unoobj/defltuno.cxx b/sc/source/ui/unoobj/defltuno.cxx index bc6f135ce174..3df667faad8c 100644 --- a/sc/source/ui/unoobj/defltuno.cxx +++ b/sc/source/ui/unoobj/defltuno.cxx @@ -33,8 +33,8 @@ -#include -#include +#include +#include #include #include diff --git a/sc/source/ui/unoobj/dispuno.cxx b/sc/source/ui/unoobj/dispuno.cxx index 1e2309dd2c0a..99bce5579e14 100644 --- a/sc/source/ui/unoobj/dispuno.cxx +++ b/sc/source/ui/unoobj/dispuno.cxx @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index befb6a6f76e2..4c37d7d4a780 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -40,8 +40,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx index 94078ff91af4..8fd4bba512eb 100644 --- a/sc/source/ui/unoobj/fielduno.cxx +++ b/sc/source/ui/unoobj/fielduno.cxx @@ -30,7 +30,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sc.hxx" -#include +#include #include diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx index a50b4003b0ac..a60bb836b142 100644 --- a/sc/source/ui/unoobj/funcuno.cxx +++ b/sc/source/ui/unoobj/funcuno.cxx @@ -35,7 +35,7 @@ #include #include -#include +#include #include "funcuno.hxx" #include "miscuno.hxx" diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx index 0a07b057740b..ddb5dc3b0496 100644 --- a/sc/source/ui/unoobj/linkuno.cxx +++ b/sc/source/ui/unoobj/linkuno.cxx @@ -33,7 +33,7 @@ -#include +#include #include #include "linkuno.hxx" diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx index 536e1f2a1a65..ab8576949b75 100644 --- a/sc/source/ui/unoobj/nameuno.cxx +++ b/sc/source/ui/unoobj/nameuno.cxx @@ -33,7 +33,7 @@ -#include +#include #include #include diff --git a/sc/source/ui/unoobj/notesuno.cxx b/sc/source/ui/unoobj/notesuno.cxx index e44dab865d46..8477d1f17779 100644 --- a/sc/source/ui/unoobj/notesuno.cxx +++ b/sc/source/ui/unoobj/notesuno.cxx @@ -30,7 +30,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sc.hxx" -#include +#include #include "rangelst.hxx" diff --git a/sc/source/ui/unoobj/optuno.cxx b/sc/source/ui/unoobj/optuno.cxx index 8c3deefba6d5..f7c8d2827f50 100644 --- a/sc/source/ui/unoobj/optuno.cxx +++ b/sc/source/ui/unoobj/optuno.cxx @@ -33,7 +33,7 @@ -#include +#include #include diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx index 6ed8181091ac..4600244cf2df 100644 --- a/sc/source/ui/unoobj/scdetect.cxx +++ b/sc/source/ui/unoobj/scdetect.cxx @@ -64,10 +64,10 @@ #include #include #include -#include +#include #include -#include -#include +#include +#include #include #include #include diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index 12cbdbdde1a1..941f586a73c9 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -45,10 +45,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/sc/source/ui/unoobj/targuno.cxx b/sc/source/ui/unoobj/targuno.cxx index 0fed003b751b..c63bec535e71 100644 --- a/sc/source/ui/unoobj/targuno.cxx +++ b/sc/source/ui/unoobj/targuno.cxx @@ -37,8 +37,8 @@ #include //#include #include -#include -#include +#include +#include #include #include #include diff --git a/sc/source/ui/unoobj/tokenuno.cxx b/sc/source/ui/unoobj/tokenuno.cxx index e6e194d7eb75..9d31b15fdf47 100644 --- a/sc/source/ui/unoobj/tokenuno.cxx +++ b/sc/source/ui/unoobj/tokenuno.cxx @@ -39,7 +39,7 @@ #include #include -#include +#include #include "miscuno.hxx" #include "convuno.hxx" diff --git a/sc/source/ui/unoobj/warnpassword.cxx b/sc/source/ui/unoobj/warnpassword.cxx index 6b11ac7c6641..4bf4163aad3c 100644 --- a/sc/source/ui/unoobj/warnpassword.cxx +++ b/sc/source/ui/unoobj/warnpassword.cxx @@ -35,7 +35,7 @@ #include "warnpassword.hxx" #include #include -#include +#include #include #include #include diff --git a/sc/source/ui/vba/vbafont.cxx b/sc/source/ui/vba/vbafont.cxx index 9855d5e056af..ee7004ae2fba 100644 --- a/sc/source/ui/vba/vbafont.cxx +++ b/sc/source/ui/vba/vbafont.cxx @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include "vbafont.hxx" #include "scitems.hxx" #include "cellsuno.hxx" diff --git a/sc/source/ui/vba/vbahelper.cxx b/sc/source/ui/vba/vbahelper.cxx index 353c036393c2..359a6c3d42ce 100644 --- a/sc/source/ui/vba/vbahelper.cxx +++ b/sc/source/ui/vba/vbahelper.cxx @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include diff --git a/sc/source/ui/vba/vbaworksheets.cxx b/sc/source/ui/vba/vbaworksheets.cxx index 546eda854056..8a4dd0455bb5 100644 --- a/sc/source/ui/vba/vbaworksheets.cxx +++ b/sc/source/ui/vba/vbaworksheets.cxx @@ -35,8 +35,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index 3dfd6e2479c2..e9116b19c87b 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -35,9 +35,9 @@ #include "scitems.hxx" -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index cf9cbeb468ad..6bdf172b9fb5 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -55,10 +55,10 @@ #include #define _ZFORLIST_DECLARE_TABLE -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index d17fa7160834..2d2cdd8efde3 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -41,13 +41,13 @@ #include #include #include -#include +#include #include -#include -#include +#include +#include #include -#include -#include +#include +#include #include #include diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx index dd79bb52a112..2f96aec815fb 100644 --- a/sc/source/ui/view/cellsh3.cxx +++ b/sc/source/ui/view/cellsh3.cxx @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include #include "globstr.hrc" diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx index 36667ee43c0f..5fd4a5f470f5 100644 --- a/sc/source/ui/view/dbfunc3.cxx +++ b/sc/source/ui/view/dbfunc3.cxx @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index 022eabdc11cf..b0f2197ad826 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -64,12 +64,12 @@ #include #include #include -#include +#include #include #include #include #include -#include +#include #define _EDITSH_CXX #include "editsh.hxx" diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index 36f6c682832f..fb83ed5624d6 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -60,13 +60,13 @@ #include #include #include -#include +#include #include #define _ZFORLIST_DECLARE_TABLE -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index de2b962f3272..aca88c554317 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -45,10 +45,10 @@ #include #include #include -#include +#include #include #include -#include +#include #include #include #include diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx index 5d87806076ab..6683a75e777b 100644 --- a/sc/source/ui/view/gridwin3.cxx +++ b/sc/source/ui/view/gridwin3.cxx @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include "tabvwsh.hxx" #include "gridwin.hxx" diff --git a/sc/source/ui/view/notemark.cxx b/sc/source/ui/view/notemark.cxx index 359c789e43de..419124596147 100644 --- a/sc/source/ui/view/notemark.cxx +++ b/sc/source/ui/view/notemark.cxx @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include "notemark.hxx" diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index f5688171b145..700c32e4698f 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -55,7 +55,7 @@ #include #include #include -#include +#include #include #include #include @@ -63,7 +63,7 @@ #ifndef _SVSTDARR_USHORTS #define _SVSTDARR_USHORTS -#include +#include #endif #include "output.hxx" diff --git a/sc/source/ui/view/pgbrksh.cxx b/sc/source/ui/view/pgbrksh.cxx index 421e76eaa8ce..3ab72f37ac35 100644 --- a/sc/source/ui/view/pgbrksh.cxx +++ b/sc/source/ui/view/pgbrksh.cxx @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include "pgbrksh.hxx" #include "tabvwsh.hxx" diff --git a/sc/source/ui/view/pivotsh.cxx b/sc/source/ui/view/pivotsh.cxx index 273b8965451e..2039934a6e45 100644 --- a/sc/source/ui/view/pivotsh.cxx +++ b/sc/source/ui/view/pivotsh.cxx @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include "sc.hrc" diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index b94837fc1793..31121f35aa1b 100644 --- a/sc/source/ui/view/preview.cxx +++ b/sc/source/ui/view/preview.cxx @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index 360c05e2f84a..ec4c317c7ad5 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -49,8 +49,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/sc/source/ui/view/prevwsh2.cxx b/sc/source/ui/view/prevwsh2.cxx index 157f4bffa4ec..58dc2d913c58 100644 --- a/sc/source/ui/view/prevwsh2.cxx +++ b/sc/source/ui/view/prevwsh2.cxx @@ -300,7 +300,7 @@ // INCLUDE --------------------------------------------------------------- #include -#include +#include #include "prevwsh.hxx" #include "docsh.hxx" diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx index 20f5250bca00..08b7f5f4ad85 100644 --- a/sc/source/ui/view/tabvwsh2.cxx +++ b/sc/source/ui/view/tabvwsh2.cxx @@ -41,10 +41,10 @@ #include #include -#include -#include +#include +#include #include -#include +#include #include #include "tabvwsh.hxx" @@ -67,7 +67,7 @@ // #98185# Create default drawing objects via keyboard #include -#include +#include #include #include diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx index 525ea1f14578..c49af4cdae77 100644 --- a/sc/source/ui/view/tabvwsh3.cxx +++ b/sc/source/ui/view/tabvwsh3.cxx @@ -45,8 +45,8 @@ #include #include #include -#include -#include +#include +#include #include #include @@ -78,9 +78,9 @@ #include "tabprotection.hxx" #include "protectiondlg.hxx" -#include +#include #define _SVSTDARR_ULONGS -#include +#include #include #include //CHINA001 diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index 8e32b1c9a2af..359c34ec3685 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -51,7 +51,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/ui/view/tabvwsh5.cxx b/sc/source/ui/view/tabvwsh5.cxx index 92cf03cdf5d6..a870171450ad 100644 --- a/sc/source/ui/view/tabvwsh5.cxx +++ b/sc/source/ui/view/tabvwsh5.cxx @@ -36,8 +36,8 @@ // INCLUDE --------------------------------------------------------------- #define _ZFORLIST_DECLARE_TABLE #include "scitems.hxx" -#include -#include +#include +#include #include #include #include diff --git a/sc/source/ui/view/tabvwsh9.cxx b/sc/source/ui/view/tabvwsh9.cxx index 7562e7d592a0..d3020756bbb5 100644 --- a/sc/source/ui/view/tabvwsh9.cxx +++ b/sc/source/ui/view/tabvwsh9.cxx @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include #include "tabvwsh.hxx" diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx index 9e844f970909..63f876cccf34 100644 --- a/sc/source/ui/view/tabvwsha.cxx +++ b/sc/source/ui/view/tabvwsha.cxx @@ -37,10 +37,10 @@ #define _ZFORLIST_DECLARE_TABLE #include "scitems.hxx" -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index 6312ff9e3b50..72ffe6d5ab10 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -63,8 +63,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx index 8eafd476d00d..9866a5aa0a0a 100644 --- a/sc/source/ui/view/tabvwshe.cxx +++ b/sc/source/ui/view/tabvwshe.cxx @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include "tabvwsh.hxx" diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx index 744481c4441c..4ef21a24e1ff 100644 --- a/sc/source/ui/view/tabvwshf.cxx +++ b/sc/source/ui/view/tabvwshf.cxx @@ -39,9 +39,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include "tabvwsh.hxx" diff --git a/sc/source/ui/view/tabvwshh.cxx b/sc/source/ui/view/tabvwshh.cxx index 7526a3de19bd..2d3ffc75340b 100644 --- a/sc/source/ui/view/tabvwshh.cxx +++ b/sc/source/ui/view/tabvwshh.cxx @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include "tabvwsh.hxx" diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index 50ede74ab06b..4c1bcc9e35fe 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -50,9 +50,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index 3065aa2fd4e1..3327ea3fe88d 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -173,9 +173,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx index 578f6c1fe733..b57653af5f9b 100644 --- a/sc/source/ui/view/viewfun4.cxx +++ b/sc/source/ui/view/viewfun4.cxx @@ -54,9 +54,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx index 71e8b4f9ae0b..0b429a21b6d3 100644 --- a/sc/source/ui/view/viewfun5.cxx +++ b/sc/source/ui/view/viewfun5.cxx @@ -54,8 +54,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 79343c31f85b..a3e695e7a3f8 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -48,8 +48,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx index d0a6f2acf015..cc51c48f67ed 100644 --- a/sc/source/ui/view/viewutil.cxx +++ b/sc/source/ui/view/viewutil.cxx @@ -43,17 +43,17 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include #include #include -#include -#include +#include +#include #include diff --git a/sc/workben/addin.cxx b/sc/workben/addin.cxx index 8520fb1337fe..527ae01b5c01 100644 --- a/sc/workben/addin.cxx +++ b/sc/workben/addin.cxx @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/workben/result.hxx b/sc/workben/result.hxx index 15b04a386399..9b901f93db22 100644 --- a/sc/workben/result.hxx +++ b/sc/workben/result.hxx @@ -31,7 +31,7 @@ #ifndef SC_RESULT_HXX #define SC_RESULT_HXX -#include +#include #include #include -- cgit v1.2.3 From 2273b2793ce2c497ffb11cbe0cdc9c3fc779f7f7 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Mon, 19 Oct 2009 13:22:39 +0200 Subject: #i103496#: move some fontsubstitution stuff from vcl to unotools to get xmloff vcl free --- sc/inc/cell.hxx | 2 +- sc/inc/patattr.hxx | 2 +- sc/source/core/data/attarray.cxx | 2 +- sc/source/core/data/stlpool.cxx | 2 +- sc/source/filter/excel/xltools.cxx | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sc/inc/cell.hxx b/sc/inc/cell.hxx index 6bc1716529a3..9355176e3a62 100644 --- a/sc/inc/cell.hxx +++ b/sc/inc/cell.hxx @@ -42,7 +42,7 @@ #include "tokenarray.hxx" #include "formularesult.hxx" #include -#include +#include #include "scdllapi.h" #define USE_MEMPOOL diff --git a/sc/inc/patattr.hxx b/sc/inc/patattr.hxx index c1fb936c90fe..65d350455ddd 100644 --- a/sc/inc/patattr.hxx +++ b/sc/inc/patattr.hxx @@ -33,7 +33,7 @@ #include #include -#include +#include #include #include "scdllapi.h" diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index dcc4ce2580d2..590f278901d6 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include "attarray.hxx" #include "global.hxx" diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx index 8b6f9a89edd3..e47f3899bfeb 100644 --- a/sc/source/core/data/stlpool.cxx +++ b/sc/source/core/data/stlpool.cxx @@ -52,7 +52,7 @@ #include #include #include -#include +#include #include #include diff --git a/sc/source/filter/excel/xltools.cxx b/sc/source/filter/excel/xltools.cxx index a84aaba82b90..e3eae79c3dfe 100644 --- a/sc/source/filter/excel/xltools.cxx +++ b/sc/source/filter/excel/xltools.cxx @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include "xestream.hxx" -- cgit v1.2.3 From 2f3859b83ef6c8d26e705ca519f1250a7973de3d Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Mon, 19 Oct 2009 11:45:37 +0000 Subject: #i105960# SID_UNDO and friends are no longer volatile --- sc/source/ui/docshell/docsh.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index f7d1e2ccae2f..3d1226ae576d 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -2390,9 +2390,9 @@ void ScDocShell::SetDrawModified( BOOL bIsModified /* = TRUE */ ) SetModified( bIsModified ); + SfxBindings* pBindings = GetViewBindings(); if (bUpdate) { - SfxBindings* pBindings = GetViewBindings(); if (pBindings) { pBindings->Invalidate( SID_SAVEDOC ); @@ -2402,6 +2402,16 @@ void ScDocShell::SetDrawModified( BOOL bIsModified /* = TRUE */ ) if (bIsModified) { + if (pBindings) + { + // #i105960# Undo etc used to be volatile. + // They always have to be invalidated, including drawing layer or row height changes + // (but not while pPaintLockData is set). + pBindings->Invalidate( SID_UNDO ); + pBindings->Invalidate( SID_REDO ); + pBindings->Invalidate( SID_REPEAT ); + } + if ( aDocument.IsChartListenerCollectionNeedsUpdate() ) { aDocument.UpdateChartListenerCollection(); -- cgit v1.2.3 -- cgit v1.2.3 From 9634b3fc0d9343ef1876be00fb29db78a0d7fed3 Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Wed, 21 Oct 2009 08:34:25 +0000 Subject: #i106045# invalidate stream positions for sheet operations, better handling of loaded formula results --- sc/source/core/data/cell.cxx | 6 ++++-- sc/source/core/data/table1.cxx | 18 ++++++++++++++++++ sc/source/core/data/table5.cxx | 6 ++++++ sc/source/ui/docshell/arealink.cxx | 4 ++++ sc/source/ui/docshell/docfunc.cxx | 6 ++++++ sc/source/ui/docshell/olinefun.cxx | 12 ++++++++++++ 6 files changed, 50 insertions(+), 2 deletions(-) diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx index aea2bf4ff276..cfd7caafa3f3 100644 --- a/sc/source/core/data/cell.cxx +++ b/sc/source/core/data/cell.cxx @@ -1641,8 +1641,9 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam ) if ( eOld == svHybridCell ) // string result from SetFormulaResultString? eOld = svString; // ScHybridCellToken has a valid GetString method + // #i106045# use approxEqual to compare with stored value bContentChanged = (eOld != eNew || - (eNew == svDouble && aResult.GetDouble() != aNewResult.GetDouble()) || + (eNew == svDouble && !rtl::math::approxEqual( aResult.GetDouble(), aNewResult.GetDouble() )) || (eNew == svString && aResult.GetString() != aNewResult.GetString())); } } @@ -1662,7 +1663,8 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam ) if ( bChanged && !bContentChanged && pDocument->IsStreamValid(aPos.Tab()) ) { if ( ( eOld == svUnknown && ( eNew == svError || ( eNew == svDouble && aNewResult.GetDouble() == 0.0 ) ) ) || - ( eOld == svHybridCell && eNew == svString && aResult.GetString() == aNewResult.GetString() ) ) + ( eOld == svHybridCell && eNew == svString && aResult.GetString() == aNewResult.GetString() ) || + ( eOld == svDouble && eNew == svDouble && rtl::math::approxEqual( aResult.GetDouble(), aNewResult.GetDouble() ) ) ) { // no change, see above } diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 10197e3a9ad5..ed1b64882e96 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -238,6 +238,9 @@ void ScTable::SetName( const String& rNewName ) bIsOlk = bOderSo = TRUE; aName = rNewName; aUpperName.Erase(); // invalidated if the name is changed + + if (IsStreamValid()) + SetStreamValid(FALSE); } const String& ScTable::GetUpperName() const @@ -291,6 +294,9 @@ void ScTable::SetLink( BYTE nMode, aLinkOpt = rOpt; // Filter-Optionen aLinkTab = rTab; // Tabellenname in Quelldatei nLinkRefreshDelay = nRefreshDelay; // refresh delay in seconds, 0==off + + if (IsStreamValid()) + SetStreamValid(FALSE); } USHORT ScTable::GetOptimalColWidth( SCCOL nCol, OutputDevice* pDev, @@ -1457,17 +1463,26 @@ void ScTable::DoColResize( SCCOL nCol1, SCCOL nCol2, SCSIZE nAdd ) void ScTable::SetRepeatColRange( const ScRange* pNew ) { SET_PRINTRANGE( pRepeatColRange, pNew ); + + if (IsStreamValid()) + SetStreamValid(FALSE); } void ScTable::SetRepeatRowRange( const ScRange* pNew ) { SET_PRINTRANGE( pRepeatRowRange, pNew ); + + if (IsStreamValid()) + SetStreamValid(FALSE); } void ScTable::ClearPrintRanges() { aPrintRanges.clear(); bPrintEntireSheet = FALSE; + + if (IsStreamValid()) + SetStreamValid(FALSE); } void ScTable::AddPrintRange( const ScRange& rNew ) @@ -1475,6 +1490,9 @@ void ScTable::AddPrintRange( const ScRange& rNew ) bPrintEntireSheet = FALSE; if( aPrintRanges.size() < 0xFFFF ) aPrintRanges.push_back( rNew ); + + if (IsStreamValid()) + SetStreamValid(FALSE); } //UNUSED2009-05 void ScTable::SetPrintRange( const ScRange& rNew ) diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx index eb959dfb2ffa..4a0cd9e135d5 100644 --- a/sc/source/core/data/table5.cxx +++ b/sc/source/core/data/table5.cxx @@ -249,6 +249,9 @@ void ScTable::RemoveManualBreaks() if (pRowFlags) pRowFlags->AndValue( 0, MAXROW, sal::static_int_cast(~CR_MANUALBREAK) ); + + if (IsStreamValid()) + SetStreamValid(FALSE); } BOOL ScTable::HasManualBreaks() const @@ -287,6 +290,9 @@ void ScTable::SetProtection(const ScTableProtection* pProtect) pTabProtection.reset(new ScTableProtection(*pProtect)); else pTabProtection.reset(NULL); + + if (IsStreamValid()) + SetStreamValid(FALSE); } ScTableProtection* ScTable::GetProtection() diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx index fd3a562ecb42..fa00559b4f27 100644 --- a/sc/source/ui/docshell/arealink.cxx +++ b/sc/source/ui/docshell/arealink.cxx @@ -172,6 +172,10 @@ void __EXPORT ScAreaLink::Closed() bAddUndo = FALSE; // nur einmal } + SCTAB nDestTab = aDestArea.aStart.Tab(); + if (pDoc->IsStreamValid(nDestTab)) + pDoc->SetStreamValid(nDestTab, FALSE); + SvBaseLink::Closed(); } diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index cb5d2ead509f..f9039a88f658 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -3079,6 +3079,9 @@ BOOL ScDocFunc::InsertPageBreak( BOOL bColumn, const ScAddress& rPos, pDoc->SetRowFlags( static_cast(nPos), nTab, nFlags ); pDoc->UpdatePageBreaks( nTab ); + if (pDoc->IsStreamValid(nTab)) + pDoc->SetStreamValid(nTab, FALSE); + if (bColumn) { rDocShell.PostPaint( static_cast(nPos)-1, 0, nTab, MAXCOL, MAXROW, nTab, PAINT_GRID ); @@ -3135,6 +3138,9 @@ BOOL ScDocFunc::RemovePageBreak( BOOL bColumn, const ScAddress& rPos, pDoc->SetRowFlags( static_cast(nPos), nTab, nFlags ); pDoc->UpdatePageBreaks( nTab ); + if (pDoc->IsStreamValid(nTab)) + pDoc->SetStreamValid(nTab, FALSE); + if (bColumn) { rDocShell.PostPaint( static_cast(nPos)-1, 0, nTab, MAXCOL, MAXROW, nTab, PAINT_GRID ); diff --git a/sc/source/ui/docshell/olinefun.cxx b/sc/source/ui/docshell/olinefun.cxx index 1da178aaa0c2..20ffb63f43fd 100644 --- a/sc/source/ui/docshell/olinefun.cxx +++ b/sc/source/ui/docshell/olinefun.cxx @@ -137,6 +137,9 @@ BOOL ScOutlineDocFunc::MakeOutline( const ScRange& rRange, BOOL bColumns, BOOL b pUndoTab, bColumns, TRUE ) ); } + if (pDoc->IsStreamValid(nTab)) + pDoc->SetStreamValid(nTab, FALSE); + USHORT nParts = 0; // Datenbereich nicht geaendert if ( bColumns ) nParts |= PAINT_TOP; @@ -200,6 +203,9 @@ BOOL ScOutlineDocFunc::RemoveOutline( const ScRange& rRange, BOOL bColumns, BOOL pUndoTab, bColumns, FALSE ) ); } + if (pDoc->IsStreamValid(nTab)) + pDoc->SetStreamValid(nTab, FALSE); + USHORT nParts = 0; // Datenbereich nicht geaendert if ( bColumns ) nParts |= PAINT_TOP; @@ -265,6 +271,9 @@ BOOL ScOutlineDocFunc::RemoveAllOutlines( SCTAB nTab, BOOL bRecord, BOOL bApi ) pDoc->UpdatePageBreaks( nTab ); + if (pDoc->IsStreamValid(nTab)) + pDoc->SetStreamValid(nTab, FALSE); + rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab, PAINT_GRID | PAINT_LEFT | PAINT_TOP | PAINT_SIZE ); rDocShell.SetDocumentModified(); @@ -333,6 +342,9 @@ BOOL ScOutlineDocFunc::AutoOutline( const ScRange& rRange, BOOL bRecord, BOOL bA pUndoDoc, pUndoTab ) ); } + if (pDoc->IsStreamValid(nTab)) + pDoc->SetStreamValid(nTab, FALSE); + rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab, PAINT_LEFT | PAINT_TOP | PAINT_SIZE ); rDocShell.SetDocumentModified(); lcl_InvalidateOutliner( rDocShell.GetViewBindings() ); -- cgit v1.2.3 From 61dec8ceed38588d3a2d2d5a91e501791b2e73c7 Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Wed, 21 Oct 2009 13:32:17 +0000 Subject: CWS-TOOLING: integrate CWS calc32stopper3 2009-10-12 14:26:09 +0200 er r276833 : disable dump again 2009-10-12 13:46:57 +0200 er r276832 : #i102294# setValue: yet another DST glitch 2009-10-12 13:21:48 +0200 iha r276828 : #i105767# Y axis vanishes in case of zero rotated axis title 2009-10-08 01:49:20 +0200 er r276772 : NextSymbol: actually do reset ODF reference detection on file/sheet separator 2009-10-08 00:18:58 +0200 er r276771 : #i101639# use TabIDs in cached RangeArrays, not RefData Tabs 2009-10-07 19:25:47 +0200 er r276767 : #i105200# UpdateBroadcastAreas: hash key changes, remove area from all slots and reinsert 2009-10-05 17:20:44 +0200 er r276690 : #i105365# SI prefixes for ang, ang3, m/h, m/hr 2009-10-05 16:21:29 +0200 er r276686 : #i105161 intersection has higher precedence than union --- .../controller/chartapiwrapper/TitleWrapper.cxx | 2 +- .../WrappedTextRotationProperty.cxx | 14 ++++- .../WrappedTextRotationProperty.hxx | 7 ++- sc/source/core/data/bcaslot.cxx | 59 ++++++++++++++++++++++ sc/source/core/inc/bcaslot.hxx | 1 + sc/source/core/tool/compiler.cxx | 34 ++++++++----- sc/source/ui/docshell/externalrefmgr.cxx | 22 ++++---- scaddins/source/analysis/analysishelper.cxx | 8 +-- 8 files changed, 118 insertions(+), 29 deletions(-) diff --git a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx index e0e9511cf71d..a84dbc0cfc4d 100644 --- a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx @@ -505,7 +505,7 @@ const std::vector< WrappedProperty* > TitleWrapper::createWrappedProperties() ::std::vector< ::chart::WrappedProperty* > aWrappedProperties; aWrappedProperties.push_back( new WrappedTitleStringProperty( m_spChart2ModelContact->m_xContext ) ); - aWrappedProperties.push_back( new WrappedTextRotationProperty() ); + aWrappedProperties.push_back( new WrappedTextRotationProperty( m_eTitleType==TitleHelper::Y_AXIS_TITLE || m_eTitleType==TitleHelper::X_AXIS_TITLE ) ); aWrappedProperties.push_back( new WrappedStackedTextProperty() ); WrappedCharacterHeightProperty::addWrappedProperties( aWrappedProperties, this ); WrappedAutomaticPositionProperties::addWrappedProperties( aWrappedProperties ); diff --git a/chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.cxx index bd505d6edac5..07532a4ecf22 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.cxx @@ -33,7 +33,9 @@ #include "WrappedTextRotationProperty.hxx" #include "macros.hxx" +#include +using namespace ::com::sun::star; using ::com::sun::star::uno::Any; using ::rtl::OUString; @@ -43,13 +45,23 @@ namespace chart { //............................................................................. -WrappedTextRotationProperty::WrappedTextRotationProperty() +WrappedTextRotationProperty::WrappedTextRotationProperty( bool bDirectState ) : ::chart::WrappedProperty( C2U( "TextRotation" ), C2U( "TextRotation" ) ) + , m_bDirectState( bDirectState ) { } WrappedTextRotationProperty::~WrappedTextRotationProperty() { } + +beans::PropertyState WrappedTextRotationProperty::getPropertyState( const uno::Reference< beans::XPropertyState >& xInnerPropertyState ) const + throw (beans::UnknownPropertyException, uno::RuntimeException) +{ + if( m_bDirectState ) + return beans::PropertyState_DIRECT_VALUE; + return WrappedProperty::getPropertyState( xInnerPropertyState ); +} + Any WrappedTextRotationProperty::convertInnerToOuterValue( const Any& rInnerValue ) const { Any aRet; diff --git a/chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.hxx b/chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.hxx index 38a516bbc1b9..54fbf38e53d7 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.hxx +++ b/chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.hxx @@ -40,12 +40,17 @@ namespace chart class WrappedTextRotationProperty : public WrappedProperty { public: - WrappedTextRotationProperty(); + WrappedTextRotationProperty( bool bDirectState=false ); virtual ~WrappedTextRotationProperty(); + virtual ::com::sun::star::beans::PropertyState getPropertyState( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const + throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + protected: virtual ::com::sun::star::uno::Any convertInnerToOuterValue( const ::com::sun::star::uno::Any& rInnerValue ) const; virtual ::com::sun::star::uno::Any convertOuterToInnerValue( const ::com::sun::star::uno::Any& rOuterValue ) const; + + bool m_bDirectState; }; //............................................................................. diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx index 85f8a4921242..d3d86be58440 100644 --- a/sc/source/core/data/bcaslot.cxx +++ b/sc/source/core/data/bcaslot.cxx @@ -353,6 +353,21 @@ void ScBroadcastAreaSlot::UpdateRemove( UpdateRefMode eUpdateRefMode, } +void ScBroadcastAreaSlot::UpdateRemoveArea( ScBroadcastArea* pArea ) +{ + ScBroadcastAreas::iterator aIter( aBroadcastAreaTbl.find( pArea)); + if (aIter == aBroadcastAreaTbl.end()) + return; + if (*aIter != pArea) + DBG_ERRORFILE( "UpdateRemoveArea: area pointer mismatch"); + else + { + aBroadcastAreaTbl.erase( aIter); + pArea->DecRef(); + } +} + + void ScBroadcastAreaSlot::UpdateInsert( ScBroadcastArea* pArea ) { ::std::pair< ScBroadcastAreas::iterator, bool > aPair = @@ -732,6 +747,50 @@ void ScBroadcastAreaSlotMachine::UpdateBroadcastAreas( } } + // Updating an area's range will modify the hash key, remove areas from all + // affected slots. Will be reinserted later with the updated range. + ScBroadcastArea* pChain = pUpdateChain; + while (pChain) + { + ScBroadcastArea* pArea = pChain; + pChain = pArea->GetUpdateChainNext(); + ScRange aRange( pArea->GetRange()); + // remove from slots + for (SCTAB nTab = aRange.aStart.Tab(); nTab <= aRange.aEnd.Tab() && pArea->GetRef(); ++nTab) + { + TableSlotsMap::iterator iTab( aTableSlotsMap.find( nTab)); + if (iTab == aTableSlotsMap.end()) + { + DBG_ERRORFILE( "UpdateBroadcastAreas: Where's the TableSlot?!?"); + continue; // for + } + ScBroadcastAreaSlot** ppSlots = (*iTab).second->getSlots(); + SCSIZE nStart, nEnd, nRowBreak; + ComputeAreaPoints( aRange, nStart, nEnd, nRowBreak ); + SCSIZE nOff = nStart; + SCSIZE nBreak = nOff + nRowBreak; + ScBroadcastAreaSlot** pp = ppSlots + nOff; + while ( nOff <= nEnd && pArea->GetRef() ) + { + if (*pp) + (*pp)->UpdateRemoveArea( pArea); + if ( nOff < nBreak ) + { + ++nOff; + ++pp; + } + else + { + nStart += BCA_SLOTS_ROW; + nOff = nStart; + pp = ppSlots + nOff; + nBreak = nOff + nRowBreak; + } + } + } + + } + // shift sheets if (nDz) { diff --git a/sc/source/core/inc/bcaslot.hxx b/sc/source/core/inc/bcaslot.hxx index ef2f77b55684..79335a35fa7e 100644 --- a/sc/source/core/inc/bcaslot.hxx +++ b/sc/source/core/inc/bcaslot.hxx @@ -192,6 +192,7 @@ public: void UpdateRemove( UpdateRefMode eUpdateRefMode, const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ); + void UpdateRemoveArea( ScBroadcastArea* pArea ); void UpdateInsert( ScBroadcastArea* pArea ); }; diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index a8ca4be2b5b6..df7131397aef 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -2278,14 +2278,16 @@ Label_MaskStateMachine: static const int kQuote = (1 << 4); // Past ' closing quote. static const int kClose = (1 << 5); + // Encountered # file/sheet separator. + static const int kFileSep = (1 << 6); // Past . sheet name separator. - static const int kPast = (1 << 6); + static const int kPast = (1 << 7); // Marked name $$ follows sheet name separator, detected // while we're still on the separator. Will be cleared when // entering the name. - static const int kMarkAhead = (1 << 7); + static const int kMarkAhead = (1 << 8); // In marked defined name. - static const int kDefName = (1 << 8); + static const int kDefName = (1 << 9); bool bAddToSymbol = true; if ((nMask & SC_COMPILER_C_ODF_RBRACKET) && !(nRefInName & kOpen)) @@ -2309,7 +2311,9 @@ Label_MaskStateMachine: { // Not in col/row yet. - if ('$' == c && '$' == pSrc[0] && !(nRefInName & kOpen)) + if (SC_COMPILER_FILE_TAB_SEP == c && (nRefInName & kFileSep)) + nRefInName = 0; + else if ('$' == c && '$' == pSrc[0] && !(nRefInName & kOpen)) { nRefInName &= ~kMarkAhead; if (!(nRefInName & kDefName)) @@ -2356,16 +2360,20 @@ Label_MaskStateMachine: } else { - if ('\'' == pSrc[0]) - { - // escapes embedded quote - nRefInName |= kQuote; - } - else + switch (pSrc[0]) { - // quote not followed by quote => close - nRefInName |= kClose; - nRefInName &= ~kOpen; + case '\'': + // escapes embedded quote + nRefInName |= kQuote; + break; + case SC_COMPILER_FILE_TAB_SEP: + // sheet name should follow + nRefInName |= kFileSep; + // fallthru + default: + // quote not followed by quote => close + nRefInName |= kClose; + nRefInName &= ~kOpen; } bAddToSymbol = !(nRefInName & kDefName); } diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index 5cfc833be5dd..f74e8c519fb6 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -384,11 +384,6 @@ ScExternalRefCache::TokenArrayRef ScExternalRefCache::getCellRangeData( return TokenArrayRef(); DocItem& rDoc = itrDoc->second; - RangeArrayMap::const_iterator itrRange = rDoc.maRangeArrays.find(rRange); - if (itrRange != rDoc.maRangeArrays.end()) - { - return itrRange->second; - } TableNameIndexMap::iterator itrTabId = rDoc.maTableNameIndex.find( ScGlobal::pCharClass->upper(rTabName)); @@ -410,6 +405,13 @@ ScExternalRefCache::TokenArrayRef ScExternalRefCache::getCellRangeData( // not all tables are cached. return TokenArrayRef(); + ScRange aCacheRange( nCol1, nRow1, static_cast(nTabFirstId), nCol2, nRow2, static_cast(nTabLastId)); + RangeArrayMap::const_iterator itrRange = rDoc.maRangeArrays.find( aCacheRange); + if (itrRange != rDoc.maRangeArrays.end()) + { + return itrRange->second; + } + TokenArrayRef pArray(new ScTokenArray); bool bFirstTab = true; for (size_t nTab = nTabFirstId; nTab <= nTabLastId; ++nTab) @@ -462,7 +464,7 @@ ScExternalRefCache::TokenArrayRef ScExternalRefCache::getCellRangeData( bFirstTab = false; } - rDoc.maRangeArrays.insert(RangeArrayMap::value_type(rRange, pArray)); + rDoc.maRangeArrays.insert( RangeArrayMap::value_type( aCacheRange, pArray)); return pArray; } @@ -545,13 +547,13 @@ void ScExternalRefCache::setCellRangeData(sal_uInt16 nFileId, const ScRange& rRa return; } - size_t nTab1 = itrTabName->second; + size_t nTabFirstId = itrTabName->second; SCROW nRow1 = rRange.aStart.Row(), nRow2 = rRange.aEnd.Row(); SCCOL nCol1 = rRange.aStart.Col(), nCol2 = rRange.aEnd.Col(); vector::const_iterator itrDataBeg = rData.begin(), itrDataEnd = rData.end(); for (vector::const_iterator itrData = itrDataBeg; itrData != itrDataEnd; ++itrData) { - size_t i = nTab1 + ::std::distance(itrDataBeg, itrData); + size_t i = nTabFirstId + ::std::distance(itrDataBeg, itrData); TableTypeRef& pTabData = rDoc.maTables[i]; if (!pTabData.get()) pTabData.reset(new Table); @@ -575,7 +577,9 @@ void ScExternalRefCache::setCellRangeData(sal_uInt16 nFileId, const ScRange& rRa } } - rDoc.maRangeArrays.insert(RangeArrayMap::value_type(rRange, pArray)); + size_t nTabLastId = nTabFirstId + rRange.aEnd.Tab() - rRange.aStart.Tab(); + ScRange aCacheRange( nCol1, nRow1, static_cast(nTabFirstId), nCol2, nRow2, static_cast(nTabLastId)); + rDoc.maRangeArrays.insert( RangeArrayMap::value_type( aCacheRange, pArray)); } bool ScExternalRefCache::isDocInitialized(sal_uInt16 nFileId) diff --git a/scaddins/source/analysis/analysishelper.cxx b/scaddins/source/analysis/analysishelper.cxx index e241b0ab88c8..7370b1adf588 100644 --- a/scaddins/source/analysis/analysishelper.cxx +++ b/scaddins/source/analysis/analysishelper.cxx @@ -2427,7 +2427,7 @@ ConvertDataList::ConvertDataList( void ) NEWD( "in", 3.9370078740157480E01, CDC_Length ); // Inch 39,37007874015748031496062992126 NEWD( "ft", 3.2808398950131234E00, CDC_Length ); // Foot 3,2808398950131233595800524934383 NEWD( "yd", 1.0936132983377078E00, CDC_Length ); // Yard 1,0936132983377077865266841644794 - NEWD( "ang", 1.0000000000000000E10, CDC_Length ); // Angstroem + NEWDP( "ang", 1.0000000000000000E10, CDC_Length ); // Angstroem NEWD( "Pica", 2.8346456692913386E03, CDC_Length ); // Pica (1/72 Inch) 2834,6456692913385826771653543307 NEWD( "ell", 8.748906E-01, CDC_Length ); // *** Ell NEWDP( "parsec", 3.240779E-17, CDC_Length ); // *** Parsec @@ -2519,7 +2519,7 @@ ConvertDataList::ConvertDataList( void ) NEWD( "in3", 6.1023744094732284E01, CDC_Volume ); // *** Cubic Inch NEWD( "ft3", 3.5314666721488590E-02, CDC_Volume ); // *** Cubic Foot NEWD( "yd3", 1.3079506193143922E-03, CDC_Volume ); // *** Cubic Yard - NEWD( "ang3", 1.0000000000000000E27, CDC_Volume ); // *** Cubic Angstroem + NEWDP( "ang3", 1.0000000000000000E27, CDC_Volume ); // *** Cubic Angstroem NEWD( "Pica3", 2.2776990435870636E07, CDC_Volume ); // *** Cubic Pica NEWD( "barrel", 6.289811E-03, CDC_Volume ); // *** Barrel (=42gal?) NEWD( "bushel", 2.837759E-02, CDC_Volume ); // *** Bushel @@ -2557,8 +2557,8 @@ ConvertDataList::ConvertDataList( void ) // SPEED: 1 Meter per Second is... NEWDP( "m/s", 1.0000000000000000E00, CDC_Speed ); // *** Meters per Second NEWDP( "m/sec", 1.0000000000000000E00, CDC_Speed ); // *** Meters per Second also - NEWD( "m/h", 3.6000000000000000E03, CDC_Speed ); // *** Meters per Hour - NEWD( "m/hr", 3.6000000000000000E03, CDC_Speed ); // *** Meters per Hour also + NEWDP( "m/h", 3.6000000000000000E03, CDC_Speed ); // *** Meters per Hour + NEWDP( "m/hr", 3.6000000000000000E03, CDC_Speed ); // *** Meters per Hour also NEWD( "mph", 2.2369362920544023E00, CDC_Speed ); // *** Britsh Miles per Hour NEWD( "kn", 1.9438444924406048E00, CDC_Speed ); // *** Knot = Nautical Miles per Hour NEWD( "admkn", 1.9438446603753486E00, CDC_Speed ); // *** Admiralty Knot -- cgit v1.2.3 From 1655bef24f20f30d5f0961789b5c67287aafcb85 Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Thu, 22 Oct 2009 15:10:43 +0000 Subject: #i106045# renaming a sheet has to reset all xml stream flags --- sc/source/core/data/document.cxx | 6 ++++++ sc/source/core/data/table1.cxx | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 8b04d5a0500e..077983b4382b 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -476,6 +476,12 @@ BOOL ScDocument::RenameTab( SCTAB nTab, const String& rName, BOOL /* bUpdateRef if ( pChartListenerCollection ) pChartListenerCollection->UpdateChartsContainingTab( nTab ); pTab[nTab]->SetName(rName); + + // If formulas refer to the renamed sheet, the TokenArray remains valid, + // but the XML stream must be re-generated. + for (i=0; i<=MAXTAB; ++i) + if (pTab[i] && pTab[i]->IsStreamValid()) + pTab[i]->SetStreamValid( FALSE ); } } return bValid; diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index ed1b64882e96..403377342661 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -239,8 +239,7 @@ void ScTable::SetName( const String& rNewName ) aName = rNewName; aUpperName.Erase(); // invalidated if the name is changed - if (IsStreamValid()) - SetStreamValid(FALSE); + // SetStreamValid is handled in ScDocument::RenameTab } const String& ScTable::GetUpperName() const -- cgit v1.2.3 From 6cf356acf508fe17019a3b90e33a1436e0d89c6e Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Fri, 23 Oct 2009 12:55:31 +0000 Subject: #i101139# MoveTable: nDestTab must be target position, not APPEND --- sc/source/ui/docshell/docsh5.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx index b7c726deeb71..5b2da76475df 100644 --- a/sc/source/ui/docshell/docsh5.cxx +++ b/sc/source/ui/docshell/docsh5.cxx @@ -840,8 +840,9 @@ BOOL ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, BOOL bCopy, BOOL bRec ScDocShellModificator aModificator( *this ); // #i92477# be consistent with ScDocFunc::InsertTable: any index past the last sheet means "append" + // #i101139# nDestTab must be the target position, not APPEND (for CopyTabProtection etc.) if ( nDestTab >= aDocument.GetTableCount() ) - nDestTab = SC_TAB_APPEND; + nDestTab = aDocument.GetTableCount(); if (bCopy) { -- cgit v1.2.3 From 1d0ac2df03a60004f5af260ab08d228c42a83f7f Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Mon, 26 Oct 2009 23:59:50 +0100 Subject: wrong merge conflict resolution --- sc/source/filter/excel/xlroot.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx index 609d4f9f3247..9706279307d1 100644 --- a/sc/source/filter/excel/xlroot.cxx +++ b/sc/source/filter/excel/xlroot.cxx @@ -54,7 +54,7 @@ #include "xlstyle.hxx" #include "xlchart.hxx" #include "xltracer.hxx" - +#include #include "root.hxx" namespace ApiScriptType = ::com::sun::star::i18n::ScriptType; -- cgit v1.2.3 -- cgit v1.2.3 From 8f101fabfe831fe151edee41909676dea89dde7a Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Thu, 29 Oct 2009 13:22:30 +0000 Subject: CWS-TOOLING: integrate CWS c07v026_OOO320 2009-10-19 10:26:11 +0200 mav r277008 : #b6886425# use standard solution to encode the URL for the Gnome 2009-10-19 08:38:28 +0200 mav r276998 : #b6886425# encode the URL correctly for the Gnome 2009-10-07 12:49:32 +0200 os r276749 : #b6887668# resize items depending on the item text length 2009-09-28 18:42:32 +0200 dr r276499 : #b6883075# shrink print ranges to Excel sheet limits 2009-09-28 16:50:25 +0200 od r276497 : #b6882166# method - assure notification on position changes, otherwise the layout will not be correct. 2009-09-15 18:31:37 +0200 dr r276185 : #b6872823# check cursor before using, patch by aw 2009-09-09 10:52:52 +0200 od r275975 : #b6879723# correct handling of new list level attributes regarding paragraph indent values, especially in case of OOo 2.0 and former hidden compatibility option "Ignore first line indent on numbering" 2009-09-08 11:10:31 +0200 od r275918 : #b6876367# method - do not reset list attributes at paragraph, if its applied list style will not change due to the newly applied paragraph style. 2009-09-07 12:48:58 +0200 obo r275890 : Merge from c07v025 into this CWS --- sc/source/filter/excel/xename.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sc/source/filter/excel/xename.cxx b/sc/source/filter/excel/xename.cxx index ace7a66dc1f9..004fbfa2932c 100644 --- a/sc/source/filter/excel/xename.cxx +++ b/sc/source/filter/excel/xename.cxx @@ -636,10 +636,13 @@ void XclExpNameManagerImpl::CreateBuiltInNames() // Calc document does not care about sheet index in print ranges aRange.aStart.SetTab( nScTab ); aRange.aEnd.SetTab( nScTab ); + aRange.Justify(); aRangeList.Append( aRange ); } - GetAddressConverter().ValidateRangeList( aRangeList, true ); - GetNameManager().InsertBuiltInName( EXC_BUILTIN_PRINTAREA, aRangeList ); + // create the NAME record (do not warn if ranges are shrunken) + GetAddressConverter().ValidateRangeList( aRangeList, false ); + if( aRangeList.Count() > 0 ) + GetNameManager().InsertBuiltInName( EXC_BUILTIN_PRINTAREA, aRangeList ); } // *** 2) print titles *** ---------------------------------------- @@ -656,8 +659,9 @@ void XclExpNameManagerImpl::CreateBuiltInNames() 0, pRowRange->aStart.Row(), nScTab, GetXclMaxPos().Col(), pRowRange->aEnd.Row(), nScTab ) ); // create the NAME record - GetAddressConverter().ValidateRangeList( aTitleList, true ); - GetNameManager().InsertBuiltInName( EXC_BUILTIN_PRINTTITLES, aTitleList ); + GetAddressConverter().ValidateRangeList( aTitleList, false ); + if( aTitleList.Count() > 0 ) + GetNameManager().InsertBuiltInName( EXC_BUILTIN_PRINTTITLES, aTitleList ); // *** 3) filter ranges *** --------------------------------------- -- cgit v1.2.3 From fdc3ba4a3e71384fd2e2e898fbc5ee71ca3a9f81 Mon Sep 17 00:00:00 2001 From: os Date: Fri, 30 Oct 2009 15:31:34 +0100 Subject: #i58212# Chinese translation changed to Chinese Conversion --- sc/source/ui/src/globstr.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src index c5b8cfd1a9e8..64acb56a57be 100644 --- a/sc/source/ui/src/globstr.src +++ b/sc/source/ui/src/globstr.src @@ -1657,7 +1657,7 @@ Resource RID_GLOBSTR String STR_UNDO_CHINESE_TRANSLATION { - Text [ en-US ] = "Chinese translation"; + Text [ en-US ] = "Chinese conversion"; }; String STR_ERR_DATAPILOT_INPUT -- cgit v1.2.3 From 81ff803d97b7c183b9fcda524a1651d3d7fc6e62 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Sat, 31 Oct 2009 00:29:04 +0100 Subject: #i106421#: move msfilter to filter --- sc/source/filter/excel/excimp8.cxx | 2 +- sc/source/filter/excel/excrecds.cxx | 4 ++-- sc/source/filter/excel/expop2.cxx | 2 +- sc/source/filter/excel/impop.cxx | 6 +++--- sc/source/filter/excel/xechart.cxx | 2 +- sc/source/filter/excel/xestream.cxx | 2 +- sc/source/filter/excel/xlchart.cxx | 2 +- sc/source/filter/excel/xltracer.cxx | 2 +- sc/source/filter/inc/xcl97esc.hxx | 2 +- sc/source/filter/inc/xestream.hxx | 4 ++-- sc/source/filter/inc/xiescher.hxx | 4 ++-- sc/source/filter/inc/xistream.hxx | 6 +++--- sc/source/filter/xcl97/xcl97esc.cxx | 2 +- sc/source/filter/xcl97/xcl97rec.cxx | 2 +- sc/source/ui/docshell/docsh.cxx | 1 - sc/util/makefile.mk | 2 +- 16 files changed, 22 insertions(+), 23 deletions(-) diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index 139020af8c0f..5c42032236a4 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -56,7 +56,7 @@ #include #include #include -#include +#include #include #include diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx index 04bebb623b3d..ce824fa70e44 100644 --- a/sc/source/filter/excel/excrecds.cxx +++ b/sc/source/filter/excel/excrecds.cxx @@ -38,7 +38,7 @@ #include "excrecds.hxx" #include -#include +#include #include "scitems.hxx" #include @@ -456,7 +456,7 @@ XclExpCountry::XclExpCountry( const XclExpRoot& rRoot ) : /* #i31530# set document country as UI country too - needed for correct behaviour of number formats. */ mnUICountry = mnDocCountry = static_cast< sal_uInt16 >( - ::svx::ConvertLanguageToCountry( rRoot.GetDocLanguage() ) ); + ::msfilter::ConvertLanguageToCountry( rRoot.GetDocLanguage() ) ); } void XclExpCountry::WriteBody( XclExpStream& rStrm ) diff --git a/sc/source/filter/excel/expop2.cxx b/sc/source/filter/excel/expop2.cxx index 69f1d4eb56d2..1a79aef3f0ec 100644 --- a/sc/source/filter/excel/expop2.cxx +++ b/sc/source/filter/excel/expop2.cxx @@ -39,7 +39,7 @@ #include #include -#include +#include #include "scerrors.hxx" #include "scextopt.hxx" diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx index 57b2b90e9681..7003cc683688 100644 --- a/sc/source/filter/excel/impop.cxx +++ b/sc/source/filter/excel/impop.cxx @@ -33,7 +33,7 @@ #include "imp_op.hxx" -#include +#include #include "scitems.hxx" #include @@ -731,12 +731,12 @@ void ImportExcel::Country( void ) maStrm >> nUICountry >> nDocCountry; // Store system language in XclRoot - LanguageType eLanguage = ::svx::ConvertCountryToLanguage( static_cast< ::svx::CountryId >( nDocCountry ) ); + LanguageType eLanguage = ::msfilter::ConvertCountryToLanguage( static_cast< ::msfilter::CountryId >( nDocCountry ) ); if( eLanguage != LANGUAGE_DONTKNOW ) SetDocLanguage( eLanguage ); // Set Excel UI language in add-in name translator - eLanguage = ::svx::ConvertCountryToLanguage( static_cast< ::svx::CountryId >( nUICountry ) ); + eLanguage = ::msfilter::ConvertCountryToLanguage( static_cast< ::msfilter::CountryId >( nUICountry ) ); if( eLanguage != LANGUAGE_DONTKNOW ) SetUILanguage( eLanguage ); } diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx index d1fed27bbec1..261bf8c42e30 100644 --- a/sc/source/filter/excel/xechart.cxx +++ b/sc/source/filter/excel/xechart.cxx @@ -58,7 +58,7 @@ #include #include -#include +#include #include "document.hxx" #include "rangelst.hxx" diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index 10d23eccdf27..1dd1bbc747f7 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -578,7 +578,7 @@ void XclExpBiff8Encrypter::Init( const String& aPass, const sal_uInt8 nDocId[16] maCodec.InitKey(mnPassw, mnDocId); // generate salt hash. - ::svx::MSCodec_Std97 aCodec; + ::msfilter::MSCodec_Std97 aCodec; aCodec.InitKey(mnPassw, mnDocId); aCodec.CreateSaltDigest(nSalt, mnSaltDigest); diff --git a/sc/source/filter/excel/xlchart.cxx b/sc/source/filter/excel/xlchart.cxx index e15adca249c5..5e7f1665c0e0 100644 --- a/sc/source/filter/excel/xlchart.cxx +++ b/sc/source/filter/excel/xlchart.cxx @@ -55,7 +55,7 @@ #include #include #include -#include +#include #include "global.hxx" #include "xlconst.hxx" diff --git a/sc/source/filter/excel/xltracer.cxx b/sc/source/filter/excel/xltracer.cxx index 48044c8401f4..fa7c0a17c5c1 100644 --- a/sc/source/filter/excel/xltracer.cxx +++ b/sc/source/filter/excel/xltracer.cxx @@ -33,7 +33,7 @@ // ============================================================================ #include "xltracer.hxx" -#include +#include #include "address.hxx" using ::rtl::OUString; diff --git a/sc/source/filter/inc/xcl97esc.hxx b/sc/source/filter/inc/xcl97esc.hxx index 00281461f289..50583debc17f 100644 --- a/sc/source/filter/inc/xcl97esc.hxx +++ b/sc/source/filter/inc/xcl97esc.hxx @@ -31,7 +31,7 @@ #ifndef SC_XCL97ESC_HXX #define SC_XCL97ESC_HXX -#include +#include #include #include #include "xlescher.hxx" diff --git a/sc/source/filter/inc/xestream.hxx b/sc/source/filter/inc/xestream.hxx index 857d756e2133..95d172baf9c2 100644 --- a/sc/source/filter/inc/xestream.hxx +++ b/sc/source/filter/inc/xestream.hxx @@ -43,7 +43,7 @@ #include "xlstream.hxx" #include "xestring.hxx" -#include +#include #include /* ============================================================================ @@ -245,7 +245,7 @@ private: sal_uInt16 GetOffsetInBlock( sal_Size nStrmPos ) const; private: - ::svx::MSCodec_Std97 maCodec; /// Crypto algorithm implementation. + ::msfilter::MSCodec_Std97 maCodec; /// Crypto algorithm implementation. sal_uInt16 mnPassw[16]; /// Cached password data for copy construction. sal_uInt8 mnDocId[16]; /// Cached document ID for copy construction. sal_uInt8 mnSaltDigest[16]; diff --git a/sc/source/filter/inc/xiescher.hxx b/sc/source/filter/inc/xiescher.hxx index c9d2daa6bb2f..3eb5a7257630 100644 --- a/sc/source/filter/inc/xiescher.hxx +++ b/sc/source/filter/inc/xiescher.hxx @@ -33,8 +33,8 @@ #include #include -#include -#include +#include +#include #include #include "xlescher.hxx" #include "xiroot.hxx" diff --git a/sc/source/filter/inc/xistream.hxx b/sc/source/filter/inc/xistream.hxx index bbc1cc04fde5..8ff3c26e9abe 100644 --- a/sc/source/filter/inc/xistream.hxx +++ b/sc/source/filter/inc/xistream.hxx @@ -32,7 +32,7 @@ #define SC_XISTREAM_HXX #include -#include +#include #include "xlstream.hxx" #include "xlconst.hxx" @@ -121,7 +121,7 @@ private: virtual sal_uInt16 OnRead( SvStream& rStrm, sal_uInt8* pnData, sal_uInt16 nBytes ); private: - ::svx::MSCodec_XorXLS95 maCodec; /// Crypto algorithm implementation. + ::msfilter::MSCodec_XorXLS95 maCodec; /// Crypto algorithm implementation. ::std::vector< sal_uInt8 > maPassword; sal_uInt16 mnKey; sal_uInt16 mnHash; @@ -155,7 +155,7 @@ private: sal_uInt16 GetOffset( sal_Size nStrmPos ) const; private: - ::svx::MSCodec_Std97 maCodec; /// Crypto algorithm implementation. + ::msfilter::MSCodec_Std97 maCodec; /// Crypto algorithm implementation. ::std::vector< sal_uInt16 > maPassword; ::std::vector< sal_uInt8 > maSalt; ::std::vector< sal_uInt8 > maVerifier; diff --git a/sc/source/filter/xcl97/xcl97esc.cxx b/sc/source/filter/xcl97/xcl97esc.cxx index e618e5d91fd5..db8b085f7629 100644 --- a/sc/source/filter/xcl97/xcl97esc.cxx +++ b/sc/source/filter/xcl97/xcl97esc.cxx @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx index 8371d75557c0..45c64cca1e4f 100644 --- a/sc/source/filter/xcl97/xcl97rec.cxx +++ b/sc/source/filter/xcl97/xcl97rec.cxx @@ -63,7 +63,7 @@ #include #include #include -#include +#include #include diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 810140545118..0e16ccf0d97c 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -63,7 +63,6 @@ #include #include #include -#include #include #include #include diff --git a/sc/util/makefile.mk b/sc/util/makefile.mk index c06071ff6324..ae5fb8d6a545 100644 --- a/sc/util/makefile.mk +++ b/sc/util/makefile.mk @@ -189,7 +189,7 @@ SHL6STDLIBS= \ $(SVTOOLLIB) \ $(SVLLIB) \ $(SVXCORELIB) \ - $(SVXMSFILTERLIB) \ + $(MSFILTERLIB) \ $(SVXLIB) \ $(BASEGFXLIB) \ $(DRAWINGLAYERLIB) \ -- cgit v1.2.3 From e8eaee285af98deba6bab3b7fb49dc6b1fe6b497 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Mon, 2 Nov 2009 20:49:14 +0100 Subject: #i106421#: create new cui resource file --- sc/source/ui/drawfunc/drawsh.cxx | 8 +++----- sc/source/ui/drawfunc/drawsh5.cxx | 4 ++-- sc/source/ui/drawfunc/drtxtob.cxx | 2 +- sc/source/ui/miscdlgs/redcom.cxx | 2 +- sc/source/ui/view/prevwsh.cxx | 2 +- sc/source/ui/view/tabvwsh3.cxx | 2 +- 6 files changed, 9 insertions(+), 11 deletions(-) diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx index 08ef8a54b1a8..e53fea436d12 100644 --- a/sc/source/ui/drawfunc/drawsh.cxx +++ b/sc/source/ui/drawfunc/drawsh.cxx @@ -266,7 +266,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if ( pFact ) { - SfxAbstractTabDialog *pDlg = pFact->CreateCaptionDialog( pWin, pView, RID_SVXDLG_CAPTION ); + SfxAbstractTabDialog *pDlg = pFact->CreateCaptionDialog( pWin, pView ); const USHORT* pRange = pDlg->GetInputRanges( *aNewAttr.GetPool() ); SfxItemSet aCombSet( *aNewAttr.GetPool(), pRange ); @@ -291,7 +291,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - SfxAbstractTabDialog* pDlg = pFact->CreateSvxTransformTabDialog( pWin, &aNewAttr,pView, RID_SVXDLG_TRANSFORM ); + SfxAbstractTabDialog* pDlg = pFact->CreateSvxTransformTabDialog( pWin, &aNewAttr,pView ); DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001 if (pDlg->Execute() == RET_OK) { @@ -398,7 +398,6 @@ void ScDrawShell::ExecuteLineDlg( SfxRequest& rReq, USHORT nTabPage ) SfxAbstractTabDialog * pDlg = pFact->CreateSvxLineTabDialog( pViewData->GetDialogParent(), &aNewAttr, pViewData->GetDocument()->GetDrawLayer(), - RID_SVXDLG_LINE, pObj, bHasMarked); DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001 @@ -439,7 +438,6 @@ void ScDrawShell::ExecuteAreaDlg( SfxRequest& rReq, USHORT nTabPage ) AbstractSvxAreaTabDialog * pDlg = pFact->CreateSvxAreaTabDialog( pViewData->GetDialogParent(), &aNewAttr, pViewData->GetDocument()->GetDrawLayer(), - RID_SVXDLG_AREA, pView); DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001 @@ -477,7 +475,7 @@ void ScDrawShell::ExecuteTextAttrDlg( SfxRequest& rReq, USHORT /* nTabPage */ ) pView->MergeAttrFromMarked( aNewAttr, FALSE ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - SfxAbstractTabDialog *pDlg = pFact->CreateTextTabDialog( pViewData->GetDialogParent(), &aNewAttr, RID_SVXDLG_TEXT, pView ); + SfxAbstractTabDialog *pDlg = pFact->CreateTextTabDialog( pViewData->GetDialogParent(), &aNewAttr, pView ); USHORT nResult = pDlg->Execute(); diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx index 26e5e6cb9b2e..5d8e4cb1ca33 100644 --- a/sc/source/ui/drawfunc/drawsh5.cxx +++ b/sc/source/ui/drawfunc/drawsh5.cxx @@ -522,7 +522,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialogdiet fail!"); - AbstractSvxObjectNameDialog* pDlg = pFact->CreateSvxObjectNameDialog(NULL, aName, RID_SVXDLG_OBJECT_NAME); + AbstractSvxObjectNameDialog* pDlg = pFact->CreateSvxObjectNameDialog(NULL, aName); OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->SetCheckNameHdl(LINK(this, ScDrawShell, NameObjectHdl)); @@ -593,7 +593,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialogdiet fail!"); - AbstractSvxObjectTitleDescDialog* pDlg = pFact->CreateSvxObjectTitleDescDialog(NULL, aTitle, aDescription, RID_SVXDLG_OBJECT_TITLE_DESC); + AbstractSvxObjectTitleDescDialog* pDlg = pFact->CreateSvxObjectTitleDescDialog(NULL, aTitle, aDescription); OSL_ENSURE(pDlg, "Dialogdiet fail!"); if(RET_OK == pDlg->Execute()) diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index b85724d37e39..908eba68cee5 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -799,7 +799,7 @@ void __EXPORT ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq ) case SID_DRAWTEXT_ATTR_DLG: { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - SfxAbstractTabDialog *pDlg = pFact->CreateTextTabDialog( pViewData->GetDialogParent(), &aEditAttr, RID_SVXDLG_TEXT, pView ); + SfxAbstractTabDialog *pDlg = pFact->CreateTextTabDialog( pViewData->GetDialogParent(), &aEditAttr, pView ); bDone = ( RET_OK == pDlg->Execute() ); diff --git a/sc/source/ui/miscdlgs/redcom.cxx b/sc/source/ui/miscdlgs/redcom.cxx index af450fdcc6ab..dd1c312cd792 100644 --- a/sc/source/ui/miscdlgs/redcom.cxx +++ b/sc/source/ui/miscdlgs/redcom.cxx @@ -49,7 +49,7 @@ ScRedComDialog::ScRedComDialog( Window* pParent, const SfxItemSet& rCoreSet, SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - pDlg = pFact->CreateSvxPostItDialog( pParent, rCoreSet, RID_SVXDLG_POSTIT, bPrevNext, TRUE ); + pDlg = pFact->CreateSvxPostItDialog( pParent, rCoreSet, bPrevNext, TRUE ); DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001 pDocShell=pShell; pDlg->DontChangeAuthor(); diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index ec4c317c7ad5..ebe58f5a0efc 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -705,7 +705,7 @@ void __EXPORT ScPreviewShell::Execute( SfxRequest& rReq ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - AbstractSvxZoomDialog* pDlg = pFact->CreateSvxZoomDialog(NULL, aSet, RID_SVXDLG_ZOOM); + AbstractSvxZoomDialog* pDlg = pFact->CreateSvxZoomDialog(NULL, aSet); DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001 pDlg->SetLimits( 20, 400 ); pDlg->HideButton( ZOOMBTN_OPTIMAL ); diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx index c49af4cdae77..c2812fdc4446 100644 --- a/sc/source/ui/view/tabvwsh3.cxx +++ b/sc/source/ui/view/tabvwsh3.cxx @@ -693,7 +693,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - pDlg = pFact->CreateSvxZoomDialog(GetDialogParent(), aSet, RID_SVXDLG_ZOOM); + pDlg = pFact->CreateSvxZoomDialog(GetDialogParent(), aSet ); DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001 } pDlg->SetLimits( MINZOOM, MAXZOOM ); -- cgit v1.2.3 From 06550364e75f0251b23576246606915690fdd513 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 3 Nov 2009 18:12:19 +0100 Subject: #i104678# use high contrast mode setting instead of IsDark (paradigm shift begun with issue i35482) --- chart2/source/controller/dialogs/DataBrowser.cxx | 4 ++-- chart2/source/controller/dialogs/dlg_DataEditor.cxx | 2 +- chart2/source/controller/dialogs/res_ErrorBar.cxx | 2 +- chart2/source/controller/dialogs/res_Trendline.cxx | 2 +- chart2/source/controller/dialogs/tp_ChartType.cxx | 4 ++-- sc/source/ui/app/inputwin.cxx | 12 ++++++------ sc/source/ui/cctrl/tbinsert.cxx | 2 +- sc/source/ui/cctrl/tbzoomsliderctrl.cxx | 8 ++++---- sc/source/ui/navipi/navipi.cxx | 12 ++++++------ sc/source/ui/pagedlg/tptable.cxx | 4 ++-- sc/source/ui/unoobj/targuno.cxx | 2 +- sc/source/ui/view/olinewin.cxx | 2 +- 12 files changed, 28 insertions(+), 28 deletions(-) diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx index 56ef98b159ba..b13333dcb323 100644 --- a/chart2/source/controller/dialogs/DataBrowser.cxx +++ b/chart2/source/controller/dialogs/DataBrowser.cxx @@ -628,7 +628,7 @@ void DataBrowser::RenewTable() const DataBrowserModel::tDataHeaderVector& aHeaders( m_apDataBrowserModel->getDataHeaders()); Link aFocusLink( LINK( this, DataBrowser, SeriesHeaderGotFocus )); Link aSeriesHeaderChangedLink( LINK( this, DataBrowser, SeriesHeaderChanged )); - bool bIsHighContrast = pWin ? (pWin->GetDisplayBackground().GetColor().IsDark()) : false; + bool bIsHighContrast = pWin ? (pWin->GetSettings().GetStyleSettings().GetHighContrastMode()) : false; for( DataBrowserModel::tDataHeaderVector::const_iterator aIt( aHeaders.begin()); aIt != aHeaders.end(); ++aIt ) @@ -1230,7 +1230,7 @@ void DataBrowser::RenewSeriesHeaders() DataBrowserModel::tDataHeaderVector aHeaders( m_apDataBrowserModel->getDataHeaders()); Link aFocusLink( LINK( this, DataBrowser, SeriesHeaderGotFocus )); Link aSeriesHeaderChangedLink( LINK( this, DataBrowser, SeriesHeaderChanged )); - bool bIsHighContrast = pWin ? (pWin->GetDisplayBackground().GetColor().IsDark()) : false; + bool bIsHighContrast = pWin ? (pWin->GetSettings().GetStyleSettings().GetHighContrastMode()) : false; for( DataBrowserModel::tDataHeaderVector::const_iterator aIt( aHeaders.begin()); aIt != aHeaders.end(); ++aIt ) diff --git a/chart2/source/controller/dialogs/dlg_DataEditor.cxx b/chart2/source/controller/dialogs/dlg_DataEditor.cxx index 6abbf5a8e038..f3b601453bee 100644 --- a/chart2/source/controller/dialogs/dlg_DataEditor.cxx +++ b/chart2/source/controller/dialogs/dlg_DataEditor.cxx @@ -358,7 +358,7 @@ bool DataEditor::ApplyChangesToModel() // sets the correct toolbar icons depending on the current mode (e.g. high contrast) void DataEditor::ApplyImageList() { - bool bIsHighContrast = ( true && GetDisplayBackground().GetColor().IsDark() ); + bool bIsHighContrast = ( true && GetSettings().GetStyleSettings().GetHighContrastMode() ); ImageList& rImgLst = bIsHighContrast ? m_aToolboxImageListHighContrast diff --git a/chart2/source/controller/dialogs/res_ErrorBar.cxx b/chart2/source/controller/dialogs/res_ErrorBar.cxx index 48bf877ae2b2..73af56b5a4d0 100644 --- a/chart2/source/controller/dialogs/res_ErrorBar.cxx +++ b/chart2/source/controller/dialogs/res_ErrorBar.cxx @@ -682,7 +682,7 @@ BOOL ErrorBarResources::FillItemSet(SfxItemSet& rOutAttrs) const void ErrorBarResources::FillValueSets() { - bool bIsHighContrast = ( true && m_aRbConst.GetDisplayBackground().GetColor().IsDark() ); + bool bIsHighContrast = ( true && m_aRbConst.GetSettings().GetStyleSettings().GetHighContrastMode() ); // do not scale images, show then centered // m_aFiPositive.SetStyle( (m_aFiPositive.GetStyle() & (~WB_SCALE)) | WB_CENTER ); diff --git a/chart2/source/controller/dialogs/res_Trendline.cxx b/chart2/source/controller/dialogs/res_Trendline.cxx index 26114a202eb9..b53df44463a6 100644 --- a/chart2/source/controller/dialogs/res_Trendline.cxx +++ b/chart2/source/controller/dialogs/res_Trendline.cxx @@ -262,7 +262,7 @@ BOOL TrendlineResources::FillItemSet(SfxItemSet& rOutAttrs) const void TrendlineResources::FillValueSets() { - bool bIsHighContrast = ( true && m_aFLType.GetDisplayBackground().GetColor().IsDark() ); + bool bIsHighContrast = ( true && m_aFLType.GetSettings().GetStyleSettings().GetHighContrastMode() ); if( m_bNoneAvailable ) m_aFINone.SetImage( SELECT_IMAGE( BMP_REGRESSION_NONE )); diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx index c35f11546d36..d5f8d5d22adb 100644 --- a/chart2/source/controller/dialogs/tp_ChartType.cxx +++ b/chart2/source/controller/dialogs/tp_ChartType.cxx @@ -854,7 +854,7 @@ ChartTypeTabPage::ChartTypeTabPage( Window* pParent m_aSubTypeList.SetColCount(4); m_aSubTypeList.SetLineCount(1); - bool bIsHighContrast = ( true && GetDisplayBackground().GetColor().IsDark() ); + bool bIsHighContrast = ( true && GetSettings().GetStyleSettings().GetHighContrastMode() ); m_aChartTypeDialogControllerList.push_back(new ColumnChartDialogController() ); m_aChartTypeDialogControllerList.push_back(new BarChartDialogController() ); @@ -1070,7 +1070,7 @@ void ChartTypeTabPage::fillAllControls( const ChartTypeParameter& rParameter, bo m_nChangingCalls++; if( m_pCurrentMainType && bAlsoResetSubTypeList ) { - bool bIsHighContrast = ( true && GetDisplayBackground().GetColor().IsDark() ); + bool bIsHighContrast = ( true && GetSettings().GetStyleSettings().GetHighContrastMode() ); m_pCurrentMainType->fillSubTypeList( m_aSubTypeList, bIsHighContrast, rParameter ); } m_aSubTypeList.SelectItem( static_cast( rParameter.nSubTypeIndex) ); diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 5a3fd605b08f..33f26947f49f 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -131,7 +131,7 @@ SfxChildWinInfo __EXPORT ScInputWindowWrapper::GetInfo() const //================================================================== -#define IMAGE(id) pImgMgr->SeekImage(id, bDark) +#define IMAGE(id) pImgMgr->SeekImage(id, bHC) //================================================================== // class ScInputWindow @@ -170,7 +170,7 @@ ScInputWindow::ScInputWindow( Window* pParent, SfxBindings* pBind ) : } DBG_ASSERT( pViewSh, "no view shell for input window" ); - BOOL bDark = GetSettings().GetStyleSettings().GetFaceColor().IsDark(); + BOOL bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); // Positionsfenster, 3 Buttons, Eingabefenster InsertWindow ( 1, &aWndPos, 0, 0 ); @@ -558,7 +558,7 @@ void ScInputWindow::SetOkCancelMode() SfxImageManager* pImgMgr = SfxImageManager::GetImageManager( pScMod ); if (!bIsOkCancelMode) { - BOOL bDark = GetSettings().GetStyleSettings().GetFaceColor().IsDark(); + BOOL bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); RemoveItem( 3 ); // SID_INPUT_SUM und SID_INPUT_EQUAL entfernen RemoveItem( 3 ); @@ -582,7 +582,7 @@ void ScInputWindow::SetSumAssignMode() SfxImageManager* pImgMgr = SfxImageManager::GetImageManager( pScMod ); if (bIsOkCancelMode) { - BOOL bDark = GetSettings().GetStyleSettings().GetFaceColor().IsDark(); + BOOL bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); // SID_INPUT_CANCEL, und SID_INPUT_OK entfernen RemoveItem( 3 ); @@ -710,8 +710,8 @@ void ScInputWindow::DataChanged( const DataChangedEvent& rDCEvt ) ScModule* pScMod = SC_MOD(); SfxImageManager* pImgMgr = SfxImageManager::GetImageManager( pScMod ); - BOOL bDark = GetSettings().GetStyleSettings().GetFaceColor().IsDark(); - // IMAGE macro uses pScMod, pImgMgr, bDark + BOOL bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); + // IMAGE macro uses pScMod, pImgMgr, bHC SetItemImage( SID_INPUT_FUNCTION, IMAGE( SID_INPUT_FUNCTION ) ); if ( bIsOkCancelMode ) diff --git a/sc/source/ui/cctrl/tbinsert.cxx b/sc/source/ui/cctrl/tbinsert.cxx index 07505476aa16..51641e0ce605 100644 --- a/sc/source/ui/cctrl/tbinsert.cxx +++ b/sc/source/ui/cctrl/tbinsert.cxx @@ -94,7 +94,7 @@ void __EXPORT ScTbxInsertCtrl::StateChanged( USHORT /* nSID */, SfxItemState eSt Image aImage = GetImage( m_xFrame, aSlotURL, hasBigImages(), - GetToolBox().GetDisplayBackground().GetColor().IsDark() ); + GetToolBox().GetSettings().GetStyleSettings().GetHighContrastMode() ); GetToolBox().SetItemImage(GetId(), aImage); } } diff --git a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx index bf957b889d82..bb0e83746050 100644 --- a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx +++ b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx @@ -273,10 +273,10 @@ ScZoomSliderWnd::ScZoomSliderWnd( Window* pParent, const ::com::sun::star::uno:: m_xDispatchProvider( rDispatchProvider ), m_xFrame( _xFrame ) { - BOOL bIsDark = GetSettings().GetStyleSettings().GetFaceColor().IsDark(); - mpImpl->maSliderButton = Image( SVX_RES( bIsDark ? RID_SVXBMP_SLIDERBUTTON_HC : RID_SVXBMP_SLIDERBUTTON ) ); - mpImpl->maIncreaseButton = Image( SVX_RES( bIsDark ? RID_SVXBMP_SLIDERINCREASE_HC : RID_SVXBMP_SLIDERINCREASE ) ); - mpImpl->maDecreaseButton = Image( SVX_RES( bIsDark ? RID_SVXBMP_SLIDERDECREASE_HC : RID_SVXBMP_SLIDERDECREASE ) ); + BOOL bIsHC = GetSettings().GetStyleSettings().GetHighContrastMode(); + mpImpl->maSliderButton = Image( SVX_RES( bIsHC ? RID_SVXBMP_SLIDERBUTTON_HC : RID_SVXBMP_SLIDERBUTTON ) ); + mpImpl->maIncreaseButton = Image( SVX_RES( bIsHC ? RID_SVXBMP_SLIDERINCREASE_HC : RID_SVXBMP_SLIDERINCREASE ) ); + mpImpl->maDecreaseButton = Image( SVX_RES( bIsHC ? RID_SVXBMP_SLIDERDECREASE_HC : RID_SVXBMP_SLIDERDECREASE ) ); Size aSliderSize = LogicToPixel( Size( aLogicalSize), MapMode( MAP_10TH_MM ) ); SetSizePixel( Size( aSliderSize.Width() * nSliderWidth-1, aSliderSize.Height() + nSliderHeight ) ); } diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx index 9bba01960b32..6e3fbaa86cc0 100644 --- a/sc/source/ui/navipi/navipi.cxx +++ b/sc/source/ui/navipi/navipi.cxx @@ -518,23 +518,23 @@ void CommandToolBox::UpdateButtons() CheckItem( IID_CHANGEROOT, bRootSet ); } - BOOL bDark = GetDisplayBackground().GetColor().IsDark(); + BOOL bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); USHORT nImageId = 0; switch ( rDlg.nDropMode ) { - case SC_DROPMODE_URL: nImageId = bDark ? RID_IMG_H_DROP_URL : RID_IMG_DROP_URL; break; - case SC_DROPMODE_LINK: nImageId = bDark ? RID_IMG_H_DROP_LINK : RID_IMG_DROP_LINK; break; - case SC_DROPMODE_COPY: nImageId = bDark ? RID_IMG_H_DROP_COPY : RID_IMG_DROP_COPY; break; + case SC_DROPMODE_URL: nImageId = bHC ? RID_IMG_H_DROP_URL : RID_IMG_DROP_URL; break; + case SC_DROPMODE_LINK: nImageId = bHC ? RID_IMG_H_DROP_LINK : RID_IMG_DROP_LINK; break; + case SC_DROPMODE_COPY: nImageId = bHC ? RID_IMG_H_DROP_COPY : RID_IMG_DROP_COPY; break; } SetItemImage( IID_DROPMODE, Image(ScResId(nImageId)) ); } void CommandToolBox::InitImageList() { - BOOL bDark = GetDisplayBackground().GetColor().IsDark(); + BOOL bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); - ImageList& rImgLst = bDark ? rDlg.aCmdImageListH : rDlg.aCmdImageList; + ImageList& rImgLst = bHC ? rDlg.aCmdImageListH : rDlg.aCmdImageList; USHORT nCount = GetItemCount(); for (USHORT i = 0; i < nCount; i++) diff --git a/sc/source/ui/pagedlg/tptable.cxx b/sc/source/ui/pagedlg/tptable.cxx index e64ef46bef87..b3640f2905c5 100644 --- a/sc/source/ui/pagedlg/tptable.cxx +++ b/sc/source/ui/pagedlg/tptable.cxx @@ -171,9 +171,9 @@ ScTablePage::ScTablePage( Window* pParent, const SfxItemSet& rCoreAttrs ) : void ScTablePage::ShowImage() { - bool bDark = GetDisplayBackground().GetColor().IsDark(); + bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); bool bLeftRight = aBtnLeftRight.IsChecked(); - aBmpPageDir.SetImage( bDark ? + aBmpPageDir.SetImage( bHC ? (bLeftRight ? aImgLeftRightHC : aImgTopDownHC) : (bLeftRight ? aImgLeftRight : aImgTopDown) ); } diff --git a/sc/source/ui/unoobj/targuno.cxx b/sc/source/ui/unoobj/targuno.cxx index 0fed003b751b..f3fcb8c6d671 100644 --- a/sc/source/ui/unoobj/targuno.cxx +++ b/sc/source/ui/unoobj/targuno.cxx @@ -248,7 +248,7 @@ void ScLinkTargetTypeObj::SetLinkTargetBitmap( uno::Any& rRet, sal_uInt16 nType } if (nImgId) { - BOOL bHighContrast = Application::GetSettings().GetStyleSettings().GetWindowColor().IsDark(); + BOOL bHighContrast = Application::GetSettings().GetStyleSettings().GetHighContrastMode(); ImageList aEntryImages( ScResId( bHighContrast ? RID_IMAGELIST_H_NAVCONT : RID_IMAGELIST_NAVCONT ) ); const Image& rImage = aEntryImages.GetImage( nImgId ); rRet <<= uno::Reference< awt::XBitmap > (VCLUnoHelper::CreateBitmap( rImage.GetBitmapEx() )); diff --git a/sc/source/ui/view/olinewin.cxx b/sc/source/ui/view/olinewin.cxx index 5ac563987e65..6e5535361653 100644 --- a/sc/source/ui/view/olinewin.cxx +++ b/sc/source/ui/view/olinewin.cxx @@ -167,7 +167,7 @@ void ScOutlineWindow::InitSettings() const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); SetBackground( rStyleSettings.GetFaceColor() ); maLineColor = rStyleSettings.GetButtonTextColor(); - mpSymbols = ScGlobal::GetOutlineSymbols( !!GetBackground().GetColor().IsDark() ); + mpSymbols = ScGlobal::GetOutlineSymbols( rStyleSettings.GetHighContrastMode() ); Invalidate(); } -- cgit v1.2.3 From 8b2c99bc100659024b68cd185490d371ee9471da Mon Sep 17 00:00:00 2001 From: mb93783 Date: Wed, 4 Nov 2009 15:39:48 +0100 Subject: #i106432#, #i103496#: some fixes found while building on more platforms --- chart2/source/controller/dialogs/dlg_DataEditor.cxx | 4 ++-- chart2/source/controller/main/ConfigurationAccess.cxx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chart2/source/controller/dialogs/dlg_DataEditor.cxx b/chart2/source/controller/dialogs/dlg_DataEditor.cxx index 05a38b87e382..eba4ccd86068 100644 --- a/chart2/source/controller/dialogs/dlg_DataEditor.cxx +++ b/chart2/source/controller/dialogs/dlg_DataEditor.cxx @@ -104,7 +104,7 @@ DataEditor::DataEditor( SvtMiscOptions aMiscOptions; const sal_Int16 nStyle( aMiscOptions.GetToolboxStyle() ); // react on changes - aMiscOptions.AddListener( LINK( this, DataEditor, MiscHdl ) ); + aMiscOptions.AddListenerLink( LINK( this, DataEditor, MiscHdl ) ); m_aTbxData.SetOutStyle( nStyle ); // set good window width @@ -132,7 +132,7 @@ DataEditor::~DataEditor() notifySystemWindow( this, & m_aTbxData, ::comphelper::mem_fun( & TaskPaneList::RemoveWindow )); SvtMiscOptions aMiscOptions; - aMiscOptions.RemoveListener( LINK( this, DataEditor, MiscHdl ) ); + aMiscOptions.RemoveListenerLink( LINK( this, DataEditor, MiscHdl ) ); OSL_TRACE( "DataEditor: DTOR" ); } diff --git a/chart2/source/controller/main/ConfigurationAccess.cxx b/chart2/source/controller/main/ConfigurationAccess.cxx index 2cb5a7c6800c..65cebdbc13d3 100644 --- a/chart2/source/controller/main/ConfigurationAccess.cxx +++ b/chart2/source/controller/main/ConfigurationAccess.cxx @@ -83,7 +83,7 @@ CalcConfigItem::~CalcConfigItem() } void CalcConfigItem::Commit() {} -void CalcConfigItem::Notify( const uno::Sequence& aPropertyNames) {} +void CalcConfigItem::Notify( const uno::Sequence& ) {} FieldUnit CalcConfigItem::getFieldUnit() { -- cgit v1.2.3 From 5caafbd39f898c4be282ceae037b4c68c76b0e30 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Thu, 5 Nov 2009 09:52:12 +0100 Subject: forgot to add filter to build.lst of apps using msfilter --- sc/prj/build.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 sc/prj/build.lst diff --git a/sc/prj/build.lst b/sc/prj/build.lst old mode 100644 new mode 100755 index f2338bf5ca71..788c8e58c463 --- a/sc/prj/build.lst +++ b/sc/prj/build.lst @@ -1,4 +1,4 @@ -sc sc : l10n oovbaapi svx stoc BOOST:boost formula oox NULL +sc sc : filter l10n oovbaapi svx stoc BOOST:boost formula oox NULL sc sc usr1 - all sc_mkout NULL sc sc\inc nmake - all sc_inc NULL sc sc\prj get - all sc_prj NULL -- cgit v1.2.3 From 2f006bf20ad7dbd59ab0ac846f06e018c2c1c4fb Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 6 Nov 2009 11:03:40 +0000 Subject: cmcfixes66: #i106674# fix remaining new[]/delete mismatches --- sc/source/core/data/column.cxx | 4 ++-- sc/source/ui/dbgui/tpsubt.cxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 0afc4fb1347c..afcd809eed1d 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -1233,8 +1233,8 @@ void ScColumn::InsertRow( SCROW nStartRow, SCSIZE nSize ) } } - delete pDelRows; - delete ppDelCells; + delete [] pDelRows; + delete [] ppDelCells; } pDocument->SetAutoCalc( bOldAutoCalc ); diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx index 337329acfec6..8bbc561c9e43 100644 --- a/sc/source/ui/dbgui/tpsubt.cxx +++ b/sc/source/ui/dbgui/tpsubt.cxx @@ -276,8 +276,8 @@ BOOL ScTpSubTotalGroup::DoFillItemSet( USHORT nGroupNo, rArgSet.Put( ScSubTotalItem( SCITEM_SUBTDATA, &theSubTotalData ) ); - if ( pSubTotals ) delete pSubTotals; - if ( pFunctions ) delete pFunctions; + if ( pSubTotals ) delete [] pSubTotals; + if ( pFunctions ) delete [] pFunctions; return TRUE; } -- cgit v1.2.3 From 3eba91118e139ff9d306f3113f86c0082e5c6c21 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Wed, 11 Nov 2009 07:25:37 +0100 Subject: #i103496#: sandbox removed --- sc/qa/complex/calcPreview/makefile.mk | 2 +- sc/qa/complex/cellRanges/makefile.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sc/qa/complex/calcPreview/makefile.mk b/sc/qa/complex/calcPreview/makefile.mk index 76a6afb4edf0..d346f6ea9213 100755 --- a/sc/qa/complex/calcPreview/makefile.mk +++ b/sc/qa/complex/calcPreview/makefile.mk @@ -40,7 +40,7 @@ PACKAGE = complex$/calcPreview #----- compile .java files ----------------------------------------- -JARFILES = mysql.jar sandbox.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar mysql.jar +JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar mysql.jar JAVAFILES = ViewForwarder.java JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) diff --git a/sc/qa/complex/cellRanges/makefile.mk b/sc/qa/complex/cellRanges/makefile.mk index 5af9bcf3b222..5ed6a3f083ff 100755 --- a/sc/qa/complex/cellRanges/makefile.mk +++ b/sc/qa/complex/cellRanges/makefile.mk @@ -40,7 +40,7 @@ PACKAGE = complex$/cellRanges #----- compile .java files ----------------------------------------- -JARFILES = mysql.jar sandbox.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar +JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar JAVAFILES = $(TARGET).java JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) -- cgit v1.2.3 From 003e500ae984553d7f47008ad15d0974aae9b8bf Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 13 Nov 2009 11:04:06 +0100 Subject: sb116: #i106845# removed obsolete IRIX port --- sc/source/ui/view/output3.cxx | 4 ---- sc/util/makefile.mk | 4 ---- 2 files changed, 8 deletions(-) diff --git a/sc/source/ui/view/output3.cxx b/sc/source/ui/view/output3.cxx index 648573bbb21c..c4c51fb3f02a 100644 --- a/sc/source/ui/view/output3.cxx +++ b/sc/source/ui/view/output3.cxx @@ -50,10 +50,6 @@ #include "tabvwsh.hxx" #include "fillinfo.hxx" - -#ifdef IRIX -#include -#endif #include // STATIC DATA ----------------------------------------------------------- diff --git a/sc/util/makefile.mk b/sc/util/makefile.mk index c06071ff6324..91e4fff6a6ee 100644 --- a/sc/util/makefile.mk +++ b/sc/util/makefile.mk @@ -41,10 +41,6 @@ USE_DEFFILE=TRUE .INCLUDE : settings.mk -.IF "$(OS)"=="IRIX" -LINKFLAGS+=-Wl,-LD_LAYOUT:lgot_buffer=30 -.ENDIF - # --- Resourcen ---------------------------------------------------- RESLIB1LIST=\ -- cgit v1.2.3 From 61556666b9ba6437eaa53a40ff9e6c525e442d15 Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Mon, 16 Nov 2009 13:48:33 +0100 Subject: validityref: #i103899# manual migration from svn (contribution from PengYunQuan) --- sc/inc/sc.hrc | 4 +- sc/inc/scabstdlg.hxx | 10 +- sc/inc/scmod.hxx | 22 ++- sc/sdi/cellsh.sdi | 3 + sc/sdi/scalc.sdi | 27 +++ sc/source/ui/app/scdll.cxx | 4 + sc/source/ui/app/scmod.cxx | 78 ++++++++ sc/source/ui/attrdlg/scdlgfact.cxx | 10 +- sc/source/ui/attrdlg/scdlgfact.hxx | 5 +- sc/source/ui/dbgui/makefile.mk | 3 +- sc/source/ui/dbgui/validate.cxx | 370 ++++++++++++++++++++++++++++++++++++- sc/source/ui/dbgui/validate.src | 82 ++++++-- sc/source/ui/docshell/docsh.cxx | 13 ++ sc/source/ui/inc/anyrefdg.hxx | 129 ++++++++++++- sc/source/ui/inc/docsh.hxx | 4 +- sc/source/ui/inc/reffact.hxx | 16 ++ sc/source/ui/inc/tabview.hxx | 5 +- sc/source/ui/inc/validate.hrc | 3 + sc/source/ui/inc/validate.hxx | 196 +++++++++++++++++++- sc/source/ui/miscdlgs/anyrefdg.cxx | 205 +++++++++++++------- sc/source/ui/view/cellsh2.cxx | 30 ++- sc/source/ui/view/makefile.mk | 3 +- sc/source/ui/view/reffact.cxx | 84 ++++++++- sc/source/ui/view/tabvwsh.cxx | 4 + sc/util/makefile.mk | 5 +- 25 files changed, 1199 insertions(+), 116 deletions(-) diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 8fb6b929337b..6633637ab3cb 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -662,7 +662,9 @@ //#define SID_OPENDLG_MODCHART (SC_MESSAGE_START + 58) #define SID_OPENDLG_CONDFRMT (SC_MESSAGE_START + 59) #define SID_OPENDLG_OPTSOLVER (SC_MESSAGE_START + 60) - +//Added by PengYunQuan for Validity Cell Range Picker #define SC_HINT_NAVIGATOR_UPDATEALL (SC_MESSAGE_START + 65) // Funktionen ------------------------------------------------------------ diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index f9895ff15ebb..94084aab4f1b 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -55,6 +55,9 @@ class SfxStyleSheetBase; class ScDPObject; struct ScDPFuncData; struct ScDPNumGroupInfo; +//Added by PengYunQuan for Validity Cell Range Picker namespace com { namespace sun { namespace star { namespace sheet { struct DataPilotFieldReference; @@ -459,8 +462,13 @@ public: virtual SfxAbstractTabDialog * CreateScParagraphDlg( Window* pParent, const SfxItemSet* pAttr ,//add for ScParagraphDlg int nId ) = 0; + //Modified by PengYunQuan for Validity Cell Range Picker virtual SfxAbstractTabDialog * CreateScSortDlg( Window* pParent, //add for ScSortDlg const SfxItemSet* pArgSet,int nId ) = 0; // for tabpage diff --git a/sc/inc/scmod.hxx b/sc/inc/scmod.hxx index 69f3def3efc5..ce46f044822e 100644 --- a/sc/inc/scmod.hxx +++ b/sc/inc/scmod.hxx @@ -41,6 +41,12 @@ #include +//Added by PengYunQuan for Validity Cell Range Picker + class KeyEvent; class SdrModel; @@ -145,6 +151,9 @@ class ScModule: public SfxModule, public SfxListener bool mbIsInSharedDocLoading; bool mbIsInSharedDocSaving; + //Added by PengYunQuan for Validity Cell Range Picker public: SFX_DECL_INTERFACE(SCID_APP) @@ -253,7 +262,10 @@ SC_DLLPUBLIC void SetAppOptions ( const ScAppOptions& rO ScFormEditData* GetFormEditData() { return pFormEditData; } // Referenzeingabe: - void SetRefDialog( USHORT nId, BOOL bVis, SfxViewFrame* pViewFrm = NULL ); + //Added by PengYunQuan for Validity Cell Range Picker BOOL IsModalMode(SfxObjectShell* pDocSh = NULL); BOOL IsFormulaMode(); BOOL IsRefDialogOpen(); @@ -276,6 +288,14 @@ SC_DLLPUBLIC void SetAppOptions ( const ScAppOptions& rO bool IsInSharedDocLoading() const { return mbIsInSharedDocLoading; } void SetInSharedDocSaving( bool bNew ) { mbIsInSharedDocSaving = bNew; } bool IsInSharedDocSaving() const { return mbIsInSharedDocSaving; } + + //Added by PengYunQuan for Validity Cell Range Picker }; #define SC_MOD() ( *(ScModule**) GetAppData(SHL_CALC) ) diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi index 7f97a8a0161e..730004f77011 100644 --- a/sc/sdi/cellsh.sdi +++ b/sc/sdi/cellsh.sdi @@ -52,6 +52,9 @@ interface CellSelection SID_OPENDLG_FUNCTION [ ExecMethod = Execute; StateMethod = GetCellState; ] SID_INS_FUNCTION [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] + // no Exec/StateMethod needed, but SfxDispatcher complains if the slot is not included in the shell + SID_VALIDITY_REFERENCE [] + // Datenbank-Operationen { SID_SORT_ASCENDING [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ] SID_SORT_DESCENDING [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ] diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi index 0be7ed5df204..2372c1dd03a0 100644 --- a/sc/sdi/scalc.sdi +++ b/sc/sdi/scalc.sdi @@ -2854,6 +2854,33 @@ SfxVoidItem SolverDialog SID_OPENDLG_OPTSOLVER GroupId = GID_OPTIONS; ] +//-------------------------------------------------------------------------- +//Added by PengYunQuan for Validity Cell Range Picker + //-------------------------------------------------------------------------- SfxVoidItem GoDownToEndOfData SID_CURSORBLKDOWN (SfxInt16Item By FN_PARAM_1,SfxBoolItem Sel FN_PARAM_2) diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx index 8bae4f1762d4..2be737d9a717 100644 --- a/sc/source/ui/app/scdll.cxx +++ b/sc/source/ui/app/scdll.cxx @@ -328,6 +328,10 @@ void ScDLL::Init() ScSpellDialogChildWindow ::RegisterChildWindow(FALSE, pMod); ::avmedia::MediaPlayer ::RegisterChildWindow(FALSE, pMod); + //Added by PengYunQuan for Validity Cell Range Picker + // Edit-Engine-Felder, soweit nicht schon in OfficeApplication::Init SvClassManager& rClassManager = SvxFieldItem::GetClassManager(); diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index 5afe9e11c7d5..fb31b5601cf8 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -2216,4 +2216,82 @@ IMPL_LINK( ScModule, CalcFieldValueHdl, EditFieldInfo*, pInfo ) +//Modified by PengYunQuan for Validity Cell Range Picke { SfxTabDialog* pDlg=NULL; switch ( nId ) { case TAB_DLG_VALIDATION : - pDlg = new ScValidationDlg( pParent, pArgSet ); + //Modified by PengYunQuan for Validity Cell Range Picker break; default: break; diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index 40f6d3bee976..530220858f35 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -546,7 +546,10 @@ public: int nId ); virtual SfxAbstractTabDialog * CreateScValidationDlg( Window* pParent, //add for ScValidationDlg - const SfxItemSet* pArgSet,int nId ); + //Modified by PengYunQuan for Validity Cell Range Picker virtual SfxAbstractTabDialog * CreateScSortDlg( Window* pParent, //add for ScSortDlg const SfxItemSet* pArgSet,int nId ); diff --git a/sc/source/ui/dbgui/makefile.mk b/sc/source/ui/dbgui/makefile.mk index 5d716552ca71..b495b5eabcc9 100644 --- a/sc/source/ui/dbgui/makefile.mk +++ b/sc/source/ui/dbgui/makefile.mk @@ -81,7 +81,8 @@ EXCEPTIONSFILES= \ $(SLO)$/csvtablebox.obj \ $(SLO)$/fieldwnd.obj \ $(SLO)$/pvlaydlg.obj \ - $(SLO)$/dapidata.obj + $(SLO)$/dapidata.obj \ + $(SLO)$/validate.obj SRS1NAME=$(TARGET) SRC1FILES = \ diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx index 8700c936e0f5..4351d357abb9 100644 --- a/sc/source/ui/dbgui/validate.cxx +++ b/sc/source/ui/dbgui/validate.cxx @@ -53,6 +53,12 @@ #include "validate.hxx" #include "compiler.hxx" #include "formula/opcode.hxx" //CHINA001 +//Added by PengYunQuan for Validity Cell Range Picker // ============================================================================ @@ -66,8 +72,19 @@ static USHORT pValueRanges[] = // ============================================================================ -ScValidationDlg::ScValidationDlg( Window* pParent, const SfxItemSet* pArgSet ) : - SfxTabDialog( pParent, ScResId( TAB_DLG_VALIDATION ), pArgSet ) +//Modified by PengYunQuan for Validity Cell Range Picker { AddTabPage( TP_VALIDATION_VALUES, ScTPValidationValue::Create, 0 ); AddTabPage( TP_VALIDATION_INPUTHELP, ScTPValidationHelp::Create, 0 ); @@ -75,8 +92,100 @@ ScValidationDlg::ScValidationDlg( Window* pParent, const SfxItemSet* pArgSet ) : FreeResource(); } +//Added by PengYunQuan for Validity Cell Range Picker + ScValidationDlg::~ScValidationDlg() { + //Added by PengYunQuan for Validity Cell Range Picker } @@ -236,7 +345,10 @@ ScTPValidationValue::ScTPValidationValue( Window* pParent, const SfxItemSet& rAr maStrMax ( ScResId( SCSTR_VALID_MAXIMUM ) ), maStrValue( ScResId( SCSTR_VALID_VALUE ) ), maStrRange( ScResId( SCSTR_VALID_RANGE ) ), - maStrList ( ScResId( SCSTR_VALID_LIST ) ) + maStrList ( ScResId( SCSTR_VALID_LIST ) ), +//Added by PengYunQuan for Validity Cell Range Picker { Init(); FreeResource(); @@ -246,6 +358,9 @@ ScTPValidationValue::ScTPValidationValue( Window* pParent, const SfxItemSet& rAr String aListSep = ::GetScCompilerNativeSymbol( ocSep ); //CHINA001 DBG_ASSERT( aListSep.Len() == 1, "ScTPValidationValue::ScTPValidationValue - list separator error" ); mcFmlaSep = aListSep.Len() ? aListSep.GetChar( 0 ) : ';'; + //Added by PengYunQuan for Validity Cell Range Picker } ScTPValidationValue::~ScTPValidationValue() @@ -257,6 +372,13 @@ void ScTPValidationValue::Init() maLbAllow.SetSelectHdl( LINK( this, ScTPValidationValue, SelectHdl ) ); maLbValue.SetSelectHdl( LINK( this, ScTPValidationValue, SelectHdl ) ); maCbShow.SetClickHdl( LINK( this, ScTPValidationValue, CheckHdl ) ); + //Added by PengYunQuan for Validity Cell Range Picker maLbAllow.SelectEntryPos( SC_VALIDDLG_ALLOW_ANY ); maLbValue.SelectEntryPos( SC_VALIDDLG_DATA_EQUAL ); @@ -374,6 +496,133 @@ void ScTPValidationValue::SetSecondFormula( const String& rFmlaStr ) maEdMax.SetText( rFmlaStr ); } +//Added by PengYunQuan for Validity Cell Range Picker // ---------------------------------------------------------------------------- @@ -427,7 +676,9 @@ IMPL_LINK( ScTPValidationValue, SelectHdl, ListBox*, EMPTYARG ) maFtMax.Show( bShowMax ); maEdMax.Show( bShowMax ); maFtHint.Show( bRange ); - + //Added by PengYunQuan for Validity Cell Range Picker return 0; } @@ -660,3 +911,114 @@ IMPL_LINK( ScTPValidationError, ClickSearchHdl, PushButton*, EMPTYARG ) return( 0L ); } +//Added by PengYunQuan for Validity Cell Range Picker diff --git a/sc/source/ui/dbgui/validate.src b/sc/source/ui/dbgui/validate.src index afd3fc213391..1f8e4b48deac 100644 --- a/sc/source/ui/dbgui/validate.src +++ b/sc/source/ui/dbgui/validate.src @@ -65,7 +65,9 @@ TabDialog TAB_DLG_VALIDATION }; Text [ en-US ] = "Validity" ; }; - +//Added by PengYunQuan for Validity Cell Range Picker TabPage TP_VALIDATION_VALUES { Hide = TRUE ; @@ -75,13 +77,19 @@ TabPage TP_VALIDATION_VALUES FixedText FT_ALLOW { Pos = MAP_APPFONT ( 6 , 16 ) ; - Size = MAP_APPFONT ( 70 , 8 ) ; + //Modified by PengYunQuan for Validity Cell Range Picker Text [ en-US ] = "~Allow" ; }; ListBox LB_ALLOW { Border = TRUE ; - Pos = MAP_APPFONT ( 80 , 14 ) ; + //Modified by PengYunQuan for Validity Cell Range Picker Size = MAP_APPFONT ( 90 , 80 ) ; TabStop = TRUE ; DropDown = TRUE ; @@ -100,13 +108,19 @@ TabPage TP_VALIDATION_VALUES FixedText FT_VALUE { Pos = MAP_APPFONT ( 6 , 58 ) ; - Size = MAP_APPFONT ( 70 , 8 ) ; + //Modified by PengYunQuan for Validity Cell Range Picker Text [ en-US ] = "~Data" ; }; ListBox LB_VALUE { Border = TRUE ; - Pos = MAP_APPFONT ( 80 , 56 ) ; + //Modified by PengYunQuan for Validity Cell Range Picker Size = MAP_APPFONT ( 90 , 90 ) ; TabStop = TRUE ; DropDown = TRUE ; @@ -126,54 +140,81 @@ TabPage TP_VALIDATION_VALUES FixedText FT_MIN { Pos = MAP_APPFONT ( 6 , 76 ) ; - Size = MAP_APPFONT ( 70 , 8 ) ; + //Modified by PengYunQuan for Validity Cell Range Picker Text [ en-US ] = "~Minimum" ; }; Edit EDT_MIN { Border = TRUE ; - Pos = MAP_APPFONT ( 80 , 74 ) ; - Size = MAP_APPFONT ( 174 , 12 ) ; + //Modified by PengYunQuan for Validity Cell Range Picker TabStop = TRUE ; }; MultiLineEdit EDT_LIST { Border = TRUE ; - Pos = MAP_APPFONT ( 80 , 74 ) ; - Size = MAP_APPFONT ( 174 , 105 ) ; + //Modified by PengYunQuan for Validity Cell Range Picker VScroll = TRUE ; IgnoreTab = TRUE ; }; FixedText FT_MAX { Pos = MAP_APPFONT ( 6 , 92 ) ; - Size = MAP_APPFONT ( 70 , 8 ) ; + //Modified by PengYunQuan for Validity Cell Range Picker Text [ en-US ] = "Ma~ximum" ; }; Edit EDT_MAX { Border = TRUE ; - Pos = MAP_APPFONT ( 80 , 90 ) ; - Size = MAP_APPFONT ( 174 , 12 ) ; + //Modified by PengYunQuan for Validity Cell Range Picker TabStop = TRUE ; }; CheckBox TSB_ALLOW_BLANKS { - Pos = MAP_APPFONT ( 80 , 30 ) ; + //Modified by PengYunQuan for Validity Cell Range Picker Size = MAP_APPFONT ( 174 , 10 ) ; TabStop = TRUE ; Text [ en-US ] = "Allow ~blank cells" ; }; CheckBox CB_SHOWLIST { - Pos = MAP_APPFONT ( 80 , 44 ) ; + //Modified by PengYunQuan for Validity Cell Range Picker Size = MAP_APPFONT ( 174 , 10 ) ; TabStop = TRUE ; Text [ en-US ] = "Show selection ~list" ; }; CheckBox CB_SORTLIST { - Pos = MAP_APPFONT ( 90 , 58 ) ; + //Modified by PengYunQuan for Validity Cell Range Picker Size = MAP_APPFONT ( 164 , 10 ) ; TabStop = TRUE ; Text [ en-US ] = "Sor~t entries ascending" ; @@ -185,6 +226,15 @@ TabPage TP_VALIDATION_VALUES WordBreak = TRUE ; Text [ en-US ] = "A valid source can only consist of a contiguous selection of rows and columns, or a formula that results in an area or array."; }; + //Added by PengYunQuan for Validity Cell Range Picker }; TabPage TP_VALIDATION_INPUTHELP diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index c8a41e81497d..716d0f6c4bd9 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -2559,3 +2559,16 @@ void ScDocShellModificator::SetDocumentModified() pDoc->BroadcastUno( SfxSimpleHint( SFX_HINT_DATACHANGED ) ); } } + +//Added by PengYunQuan for Validity Cell Range Picker diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx index 9e2d833b27d0..18125076d5cf 100644 --- a/sc/source/ui/inc/anyrefdg.hxx +++ b/sc/source/ui/inc/anyrefdg.hxx @@ -42,19 +42,28 @@ #endif #include #include "address.hxx" +#include "cell.hxx" +#include "compiler.hxx" #include "formula/funcutl.hxx" #include "IAnyRefDialog.hxx" +#include "scresid.hxx" #include class SfxObjectShell; class ScRange; class ScDocument; class ScTabViewShell; -class ScAnyRefDlg; -class ScFormulaCell; -class ScCompiler; +//The class of ScAnyRefDlg is rewritten by PengYunQuan for Validity Cell Range Picker +//class ScAnyRefDlg; +class ScRefHandler; class ScRangeList; +//Added by PengYunQuan for Validity Cell Range Picker class ScFormulaReferenceHelper { IAnyRefDialog* m_pDlg; @@ -104,12 +113,28 @@ public: void ViewShellChanged( ScTabViewShell* pScViewShell ); static void enableInput(BOOL _bInput); +//Added by PengYunQuan for Validity Cell Range Picker friend class formula::RefButton; friend class formula::RefEdit; @@ -130,7 +155,8 @@ protected: void SetDispatcherLock( BOOL bLock ); - virtual long PreNotify( NotifyEvent& rNEvt ); + //Overwrite TWindow will implemented by ScRefHdlrImplBase + //virtual long PreNotify( NotifyEvent& rNEvt ); virtual void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); virtual void RefInputDone( BOOL bForced = FALSE ); @@ -140,9 +166,9 @@ protected: bool ParseWithNames( ScRangeList& rRanges, const String& rStr, ScDocument* pDoc ); public: - ScAnyRefDlg( SfxBindings* pB, SfxChildWindow* pCW, - Window* pParent, USHORT nResId); - virtual ~ScAnyRefDlg(); + ScRefHandler( Window &rWindow, SfxBindings* pB/*, SfxChildWindow* pCW, + Window* pParent, USHORT nResId*/, bool bBindRef ); + virtual ~ScRefHandler(); virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) = 0; virtual void AddRefEntry(); @@ -159,15 +185,100 @@ public: virtual void ViewShellChanged( ScTabViewShell* pScViewShell ); void SwitchToDocument(); - SfxBindings& GetBindings(); + //SfxBindings& GetBindings(); virtual void SetActive() = 0; // virtual BOOL Close(); + //Overwrite TWindow will implemented by ScRefHdlrImplBase + //virtual void StateChanged( StateChangedType nStateChange ); + +//Added by PengYunQuan for Validity Cell Range Picker +}; + + +//============================================================================ +//Added by PengYunQuan for Validity Cell Range Picker ScSheetSaveData* GetSheetSaveData(); }; diff --git a/sc/source/ui/inc/reffact.hxx b/sc/source/ui/inc/reffact.hxx index cbd5da901a63..bc43aedf918f 100644 --- a/sc/source/ui/inc/reffact.hxx +++ b/sc/source/ui/inc/reffact.hxx @@ -102,6 +102,22 @@ class ScSimpleRefDlgWrapper: public SfxChildWindow void StartRefInput(); }; +//Added by PengYunQuan for Validity Cell Range Picker //================================================================== diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx index fe5da618e895..bc24b497c46b 100644 --- a/sc/source/ui/inc/tabview.hxx +++ b/sc/source/ui/inc/tabview.hxx @@ -390,7 +390,10 @@ public: void SetNewStartIfMarking(); - void SetTabNo( SCTAB nTab, BOOL bNew = FALSE, BOOL bExtendSelection = FALSE ); + //Added by PengYunQuan for Validity Cell Range Picker void SelectNextTab( short nDir, BOOL bExtendSelection = FALSE ); void ActivateView( BOOL bActivate, BOOL bFirst ); diff --git a/sc/source/ui/inc/validate.hrc b/sc/source/ui/inc/validate.hrc index 0f69e6a55136..4d46d42263b2 100644 --- a/sc/source/ui/inc/validate.hrc +++ b/sc/source/ui/inc/validate.hrc @@ -61,6 +61,9 @@ #define CB_SORTLIST 28 #define EDT_LIST 29 #define FT_SOURCEHINT 30 +//Added by PengYunQuan for Validity Cell Range Picker /* Position indexes for "Allow" list box. They do not map directly to ScValidationMode and can safely be modified to diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx index 2844a9f74e0f..0ac51e75b5d5 100644 --- a/sc/source/ui/inc/validate.hxx +++ b/sc/source/ui/inc/validate.hxx @@ -36,23 +36,164 @@ #include #include #include - +//Added by PengYunQuan for Validity Cell Range Picker // ============================================================================ +//Added by PengYunQuan for Validity Cell Range Picker + /** The "Validity" tab dialog. */ -class ScValidationDlg : public SfxTabDialog +//Modified by PengYunQuan for Validity Cell Range Picker { + //Added by PengYunQuan for Validity Cell Range Picker public: - explicit ScValidationDlg( Window* pParent, const SfxItemSet* pArgSet ); + //Modified by PengYunQuan for Validity Cell Range Picker + //Added by PengYunQuan for Validity Cell Range Picker }; // ============================================================================ /** The tab page "Criteria" from the Validation dialog. */ -class ScTPValidationValue : public SfxTabPage +//Modified by PengYunQuan for Validity Cell Range Picker { public: explicit ScTPValidationValue( Window* pParent, const SfxItemSet& rArgSet ); @@ -84,10 +225,16 @@ private: FixedText maFtValue; ListBox maLbValue; FixedText maFtMin; - Edit maEdMin; + //Modified by PengYunQuan for Validity Cell Range Picker MultiLineEdit maEdList; /// Entries for explicit list FixedText maFtMax; - Edit maEdMax; + //Modified by PengYunQuan for Validity Cell Range Picker FixedText maFtHint; /// Hint text for cell range validity. String maStrMin; @@ -96,6 +243,33 @@ private: String maStrRange; String maStrList; sal_Unicode mcFmlaSep; /// List separator in formulas. + //Added by PengYunQuan for Validity Cell Range Picker }; @@ -161,6 +335,16 @@ public: virtual void Reset ( const SfxItemSet& rArgSet ); }; +//Added by PengYunQuan for Validity Cell Range Picker #endif // SC_VALIDATE_HXX diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx index befabb51a17c..0d93eb0c7a93 100644 --- a/sc/source/ui/miscdlgs/anyrefdg.cxx +++ b/sc/source/ui/miscdlgs/anyrefdg.cxx @@ -377,7 +377,10 @@ IMPL_LINK( ScFormulaReferenceHelper, AccelSelectHdl, Accelerator *, pSelAccel ) //---------------------------------------------------------------------------- void ScFormulaReferenceHelper::RefInputDone( BOOL bForced ) { - if (pRefEdit && (bForced || !pRefBtn)) + //Modified by PengYunQuan for Validity Cell Range Picker { if (bAccInserted) // Accelerator wieder abschalten { @@ -677,23 +680,33 @@ void lcl_HideAllReferences() } //============================================================================ -// class ScAnyRefDlg +//The class of ScAnyRefDlg is rewritten by PengYunQuan for Validity Cell Range Picker +// class ScRefHandler //---------------------------------------------------------------------------- -ScAnyRefDlg::ScAnyRefDlg( SfxBindings* pB, SfxChildWindow* pCW, - Window* pParent, USHORT nResId) - : SfxModelessDialog ( pB, pCW, pParent, ScResId( nResId ) ), +ScRefHandler::ScRefHandler( Window &rWindow, SfxBindings* pB/*, SfxChildWindow* pCW, + Window* pParent, USHORT nResId*/, bool bBindRef ) + : //SfxModelessDialog ( pB, pCW, pParent, ScResId( nResId ) ), + m_rWindow( rWindow ), + m_bInRefMode( false ), m_aHelper(this,pB), pMyBindings( pB ), pActiveWin(NULL) { - m_aHelper.SetWindow(this); - if(GetHelpId()==0) //Hack, da im SfxModelessDialog die HelpId - SetHelpId(GetUniqueId()); //fuer einen ModelessDialog entfernt und + m_aHelper.SetWindow(/*this*/&m_rWindow); + if(m_rWindow.GetHelpId()==0) //Hack, da im SfxModelessDialog die HelpId + m_rWindow.SetHelpId(m_rWindow.GetUniqueId()); //fuer einen ModelessDialog entfernt und //in eine UniqueId gewandelt wird, machen //wir das an dieser Stelle rueckgaengig. aTimer.SetTimeout(200); - aTimer.SetTimeoutHdl(LINK( this, ScAnyRefDlg, UpdateFocusHdl)); + aTimer.SetTimeoutHdl(LINK( this, ScRefHandler, UpdateFocusHdl)); + + if( bBindRef ) EnterRefMode(); +} + +bool ScRefHandler::EnterRefMode() +{ + if( m_bInRefMode ) return false; SC_MOD()->InputEnterHandler(); // ScTabViewShell* pScViewShell = ScTabViewShell::GetActiveViewShell(); @@ -740,15 +753,25 @@ ScAnyRefDlg::ScAnyRefDlg( SfxBindings* pB, SfxChildWindow* pCW, m_aHelper.SetDispatcherLock( TRUE ); //@Test //SFX_APPWINDOW->Disable(TRUE); //@BugID 54702 + + return m_bInRefMode = true; } //---------------------------------------------------------------------------- -ScAnyRefDlg::~ScAnyRefDlg() +ScRefHandler::~ScRefHandler() +{ + LeaveRefMode(); +} + +bool ScRefHandler::LeaveRefMode() { + if( !m_bInRefMode ) return false; + lcl_HideAllReferences(); - SetModalInputMode(FALSE); + if( Dialog *pDlg = dynamic_cast( static_cast(*this) ) ) + pDlg->SetModalInputMode(FALSE); SetDispatcherLock( FALSE ); //! here and in DoClose ? ScTabViewShell* pScViewShell = ScTabViewShell::GetActiveViewShell(); @@ -757,20 +780,23 @@ ScAnyRefDlg::~ScAnyRefDlg() //SFX_APPWINDOW->Enable(TRUE,TRUE); lcl_InvalidateWindows(); + + m_bInRefMode = false; + return true; } //---------------------------------------------------------------------------- -SfxBindings& ScAnyRefDlg::GetBindings() -{ - //! SfxModelessDialog should allow access to pBindings pointer - - return *pMyBindings; -} +//SfxBindings& ScRefHandler::GetBindings() +//{ +// //! SfxModelessDialog should allow access to pBindings pointer +// +// return *pMyBindings; +//} //---------------------------------------------------------------------------- -void ScAnyRefDlg::SwitchToDocument() +void ScRefHandler::SwitchToDocument() { ScTabViewShell* pCurrent = ScTabViewShell::GetActiveViewShell(); if (pCurrent) @@ -800,7 +826,7 @@ void ScAnyRefDlg::SwitchToDocument() //---------------------------------------------------------------------------- -BOOL ScAnyRefDlg::IsDocAllowed(SfxObjectShell* pDocSh) const // pDocSh may be 0 +BOOL ScRefHandler::IsDocAllowed(SfxObjectShell* pDocSh) const // pDocSh may be 0 { // default: allow only same document (overridden in function dialog) String aCmpName; @@ -813,41 +839,41 @@ BOOL ScAnyRefDlg::IsDocAllowed(SfxObjectShell* pDocSh) const // pDocSh may be //---------------------------------------------------------------------------- -BOOL __EXPORT ScAnyRefDlg::IsRefInputMode() const +BOOL __EXPORT ScRefHandler::IsRefInputMode() const { - return IsVisible(); // nur wer sichtbar ist kann auch Referenzen bekommen + return m_rWindow.IsVisible(); // nur wer sichtbar ist kann auch Referenzen bekommen } //---------------------------------------------------------------------------- -BOOL __EXPORT ScAnyRefDlg::DoClose( USHORT nId ) +BOOL __EXPORT ScRefHandler::DoClose( USHORT nId ) { m_aHelper.DoClose(nId); return TRUE; } -void ScAnyRefDlg::SetDispatcherLock( BOOL bLock ) +void ScRefHandler::SetDispatcherLock( BOOL bLock ) { m_aHelper.SetDispatcherLock( bLock ); } //---------------------------------------------------------------------------- -void ScAnyRefDlg::ViewShellChanged(ScTabViewShell* pScViewShell ) +void ScRefHandler::ViewShellChanged(ScTabViewShell* pScViewShell ) { m_aHelper.ViewShellChanged(pScViewShell); } //---------------------------------------------------------------------------- -void ScAnyRefDlg::AddRefEntry() +void ScRefHandler::AddRefEntry() { // wenn nicht ueberladen, gibt es keine Mehrfach-Referenzen } //---------------------------------------------------------------------------- -BOOL __EXPORT ScAnyRefDlg::IsTableLocked() const +BOOL __EXPORT ScRefHandler::IsTableLocked() const { // per Default kann bei Referenzeingabe auch die Tabelle umgeschaltet werden @@ -861,48 +887,99 @@ BOOL __EXPORT ScAnyRefDlg::IsTableLocked() const // //---------------------------------------------------------------------------- -void ScAnyRefDlg::RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton ) +void ScRefHandler::RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton ) { m_aHelper.RefInputStart( pEdit, pButton ); } -void ScAnyRefDlg::ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* pButton ) +void ScRefHandler::ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* pButton ) { m_aHelper.ToggleCollapsed( pEdit, pButton ); } -long ScAnyRefDlg::PreNotify( NotifyEvent& rNEvt ) -{ - USHORT nSwitch=rNEvt.GetType(); - if(nSwitch==EVENT_GETFOCUS) - { - pActiveWin=rNEvt.GetWindow(); - } - return SfxModelessDialog::PreNotify(rNEvt); -} - -void ScAnyRefDlg::StateChanged( StateChangedType nStateChange ) -{ - SfxModelessDialog::StateChanged( nStateChange ); - if(nStateChange == STATE_CHANGE_VISIBLE) - { - if(IsVisible()) - { - m_aHelper.enableInput( FALSE ); - m_aHelper.EnableSpreadsheets(); - m_aHelper.SetDispatcherLock( TRUE ); - aTimer.Start(); - } - else - { - m_aHelper.enableInput( TRUE ); - m_aHelper.SetDispatcherLock( FALSE ); //! here and in DoClose ? - } - } -} - -IMPL_LINK( ScAnyRefDlg, UpdateFocusHdl, Timer*, EMPTYARG ) +//The two following function is commentted out by PengYunQuan for Validity Cell Range Picker +//long ScAnyRefDlg::PreNotify( NotifyEvent& rNEvt ) +//{ +// USHORT nSwitch=rNEvt.GetType(); +// if(nSwitch==EVENT_GETFOCUS) +// { +// pActiveWin=rNEvt.GetWindow(); +// } +// return SfxModelessDialog::PreNotify(rNEvt); +//} +// +//void ScAnyRefDlg::StateChanged( StateChangedType nStateChange ) +//{ +// SfxModelessDialog::StateChanged( nStateChange ); +// +// if(nStateChange == STATE_CHANGE_VISIBLE) +// { +// if(IsVisible()) +// { +// m_aHelper.enableInput( FALSE ); +// m_aHelper.EnableSpreadsheets(); +// m_aHelper.SetDispatcherLock( TRUE ); +// aTimer.Start(); +// } +// else +// { +// m_aHelper.enableInput( TRUE ); +// m_aHelper.SetDispatcherLock( FALSE ); //! here and in DoClose ? +// } +// } +//} + +#if defined( _MSC_VER ) +#define INTRODUCE_TEMPLATE +#else +#define INTRODUCE_TEMPLATE template <> +#endif + +#define IMPL_TWINDOW_PRENOTIFY( TWindow,bBindRef ) \ +INTRODUCE_TEMPLATE long ScRefHdlrImplBase::PreNotify( NotifyEvent& rNEvt )\ +{\ + if( bBindRef || m_bInRefMode )\ + {\ + USHORT nSwitch=rNEvt.GetType();\ + if(nSwitch==EVENT_GETFOCUS)\ + {\ + pActiveWin=rNEvt.GetWindow();\ + }\ + }\ + return TWindow::PreNotify(rNEvt);\ +} + +#define IMPL_TWINDOW_STATECHANGED( TWindow,bBindRef ) \ +INTRODUCE_TEMPLATE void ScRefHdlrImplBase::StateChanged( StateChangedType nStateChange )\ +{\ + TWindow::StateChanged( nStateChange );\ +\ + if( !bBindRef && !m_bInRefMode ) return;\ + \ + if(nStateChange == STATE_CHANGE_VISIBLE)\ + {\ + if(m_rWindow.IsVisible())\ + {\ + m_aHelper.enableInput( FALSE );\ + m_aHelper.EnableSpreadsheets();\ + m_aHelper.SetDispatcherLock( TRUE );\ + aTimer.Start();\ + }\ + else\ + {\ + m_aHelper.enableInput( TRUE );\ + m_aHelper.SetDispatcherLock( FALSE ); /*//! here and in DoClose ?*/\ + }\ + }\ +} + +IMPL_TWINDOW_PRENOTIFY( SfxModelessDialog, true ) +IMPL_TWINDOW_PRENOTIFY( SfxTabDialog, false ) +IMPL_TWINDOW_STATECHANGED( SfxModelessDialog, true ) +IMPL_TWINDOW_STATECHANGED( SfxTabDialog, false ) + +IMPL_LINK( ScRefHandler, UpdateFocusHdl, Timer*, EMPTYARG ) { if (pActiveWin) { @@ -911,27 +988,27 @@ IMPL_LINK( ScAnyRefDlg, UpdateFocusHdl, Timer*, EMPTYARG ) return 0; } // ----------------------------------------------------------------------------- -bool ScAnyRefDlg::ParseWithNames( ScRangeList& rRanges, const String& rStr, ScDocument* pDoc ) +bool ScRefHandler::ParseWithNames( ScRangeList& rRanges, const String& rStr, ScDocument* pDoc ) { return m_aHelper.ParseWithNames( rRanges, rStr, pDoc ); } // ----------------------------------------------------------------------------- -void ScAnyRefDlg::HideReference( BOOL bDoneRefMode ) +void ScRefHandler::HideReference( BOOL bDoneRefMode ) { m_aHelper.HideReference( bDoneRefMode ); } // ----------------------------------------------------------------------------- -void ScAnyRefDlg::ShowReference( const XubString& rStr ) +void ScRefHandler::ShowReference( const XubString& rStr ) { m_aHelper.ShowReference( rStr ); } // ----------------------------------------------------------------------------- -void ScAnyRefDlg::ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pButton ) +void ScRefHandler::ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pButton ) { m_aHelper.ReleaseFocus( pEdit,pButton ); } //---------------------------------------------------------------------------- -void ScAnyRefDlg::RefInputDone( BOOL bForced ) +void ScRefHandler::RefInputDone( BOOL bForced ) { m_aHelper.RefInputDone( bForced ); } diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index 039e4dc256ba..29db7f2286b3 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -209,6 +209,18 @@ BOOL lcl_GetSortParam( const ScViewData* pData, ScSortParam& rSortParam ) return bSort; } +// Added by PengYunQuan for Validity Cell Range Picker + void ScCellShell::ExecuteDB( SfxRequest& rReq ) { ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell(); @@ -1060,10 +1072,18 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) //CHINA001 ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); //CHINA001 DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001 - SfxAbstractTabDialog* pDlg = pFact->CreateScValidationDlg( NULL, &aArgSet, TAB_DLG_VALIDATION ); + //Modified by PengYunQuan for Validity Cell Range Picker DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001 - if ( pDlg->Execute() == RET_OK ) + //Modified by PengYunQuan for Validity Cell Range Picker { const SfxItemSet* pOutSet = pDlg->GetOutputItemSet(); @@ -1142,7 +1162,11 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) pTabViewShell->SetValidation( aData ); rReq.Done( *pOutSet ); } - delete pDlg; + // Modified by PengYunQuan for Validity Cell Range Picker } } break; diff --git a/sc/source/ui/view/makefile.mk b/sc/source/ui/view/makefile.mk index 466ab5dc8627..d8f45c8a754f 100644 --- a/sc/source/ui/view/makefile.mk +++ b/sc/source/ui/view/makefile.mk @@ -161,7 +161,8 @@ EXCEPTIONSFILES= \ $(SLO)$/tabvwshb.obj \ $(SLO)$/viewdata.obj \ $(SLO)$/viewfun5.obj \ - $(SLO)$/viewfun7.obj + $(SLO)$/viewfun7.obj \ + $(SLO)$/reffact.obj # goal seek -O2 diff --git a/sc/source/ui/view/reffact.cxx b/sc/source/ui/view/reffact.cxx index 66f9cb88fb2c..8b36ae6a480e 100644 --- a/sc/source/ui/view/reffact.cxx +++ b/sc/source/ui/view/reffact.cxx @@ -47,6 +47,9 @@ #include "acredlin.hxx" #include "simpref.hxx" #include "scmod.hxx" +//Added by PengYunQuan for Validity Cell Range Picker*/\ + if (!pViewShell) \ + pViewShell = PTR_CAST( ScTabViewShell, SfxViewShell::Current() ); \ DBG_ASSERT( pViewShell, "missing view shell :-(" ); \ pWindow = pViewShell ? \ pViewShell->CreateRefDialog( p, this, pInfo, pParentP, sid ) : NULL; \ @@ -355,3 +388,50 @@ IMPL_CHILD_CTOR( ScHighlightChgDlgWrapper, FID_CHG_SHOW ) /*------------------------------------------------------------------------*/ +//Added by PengYunQuan for Validity Cell Range Picker diff --git a/sc/source/ui/view/tabvwsh.cxx b/sc/source/ui/view/tabvwsh.cxx index 497eb65fc76f..4c73d14d51be 100644 --- a/sc/source/ui/view/tabvwsh.cxx +++ b/sc/source/ui/view/tabvwsh.cxx @@ -96,6 +96,10 @@ SFX_IMPL_INTERFACE(ScTabViewShell,SfxViewShell,ScResId(SCSTR_TABVIEWSHELL)) SFX_CHILDWINDOW_REGISTRATION(GalleryChildWindow::GetChildWindowId()); SFX_CHILDWINDOW_REGISTRATION(ScSpellDialogChildWindow::GetChildWindowId()); SFX_CHILDWINDOW_REGISTRATION( ::avmedia::MediaPlayer::GetChildWindowId() ); + + //Added by PengYunQuan for Validity Cell Range Picker } SFX_IMPL_VIEWFACTORY( ScTabViewShell, ScResId(STR_NONAME) ) diff --git a/sc/util/makefile.mk b/sc/util/makefile.mk index c06071ff6324..eded4b9df3f7 100644 --- a/sc/util/makefile.mk +++ b/sc/util/makefile.mk @@ -229,8 +229,9 @@ SHL8STDLIBS= \ $(I18NISOLANGLIB) \ $(COMPHELPERLIB) \ $(CPPULIB) \ - $(SALLIB) - + $(SALLIB) \ + $(FORLIB) \ + $(FORUILIB) .IF "$(ENABLE_LAYOUT)" == "TRUE" SHL8STDLIBS+=$(TKLIB) .ENDIF # ENABLE_LAYOUT == TRUE -- cgit v1.2.3 From e799c0f7ff29e81f19e26359d738c5c643452bc6 Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Thu, 19 Nov 2009 15:35:41 +0000 Subject: #i106854# get source stream directly from document's storage instead of a temporary SfxMedium --- sc/source/filter/xml/xmlwrap.cxx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx index 7bc5396fcb5b..3d27cde55d98 100644 --- a/sc/source/filter/xml/xmlwrap.cxx +++ b/sc/source/filter/xml/xmlwrap.cxx @@ -737,12 +737,8 @@ sal_Bool ScXMLImportWrapper::ExportToComponent(uno::ReferenceGetMedium(); - String aSrcURL = pSrcMed->GetOrigURL(); - - // SfxMedium must not be read-only, or it will create a temp file in GetStorage - SfxMedium aTmpMedium( aSrcURL, STREAM_READWRITE, FALSE, NULL, NULL ); - uno::Reference xTmpStorage = aTmpMedium.GetStorage(); + // #i106854# use the document's storage directly, without a temporary SfxMedium + uno::Reference xTmpStorage = rDoc.GetDocumentShell()->GetStorage(); uno::Reference xSrcStream; uno::Reference xSrcInput; try -- cgit v1.2.3 From ef9931cee162db34de60adb23ee7c54083105ff6 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Fri, 20 Nov 2009 14:02:34 +0000 Subject: CWS-TOOLING: integrate CWS calc32stopper5 2009-11-12 13:18:26 +0100 dr r277477 : #i105267# missing in exception files list 2009-11-12 11:13:57 +0100 dr r277472 : CWS-TOOLING: rebase CWS calc32stopper5 to branches/OOO320@277373 (milestone: OOO320:m4) 2009-11-11 17:27:10 +0100 dr r277466 : #i105267# remember all existing copies of ScAccessibeEditLineTextData in the ScTextWnd instance (text input line) 2009-11-04 09:59:49 +0100 dr r277334 : dump even more BIFF records written by XL12 2009-10-27 19:11:37 +0100 dr r277231 : few dumper additions 2009-10-27 17:17:10 +0100 nn r277225 : #i106343# check if pDocShell is set in GetFormatter 2009-10-26 14:54:15 +0100 dr r277178 : #i106194# OOXML: load form controls from binary streams 2009-10-26 14:14:01 +0100 dr r277177 : #i106194# OOXML: load form controls from binary streams --- sc/source/ui/Accessibility/AccessibleText.cxx | 6 ++-- sc/source/ui/app/inputwin.cxx | 41 ++++++++++++++++++--------- sc/source/ui/app/makefile.mk | 3 +- sc/source/ui/inc/inputwin.hxx | 13 ++++----- 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 #include "scitems.hxx" #include @@ -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 #include -#endif #include #include -#ifndef _COMBOBOX_HXX //autogen #include -#endif #include #include @@ -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) -- cgit v1.2.3 From 590cca7e29c5efb2310b8de7a588cddc86f0b399 Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Tue, 24 Nov 2009 13:58:30 +0000 Subject: #i107151# Compare/CompareMat: call Pop for svEmptyCell --- sc/source/core/tool/interpr1.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 904c2625730c..65e51356f1a0 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -780,6 +780,7 @@ double ScInterpreter::Compare() switch ( GetRawStackType() ) { case svEmptyCell: + Pop(); aComp.bEmpty[ i ] = TRUE; break; case svMissing: @@ -836,6 +837,7 @@ ScMatrixRef ScInterpreter::CompareMat( ScCompareOptions* pOptions ) switch (GetRawStackType()) { case svEmptyCell: + Pop(); aComp.bEmpty[ i ] = TRUE; break; case svMissing: -- cgit v1.2.3 From 8a639d2465c6f5451b4ce4a87d7c389d835ddef0 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Tue, 24 Nov 2009 18:33:17 +0000 Subject: #i107170# use current script for default cell style --- sc/source/filter/excel/xehelper.cxx | 4 +- sc/source/filter/excel/xestyle.cxx | 206 +++++++++++++++++++++--------------- sc/source/filter/inc/xestyle.hxx | 39 +++++-- 3 files changed, 151 insertions(+), 98 deletions(-) diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index 45a44b2c88d1..ad474c8c2873 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -415,7 +415,7 @@ XclExpStringRef lclCreateFormattedString( nScript = nLastScript; // construct font from current text portion - SvxFont aFont( XclExpFontBuffer::GetFontFromItemSet( rItemSet, nScript ) ); + SvxFont aFont( XclExpFontHelper::GetFontFromItemSet( rRoot, rItemSet, nScript ) ); // Excel start position of this portion sal_uInt16 nXclPortionStart = xString->Len(); @@ -529,7 +529,7 @@ XclExpStringRef lclCreateFormattedString( sal_Int16 nScript = xBreakIt->getScriptType( aXclPortionText, 0 ); if( nScript == ApiScriptType::WEAK ) nScript = nLastScript; - SvxFont aFont( XclExpFontBuffer::GetFontFromItemSet( aItemSet, nScript ) ); + SvxFont aFont( XclExpFontHelper::GetFontFromItemSet( rRoot, aItemSet, nScript ) ); nLastScript = nScript; // add escapement diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index 2172a7678763..0288d4ac164c 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -823,6 +823,120 @@ void XclExpPalette::WriteBody( XclExpStream& rStrm ) namespace { +typedef ::std::pair< USHORT, sal_Int16 > WhichAndScript; + +sal_Int16 lclCheckFontItems( const SfxItemSet& rItemSet, + const WhichAndScript& rWAS1, const WhichAndScript& rWAS2, const WhichAndScript& rWAS3 ) +{ + if( ScfTools::CheckItem( rItemSet, rWAS1.first, false ) ) return rWAS1.second; + if( ScfTools::CheckItem( rItemSet, rWAS2.first, false ) ) return rWAS2.second; + if( ScfTools::CheckItem( rItemSet, rWAS3.first, false ) ) return rWAS3.second; + return 0; +}; + +} // namespace + +/*static*/ sal_Int16 XclExpFontHelper::GetFirstUsedScript( const XclExpRoot& rRoot, const SfxItemSet& rItemSet ) +{ + namespace ApiScriptType = ::com::sun::star::i18n::ScriptType; + + /* #i17050# #i107170# We need to determine which font items are set in the + item set, and which script type we should prefer according to the + current language settings. */ + + static const WhichAndScript WAS_LATIN( ATTR_FONT, ::com::sun::star::i18n::ScriptType::LATIN ); + static const WhichAndScript WAS_ASIAN( ATTR_CJK_FONT, ::com::sun::star::i18n::ScriptType::ASIAN ); + static const WhichAndScript WAS_CMPLX( ATTR_CTL_FONT, ::com::sun::star::i18n::ScriptType::COMPLEX ); + + /* #114008# do not let a font from a parent style override an explicit + cell font. */ + + sal_Int16 nDefScript = rRoot.GetDefApiScript(); + sal_Int16 nScript = 0; + const SfxItemSet* pCurrSet = &rItemSet; + + while( (nScript == 0) && pCurrSet ) + { + switch( nDefScript ) + { + case ApiScriptType::LATIN: + nScript = lclCheckFontItems( *pCurrSet, WAS_LATIN, WAS_CMPLX, WAS_ASIAN ); + break; + case ApiScriptType::ASIAN: + nScript = lclCheckFontItems( *pCurrSet, WAS_ASIAN, WAS_CMPLX, WAS_LATIN ); + break; + case ApiScriptType::COMPLEX: + nScript = lclCheckFontItems( *pCurrSet, WAS_CMPLX, WAS_ASIAN, WAS_LATIN ); + break; + default: + DBG_ERRORFILE( "XclExpFontHelper::GetFirstUsedScript - unknown script type" ); + nScript = ApiScriptType::LATIN; + }; + pCurrSet = pCurrSet->GetParent(); + } + + return nScript; +} + +/*static*/ Font XclExpFontHelper::GetFontFromItemSet( const XclExpRoot& rRoot, const SfxItemSet& rItemSet, sal_Int16 nScript ) +{ + namespace ApiScriptType = ::com::sun::star::i18n::ScriptType; + + // if WEAK is passed, guess script type from existing items in the item set + if( nScript == ApiScriptType::WEAK ) + nScript = GetFirstUsedScript( rRoot, rItemSet ); + + // convert to core script type constants + BYTE nScScript = SCRIPTTYPE_LATIN; + switch( nScript ) + { + case ApiScriptType::LATIN: nScScript = SCRIPTTYPE_LATIN; break; + case ApiScriptType::ASIAN: nScScript = SCRIPTTYPE_ASIAN; break; + case ApiScriptType::COMPLEX: nScScript = SCRIPTTYPE_COMPLEX; break; + default: DBG_ERRORFILE( "XclExpFontHelper::GetFontFromItemSet - unknown script type" ); + } + + // fill the font object + Font aFont; + ScPatternAttr::GetFont( aFont, rItemSet, SC_AUTOCOL_RAW, 0, 0, 0, nScScript ); + return aFont; +} + +/*static*/ bool XclExpFontHelper::CheckItems( const XclExpRoot& rRoot, const SfxItemSet& rItemSet, sal_Int16 nScript, bool bDeep ) +{ + static const USHORT pnCommonIds[] = { + ATTR_FONT_UNDERLINE, ATTR_FONT_CROSSEDOUT, ATTR_FONT_CONTOUR, + ATTR_FONT_SHADOWED, ATTR_FONT_COLOR, ATTR_FONT_LANGUAGE, 0 }; + static const USHORT pnLatinIds[] = { + ATTR_FONT, ATTR_FONT_HEIGHT, ATTR_FONT_WEIGHT, ATTR_FONT_POSTURE, 0 }; + static const USHORT pnAsianIds[] = { + ATTR_CJK_FONT, ATTR_CJK_FONT_HEIGHT, ATTR_CJK_FONT_WEIGHT, ATTR_CJK_FONT_POSTURE, 0 }; + static const USHORT pnComplexIds[] = { + ATTR_CTL_FONT, ATTR_CTL_FONT_HEIGHT, ATTR_CTL_FONT_WEIGHT, ATTR_CTL_FONT_POSTURE, 0 }; + + bool bUsed = ScfTools::CheckItems( rItemSet, pnCommonIds, bDeep ); + if( !bUsed ) + { + namespace ApiScriptType = ::com::sun::star::i18n::ScriptType; + // if WEAK is passed, guess script type from existing items in the item set + if( nScript == ApiScriptType::WEAK ) + nScript = GetFirstUsedScript( rRoot, rItemSet ); + // check the correct items + switch( nScript ) + { + case ApiScriptType::LATIN: bUsed = ScfTools::CheckItems( rItemSet, pnLatinIds, bDeep ); break; + case ApiScriptType::ASIAN: bUsed = ScfTools::CheckItems( rItemSet, pnAsianIds, bDeep ); break; + case ApiScriptType::COMPLEX: bUsed = ScfTools::CheckItems( rItemSet, pnComplexIds, bDeep ); break; + default: DBG_ERRORFILE( "XclExpFontHelper::CheckItems - unknown script type" ); + } + } + return bUsed; +} + +// ---------------------------------------------------------------------------- + +namespace { + sal_uInt32 lclCalcHash( const XclFontData& rFontData ) { sal_uInt32 nHash = rFontData.maName.Len(); @@ -993,7 +1107,8 @@ sal_uInt16 XclExpFontBuffer::Insert( const SfxItemSet& rItemSet, sal_Int16 nScript, XclExpColorType eColorType, bool bAppFont ) { // #i17050# #114008# #115495# script type now provided by caller - return Insert( GetFontFromItemSet( rItemSet, nScript ), eColorType, bAppFont ); + Font aFont = XclExpFontHelper::GetFontFromItemSet( GetRoot(), rItemSet, nScript ); + return Insert( aFont, eColorType, bAppFont ); } sal_uInt16 XclExpFontBuffer::Insert( const ScPatternAttr& rPattern, @@ -1022,90 +1137,6 @@ void XclExpFontBuffer::SaveXml( XclExpXmlStream& rStrm ) rStyleSheet->endElement( XML_fonts ); } -sal_Int16 XclExpFontBuffer::GetFirstUsedScript( const SfxItemSet& rItemSet ) -{ - /* #i17050# We need to determine if a CJK or CTL font item is set in the - item set. It is possible that both may be present. In this case, - we will choose CJK. Either option is equally correct. */ - - namespace ApiScriptType = ::com::sun::star::i18n::ScriptType; - sal_Int16 nScript = ApiScriptType::LATIN; - - // #114008# do not let a font from a parent style override an explicit cell font - const SfxItemSet* pCurrSet = &rItemSet; - bool bFound = false; - while( !bFound && pCurrSet ) - { - bFound = true; - if( ScfTools::CheckItem( *pCurrSet, ATTR_CJK_FONT, false ) ) - nScript = ApiScriptType::ASIAN; - else if( ScfTools::CheckItem( *pCurrSet, ATTR_CTL_FONT, false ) ) - nScript = ApiScriptType::COMPLEX; - else if( ScfTools::CheckItem( *pCurrSet, ATTR_FONT, false ) ) - nScript = ApiScriptType::LATIN; - else - bFound = false; - pCurrSet = pCurrSet->GetParent(); - } - - return nScript; -} - -Font XclExpFontBuffer::GetFontFromItemSet( const SfxItemSet& rItemSet, sal_Int16 nScript ) -{ - namespace ApiScriptType = ::com::sun::star::i18n::ScriptType; - - // if WEAK is passed, guess script type from existing items in the item set - if( nScript == ApiScriptType::WEAK ) - nScript = GetFirstUsedScript( rItemSet ); - - // convert to core script type constants - BYTE nScScript = SCRIPTTYPE_LATIN; - switch( nScript ) - { - case ApiScriptType::LATIN: nScScript = SCRIPTTYPE_LATIN; break; - case ApiScriptType::ASIAN: nScScript = SCRIPTTYPE_ASIAN; break; - case ApiScriptType::COMPLEX: nScScript = SCRIPTTYPE_COMPLEX; break; - default: DBG_ERRORFILE( "XclExpFontBuffer::GetFontFromItemSet - unknown script type" ); - } - - // fill the font object - Font aFont; - ScPatternAttr::GetFont( aFont, rItemSet, SC_AUTOCOL_RAW, 0, 0, 0, nScScript ); - return aFont; -} - -bool XclExpFontBuffer::CheckItems( const SfxItemSet& rItemSet, sal_Int16 nScript, bool bDeep ) -{ - static const USHORT pnCommonIds[] = { - ATTR_FONT_UNDERLINE, ATTR_FONT_CROSSEDOUT, ATTR_FONT_CONTOUR, - ATTR_FONT_SHADOWED, ATTR_FONT_COLOR, ATTR_FONT_LANGUAGE, 0 }; - static const USHORT pnLatinIds[] = { - ATTR_FONT, ATTR_FONT_HEIGHT, ATTR_FONT_WEIGHT, ATTR_FONT_POSTURE, 0 }; - static const USHORT pnAsianIds[] = { - ATTR_CJK_FONT, ATTR_CJK_FONT_HEIGHT, ATTR_CJK_FONT_WEIGHT, ATTR_CJK_FONT_POSTURE, 0 }; - static const USHORT pnComplexIds[] = { - ATTR_CTL_FONT, ATTR_CTL_FONT_HEIGHT, ATTR_CTL_FONT_WEIGHT, ATTR_CTL_FONT_POSTURE, 0 }; - - bool bUsed = ScfTools::CheckItems( rItemSet, pnCommonIds, bDeep ); - if( !bUsed ) - { - namespace ApiScriptType = ::com::sun::star::i18n::ScriptType; - // if WEAK is passed, guess script type from existing items in the item set - if( nScript == ApiScriptType::WEAK ) - nScript = GetFirstUsedScript( rItemSet ); - // check the correct items - switch( nScript ) - { - case ApiScriptType::LATIN: bUsed = ScfTools::CheckItems( rItemSet, pnLatinIds, bDeep ); break; - case ApiScriptType::ASIAN: bUsed = ScfTools::CheckItems( rItemSet, pnAsianIds, bDeep ); break; - case ApiScriptType::COMPLEX: bUsed = ScfTools::CheckItems( rItemSet, pnComplexIds, bDeep ); break; - default: DBG_ERRORFILE( "XclExpFontBuffer::CheckItems - unknown script type" ); - } - } - return bUsed; -} - // private -------------------------------------------------------------------- void XclExpFontBuffer::InitDefaultFonts() @@ -1885,7 +1916,8 @@ XclExpXF::XclExpXF( const XclExpRoot& rRoot, const SfxStyleSheetBase& rStyleShee mnParentXFId( XclExpXFBuffer::GetXFIdFromIndex( EXC_XF_STYLEPARENT ) ) { bool bDefStyle = (rStyleSheet.GetName() == ScGlobal::GetRscString( STR_STYLENAME_STANDARD )); - Init( const_cast< SfxStyleSheetBase& >( rStyleSheet ).GetItemSet(), ::com::sun::star::i18n::ScriptType::WEAK, + sal_Int16 nScript = bDefStyle ? GetDefApiScript() : ::com::sun::star::i18n::ScriptType::WEAK; + Init( const_cast< SfxStyleSheetBase& >( rStyleSheet ).GetItemSet(), nScript, NUMBERFORMAT_ENTRY_NOT_FOUND, EXC_FONT_NOTFOUND, false, bDefStyle ); } @@ -1947,7 +1979,7 @@ void XclExpXF::Init( const SfxItemSet& rItemSet, sal_Int16 nScript, if( nForceXclFont == EXC_FONT_NOTFOUND ) { mnXclFont = GetFontBuffer().Insert( rItemSet, nScript, EXC_COLOR_CELLTEXT, bDefStyle ); - mbFontUsed = XclExpFontBuffer::CheckItems( rItemSet, nScript, IsStyleXF() ); + mbFontUsed = XclExpFontHelper::CheckItems( GetRoot(), rItemSet, nScript, IsStyleXF() ); } else { diff --git a/sc/source/filter/inc/xestyle.hxx b/sc/source/filter/inc/xestyle.hxx index fb2ea876c279..ebc4300baa62 100644 --- a/sc/source/filter/inc/xestyle.hxx +++ b/sc/source/filter/inc/xestyle.hxx @@ -139,6 +139,36 @@ const size_t EXC_FONTLIST_NOTFOUND = static_cast< size_t >( -1 ); // ---------------------------------------------------------------------------- +/** Static helper functions for font export. */ +class XclExpFontHelper +{ +public: + /** Returns the script type of the first font item found in the item set and its parents. */ + static sal_Int16 GetFirstUsedScript( + const XclExpRoot& rRoot, + const SfxItemSet& rItemSet ); + + /** Returns a VCL font object filled from the passed item set. */ + static Font GetFontFromItemSet( + const XclExpRoot& rRoot, + const SfxItemSet& rItemSet, + sal_Int16 nScript ); + + /** Returns true, if at least one font related item is set in the passed item set. + @param bDeep true = Searches in parent item sets too. */ + static bool CheckItems( + const XclExpRoot& rRoot, + const SfxItemSet& rItemSet, + sal_Int16 nScript, + bool bDeep ); + +private: + XclExpFontHelper(); + ~XclExpFontHelper(); +}; + +// ---------------------------------------------------------------------------- + /** Stores all data of an Excel font and provides export of FONT records. */ class XclExpFont : public XclExpRecord, protected XclExpRoot { @@ -228,15 +258,6 @@ public: virtual void Save( XclExpStream& rStrm ); virtual void SaveXml( XclExpXmlStream& rStrm ); - /** Returns the script type of the first font item found in the item set and its parents. */ - static sal_Int16 GetFirstUsedScript( const SfxItemSet& rItemSet ); - - /** Returns a VCL font object filled from the passed item set. */ - static Font GetFontFromItemSet( const SfxItemSet& rItemSet, sal_Int16 nScript ); - /** Returns true, if at least one font related item is set in the passed item set. - @param bDeep true = Searches in parent item sets too. */ - static bool CheckItems( const SfxItemSet& rItemSet, sal_Int16 nScript, bool bDeep ); - private: /** Initializes the default fonts for the current BIFF version. */ void InitDefaultFonts(); -- cgit v1.2.3 From 05086718f237f3928e18de1f2a8114ac693b1c17 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Mon, 30 Nov 2009 12:28:12 +0000 Subject: #i107275# ScRefTokenHelper::compileRangeRepresentation - allow parentheses enclosing the entire expression --- sc/source/core/tool/reftokenhelper.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sc/source/core/tool/reftokenhelper.cxx b/sc/source/core/tool/reftokenhelper.cxx index d0f2b8233de0..53a87667e8c6 100644 --- a/sc/source/core/tool/reftokenhelper.cxx +++ b/sc/source/core/tool/reftokenhelper.cxx @@ -54,12 +54,17 @@ void ScRefTokenHelper::compileRangeRepresentation( const sal_Unicode cSep = GetScCompilerNativeSymbol(ocSep).GetChar(0); const sal_Unicode cQuote = '\''; + // #i107275# ignore parentheses + OUString aRangeStr = rRangeStr; + while( (aRangeStr.getLength() >= 2) && (aRangeStr[ 0 ] == '(') && (aRangeStr[ aRangeStr.getLength() - 1 ] == ')') ) + aRangeStr = aRangeStr.copy( 1, aRangeStr.getLength() - 2 ); + bool bFailure = false; sal_Int32 nOffset = 0; while (nOffset >= 0 && !bFailure) { OUString aToken; - ScRangeStringConverter::GetTokenByOffset(aToken, rRangeStr, nOffset, cSep, cQuote); + ScRangeStringConverter::GetTokenByOffset(aToken, aRangeStr, nOffset, cSep, cQuote); if (nOffset < 0) break; -- cgit v1.2.3 From 4d256d26b3d99149c3dafe8b1acbc161c69c171d Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Tue, 8 Dec 2009 17:37:17 +0100 Subject: masterfix: #i10000# crash in sc fixed --- sc/source/ui/view/viewdata.cxx | 80 ++++++++++++++++++++++++++++++++---------- 1 file changed, 61 insertions(+), 19 deletions(-) diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index c3c096a6a666..c23eb73e1f59 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -612,16 +612,26 @@ void ScViewData::SetZoomType( SvxZoomType eNew, std::vector< SCTAB >& tabs ) if ( !bAll ) // create associated table data CreateTabData( tabs ); - std::vector< SCTAB >::iterator it_end = tabs.end(); - std::vector< SCTAB >::iterator it = tabs.begin(); - for ( SCTAB i = ( bAll ? 0 : *it ); ( bAll ? i <= MAXTAB : it != it_end ); ++i , ++it ) - { - if ( pTabData[i] ) - pTabData[i]->eZoomType = eNew; - } - if ( bAll ) + { + for ( SCTAB i = 0; i <= MAXTAB; ++i ) + { + if ( pTabData[i] ) + pTabData[i]->eZoomType = eNew; + } eDefZoomType = eNew; + } + else + { + std::vector< SCTAB >::iterator it_end = tabs.end(); + std::vector< SCTAB >::iterator it = tabs.begin(); + for ( ; it != it_end; ++it ) + { + SCTAB i = *it; + if ( pTabData[i] ) + pTabData[i]->eZoomType = eNew; + } + } } void ScViewData::SetZoomType( SvxZoomType eNew, BOOL bAll ) @@ -659,22 +669,54 @@ void ScViewData::SetZoom( const Fraction& rNewX, const Fraction& rNewY, std::vec if (aValidY>aFrac400) aValidY = aFrac400; - std::vector< SCTAB >::iterator it_end = tabs.end(); - std::vector< SCTAB >::iterator it = tabs.begin(); - - for ( SCTAB i = ( bAll ? 0 : *it ); ( bAll ? i <= MAXTAB : it != it_end ); ++i , ++it ) + if ( bAll ) { - if ( pTabData[i] ) + for ( SCTAB i = 0; i <= MAXTAB; ++i ) { - if ( bPagebreak ) + if ( pTabData[i] ) { - pTabData[i]->aPageZoomX = aValidX; - pTabData[i]->aPageZoomY = aValidY; + if ( bPagebreak ) + { + pTabData[i]->aPageZoomX = aValidX; + pTabData[i]->aPageZoomY = aValidY; + } + else + { + pTabData[i]->aZoomX = aValidX; + pTabData[i]->aZoomY = aValidY; + } } - else + } + if ( bPagebreak ) + { + aDefPageZoomX = aValidX; + aDefPageZoomY = aValidY; + } + else + { + aDefZoomX = aValidX; + aDefZoomY = aValidY; + } + } + else + { + std::vector< SCTAB >::iterator it_end = tabs.end(); + std::vector< SCTAB >::iterator it = tabs.begin(); + for ( ; it != it_end; ++it ) + { + SCTAB i = *it; + if ( pTabData[i] ) { - pTabData[i]->aZoomX = aValidX; - pTabData[i]->aZoomY = aValidY; + if ( bPagebreak ) + { + pTabData[i]->aPageZoomX = aValidX; + pTabData[i]->aPageZoomY = aValidY; + } + else + { + pTabData[i]->aZoomX = aValidX; + pTabData[i]->aZoomY = aValidY; + } } } } -- cgit v1.2.3 From 1b5acf308480c738ddafc97b720f54446436de5b Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Wed, 9 Dec 2009 11:10:48 +0000 Subject: #i107501# #i107518# ScRange::Parse_XL_Header: reset external doc name if it was none --- sc/source/core/tool/address.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index 259018e213ce..4cf317073b56 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -365,7 +365,10 @@ const sal_Unicode* ScRange::Parse_XL_Header( { p = lcl_ParseQuotedName(p, rExternDocName); if (!*p || *p != ']' || !rExternDocName.Len()) + { + rExternDocName.Erase(); return start; + } } else { @@ -418,7 +421,10 @@ const sal_Unicode* ScRange::Parse_XL_Header( // Excel does not allow [ and ] characters in sheet names though. p = lcl_ParseQuotedName(p, rExternDocName); if (!*p || *p != '!') + { + rExternDocName.Erase(); return start; + } if (rExternDocName.Len()) { xub_StrLen nOpen = rExternDocName.Search( '['); -- cgit v1.2.3 From 27f3b9b1fee739ae147ac1bd15a69d70bc529298 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Thu, 17 Dec 2009 17:28:31 +0000 Subject: #i107741# HasRefListExpressibleAsOneReference is supposed to detect one reference, really do so --- sc/source/core/data/cell2.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sc/source/core/data/cell2.cxx b/sc/source/core/data/cell2.cxx index d7d3708c3295..4caaa1cb3267 100644 --- a/sc/source/core/data/cell2.cxx +++ b/sc/source/core/data/cell2.cxx @@ -679,6 +679,14 @@ ScFormulaCell::HasRefListExpressibleAsOneReference(ScRange& rRange) const Union of these references must form one range and their intersection must be empty set. */ + + // Detect the simple case of exactly one reference in advance without all + // overhead. + // #i107741# Doing so actually makes outlines using SUBTOTAL(x;reference) + // work again, where the function does not have only references. + if (HasOneReference( rRange)) + return true; + pCode->Reset(); // Get first reference, if any ScToken* const pFirstReference( -- cgit v1.2.3