[Libreoffice-commits] core.git: 2 commits - sw/source sw/uiconfig

Zolnai Tamás tamas.zolnai at collabora.com
Wed Mar 5 13:25:25 PST 2014


 sw/source/core/inc/flyfrm.hxx        |   13 +
 sw/source/core/inc/frame.hxx         |    2 
 sw/source/core/layout/calcmove.cxx   |   15 ++
 sw/source/core/layout/fly.cxx        |  181 ++++++++++++++++++---------
 sw/source/core/layout/flylay.cxx     |    8 +
 sw/source/ui/frmdlg/frmpage.cxx      |   36 +++++
 sw/source/ui/inc/frmpage.hxx         |    3 
 sw/uiconfig/swriter/ui/frmaddpage.ui |  233 +++++++++++++++++++++++++----------
 8 files changed, 367 insertions(+), 124 deletions(-)

New commits:
commit cb19042f4395c97d123a27c6960d5e30d666c010
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date:   Wed Mar 5 22:15:09 2014 +0100

    New feature: vertical alignment for text frames: Layout part
    
    - Introduce a new attribute (content position) for fly frames. Content
    position specify the top-left corner of the content area (where
    frame content can be placed). Add methods and members for invalidation.
    - Extract content's height calculation from SwFlyFrm::Format()
    to a funtction so we can use this inside SwFlyFrm::MakeContentPos.
    
    Change-Id: I64abb70afb652ad5c11aa69b5ba12a85210e215b

diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx
index 234e94d..a666a9d 100644
--- a/sw/source/core/inc/flyfrm.hxx
+++ b/sw/source/core/inc/flyfrm.hxx
@@ -118,8 +118,12 @@ protected:
 
     friend class SwNoTxtFrm; // is allowed to call NotifyBackground
 
+    Point m_aContentPos;        // content area's position relatively to Frm
+    bool m_bValidContentPos;
+
     virtual void Format( const SwBorderAttrs *pAttrs = 0 );
     void MakePrtArea( const SwBorderAttrs &rAttrs );
+    void MakeContentPos( const SwBorderAttrs &rAttrs );
 
     void Lock()         { bLocked = sal_True; }
     void Unlock()       { bLocked = sal_False; }
@@ -147,6 +151,8 @@ protected:
 
     virtual const IDocumentDrawModelAccess* getIDocumentDrawModelAccess( );
 
+    SwTwips CalcContentHeight(const SwBorderAttrs *pAttrs, const SwTwips nMinHeight, const SwTwips nUL);
+
 public:
     // #i26791#
     TYPEINFO();
@@ -279,6 +285,13 @@ public:
     virtual       SwFlyFrmFmt *GetFmt();
 
     virtual void dumpAsXml( xmlTextWriterPtr writer ) { SwLayoutFrm::dumpAsXml( writer ); };
+
+    virtual void Calc() const;
+
+    const Point& ContentPos() const { return m_aContentPos; }
+    Point& ContentPos() { return m_aContentPos; }
+
+    void InvalidateContentPos();
 };
 #endif
 
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index c78614a..73b32f8 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -682,7 +682,7 @@ public:
     inline SwLayoutFrm *GetPrevLayoutLeaf();
     inline SwLayoutFrm *GetNextLayoutLeaf();
 
-    inline void Calc() const;       // here might be "formatted"
+    virtual void Calc() const;      // here might be "formatted"
     inline void OptCalc() const;    // here we assume (for optimization) that
                                     // the predecessors are already formatted
 
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index b8e9b12..88be7b6 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -25,6 +25,7 @@
 #include "fmtftn.hxx"
 #include <editeng/ulspitem.hxx>
 #include <editeng/keepitem.hxx>
+#include <svx/sdtaitm.hxx>
 
 #include <fmtfsize.hxx>
 #include <fmtanchr.hxx>
