[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng svx/source
matteocam
matteo.campanelli at gmail.com
Wed Jun 10 13:11:17 PDT 2015
editeng/source/editeng/editeng.cxx | 5 +++++
editeng/source/editeng/impedit.hxx | 2 +-
editeng/source/editeng/impedit3.cxx | 16 ++--------------
editeng/source/outliner/outliner.cxx | 5 +++++
include/editeng/editeng.hxx | 1 +
include/editeng/outliner.hxx | 1 +
svx/source/svdraw/svdotextdecomposition.cxx | 26 ++++++++------------------
7 files changed, 23 insertions(+), 33 deletions(-)
New commits:
commit c6391cf90e9885d4bf92d44733047f40c8ad5e18
Author: matteocam <matteo.campanelli at gmail.com>
Date: Wed Jun 10 16:09:59 2015 -0400
Checking overflowing and cutting text in impChainedTextDecomposition
Change-Id: I0d28e46770269e4703cec193d510036b8a036286
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index 6aaf967..82881af 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -2794,6 +2794,11 @@ void EditEngine::ClearOverflowingParaNum() {
pImpEditEngine->ClearOverflowingParaNum();
}
+bool EditEngine::IsPageOverflow() {
+ pImpEditEngine->CheckPageOverflow();
+ return pImpEditEngine->IsPageOverflow();
+}
+
EFieldInfo::EFieldInfo()
{
pFieldItem = NULL;
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 578371d..9b8d675 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -737,7 +737,7 @@ public:
const Size& GetMaxAutoPaperSize() const { return aMaxAutoPaperSize; }
void SetMaxAutoPaperSize( const Size& rSz ) { aMaxAutoPaperSize = rSz; }
- bool IsPageOverflow( const Size aCurPaperSize, const Size aPrevPaperSize ) const;
+ bool IsPageOverflow( ) const;
void FormatDoc();
void FormatFullDoc();
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 6e06ac2..91c6d58 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -353,21 +353,9 @@ void ImpEditEngine::FormatFullDoc()
FormatDoc();
}
-bool ImpEditEngine::IsPageOverflow( const Size aCurPaperSize, const Size aPrevPaperSize ) const
+bool ImpEditEngine::IsPageOverflow( ) const
{
- const bool bTextGrowX=(aStatus.GetControlWord() & EE_STAT_TEXTWIDTHCHANGED) !=0;
- const bool bTextGrowY=(aStatus.GetControlWord() & EE_STAT_TEXTHEIGHTCHANGED) !=0;
-
- const bool bPageExpansionX = ( aPrevPaperSize.Width() != 0 ) && // XXX
- ( aCurPaperSize.Width() > aPrevPaperSize.Width() );
- const bool bPageExpansionY = ( aPrevPaperSize.Height() != 0 ) && // XXX
- ( aCurPaperSize.Height() > aPrevPaperSize.Height() );
-
- // Has text size changed (in the right vertical direction) AND
- // is this change an expansion?
- return ( bTextGrowY && !IsVertical() && bPageExpansionY ) ||
- ( bTextGrowX && IsVertical() && bPageExpansionX );
-
+ return mbNeedsChainingHandling;
}
void ImpEditEngine::FormatDoc()
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index 9e3e8f6..a4c285b 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -2089,6 +2089,11 @@ bool Outliner::HasParaFlag( const Paragraph* pPara, sal_uInt16 nFlag ) const
return pPara && pPara->HasFlag( nFlag );
}
+bool Outliner::IsPageOverflow()
+{
+ return pEditEngine->IsPageOverflow();
+}
+
NonOverflowingText *Outliner::GetNonOverflowingText() const
{
/* XXX:
diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx
index 1f9fafb..ede68be 100644
--- a/include/editeng/editeng.hxx
+++ b/include/editeng/editeng.hxx
@@ -604,6 +604,7 @@ public:
sal_Int32 GetOverflowingParaNum() const;
sal_Int32 GetOverflowingLineNum() const;
void ClearOverflowingParaNum();
+ bool IsPageOverflow();
};
#endif // INCLUDED_EDITENG_EDITENG_HXX
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index 0105caf3..76f0157 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -763,6 +763,7 @@ public:
NonOverflowingText *GetNonOverflowingText() const;
OverflowingText *GetOverflowingText() const;
void ClearOverflowingParaNum();
+ bool IsPageOverflow();
virtual void DepthChangedHdl();
void SetDepthChangedHdl(const Link& rLink){aDepthChangedHdl=rLink;}
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index dfaa1d8..3e9e262 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -1605,22 +1605,6 @@ void SdrTextObj::impDecomposeChainedTextPrimitive(
// Text
const OutlinerParaObject* pOutlinerParaObject = rSdrChainedTextPrimitive.getSdrText()->GetOutlinerParaObject();
-
- // FIXME
- // Experiment: cutting all paragraphs after first (if any)
- rOutliner.SetText(*pOutlinerParaObject);
- pOutlinerParaObject = rOutliner.CreateParaObject(0,1);
-
-
-
- // FIXME(matteocam)
- // Experiment: setting only the non overflowing text
- // Question: XXX: How do you know there is an overflow in the first place here??
- // Question: what is the page size set at the end of these procedure. Is the "real" text size anywhere?
-
- // Sub-experiment: removing the second paragraph if present
-
-
OSL_ENSURE(pOutlinerParaObject, "impDecomposeBlockTextPrimitive used with no OutlinerParaObject (!)");
const bool bVerticalWritintg(pOutlinerParaObject->IsVertical());
@@ -1643,9 +1627,15 @@ void SdrTextObj::impDecomposeChainedTextPrimitive(
rOutliner.SetPaperSize(aNullSize);
rOutliner.SetUpdateMode(true);
+ // Sets original text
rOutliner.SetText(*pOutlinerParaObject);
- // We do not need this
- //ImpAutoFitText(rOutliner,aAnchorTextSize,bVerticalWritintg);
+
+ // If overflow occurs we have to cut the text at the right point
+ if ( rOutliner.IsPageOverflow() ) {
+ const OutlinerParaObject *pNewTxt = impGetNonOverflowingParaObject();
+ rOutliner.SetText(*pNewTxt);
+ // XXX: Order transfer of stuff in next link here
+ }
// set visualizing page at Outliner; needed e.g. for PageNumberField decomposition
rOutliner.setVisualizedPage(GetSdrPageFromXDrawPage(aViewInformation.getVisualizedPage()));
More information about the Libreoffice-commits
mailing list