summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2016-10-13 20:45:09 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2016-10-13 20:46:27 -0400
commitd800825f0d673071519846431e4113c1bd292482 (patch)
tree20f8867cf49e3329831d43ef2bddbb4590373a57
parent45a7137c6796f33fbf5b8f7cb64e293260d991cb (diff)
Annotate the code a bit around EditGrowX/Y.
Change-Id: Ib7ee2e4aa393b7d842aeaf0569f104eee17ea4ad
-rw-r--r--sc/source/ui/inc/viewdata.hxx12
-rw-r--r--sc/source/ui/view/viewdata.cxx3
2 files changed, 14 insertions, 1 deletions
diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx
index d4b5a0499231..4986e1fe2a1e 100644
--- a/sc/source/ui/inc/viewdata.hxx
+++ b/sc/source/ui/inc/viewdata.hxx
@@ -444,7 +444,19 @@ public:
EditView* GetEditView( ScSplitPos eWhich ) const
{ return pEditView[eWhich]; }
+ /**
+ * Extend the output area for the edit engine view in a horizontal
+ * direction as needed.
+ */
void EditGrowX();
+
+ /**
+ * Extend the output area for the edit engine view in a vertical direction
+ * as needed.
+ *
+ * @param bInitial when true, then the call originates from a brand-new
+ * edit engine instance.
+ */
void EditGrowY( bool bInitial = false );
ScSplitPos GetEditActivePart() const { return eEditActivePart; }
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 7763af3e3820..4eb61f04b345 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -1212,6 +1212,7 @@ void ScViewData::EditGrowX()
static_cast<ScEditEngineDefaulter*>( pCurView->GetEditEngine() );
vcl::Window* pWin = pCurView->GetWindow();
+ // Get the left- and right-most column positions.
SCCOL nLeft = GetPosX(eHWhich);
SCCOL nRight = nLeft + VisibleCellsX(eHWhich);
@@ -1219,7 +1220,7 @@ void ScViewData::EditGrowX()
Rectangle aArea = pCurView->GetOutputArea();
long nOldRight = aArea.Right();
- // Margin ist schon bei der urspruenglichen Breite beruecksichtigt
+ // Margin is already included in the original width.
long nTextWidth = pEngine->CalcTextWidth();
bool bChanged = false;