@@ -581,7 +582,11 @@ void SwFrm::MakePos()
             else
             {
                 maFrm.Pos( GetUpper()->Frm().Pos() );
-                maFrm.Pos() += GetUpper()->Prt().Pos();
+                if( GetUpper()->IsFlyFrm() )
+                    maFrm.Pos() += static_cast<SwFlyFrm*>(GetUpper())->ContentPos();
+                else
+                    maFrm.Pos() += GetUpper()->Prt().Pos();
+
                 if( FRM_NEIGHBOUR & nMyType && IsRightToLeft() )
                 {
                     if( bVert )
@@ -1335,6 +1340,14 @@ void SwCntntFrm::MakeAll()
             if ( nConsequetiveFormatsWithoutChange <= cnStopFormat )
             {
                 Format();
+
+                // When a lower of a vertically aligned fly frame changes it's size we need to recalculate content pos.
+                if( GetUpper() && GetUpper()->IsFlyFrm() &&
+                    GetUpper()->GetFmt()->GetTextVertAdjust().GetValue() != SDRTEXTVERTADJUST_TOP )
+                {
+                    static_cast<SwFlyFrm*>(GetUpper())->InvalidateContentPos();
+                    GetUpper()->SetCompletePaint();
+                }
             }
 #if OSL_DEBUG_LEVEL > 0
             else
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index df97a35..5d0aede 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -72,7 +72,8 @@ SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
     bLayout( sal_False ),
     bAutoPosition( sal_False ),
     bNoShrink( sal_False ),
-    bLockDeleteContent( sal_False )
+    bLockDeleteContent( sal_False ),
+    m_bValidContentPos( false )
 {
     mnType = FRMC_FLY;
 
@@ -931,6 +932,13 @@ void SwFlyFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
         }
         break;
 
+        case RES_TEXT_VERT_ADJUST:
+        {
+            InvalidateContentPos();
+            rInvFlags |= 0x10;
+        }
+        break;
+
         case RES_BOX:
         case RES_SHADOW:
             rInvFlags |= 0x17;
@@ -1232,7 +1240,7 @@ void SwFlyFrm::Format( const SwBorderAttrs *pAttrs )
         const SwTwips nUL = pAttrs->CalcTopLine()  + pAttrs->CalcBottomLine();
         const SwTwips nLR = pAttrs->CalcLeftLine() + pAttrs->CalcRightLine();
         const SwFmtFrmSize &rFrmSz = GetFmt()->GetFrmSize();
-              Size aRelSize( CalcRel( rFrmSz ) );
+        Size aRelSize( CalcRel( rFrmSz ) );
 
         OSL_ENSURE( pAttrs->GetSize().Height() != 0 || rFrmSz.GetHeightPercent(), "FrameAttr height is 0." );
         OSL_ENSURE( pAttrs->GetSize().Width()  != 0 || rFrmSz.GetWidthPercent(), "FrameAttr width is 0." );
@@ -1240,62 +1248,11 @@ void SwFlyFrm::Format( const SwBorderAttrs *pAttrs )
         SWRECTFN( this )
         if( !HasFixSize() )
         {
-            SwTwips nRemaining = 0;
-
             long nMinHeight = 0;
             if( IsMinHeight() )
                 nMinHeight = bVert ? aRelSize.Width() : aRelSize.Height();
 
-            if ( Lower() )
-            {
-                if ( Lower()->IsColumnFrm() )
-                {
-                    FormatWidthCols( *pAttrs, nUL, nMinHeight );
-                    nRemaining = (Lower()->Frm().*fnRect->fnGetHeight)();
-                }
-                else
-                {
-                    SwFrm *pFrm = Lower();
-                    while ( pFrm )
-                    {
-                        nRemaining += (pFrm->Frm().*fnRect->fnGetHeight)();
-                        if( pFrm->IsTxtFrm() && ((SwTxtFrm*)pFrm)->IsUndersized() )
-                            // This TxtFrm would like to be a bit larger
-                            nRemaining += ((SwTxtFrm*)pFrm)->GetParHeight()
-                                    - (pFrm->Prt().*fnRect->fnGetHeight)();
-                        else if( pFrm->IsSctFrm() && ((SwSectionFrm*)pFrm)->IsUndersized() )
-                            nRemaining += ((SwSectionFrm*)pFrm)->Undersize();
-                        pFrm = pFrm->GetNext();
-                    }
-                }
-                if ( GetDrawObjs() )
-                {
-                    sal_uInt32 nCnt = GetDrawObjs()->Count();
-                    SwTwips nTop = (Frm().*fnRect->fnGetTop)();
-                    SwTwips nBorder = (Frm().*fnRect->fnGetHeight)() -
-                                      (Prt().*fnRect->fnGetHeight)();
-                    for ( sal_uInt16 i = 0; i < nCnt; ++i )
-                    {
-                        SwAnchoredObject* pAnchoredObj = (*GetDrawObjs())[i];
-                        if ( pAnchoredObj->ISA(SwFlyFrm) )
-                        {
-                            SwFlyFrm* pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
-                            // OD 06.11.2003 #i22305# - consider
-                            // only Writer fly frames, which follow the text flow.
-                            if ( pFly->IsFlyLayFrm() &&
-                                 pFly->Frm().Top() != FAR_AWAY &&
-                                 pFly->GetFmt()->GetFollowTextFlow().GetValue() )
-                            {
-                                SwTwips nDist = -(pFly->Frm().*fnRect->
-                                    fnBottomDist)( nTop );
-                                if( nDist > nBorder + nRemaining )
-                                    nRemaining = nDist - nBorder;
-                            }
-                        }
-                    }
-                }
-            }
-
+            SwTwips nRemaining = CalcContentHeight(pAttrs, nMinHeight, nUL);
             if( IsMinHeight() && (nRemaining + nUL) < nMinHeight )
                 nRemaining = nMinHeight - nUL;
             // Because the Grow/Shrink of the Flys does not directly
@@ -1304,8 +1261,10 @@ void SwFlyFrm::Format( const SwBorderAttrs *pAttrs )
             // Notification is running along already.
             // As we already got a lot of zeros per attribute, we block them
             // from now on.
+
             if ( nRemaining < MINFLY )
                 nRemaining = MINFLY;
+
             (Prt().*fnRect->fnSetHeight)( nRemaining );
             nRemaining -= (Frm().*fnRect->fnGetHeight)();
             (Frm().*fnRect->fnAddBottom)( nRemaining + nUL );
@@ -1715,7 +1674,6 @@ void SwFlyFrm::MakeObjPos()
 
 void SwFlyFrm::MakePrtArea( const SwBorderAttrs &rAttrs )
 {
-
     if ( !mbValidPrtArea )
     {
         mbValidPrtArea = sal_True;
@@ -1729,6 +1687,55 @@ void SwFlyFrm::MakePrtArea( const SwBorderAttrs &rAttrs )
     }
 }
 
+void SwFlyFrm::MakeContentPos( const SwBorderAttrs &rAttrs )
+{
+    if ( !m_bValidContentPos )
+    {
+        m_bValidContentPos = true;
+
+        const SwTwips nUL = rAttrs.CalcTopLine()  + rAttrs.CalcBottomLine();
+        Size aRelSize( CalcRel( GetFmt()->GetFrmSize() ) );
+
+        SWRECTFN( this )
+        long nMinHeight = 0;
+        if( IsMinHeight() )
+            nMinHeight = bVert ? aRelSize.Width() : aRelSize.Height();
+
+        Point aNewContentPos;
+        aNewContentPos = Prt().Pos();
+        const SdrTextVertAdjust nAdjust = GetFmt()->GetTextVertAdjust().GetValue();
+        if( nAdjust != SDRTEXTVERTADJUST_TOP )
+        {
+            SwTwips nDiff = (Prt().*fnRect->fnGetHeight)() - CalcContentHeight(&rAttrs, nMinHeight, nUL);
+            if( nDiff > 0 )
+            {
+                if( nAdjust == SDRTEXTVERTADJUST_CENTER )
+                {
+                    aNewContentPos.setY(aNewContentPos.getY() + nDiff/2);
+                }
+                else if( nAdjust == SDRTEXTVERTADJUST_BOTTOM )
+                {
+                    aNewContentPos.setY(aNewContentPos.getY() + nDiff);
+                }
+            }
+        }
+        if( aNewContentPos != ContentPos() )
+        {
+            ContentPos() = aNewContentPos;
+            for( SwFrm *pFrm = Lower(); pFrm; pFrm = pFrm->GetNext())
+            {
+                pFrm->InvalidatePos();
+            }
+        }
+    }
+}
+
+void SwFlyFrm::InvalidateContentPos()
+{
+    m_bValidContentPos = false;
+    _Invalidate();
+}
+
 SwTwips SwFlyFrm::_Grow( SwTwips nDist, sal_Bool bTst )
 {
     SWRECTFN( this )
@@ -2613,4 +2620,68 @@ SwFlyFrmFmt * SwFlyFrm::GetFmt()
     return static_cast< SwFlyFrmFmt * >( GetDep() );
 }
 
+void SwFlyFrm::Calc() const
+{
+    if ( !m_bValidContentPos )
+        ((SwFlyFrm*)this)->PrepareMake();
+    else
+        SwLayoutFrm::Calc();
+}
+
+SwTwips SwFlyFrm::CalcContentHeight(const SwBorderAttrs *pAttrs, const SwTwips nMinHeight, const SwTwips nUL)
+{
+    SWRECTFN( this )
+    SwTwips nHeight = 0;
+    if ( Lower() )
+    {
+        if ( Lower()->IsColumnFrm() )
+        {
+            FormatWidthCols( *pAttrs, nUL, nMinHeight );
+            nHeight = (Lower()->Frm().*fnRect->fnGetHeight)();
+        }
+        else
+        {
+            SwFrm *pFrm = Lower();
+            while ( pFrm )
+            {
+                nHeight += (pFrm->Frm().*fnRect->fnGetHeight)();
+                if( pFrm->IsTxtFrm() && ((SwTxtFrm*)pFrm)->IsUndersized() )
+                // This TxtFrm would like to be a bit larger
+                    nHeight += ((SwTxtFrm*)pFrm)->GetParHeight()
+                            - (pFrm->Prt().*fnRect->fnGetHeight)();
+                else if( pFrm->IsSctFrm() && ((SwSectionFrm*)pFrm)->IsUndersized() )
+                    nHeight += ((SwSectionFrm*)pFrm)->Undersize();
+                pFrm = pFrm->GetNext();
+            }
+        }
+        if ( GetDrawObjs() )
+        {
+            sal_uInt32 nCnt = GetDrawObjs()->Count();
+            SwTwips nTop = (Frm().*fnRect->fnGetTop)();
+            SwTwips nBorder = (Frm().*fnRect->fnGetHeight)() -
+            (Prt().*fnRect->fnGetHeight)();
+            for ( sal_uInt16 i = 0; i < nCnt; ++i )
+            {
+                SwAnchoredObject* pAnchoredObj = (*GetDrawObjs())[i];
+                if ( pAnchoredObj->ISA(SwFlyFrm) )
+                {
+                    SwFlyFrm* pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
+                    // OD 06.11.2003 #i22305# - consider
+                    // only Writer fly frames, which follow the text flow.
+                    if ( pFly->IsFlyLayFrm() &&
+                        pFly->Frm().Top() != FAR_AWAY &&
+                        pFly->GetFmt()->GetFollowTextFlow().GetValue() )
+                    {
+                        SwTwips nDist = -(pFly->Frm().*fnRect->
+                            fnBottomDist)( nTop );
+                        if( nDist > nBorder + nHeight )
+                            nHeight = nDist - nBorder;
+                    }
+                }
+            }
+        }
+    }
+    return nHeight;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx
index ce7e0e9..554f3a4 100644
--- a/sw/source/core/layout/flylay.cxx
+++ b/sw/source/core/layout/flylay.cxx
@@ -140,7 +140,7 @@ void SwFlyFreeFrm::MakeAll()
     sal_uInt16 nLoopControlRuns = 0;
     const sal_uInt16 nLoopControlMax = 10;
 
-    while ( !mbValidPos || !mbValidSize || !mbValidPrtArea || bFormatHeightOnly )
+    while ( !mbValidPos || !mbValidSize || !mbValidPrtArea || bFormatHeightOnly || !m_bValidContentPos )
     {
         SWRECTFN( this )
         const SwFmtFrmSize *pSz;
@@ -157,7 +157,10 @@ void SwFlyFreeFrm::MakeAll()
             }
 
             if ( !mbValidPrtArea )
+            {
                 MakePrtArea( rAttrs );
+                m_bValidContentPos = false;
+            }
 
             if ( !mbValidSize || bFormatHeightOnly )
             {
@@ -185,6 +188,9 @@ void SwFlyFreeFrm::MakeAll()
                 else
                     mbValidSize = sal_False;
             }
+
+            if ( !m_bValidContentPos )
+                MakeContentPos( rAttrs );
         }
 
         if ( mbValidPos && mbValidSize )
commit 80d1a46e0f3b57f1bbaf7bc4c8aac81195ea8f4d
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date:   Wed Mar 5 18:21:20 2014 +0100

    New feature: vertical alignment for text frames: UI part
    
    Add a new combobox to the Options tab page of Frame dialog,
    which works with RES_TEXT_VERT_ADJUST attribute.
    
    The combobox is placed to the right side of the dialog,
    to follow ux-advise suggestion.
    
    Change-Id: I47cec8e9dea748b8e9d23fc51cacbeec1c890a4e

diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index b67ab00..3150515 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -57,6 +57,8 @@
 #include <grfatr.hxx>
 #include <uiitems.hxx>
 #include <fmtfollowtextflow.hxx>
+#include <editeng/adjustitem.hxx>
+#include <svx/sdtaitm.hxx>
 
 #include <frmui.hrc>
 #include <sfx2/filedlghelper.hxx>
@@ -2883,6 +2885,9 @@ SwFrmAddPage::SwFrmAddPage(Window *pParent, const SfxItemSet &rSet)
     get(pProtectFrameCB,"protectframe");
     get(pProtectSizeCB,"protectsize");
 
+    get(m_pContentAlignFrame, "contentalign");
+    get(m_pVertAlignLB,"vertalign");
+
     get(pPropertiesFrame,"properties");
     get(pEditInReadonlyCB,"editinreadonly");
     get(pPrintFrameCB,"printframe");
@@ -2918,6 +2923,7 @@ void SwFrmAddPage::Reset(const SfxItemSet &rSet )
         {
             pPropertiesFrame->Hide();
         }
+        m_pContentAlignFrame->Hide();
     }
 
     if(SFX_ITEM_SET == rSet.GetItemState(FN_SET_FRM_ALT_NAME, false, &pItem))
@@ -3064,6 +3070,22 @@ void SwFrmAddPage::Reset(const SfxItemSet &rSet )
         pTextFlowFT->Hide();
         pTextFlowLB->Hide();
     }
+
+    // Content alignment
+    if ( rSet.GetItemState(RES_TEXT_VERT_ADJUST) > SFX_ITEM_AVAILABLE )
+    {
+        SdrTextVertAdjust nAdjust = ((const SdrTextVertAdjustItem&)rSet.Get(RES_TEXT_VERT_ADJUST)).GetValue();
+        sal_uInt16 nPos = 0;
+        switch(nAdjust)
+        {
+            case SDRTEXTVERTADJUST_TOP:      nPos = 0;   break;
+            case SDRTEXTVERTADJUST_CENTER:
+            case SDRTEXTVERTADJUST_BLOCK:    nPos = 1;   break;
+            case SDRTEXTVERTADJUST_BOTTOM:   nPos = 2;   break;
+        }
+        m_pVertAlignLB->SelectEntryPos(nPos);
+    }
+    m_pVertAlignLB->SaveValue();
 }
 
 sal_Bool SwFrmAddPage::FillItemSet(SfxItemSet &rSet)
