diff options
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/app/inputhdl.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/dbgui/filtdlg.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/dbgui/makefile.mk | 1 | ||||
-rw-r--r-- | sc/source/ui/dbgui/pfiltdlg.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/dbgui/pvfundlg.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/dbgui/validate.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh.cxx | 22 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh2.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh5.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/inc/filtdlg.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/inc/gridwin.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/src/scfuncs.src | 22 | ||||
-rw-r--r-- | sc/source/ui/unoobj/cellsuno.cxx | 9 | ||||
-rwxr-xr-x | sc/source/ui/unoobj/dapiuno.cxx | 7 | ||||
-rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 16 | ||||
-rw-r--r-- | sc/source/ui/unoobj/servuno.cxx | 25 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 13 |
17 files changed, 114 insertions, 34 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 485ea4b88589..40b65ce401ad 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -189,6 +189,14 @@ handle_r1c1: if ( (nFlags & SCA_TAB2_3D) == 0 ) aRange.aEnd.SetTab( aRange.aStart.Tab() ); + if ( ( nFlags & ( SCA_VALID_COL2 | SCA_VALID_ROW2 | SCA_VALID_TAB2 ) ) == 0 ) + { + // #i73766# if a single ref was parsed, set the same "abs" flags for ref2, + // so Format doesn't output a double ref because of different flags. + USHORT nAbsFlags = nFlags & ( SCA_COL_ABSOLUTE | SCA_ROW_ABSOLUTE | SCA_TAB_ABSOLUTE ); + nFlags |= nAbsFlags << 4; + } + if (!nCount) { pEngine->SetUpdateMode( FALSE ); diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx index 56878f623828..b5dd2f3242c2 100644 --- a/sc/source/ui/dbgui/filtdlg.cxx +++ b/sc/source/ui/dbgui/filtdlg.cxx @@ -448,24 +448,27 @@ void ScFilterDlg::UpdateValueList( USHORT nList ) SCCOL nColumn = theQueryData.nCol1 + static_cast<SCCOL>(nFieldSelPos) - 1; if (!pEntryLists[nColumn]) { + USHORT nOffset = GetSliderPos(); SCTAB nTab = nSrcTab; SCROW nFirstRow = theQueryData.nRow1; SCROW nLastRow = theQueryData.nRow2; + mbHasDates[nOffset+nList-1] = false; // erstmal ohne die erste Zeile pEntryLists[nColumn] = new TypedScStrCollection( 128, 128 ); pEntryLists[nColumn]->SetCaseSensitive( aBtnCase.IsChecked() ); pDoc->GetFilterEntriesArea( nColumn, nFirstRow+1, nLastRow, - nTab, *pEntryLists[nColumn] ); + nTab, *pEntryLists[nColumn], mbHasDates[nOffset+nList-1] ); // Eintrag fuer die erste Zeile //! Eintrag (pHdrEntry) ohne Collection erzeugen? nHeaderPos[nColumn] = USHRT_MAX; TypedScStrCollection aHdrColl( 1, 1 ); + bool bDummy = false; pDoc->GetFilterEntriesArea( nColumn, nFirstRow, nFirstRow, - nTab, aHdrColl ); + nTab, aHdrColl, bDummy ); TypedStrData* pHdrEntry = aHdrColl[0]; if ( pHdrEntry ) { @@ -1061,7 +1064,8 @@ IMPL_LINK( ScFilterDlg, ValModifyHdl, ComboBox*, pEd ) static_cast<SCCOL>(nField) - 1) : static_cast<SCCOL>(0); ScQueryOp eOp = (ScQueryOp)pLbCond->GetSelectEntryPos(); - rEntry.eOp = eOp; + rEntry.eOp = eOp; + rEntry.bQueryByDate = mbHasDates[nQE]; } } diff --git a/sc/source/ui/dbgui/makefile.mk b/sc/source/ui/dbgui/makefile.mk index 2d4fa71f690e..1e7000d0cb07 100644 --- a/sc/source/ui/dbgui/makefile.mk +++ b/sc/source/ui/dbgui/makefile.mk @@ -106,7 +106,6 @@ LIB1OBJFILES = \ $(SLO)$/expftext.obj \ $(SLO)$/fieldwnd.obj \ $(SLO)$/pvlaydlg.obj \ - $(SLO)$/pvfundlg.obj \ $(SLO)$/consdlg.obj \ $(SLO)$/imoptdlg.obj \ $(SLO)$/csvsplits.obj \ diff --git a/sc/source/ui/dbgui/pfiltdlg.cxx b/sc/source/ui/dbgui/pfiltdlg.cxx index cde18fcc3b52..d590ffb83457 100644 --- a/sc/source/ui/dbgui/pfiltdlg.cxx +++ b/sc/source/ui/dbgui/pfiltdlg.cxx @@ -349,11 +349,12 @@ void ScPivotFilterDlg::UpdateValueList( USHORT nList ) SCROW nFirstRow = theQueryData.nRow1; SCROW nLastRow = theQueryData.nRow2; nFirstRow++; + bool bHasDates = false; pEntryLists[nColumn] = new TypedScStrCollection( 128, 128 ); pEntryLists[nColumn]->SetCaseSensitive( aBtnCase.IsChecked() ); pDoc->GetFilterEntriesArea( nColumn, nFirstRow, nLastRow, - nTab, *pEntryLists[nColumn] ); + nTab, *pEntryLists[nColumn], bHasDates ); } TypedScStrCollection* pColl = pEntryLists[nColumn]; diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx index 03de0b8914a3..6b04993ba0bc 100644 --- a/sc/source/ui/dbgui/pvfundlg.cxx +++ b/sc/source/ui/dbgui/pvfundlg.cxx @@ -28,6 +28,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sc.hxx" +#undef SC_DLLIMPLEMENTATION + #include "pvfundlg.hxx" #include <com/sun/star/sheet/DataPilotFieldReferenceType.hpp> diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx index 5fdf386323d9..1ee02badefe1 100644 --- a/sc/source/ui/dbgui/validate.cxx +++ b/sc/source/ui/dbgui/validate.cxx @@ -581,7 +581,7 @@ void ScTPValidationValue::TidyListBoxes() pWnd = GetChild(0); - while( std::find( alstOrder.begin(), alstOrder.end(), pWnd ) != alstOrder.end() && NULL != ( pWnd = pWnd->GetWindow( WINDOW_NEXT) ) ); + while( std::find( alstOrder.begin(), alstOrder.end(), pWnd ) != alstOrder.end() && NULL != ( pWnd = pWnd->GetWindow( WINDOW_NEXT) ) ) ; if ( pWnd ) { diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 821b2a6ad880..135bbcdace49 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -356,6 +356,7 @@ void ScDocShell::AfterXMLLoading(sal_Bool bRet) } else aDocument.SetInsertingFromOtherDoc( FALSE ); +#if 0 // disable load of vba related libraries // add vba globals ( if they are availabl ) uno::Any aGlobs; uno::Sequence< uno::Any > aArgs(1); @@ -376,7 +377,7 @@ void ScDocShell::AfterXMLLoading(sal_Bool bRet) BasicManager* pAppMgr = SFX_APP()->GetBasicManager(); if ( pAppMgr ) pAppMgr->SetGlobalUNOConstant( "ThisExcelDoc", aArgs[ 0 ] ); - +#endif aDocument.SetImportingXML( FALSE ); aDocument.EnableExecuteLink( true ); aDocument.EnableUndo( TRUE ); @@ -767,19 +768,38 @@ void __EXPORT ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) if ( !bSuccess ) SetError( ERRCODE_IO_ABORT, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); // this error code will produce no error message, but will break the further saving process } + if (pSheetSaveData) + pSheetSaveData->SetInSupportedSave(true); } break; + case SFX_EVENT_SAVEASDOC: + case SFX_EVENT_SAVETODOC: + // #i108978# If no event is sent before saving, there will also be no "...DONE" event, + // and SAVE/SAVEAS can't be distinguished from SAVETO. So stream copying is only enabled + // if there is a SAVE/SAVEAS/SAVETO event first. + if (pSheetSaveData) + pSheetSaveData->SetInSupportedSave(true); + break; case SFX_EVENT_SAVEDOCDONE: { if ( IsDocShared() && !SC_MOD()->IsInSharedDocSaving() ) { } UseSheetSaveEntries(); // use positions from saved file for next saving + if (pSheetSaveData) + pSheetSaveData->SetInSupportedSave(false); } break; case SFX_EVENT_SAVEASDOCDONE: // new positions are used after "save" and "save as", but not "save to" UseSheetSaveEntries(); // use positions from saved file for next saving + if (pSheetSaveData) + pSheetSaveData->SetInSupportedSave(false); + break; + case SFX_EVENT_SAVETODOCDONE: + // only reset the flag, don't use the new positions + if (pSheetSaveData) + pSheetSaveData->SetInSupportedSave(false); break; default: { diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx index 4b76c18edbe6..9e3ed217382f 100644 --- a/sc/source/ui/docshell/docsh2.cxx +++ b/sc/source/ui/docshell/docsh2.cxx @@ -102,6 +102,7 @@ BOOL __EXPORT ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xSt InitItems(); CalcOutputFactor(); +#if 0 uno::Any aGlobs; uno::Sequence< uno::Any > aArgs(1); aArgs[ 0 ] <<= GetModel(); @@ -121,6 +122,7 @@ BOOL __EXPORT ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xSt BasicManager* pAppMgr = SFX_APP()->GetBasicManager(); if ( pAppMgr ) pAppMgr->SetGlobalUNOConstant( "ThisExcelDoc", aArgs[ 0 ] ); +#endif return bRet; } diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx index 1bbf9437bc1c..061ece5efc90 100644 --- a/sc/source/ui/docshell/docsh5.cxx +++ b/sc/source/ui/docshell/docsh5.cxx @@ -97,8 +97,9 @@ void ScDocShell::ErrorMessage( USHORT nGlobStrId ) BOOL ScDocShell::IsEditable() const { // import into read-only document is possible - must be extended if other filters use api + // #i108547# MSOOXML filter uses "IsChangeReadOnlyEnabled" property - return !IsReadOnly() || aDocument.IsImportingXML(); + return !IsReadOnly() || aDocument.IsImportingXML() || aDocument.IsChangeReadOnlyEnabled(); } void ScDocShell::DBAreaDeleted( SCTAB nTab, SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW /* nY2 */ ) diff --git a/sc/source/ui/inc/filtdlg.hxx b/sc/source/ui/inc/filtdlg.hxx index 068a48b8d689..31e0e3a5d4b1 100644 --- a/sc/source/ui/inc/filtdlg.hxx +++ b/sc/source/ui/inc/filtdlg.hxx @@ -164,6 +164,7 @@ private: ListBox* aFieldLbArr[4]; ListBox* aCondLbArr[4]; ListBox* aConnLbArr[4]; + bool mbHasDates[MAXQUERY]; BOOL bRefreshExceptQuery[MAXQUERY]; USHORT nFieldCount; BOOL bRefInputMode; diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index 149498a8314d..4d6ef782aed6 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -215,7 +215,7 @@ private: BOOL IsAutoFilterActive( SCCOL nCol, SCROW nRow, SCTAB nTab ); void ExecFilter( ULONG nSel, SCCOL nCol, SCROW nRow, - const String& aValue ); + const String& aValue, bool bCheckForDates ); void FilterSelect( ULONG nSel ); void ExecDataSelect( SCCOL nCol, SCROW nRow, const String& rStr ); diff --git a/sc/source/ui/src/scfuncs.src b/sc/source/ui/src/scfuncs.src index 18adf9883373..2f5a2d8c88fb 100644 --- a/sc/source/ui/src/scfuncs.src +++ b/sc/source/ui/src/scfuncs.src @@ -1024,7 +1024,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS1 }; String 3 // Description of Parameter 1 { - Text [ en-US ] = "An interger between 1583 and 9956, or 0 and 99 (19xx or 20xx depending on the option set)."; + Text [ en-US ] = "An integer between 1583 and 9956, or 0 and 99 (19xx or 20xx depending on the option set)."; }; }; // -=*# Resource for function BW #*=- @@ -1576,7 +1576,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS1 { String 1 // Description { - Text [ en-US ] = "Calulates the arithmetically declining value of an asset (depreciation) for a specified period." ; + Text [ en-US ] = "Calculates the arithmetically declining value of an asset (depreciation) for a specified period." ; }; ExtraData = { @@ -4064,7 +4064,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS1 { String 1 // Description { - Text [ en-US ] = "Array transposition. Exchanges the rows and columns of an aray." ; + Text [ en-US ] = "Array transposition. Exchanges the rows and columns of an array." ; }; ExtraData = { @@ -4724,7 +4724,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2 }; String 3 // Description of Parameter 1 { - Text [ en-US ] = "Value 1; value 2;.. .are 1 to 30 arguments representing a sample taken from a basic total population."; + Text [ en-US ] = "Value 1; value 2; ... are 1 to 30 arguments representing a sample taken from a basic total population."; }; }; // -=*# Resource for function VARIANZEN #*=- @@ -4820,7 +4820,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2 }; String 3 // Description of Parameter 1 { - Text [ en-US ] = "Value 1; value 2;.. .are 1 to 30 arguments representing a sample taken from a basic total population."; + Text [ en-US ] = "Value 1; value 2; ... are 1 to 30 arguments representing a sample taken from a basic total population."; }; }; // -=*# Resource for function STABWN #*=- @@ -4916,7 +4916,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2 }; String 3 // Description of Parameter 1 { - Text [ en-US ] = "Value 1; value 2;.. .are 1 to 30 arguments representing a sample taken from a basic total population."; + Text [ en-US ] = "Value 1; value 2; ... are 1 to 30 arguments representing a sample taken from a basic total population."; }; }; // -=*# Resource for function SUMQUADABW #*=- @@ -6358,7 +6358,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2 }; String 7 // Description of Parameter 3 { - Text [ en-US ] = "Mode = 1calculates the one-tailed test, 2 = two-tailed distribution." ; + Text [ en-US ] = "Mode = 1 calculates the one-tailed test, 2 = two-tailed distribution." ; }; }; // -=*# Resource for function TINV #*=- @@ -7525,7 +7525,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2 }; String 9 // Description of Parameter 4 { - Text [ en-US ] = "if the value is TRUE or not given, the search column of the array must be sorted in ascending order." ; + Text [ en-US ] = "If the value is TRUE or not given, the search column of the array must be sorted in ascending order." ; }; }; // -=*# Resource for function INDEX #*=- @@ -8397,7 +8397,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2 { String 1 // Description { - Text [ en-US ] = "Converts a value into text." ; + Text [ en-US ] = "Returns a value if it is text, otherwise an empty string." ; }; ExtraData = { @@ -8413,7 +8413,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2 }; String 3 // Description of Parameter 1 { - Text [ en-US ] = "The value to be converted." ; + Text [ en-US ] = "The value to be checked and returned if it is text." ; }; }; // -=*# Resource for function ERSETZEN #*=- @@ -8709,7 +8709,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2 }; String 9 // Description of Parameter 4 { - Text [ en-US ] = "Which occurence of the old text is to be replaced." ; + Text [ en-US ] = "Which occurrence of the old text is to be replaced." ; }; }; // -=*# Resource for function BASIS #*=- diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 4eddb447e8a9..d563dea095dd 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -7912,7 +7912,8 @@ void SAL_CALL ScTableSheetObj::protect( const rtl::OUString& aPassword ) { ScUnoGuard aGuard; ScDocShell* pDocSh = GetDocShell(); - if ( pDocSh ) + // #i108245# if already protected, don't change anything + if ( pDocSh && !pDocSh->GetDocument()->IsTabProtected( GetTab_Impl() ) ) { String aString(aPassword); ScDocFunc aFunc(*pDocSh); @@ -7929,9 +7930,9 @@ void SAL_CALL ScTableSheetObj::unprotect( const rtl::OUString& aPassword ) { String aString(aPassword); ScDocFunc aFunc(*pDocSh); - aFunc.Unprotect( GetTab_Impl(), aString, TRUE ); - - //! Rueckgabewert auswerten, Exception oder so + BOOL bDone = aFunc.Unprotect( GetTab_Impl(), aString, TRUE ); + if (!bDone) + throw lang::IllegalArgumentException(); } } diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index 7e23d6b2f9f5..c7bf89671161 100755 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -1891,9 +1891,10 @@ void SAL_CALL ScDataPilotFieldObj::setPropertyValue( const OUString& aPropertyNa String aNameString(aPropertyName); if ( aNameString.EqualsAscii( SC_UNONAME_FUNCTION ) ) { - GeneralFunction eFunction = GeneralFunction_NONE; - if( aValue >>= eFunction ) - setFunction( eFunction ); + // #i109350# use GetEnumFromAny because it also allows sal_Int32 + GeneralFunction eFunction = (GeneralFunction) + ScUnoHelpFunctions::GetEnumFromAny( aValue ); + setFunction( eFunction ); } else if ( aNameString.EqualsAscii( SC_UNONAME_SUBTOTALS ) ) { diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 8e857adca09c..85c17f868b0a 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -1392,7 +1392,8 @@ void SAL_CALL ScModelObj::enableAutomaticCalculation( sal_Bool bEnabled ) void SAL_CALL ScModelObj::protect( const rtl::OUString& aPassword ) throw(uno::RuntimeException) { ScUnoGuard aGuard; - if (pDocShell) + // #i108245# if already protected, don't change anything + if ( pDocShell && !pDocShell->GetDocument()->IsDocProtected() ) { String aString(aPassword); @@ -1410,9 +1411,9 @@ void SAL_CALL ScModelObj::unprotect( const rtl::OUString& aPassword ) String aString(aPassword); ScDocFunc aFunc(*pDocShell); - aFunc.Unprotect( TABLEID_DOC, aString, TRUE ); - - //! Rueckgabewert auswerten, Exception oder so + BOOL bDone = aFunc.Unprotect( TABLEID_DOC, aString, TRUE ); + if (!bDone) + throw lang::IllegalArgumentException(); } } @@ -2074,6 +2075,13 @@ sal_Int64 SAL_CALL ScModelObj::getSomething( return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); } + if ( rId.getLength() == 16 && + 0 == rtl_compareMemory( SfxObjectShell::getUnoTunnelId().getConstArray(), + rId.getConstArray(), 16 ) ) + { + return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(pDocShell )); + } + // aggregated number formats supplier has XUnoTunnel, too // interface from aggregated object must be obtained via queryAggregation diff --git a/sc/source/ui/unoobj/servuno.cxx b/sc/source/ui/unoobj/servuno.cxx index 0c57963a4f12..956c659f9b15 100644 --- a/sc/source/ui/unoobj/servuno.cxx +++ b/sc/source/ui/unoobj/servuno.cxx @@ -65,6 +65,10 @@ #include <com/sun/star/form/XFormsSupplier.hpp> #include <svx/unomod.hxx> +#include <comphelper/processfactory.hxx> +#include <basic/basmgr.hxx> +#include <sfx2/app.hxx> + using namespace ::com::sun::star; class ScVbaCodeNameProvider : public ::cppu::WeakImplHelper1< document::XCodeNameQuery > @@ -183,6 +187,7 @@ static const ProvNamesId_Type __FAR_DATA aProvNamesId[] = { "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 }, + { "ooo.vba.VBAGlobals", SC_SERVICE_VBAGLOBALS }, }; // @@ -236,6 +241,7 @@ static const sal_Char* __FAR_DATA aOldNames[SC_SERVICE_COUNT] = "", // SC_SERVICE_FORMULAPARS "", // SC_SERVICE_OPCODEMAPPER "", // SC_SERVICE_VBACODENAMEPROVIDER + "", // SC_SERVICE_VBAGLOBALS }; @@ -453,6 +459,25 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance( } break; } + case SC_SERVICE_VBAGLOBALS: + { + uno::Any aGlobs; + ScDocument* pDoc = pDocShell->GetDocument(); + if ( pDoc ) + { + if ( !pDocShell->GetBasicManager()->GetGlobalUNOConstant( "VBAGlobals", aGlobs ) ) + { + uno::Sequence< uno::Any > aArgs(1); + aArgs[ 0 ] <<= pDocShell->GetModel(); + aGlobs <<= ::comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.excel.Globals" ) ), aArgs ); + pDocShell->GetBasicManager()->SetGlobalUNOConstant( "VBAGlobals", aGlobs ); + BasicManager* pAppMgr = SFX_APP()->GetBasicManager(); + if ( pAppMgr ) + pAppMgr->SetGlobalUNOConstant( "ThisExcelDoc", aArgs[ 0 ] ); + } + aGlobs >>= xRet; + } + } } return xRet; diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index b8eeb868809e..87740a88e4df 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -165,6 +165,7 @@ private: BOOL bInit; BOOL bCancelled; BOOL bInSelect; + bool mbListHasDates; ULONG nSel; ScFilterBoxMode eMode; @@ -188,6 +189,8 @@ public: BOOL IsInInit() const { return bInit; } void SetCancelled() { bCancelled = TRUE; } BOOL IsInSelect() const { return bInSelect; } + void SetListHasDates(bool b) { mbListHasDates = b; } + bool HasDates() const { return mbListHasDates; } }; //------------------------------------------------------------------- @@ -203,6 +206,7 @@ ScFilterListBox::ScFilterListBox( Window* pParent, ScGridWindow* pGrid, bInit( TRUE ), bCancelled( FALSE ), bInSelect( FALSE ), + mbListHasDates(false), nSel( 0 ), eMode( eNewMode ) { @@ -907,7 +911,9 @@ void ScGridWindow::DoAutoFilterMenue( SCCOL nCol, SCROW nRow, BOOL bDataSelect ) pFilterBox->SetSeparatorPos( nDefCount - 1 ); // get list entries - pDoc->GetFilterEntries( nCol, nRow, nTab, aStrings, true ); + bool bHasDates = false; + pDoc->GetFilterEntries( nCol, nRow, nTab, true, aStrings, bHasDates); + pFilterBox->SetListHasDates(bHasDates); // check widths of numerical entries (string entries are not included) // so all numbers are completely visible @@ -1117,7 +1123,7 @@ void ScGridWindow::FilterSelect( ULONG nSel ) ExecDataSelect( nCol, nRow, aString ); break; case SC_FILTERBOX_FILTER: - ExecFilter( nSel, nCol, nRow, aString ); + ExecFilter( nSel, nCol, nRow, aString, pFilterBox->HasDates() ); break; case SC_FILTERBOX_SCENARIO: pViewData->GetView()->UseScenario( aString ); @@ -1150,7 +1156,7 @@ void ScGridWindow::ExecDataSelect( SCCOL nCol, SCROW nRow, const String& rStr ) void ScGridWindow::ExecFilter( ULONG nSel, SCCOL nCol, SCROW nRow, - const String& aValue ) + const String& aValue, bool bCheckForDates ) { SCTAB nTab = pViewData->GetTabNo(); ScDocument* pDoc = pViewData->GetDocument(); @@ -1222,6 +1228,7 @@ void ScGridWindow::ExecFilter( ULONG nSel, rNewEntry.bDoQuery = TRUE; rNewEntry.bQueryByString = TRUE; rNewEntry.nField = nCol; + rNewEntry.bQueryByDate = bCheckForDates; if ( nSel == SC_AUTOFILTER_TOP10 ) { rNewEntry.eOp = SC_TOPVAL; |