[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - 2 commits - editeng/source include/editeng svx/source

matteocam matteo.campanelli at gmail.com
Thu Jul 17 17:07:03 PDT 2014


 editeng/source/editeng/impedit.hxx  |    2 ++
 editeng/source/editeng/impedit3.cxx |   18 +++++++-----------
 include/editeng/editstat.hxx        |    7 ++++++-
 svx/source/svdraw/svdotext.cxx      |    4 ++++
 4 files changed, 19 insertions(+), 12 deletions(-)

New commits:
commit 8f2cfe1d868a43ce293528a09cd44f4e018be755
Author: matteocam <matteo.campanelli at gmail.com>
Date:   Fri Jul 18 02:03:21 2014 +0200

    IsPageOverflow in ImpEditEngine. PageOverflow in EditStatus.
    
    Change-Id: I3f2bba42b1f59278db43990c48cfa600ff739d2f

diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 9252bd0..506d597 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -260,8 +260,6 @@ protected:
         throw (::com::sun::star::uno::RuntimeException,
                std::exception) SAL_OVERRIDE;
 
-    bool IsPageOverflow( const Size aCurPaperSize, const Size aPrevPaperSize ) const;
-
     void ShowDDCursor( const Rectangle& rRect );
     void HideDDCursor();
 
@@ -727,6 +725,8 @@ public:
     const Size&             GetMaxAutoPaperSize() const             { return aMaxAutoPaperSize; }
     void                    SetMaxAutoPaperSize( const Size& rSz )  { aMaxAutoPaperSize = rSz; }
 
+    bool IsPageOverflow( const Size aCurPaperSize, const Size aPrevPaperSize ) const;
+
     void                    FormatDoc();
     void                    FormatFullDoc();
     void                    UpdateViews( EditView* pCurView = 0 );
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index bef5162..48c2450 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -542,11 +542,8 @@ void ImpEditEngine::CheckAutoPageSize()
     SetValidPaperSize( aPaperSize );    // consider Min, Max
 
     // FIXME(matteocam)
-    fprintf( stderr, IsPageOverflow( aStatus.GetStatusWord(),
-                                    IsVertical(),
-                                    aPrevPaperSize,
-                                    aPaperSize)
-                     ? "YES Overflow!\n"  : "NO Overflow!\n" );
+    fprintf( stderr, IsPageOverflow(aPaperSize, aPrevPaperSize)
+                        ? "YES Overflow!\n"  : "NO Overflow!\n" );
 
     if ( aPaperSize != aPrevPaperSize )
     {
diff --git a/include/editeng/editstat.hxx b/include/editeng/editstat.hxx
index 8fd9f40..e62ef82 100644
--- a/include/editeng/editstat.hxx
+++ b/include/editeng/editstat.hxx
@@ -92,8 +92,11 @@ protected:
     sal_uLong   nControlBits;
     sal_Int32   nPrevPara;                  // for EE_STAT_CRSRLEFTPARA
 
+    bool        bIsPageOverflow;
+
 public:
-            EditStatus()                { nStatusBits = 0; nControlBits = 0; nPrevPara = -1; }
+            EditStatus()                { nStatusBits = 0; nControlBits = 0;
+                                          nPrevPara = -1; bIsPageOverflow = false; }
 
     void    Clear()                     { nStatusBits = 0; }
     void    SetControlBits( sal_uLong nMask, bool bOn )
@@ -107,6 +110,8 @@ public:
 
     sal_Int32   GetPrevParagraph() const    { return nPrevPara; }
     sal_Int32&  GetPrevParagraph()          { return nPrevPara; }
+
+    bool        IsPageOverflow() const      { return bIsPageOverflow; }
 };
 
 #define SPELLCMD_IGNOREWORD         0x0001
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 5d113a9..b24d90d 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1925,6 +1925,10 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* pEditStatus )
             ImpAutoFitText(*pEdtOutl);
             mbInDownScale = false;
         }
+        else if (IsChained() && pEditStatus->IsOverflow())
+        {
+
+        }
     }
 }
 
commit 02ee8c2b17c8c96ad89a79c8c8c5e419c7161552
Author: matteocam <matteo.campanelli at gmail.com>
Date:   Thu Jul 17 23:20:07 2014 +0200

    IsPageOverflow in ImpEditEngine
    
    Change-Id: If6f7641de8e182df6231db7895d4809a7ddb3acb

diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index b225ac6..9252bd0 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -260,6 +260,8 @@ protected:
         throw (::com::sun::star::uno::RuntimeException,
                std::exception) SAL_OVERRIDE;
 
+    bool IsPageOverflow( const Size aCurPaperSize, const Size aPrevPaperSize ) const;
+
     void ShowDDCursor( const Rectangle& rRect );
     void HideDDCursor();
 
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index b291967..bef5162 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -353,19 +353,18 @@ void ImpEditEngine::FormatFullDoc()
     FormatDoc();
 }
 
-bool IsPageOverflow(const sal_uInt32 aStatus, bool isVertical,
-                    const Size aPrevPaperSize, const Size aPaperSize)
+bool ImpEditEngine::IsPageOverflow( const Size aCurPaperSize, const Size aPrevPaperSize ) const
 {
     const bool bTextGrowX=(aStatus & EE_STAT_TEXTWIDTHCHANGED) !=0;
     const bool bTextGrowY=(aStatus & EE_STAT_TEXTHEIGHTCHANGED) !=0;
 
     const bool bPageExpansionX = ( aPrevPaperSize.Width() != 0 ) && // XXX
-                            ( aPaperSize.Width() > aPrevPaperSize.Width() );
+                            ( aCurPaperSize.Width() > aPrevPaperSize.Width() );
     const bool bPageExpansionY = ( aPrevPaperSize.Height() != 0 ) && // XXX
-                            ( aPaperSize.Height() > aPrevPaperSize.Height() );
+                            ( aCurPaperSize.Height() > aPrevPaperSize.Height() );
 
-    return ( bTextGrowY && !isVertical && bPageExpansionY ) ||
-           ( bTextGrowX && isVertical &&  bPageExpansionX );
+    return ( bTextGrowY && !IsVertical() && bPageExpansionY ) ||
+           ( bTextGrowX && IsVertical() &&  bPageExpansionX );
 
 }
 


More information about the Libreoffice-commits mailing list