@@ -3125,6 +3147,20 @@ sal_Bool SwFrmAddPage::FillItemSet(SfxItemSet &rSet)
                 bRet |= 0 != rSet.Put(SfxStringItem(FN_PARAM_CHAIN_NEXT, sCurrentNextChain));
         }
     }
+
+    if(m_pVertAlignLB->GetSelectEntryPos() != m_pVertAlignLB->GetSavedValue())
+    {
+        SdrTextVertAdjust nAdjust;
+        switch(m_pVertAlignLB->GetSelectEntryPos())
+        {
+            default:
+            case 0 : nAdjust = SDRTEXTVERTADJUST_TOP; break;
+            case 1 : nAdjust = SDRTEXTVERTADJUST_CENTER; break;
+            case 2 : nAdjust = SDRTEXTVERTADJUST_BOTTOM; break;
+        }
+        bRet |= 0 != rSet.Put(SdrTextVertAdjustItem(nAdjust, RES_TEXT_VERT_ADJUST));
+    }
+
     return bRet;
 }
 
diff --git a/sw/source/ui/inc/frmpage.hxx b/sw/source/ui/inc/frmpage.hxx
index 5949195..4f47b2c 100644
--- a/sw/source/ui/inc/frmpage.hxx
+++ b/sw/source/ui/inc/frmpage.hxx
@@ -286,6 +286,9 @@ class SwFrmAddPage : public SfxTabPage
     CheckBox*     pProtectFrameCB;
     CheckBox*     pProtectSizeCB;
 
