diff options
Diffstat (limited to 'sc/source/ui/docshell')
-rw-r--r-- | sc/source/ui/docshell/docfunc.cxx | 15 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh4.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh8.cxx | 4 |
3 files changed, 10 insertions, 13 deletions
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index ae2d64cb6252..22b804d1e02a 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -1813,11 +1813,10 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark, ScDocAttrIterator aTestIter( &rDoc, i, nMergeTestStartCol, nMergeTestStartRow, nMergeTestEndCol, nMergeTestEndRow ); ScRange aExtendRange( nMergeTestStartCol, nMergeTestStartRow, i, nMergeTestEndCol, nMergeTestEndRow, i ); const ScPatternAttr* pPattern = NULL; - const ScMergeAttr* pMergeFlag = NULL; const ScMergeFlagAttr* pMergeFlagAttr = NULL; while ( ( pPattern = aTestIter.GetNext( nTestCol, nTestRow1, nTestRow2 ) ) != NULL ) { - pMergeFlag = static_cast<const ScMergeAttr*>( &pPattern->GetItem(ATTR_MERGE) ); + const ScMergeAttr* pMergeFlag = static_cast<const ScMergeAttr*>( &pPattern->GetItem(ATTR_MERGE) ); pMergeFlagAttr = static_cast<const ScMergeFlagAttr*>( &pPattern->GetItem(ATTR_MERGE_FLAG) ); sal_Int16 nNewFlags = pMergeFlagAttr->GetValue() & ( SC_MF_HOR | SC_MF_VER ); if( ( pMergeFlag && pMergeFlag->IsMerged() ) || nNewFlags == SC_MF_HOR || nNewFlags == SC_MF_VER ) @@ -1939,14 +1938,12 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark, if ( bSuccess ) { - SCTAB* pTabs = NULL; - SCTAB* pScenarios = NULL; SCTAB nUndoPos = 0; if ( bRecord ) { - pTabs = new SCTAB[nSelCount]; - pScenarios = new SCTAB[nSelCount]; + SCTAB* pTabs = new SCTAB[nSelCount]; + SCTAB* pScenarios = new SCTAB[nSelCount]; nUndoPos = 0; itr = aMark.begin(); for (; itr != itrEnd && *itr < nTabCount; ++itr) @@ -2225,11 +2222,10 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, ScDocAttrIterator aTestIter( &rDoc, i, nUndoStartCol, nUndoStartRow, nMergeTestEndCol, nMergeTestEndRow ); ScRange aExtendRange( nUndoStartCol, nUndoStartRow, i, nMergeTestEndCol, nMergeTestEndRow, i ); const ScPatternAttr* pPattern = NULL; - const ScMergeAttr* pMergeFlag = NULL; const ScMergeFlagAttr* pMergeFlagAttr = NULL; while ( ( pPattern = aTestIter.GetNext( nTestCol, nTestRow1, nTestRow2 ) ) != NULL ) { - pMergeFlag = static_cast<const ScMergeAttr*>( &pPattern->GetItem( ATTR_MERGE ) ); + const ScMergeAttr* pMergeFlag = static_cast<const ScMergeAttr*>( &pPattern->GetItem( ATTR_MERGE ) ); pMergeFlagAttr = static_cast<const ScMergeFlagAttr*>( &pPattern->GetItem( ATTR_MERGE_FLAG ) ); sal_Int16 nNewFlags = pMergeFlagAttr->GetValue() & ( SC_MF_HOR | SC_MF_VER ); if( ( pMergeFlag && pMergeFlag->IsMerged() ) || nNewFlags == SC_MF_HOR || nNewFlags == SC_MF_VER ) @@ -5051,7 +5047,6 @@ bool ScDocFunc::InsertNameList( const ScAddress& rStartPos, bool bApi ) ScDocument& rDoc = rDocShell.GetDocument(); const bool bRecord = rDoc.IsUndoEnabled(); SCTAB nTab = rStartPos.Tab(); - ScDocument* pUndoDoc = NULL; //local names have higher priority than global names ScRangeName* pLocalList = rDoc.GetRangeName(nTab); @@ -5082,6 +5077,8 @@ bool ScDocFunc::InsertNameList( const ScAddress& rStartPos, bool bApi ) ScEditableTester aTester( &rDoc, nTab, nStartCol,nStartRow, nEndCol,nEndRow ); if (aTester.IsEditable()) { + ScDocument* pUndoDoc = NULL; + if (bRecord) { pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 948e170dffd0..d808c22d1ef0 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -1467,8 +1467,6 @@ void ScDocShell::PageStyleModified( const OUString& rStyleName, bool bApi ) { ScDocShellModificator aModificator( *this ); - bool bWarn = false; - SCTAB nTabCount = aDocument.GetTableCount(); SCTAB nUseTab = MAXTAB+1; for (SCTAB nTab=0; nTab<nTabCount && nUseTab>MAXTAB; nTab++) @@ -1479,6 +1477,8 @@ void ScDocShell::PageStyleModified( const OUString& rStyleName, bool bApi ) if (ValidTab(nUseTab)) // nicht verwendet -> nichts zu tun { + bool bWarn = false; + ScPrintFunc aPrintFunc( this, GetPrinter(), nUseTab ); //! ohne CountPages auskommen if (!aPrintFunc.UpdatePages()) // setzt Umbrueche auf allen Tabs bWarn = true; diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index ef8e78bd0134..e8e5f46db007 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -300,8 +300,6 @@ sal_uLong ScDocShell::DBaseImport( const OUString& rFullFileName, rtl_TextEncodi #else sal_uLong nErr = eERR_OK; - long i; - long nColCount = 0; // Try to get the Text Encoding from the driver if( eCharSet == RTL_TEXTENCODING_IBM_850 ) @@ -309,6 +307,8 @@ sal_uLong ScDocShell::DBaseImport( const OUString& rFullFileName, rtl_TextEncodi try { + long i; + long nColCount = 0; OUString aTabName; uno::Reference<sdbc::XDriverManager2> xDrvMan; uno::Reference<sdbc::XConnection> xConnection; |