[Libreoffice-commits] .: sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Tue Jun 7 13:11:41 PDT 2011
sc/source/ui/inc/viewdata.hxx | 3 +--
sc/source/ui/view/viewdata.cxx | 35 +++++++++++++----------------------
2 files changed, 14 insertions(+), 24 deletions(-)
New commits:
commit 18f9b45dbbbb185344489879afaf7e0bf30161f5
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Tue Jun 7 16:11:09 2011 -0400
More meaningful method name & this should be private.
diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx
index fb86f15..a39e5d6 100644
--- a/sc/source/ui/inc/viewdata.hxx
+++ b/sc/source/ui/inc/viewdata.hxx
@@ -237,6 +237,7 @@ private:
SC_DLLPRIVATE void CreateTabData( std::vector< SCTAB >& rvTabs );
SC_DLLPRIVATE void CreateSelectedTabData();
SC_DLLPRIVATE void EnsureTabDataSize(size_t nSize);
+ SC_DLLPRIVATE void UpdateCurrentTab();
public:
ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh );
@@ -275,8 +276,6 @@ public:
sal_Bool IsActive() const { return bActive; }
void Activate(sal_Bool bActivate) { bActive = bActivate; }
- void UpdateThis();
-
void InsertTab( SCTAB nTab );
void InsertTabs( SCTAB nTab, SCTAB nNewSheets );
void DeleteTab( SCTAB nTab );
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 2eef5f3..9e44d1a 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -437,24 +437,16 @@ ScViewData::~ScViewData()
delete pOptions;
}
-void ScViewData::UpdateThis()
+void ScViewData::UpdateCurrentTab()
{
- do
+ pThisTab = maTabData[nTabNo];
+ while (!pThisTab)
{
- pThisTab = maTabData[nTabNo];
- if (!pThisTab)
- {
- if (nTabNo>0)
- --nTabNo;
- else
- {
- pThisTab = maTabData[0] = new ScViewDataTable();
- }
-
- // hier keine Assertion, weil sonst Paints kommen, bevor alles initialisiert ist!
- }
+ if (nTabNo > 0)
+ pThisTab = maTabData[--nTabNo];
+ else
+ pThisTab = maTabData[0] = new ScViewDataTable;
}
- while (!pThisTab);
}
void ScViewData::InsertTab( SCTAB nTab )
@@ -465,7 +457,7 @@ void ScViewData::InsertTab( SCTAB nTab )
maTabData.insert( maTabData.begin() + nTab, NULL );
CreateTabData( nTab );
- UpdateThis();
+ UpdateCurrentTab();
aMarkData.InsertTab( nTab );
}
@@ -482,7 +474,7 @@ void ScViewData::InsertTabs( SCTAB nTab, SCTAB nNewSheets )
CreateTabData( i );
aMarkData.InsertTab( i );
}
- UpdateThis();
+ UpdateCurrentTab();
}
void ScViewData::DeleteTab( SCTAB nTab )
@@ -490,7 +482,7 @@ void ScViewData::DeleteTab( SCTAB nTab )
delete maTabData.at(nTab);
maTabData.erase(maTabData.begin() + nTab);
- UpdateThis();
+ UpdateCurrentTab();
aMarkData.DeleteTab( nTab );
}
@@ -503,8 +495,7 @@ void ScViewData::DeleteTabs( SCTAB nTab, SCTAB nSheets )
}
maTabData.erase(maTabData.begin() + nTab, maTabData.begin()+ nTab+nSheets);
- UpdateThis();
-
+ UpdateCurrentTab();
}
void ScViewData::CopyTab( SCTAB nSrcTab, SCTAB nDestTab )
@@ -528,7 +519,7 @@ void ScViewData::CopyTab( SCTAB nSrcTab, SCTAB nDestTab )
else
maTabData.insert(maTabData.begin() + nDestTab, NULL);
- UpdateThis();
+ UpdateCurrentTab();
aMarkData.InsertTab( nDestTab );
}
@@ -551,7 +542,7 @@ void ScViewData::MoveTab( SCTAB nSrcTab, SCTAB nDestTab )
maTabData[nDestTab] = pTab;
}
- UpdateThis();
+ UpdateCurrentTab();
aMarkData.DeleteTab( nSrcTab );
aMarkData.InsertTab( nDestTab ); // ggf. angepasst
}
More information about the Libreoffice-commits
mailing list