+    VclContainer* m_pContentAlignFrame;
+    ListBox*      m_pVertAlignLB;
+
     VclContainer* pPropertiesFrame;
     CheckBox*     pEditInReadonlyCB;
     CheckBox*     pPrintFrameCB;
diff --git a/sw/uiconfig/swriter/ui/frmaddpage.ui b/sw/uiconfig/swriter/ui/frmaddpage.ui
index b668b2e..dcbf12a 100644
--- a/sw/uiconfig/swriter/ui/frmaddpage.ui
+++ b/sw/uiconfig/swriter/ui/frmaddpage.ui
@@ -1,6 +1,28 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkListStore" id="liststore">
+    <columns>
+      <!-- column-name gchararray1 -->
+      <column type="gchararray"/>
+      <!-- column-name gint1 -->
+      <column type="gint"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0" translatable="yes">Top</col>
+        <col id="1">0</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Centered</col>
+        <col id="1">1</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Bottom</col>
+        <col id="1">2</col>
+      </row>
+    </data>
+  </object>
   <object class="GtkBox" id="FrmAddPage">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
@@ -177,91 +199,170 @@
       </packing>
     </child>
     <child>
-      <object class="GtkFrame" id="protect">
+      <object class="GtkGrid" id="grid2">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
-        <property name="hexpand">True</property>
-        <property name="label_xalign">0</property>
-        <property name="shadow_type">none</property>
+        <property name="column_homogeneous">True</property>
         <child>
