[Libreoffice-commits] core.git: Branch 'feature/table_rotated_text' - editeng/source include/editeng

Tamás Zolnai tamas.zolnai at collabora.com
Fri Apr 14 22:18:39 UTC 2017


 editeng/source/outliner/outlin2.cxx  |    5 +++++
 editeng/source/outliner/outliner.cxx |   29 +++++++++++++++++++++++------
 include/editeng/outliner.hxx         |    1 +
 3 files changed, 29 insertions(+), 6 deletions(-)

New commits:
commit e3055e8acdb6de5d53c9f27a17183ccb2c0a4d16
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
Date:   Sat Apr 15 00:18:11 2017 +0200

    Fix vertical text and bitmap bullet rendering
    
    Change-Id: I881fce0511c81b164516d68f72c7e750687d4e0e

diff --git a/editeng/source/outliner/outlin2.cxx b/editeng/source/outliner/outlin2.cxx
index 08495c39fa07..45efe99362ed 100644
--- a/editeng/source/outliner/outlin2.cxx
+++ b/editeng/source/outliner/outlin2.cxx
@@ -536,6 +536,11 @@ bool Outliner::IsVertical() const
     return pEditEngine->IsVertical();
 }
 
+bool Outliner::IsTopToBottom() const
+{
+    return pEditEngine->IsTopToBottom();
+}
+
 void Outliner::SetFixedCellHeight( bool bUseFixedCellHeight )
 {
     pEditEngine->SetFixedCellHeight( bUseFixedCellHeight );
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index 3f7914ff2ad2..6ffaf540edfe 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -861,7 +861,7 @@ vcl::Font Outliner::ImpCalcBulletFont( sal_Int32 nPara ) const
     aBulletFont.SetFontSize( Size( 0, nScaledLineHeight ) );
     bool bVertical = IsVertical();
     aBulletFont.SetVertical( bVertical );
-    aBulletFont.SetOrientation( bVertical ? 2700 : 0 );
+    aBulletFont.SetOrientation( bVertical ? (IsTopToBottom() ? 2700 : 900) : 0 );
 
     Color aColor( COL_AUTO );
     if( !pEditEngine->IsFlatMode() && !( pEditEngine->GetControlWord() & EEControlBits::NOCOLORS ) )
@@ -890,6 +890,7 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
     if (bDrawBullet && ImplHasNumberFormat(nPara))
     {
         bool bVertical = IsVertical();
+        bool bTopToBottom = IsTopToBottom();
 
         bool bRightToLeftPara = pEditEngine->IsRightToLeft( nPara );
 
@@ -927,9 +928,17 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
                 }
                 else
                 {
-//                  aTextPos.X() = rStartPos.X() - aBulletArea.Bottom();
-                    aTextPos.X() = rStartPos.X() - ( bSymbol ? aBulletArea.Bottom() : aParaInfos.nFirstLineMaxAscent );
-                    aTextPos.Y() = rStartPos.Y() + aBulletArea.Left();
+                    if (bTopToBottom)
+                    {
+//                      aTextPos.X() = rStartPos.X() - aBulletArea.Bottom();
+                        aTextPos.X() = rStartPos.X() - (bSymbol ? aBulletArea.Bottom() : aParaInfos.nFirstLineMaxAscent);
+                        aTextPos.Y() = rStartPos.Y() + aBulletArea.Left();
+                    }
+                    else
+                    {
+                        aTextPos.X() = rStartPos.X() + (bSymbol ? aBulletArea.Bottom() : aParaInfos.nFirstLineMaxAscent);
+                        aTextPos.Y() = rStartPos.Y() + aBulletArea.Left();
+                    }
                 }
 
                 if ( nOrientation )
@@ -998,8 +1007,16 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
                     }
                     else
                     {
-                        aBulletPos.X() = rStartPos.X() - aBulletArea.Bottom();
-                        aBulletPos.Y() = rStartPos.Y() + aBulletArea.Left();
+                        if (bTopToBottom)
+                        {
+                            aBulletPos.X() = rStartPos.X() - aBulletArea.Bottom();
+                            aBulletPos.Y() = rStartPos.Y() + aBulletArea.Left();
+                        }
+                        else
+                        {
+                            aBulletPos.X() = rStartPos.X() + aBulletArea.Top();
+                            aBulletPos.Y() = rStartPos.Y() - aBulletArea.Right();
+                        }
                     }
 
                     if(bStrippingPortions)
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index 5d2ce0044517..e8fdb13b6920 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -686,6 +686,7 @@ public:
 
     void            SetVertical( bool bVertical, bool bTopToBottom = true);
     bool            IsVertical() const;
+    bool            IsTopToBottom() const;
 
     void            SetFixedCellHeight( bool bUseFixedCellHeight );
 


More information about the Libreoffice-commits mailing list