diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2011-03-24 23:14:28 -0400 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2011-04-01 00:11:02 -0400 |
commit | e3f6c20d4ab425674382ba164e00bb01cc17cb1c (patch) | |
tree | af502f206e44573602036dfbac0e597601c0098f /sc/source/ui/undo/undoutil.cxx | |
parent | ca6285bd996927f79772abe442443bc9abd76b49 (diff) |
Support sheet-local anonymous database ranges.
This is for an Easy Hack to allow one autofilter per sheet, not per
document.
Diffstat (limited to 'sc/source/ui/undo/undoutil.cxx')
-rw-r--r-- | sc/source/ui/undo/undoutil.cxx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sc/source/ui/undo/undoutil.cxx b/sc/source/ui/undo/undoutil.cxx index 0e22e2532..93d9c3fe8 100644 --- a/sc/source/ui/undo/undoutil.cxx +++ b/sc/source/ui/undo/undoutil.cxx @@ -42,6 +42,7 @@ #include "document.hxx" #include "dbcolect.hxx" #include "globstr.hrc" +#include "globalnames.hxx" #include "global.hxx" void ScUndoUtil::MarkSimpleBlock( ScDocShell* pDocShell, @@ -98,22 +99,18 @@ ScDBData* ScUndoUtil::GetOldDBData( ScDBData* pUndoData, ScDocument* pDoc, SCTAB { String aName; pUndoData->GetName( aName ); - if ( aName == ScGlobal::GetRscString( STR_DB_NONAME ) ) + if ( rtl::OUString(aName) == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(STR_DB_LOCAL_NONAME) ) ) bWasTemp = sal_True; } DBG_ASSERT(bWasTemp, "Undo: didn't find database range"); (void)bWasTemp; - - sal_uInt16 nIndex; - ScDBCollection* pColl = pDoc->GetDBCollection(); - if (pColl->SearchName( ScGlobal::GetRscString( STR_DB_NONAME ), nIndex )) - pRet = (*pColl)[nIndex]; - else + pRet = pDoc->GetAnonymousDBData(nTab); + if (!pRet) { - pRet = new ScDBData( ScGlobal::GetRscString( STR_DB_NONAME ), nTab, + pRet = new ScDBData( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(STR_DB_LOCAL_NONAME)), nTab, nCol1,nRow1, nCol2,nRow2, sal_True, pDoc->HasColHeader( nCol1,nRow1,nCol2,nRow2,nTab ) ); - pColl->Insert( pRet ); + pDoc->SetAnonymousDBData(nTab,pRet); } } |