-          <object class="GtkAlignment" id="alignment2">
+          <object class="GtkFrame" id="contentalign">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="hexpand">True</property>
-            <property name="vexpand">True</property>
-            <property name="top_padding">6</property>
-            <property name="left_padding">12</property>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">none</property>
             <child>
-              <object class="GtkGrid" id="grid2">
+              <object class="GtkAlignment" id="alignment2">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="hexpand">True</property>
-                <property name="row_spacing">6</property>
-                <property name="column_spacing">12</property>
+                <property name="top_padding">6</property>
+                <property name="left_padding">12</property>
                 <child>
-                  <object class="GtkCheckButton" id="protectcontent">
-                    <property name="label" translatable="yes">_Contents</property>
+                  <object class="GtkGrid" id="grid8">
                     <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="use_underline">True</property>
-                    <property name="xalign">0</property>
-                    <property name="draw_indicator">True</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">0</property>
-                    <property name="width">1</property>
-                    <property name="height">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkCheckButton" id="protectframe">
-                    <property name="label" translatable="yes">P_osition</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="use_underline">True</property>
-                    <property name="xalign">0</property>
-                    <property name="draw_indicator">True</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">1</property>
-                    <property name="width">1</property>
-                    <property name="height">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkCheckButton" id="protectsize">
-                    <property name="label" translatable="yes">_Size</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="use_underline">True</property>
-                    <property name="xalign">0</property>
-                    <property name="draw_indicator">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="column_spacing">12</property>
+                    <child>
+                      <object class="GtkLabel" id="label2">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">_Vertical alignment</property>
+                        <property name="use_underline">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">0</property>
+                        <property name="width">1</property>
+                        <property name="height">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkComboBox" id="vertalign">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="model">liststore</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="top_attach">0</property>
+                        <property name="width">1</property>
+                        <property name="height">1</property>
+                      </packing>
+                    </child>
                   </object>
