summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-07-29 18:24:57 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-07-30 21:41:49 -0400
commit45db9b09767dfa76bdff3e89bc9a04607e648687 (patch)
tree85cfeb19d1287361824e7cab8621b205ab3d50ff
parentthe dialog hierarchy changed iwith the ui format, fdo#81867 (diff)
downloadcore-45db9b09767dfa76bdff3e89bc9a04607e648687.tar.gz
core-45db9b09767dfa76bdff3e89bc9a04607e648687.zip
Scope reduction.
Change-Id: Ib77fccaf0c418e875816ed553f3540190ac0caee
-rw-r--r--sc/source/core/data/document.cxx60
1 files changed, 29 insertions, 31 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 549ab9c6ebd1..3887f91f37ee 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -1835,51 +1835,49 @@ void ScDocument::InitUndoSelected( ScDocument* pSrcDoc, const ScMarkData& rTabSe
void ScDocument::InitUndo( ScDocument* pSrcDoc, SCTAB nTab1, SCTAB nTab2,
bool bColInfo, bool bRowInfo )
{
- if (bIsUndo)
+ if (!bIsUndo)
{
- Clear();
+ OSL_FAIL("InitUndo");
+ return;
+ }
- // Undo document shares its pooled resources with the source document.
- SharePooledResources(pSrcDoc);
+ Clear();
- if (pSrcDoc->pShell->GetMedium())
- maFileURL = pSrcDoc->pShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DECODE_TO_IURI);
+ // Undo document shares its pooled resources with the source document.
+ SharePooledResources(pSrcDoc);
- OUString aString;
- if ( nTab2 >= static_cast<SCTAB>(maTabs.size()))
- maTabs.resize(nTab2 + 1, NULL);
- for (SCTAB nTab = nTab1; nTab <= nTab2; nTab++)
- {
- ScTable* pTable = new ScTable(this, nTab, aString, bColInfo, bRowInfo);
- maTabs[nTab] = pTable;
- }
- }
- else
+ if (pSrcDoc->pShell->GetMedium())
+ maFileURL = pSrcDoc->pShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DECODE_TO_IURI);
+
+ OUString aString;
+ if ( nTab2 >= static_cast<SCTAB>(maTabs.size()))
+ maTabs.resize(nTab2 + 1, NULL);
+ for (SCTAB nTab = nTab1; nTab <= nTab2; nTab++)
{
- OSL_FAIL("InitUndo");
+ ScTable* pTable = new ScTable(this, nTab, aString, bColInfo, bRowInfo);
+ maTabs[nTab] = pTable;
}
}
void ScDocument::AddUndoTab( SCTAB nTab1, SCTAB nTab2, bool bColInfo, bool bRowInfo )
{
- if (bIsUndo)
+ if (!bIsUndo)
{
- OUString aString;
- if (nTab2 >= static_cast<SCTAB>(maTabs.size()))
- {
- maTabs.resize(nTab2+1,NULL);
- }
- for (SCTAB nTab = nTab1; nTab <= nTab2; nTab++)
- if (!maTabs[nTab])
- {
- maTabs[nTab] = new ScTable(this, nTab, aString, bColInfo, bRowInfo);
- }
-
+ OSL_FAIL("AddUndoTab");
+ return;
}
- else
+
+ OUString aString;
+ if (nTab2 >= static_cast<SCTAB>(maTabs.size()))
{
- OSL_FAIL("InitUndo");
+ maTabs.resize(nTab2+1,NULL);
}
+
+ for (SCTAB nTab = nTab1; nTab <= nTab2; nTab++)
+ if (!maTabs[nTab])
+ {
+ maTabs[nTab] = new ScTable(this, nTab, aString, bColInfo, bRowInfo);
+ }
}
void ScDocument::SetCutMode( bool bVal )