-                  <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">2</property>
-                    <property name="width">1</property>
-                    <property name="height">1</property>
-                  </packing>
                 </child>
               </object>
             </child>
+            <child type="label">
+              <object class="GtkLabel" id="label7">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Content alignment</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
+              </object>
+            </child>
           </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="top_attach">0</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
         </child>
-        <child type="label">
-          <object class="GtkLabel" id="label2">
+        <child>
+          <object class="GtkFrame" id="protect">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="label" translatable="yes">Protect</property>
-            <attributes>
-              <attribute name="weight" value="bold"/>
-            </attributes>
+            <property name="hexpand">True</property>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">none</property>
+            <child>
+              <object class="GtkAlignment" id="alignment6">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <property name="vexpand">True</property>
+                <property name="top_padding">6</property>
+                <property name="left_padding">12</property>
+                <child>
+                  <object class="GtkGrid" id="grid9">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="hexpand">True</property>
+                    <property name="row_spacing">5</property>
+                    <property name="column_spacing">12</property>
+                    <child>
+                      <object class="GtkCheckButton" id="protectcontent">
+                        <property name="label" translatable="yes">_Contents</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="use_underline">True</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">0</property>
+                        <property name="width">1</property>
+                        <property name="height">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkCheckButton" id="protectframe">
+                        <property name="label" translatable="yes">P_osition</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="use_underline">True</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">1</property>
+                        <property name="width">1</property>
+                        <property name="height">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkCheckButton" id="protectsize">
+                        <property name="label" translatable="yes">_Size</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="use_underline">True</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">2</property>
+                        <property name="width">1</property>
+                        <property name="height">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child type="label">
+              <object class="GtkLabel" id="label8">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Protect</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
+              </object>
+            </child>
           </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">0</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
         </child>
       </object>
       <packing>


More information about the Libreoffice-commits mailing list