[PATCH] Converted Tools->Options->(Web/)Writer->View dialogue.

Pavel Kačer (via_Code_Review) gerrit at gerrit.libreoffice.org
Thu Apr 11 02:33:14 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3325

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/25/3325/1

Converted Tools->Options->(Web/)Writer->View dialogue.

Change-Id: Ifa11da48867303dbecd2ef104f2c0842aaeb5d72
---
M sw/UI_swriter.mk
M sw/source/ui/config/optdlg.src
M sw/source/ui/config/optpage.cxx
M sw/source/ui/inc/optpage.hxx
A sw/uiconfig/swriter/ui/viewoptionspage.ui
5 files changed, 607 insertions(+), 282 deletions(-)



diff --git a/sw/UI_swriter.mk b/sw/UI_swriter.mk
index 1ae6c0c..82c10e4 100644
--- a/sw/UI_swriter.mk
+++ b/sw/UI_swriter.mk
@@ -51,6 +51,7 @@
 	sw/uiconfig/swriter/ui/tabletextflowpage \
 	sw/uiconfig/swriter/ui/textgridpage \
 	sw/uiconfig/swriter/ui/titlepage \
+	sw/uiconfig/swriter/ui/viewoptionspage \
 	sw/uiconfig/swriter/ui/wordcount \
 ))
 
diff --git a/sw/source/ui/config/optdlg.src b/sw/source/ui/config/optdlg.src
index 9b8cf42..889408f9 100644
--- a/sw/source/ui/config/optdlg.src
+++ b/sw/source/ui/config/optdlg.src
@@ -24,170 +24,6 @@
 #include "optdlg.hrc"
 #include "helpid.h"
 
-/**************************************************************************/
-/*                                                                        */
-/*  TabPage View/Content                                              */
-/*                                                                        */
-/**************************************************************************/
-TabPage TP_CONTENT_OPT
-{
-    HelpID = HID_CONTENT_OPT ;
-    SVLook = TRUE ;
-    Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
-    Hide = TRUE ;
-    FixedLine FL_LINE
-    {
-        Pos = MAP_APPFONT ( 6 , 3 ) ;
-        Size = MAP_APPFONT ( 118 , 8 ) ;
-        Group = TRUE ;
-        Text [ en-US ] = "Guides";
-    };
-    CheckBox CB_CROSS
-    {
-        HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_CROSS";
-        Pos = MAP_APPFONT ( 12 , 14 ) ;
-        Size = MAP_APPFONT ( 118 , 10 ) ;
-        Text [ en-US ] = "Helplines ~While Moving";
-    };
-    FixedLine FL_WINDOW
-    {
-        Pos = MAP_APPFONT ( 130 , 3 ) ;
-        Size = MAP_APPFONT ( 124 , 8 ) ;
-        Group = TRUE ;
-        Text [ en-US ] = "View";
-    };
-    CheckBox CB_HSCROLL
-    {
-        HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_HSCROLL";
-        Pos = MAP_APPFONT ( 136 , 14 ) ;
-        Size = MAP_APPFONT ( 108 , 10 ) ;
-        Text [ en-US ] = "H~orizontal scrollbar" ;
-    };
-    CheckBox CB_VSCROLL
-    {
-        HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_VSCROLL";
-        Pos = MAP_APPFONT ( 136 , 27 ) ;
-        Size = MAP_APPFONT ( 108 , 10 ) ;
-        Text [ en-US ] = "~Vertical scrollbar" ;
-    };
-    CheckBox CB_ANY_RULER
-    {
-        HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_ANY_RULER";
-        Pos = MAP_APPFONT ( 136 , 40 ) ;
-        Size = MAP_APPFONT ( 65 , 10 ) ;
-        Text [ en-US ] = "R~uler" ;
-    };
-    CheckBox CB_HRULER
-    {
-        HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_HRULER";
-        Pos = MAP_APPFONT ( 142 , 53 ) ;
-        Size = MAP_APPFONT ( 62 , 10 ) ;
-        Text [ en-US ] = "Hori~zontal ruler" ;
-    };
-    ListBox LB_HMETRIC
-    {
-        HelpID = "sw:ListBox:TP_CONTENT_OPT:LB_HMETRIC";
-        Pos = MAP_APPFONT ( 206 , 51 ) ;
-        Size = MAP_APPFONT ( 45 , 60 ) ;
-        DropDown = TRUE;
-    };
-    CheckBox CB_VRULER
-    {
-        HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_VRULER";
-        Pos = MAP_APPFONT ( 142 , 66 ) ;
-        Size = MAP_APPFONT ( 62 , 10 ) ;
-        Text [ en-US ] = "Verti~cal ruler" ;
-    };
-    CheckBox CB_VRULER_RIGHT
-    {
-        HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_VRULER_RIGHT";
-        Pos = MAP_APPFONT ( 148 , 79 ) ;
-        Size = MAP_APPFONT ( 100 , 10 ) ;
-        Text [ en-US ] = "Right-aligned";
-    };
-    ListBox LB_VMETRIC
-    {
-        HelpID = "sw:ListBox:TP_CONTENT_OPT:LB_VMETRIC";
-        Pos = MAP_APPFONT ( 206 , 64 ) ;
-        Size = MAP_APPFONT ( 45 , 60 ) ;
-        DropDown = TRUE;
-    };
-    CheckBox CB_SMOOTH_SCROLL
-    {
-        HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_SMOOTH_SCROLL";
-        Pos = MAP_APPFONT ( 136 , 79 ) ;
-        Size = MAP_APPFONT ( 108 , 10 ) ;
-        Text [ en-US ] = "S~mooth scroll" ;
-    };
-    FixedLine FL_DISP
-    {
-        Pos = MAP_APPFONT ( 6 , 30 ) ;
-        Size = MAP_APPFONT ( 118 , 8 ) ;
-        Text [ en-US ] = "Display" ;
-        Group = TRUE ;
-    };
-    CheckBox CB_GRF
-    {
-        HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_GRF";
-        Pos = MAP_APPFONT ( 12 , 41 ) ;
-        Size = MAP_APPFONT ( 108 , 10 ) ;
-        Text [ en-US ] = "~Graphics and objects" ;
-        TabStop = TRUE ;
-        Group = TRUE ;
-    };
-    CheckBox CB_TBL
-    {
-        HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_TBL";
-        Pos = MAP_APPFONT ( 12 , 54 ) ;
-        Size = MAP_APPFONT ( 108 , 10 ) ;
-        Text [ en-US ] = "~Tables " ;
-    };
-    CheckBox CB_DRWFAST
-    {
-        HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_DRWFAST";
-        Pos = MAP_APPFONT ( 12 , 67 ) ;
-        Size = MAP_APPFONT ( 108 , 10 ) ;
-        Text [ en-US ] = "Dra~wings and controls" ;
-    };
-    CheckBox CB_FIELD
-    {
-        HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_FIELD";
-        Pos = MAP_APPFONT ( 12 , 80 ) ;
-        Size = MAP_APPFONT ( 108 , 10 ) ;
-        Text [ en-US ] = "~Field codes" ;
-    };
-    CheckBox CB_POSTIT
-    {
-        HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_POSTIT";
-        Pos = MAP_APPFONT ( 12 , 93 ) ;
-        Size = MAP_APPFONT ( 108 , 10 ) ;
-        Text [ en-US ] = "~Comments" ;
-    };
-    FixedLine FL_SETTINGS
-    {
-        Pos = MAP_APPFONT ( 130 , 122 ) ;
-        Size = MAP_APPFONT ( 124 , 8 ) ;
-        Text [ en-US ] = "Settings";
-        Hide = TRUE;
-    };
-    FixedText FT_METRIC
-    {
-        Pos = MAP_APPFONT ( 136 , 135 ) ;
-        Size = MAP_APPFONT ( 60 , 8 ) ;
-        Text [ en-US ] = "Measurement unit";
-        Hide = TRUE;
-    };
-    ListBox LB_METRIC
-    {
-        HelpID = "sw:ListBox:TP_CONTENT_OPT:LB_METRIC";
-        Pos = MAP_APPFONT ( 199, 133 ) ;
-        Size = MAP_APPFONT ( 50 , 50 ) ;
-        Border = TRUE ;
-        DropDown = TRUE ;
-        Hide = TRUE;
-    };
-};
-
 TabPage TP_STD_FONT
 {
     HelpID = HID_STD_FONT ;
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index bfe09fe..82ef3251 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -67,54 +67,60 @@
 
 using namespace ::com::sun::star;
 
+/*--------------------------------------------------------
+ Tools->Options->Writer->View
+ Tools->Options->Writer/Web->View
+--------------------------------------------------------- */
 SwContentOptPage::SwContentOptPage( Window* pParent,
                                       const SfxItemSet& rCoreSet ) :
-    SfxTabPage( pParent, SW_RES( TP_CONTENT_OPT ), rCoreSet ),
-    aLineFL       ( this,   SW_RES( FL_LINE     ) ),
-    aCrossCB      ( this,   SW_RES( CB_CROSS     ) ),
-
-    aWindowFL     ( this,   SW_RES( FL_WINDOW   ) ),
-    aHScrollBox   ( this,   SW_RES( CB_HSCROLL   ) ),
-    aVScrollBox   ( this,   SW_RES( CB_VSCROLL   ) ),
-    aAnyRulerCB   ( this,   SW_RES( CB_ANY_RULER ) ),
-    aHRulerCBox   ( this,   SW_RES( CB_HRULER   ) ),
-    aHMetric      ( this,   SW_RES( LB_HMETRIC    ) ),
-    aVRulerCBox   ( this,   SW_RES( CB_VRULER    ) ),
-    aVRulerRightCBox( this, SW_RES( CB_VRULER_RIGHT    ) ),
-    aVMetric      ( this,   SW_RES( LB_VMETRIC    ) ),
-    aSmoothCBox   ( this,   SW_RES( CB_SMOOTH_SCROLL    ) ),
-
-    aDispFL      ( this,   SW_RES( FL_DISP     ) ),
-    aGrfCB        ( this,   SW_RES( CB_GRF          ) ),
-    aTblCB        ( this,   SW_RES( CB_TBL      ) ),
-    aDrwCB        ( this,   SW_RES( CB_DRWFAST   ) ),
-    aFldNameCB    ( this,   SW_RES( CB_FIELD    ) ),
-    aPostItCB     ( this,   SW_RES( CB_POSTIT   ) ),
-
-    aSettingsFL   ( this,   SW_RES( FL_SETTINGS   ) ),
-    aMetricFT     ( this,   SW_RES( FT_METRIC   ) ),
-    aMetricLB     ( this,   SW_RES( LB_METRIC   ) )
+    SfxTabPage(pParent, "ViewOptionsPage",
+               "modules/swriter/ui/viewoptionspage.ui", rCoreSet)
 {
-    FreeResource();
+    get (m_pCrossCB, "helplines");
+
+    get (m_pHScrollBox, "hscrollbar");
+    get (m_pVScrollBox, "vscrollbar");
+    get (m_pAnyRulerCB, "ruler");
+    get (m_pHRulerCBox, "hruler");
+    get (m_pHMetric, "hrulercombobox");
+    get (m_pVRulerCBox, "vruler");
+    get (m_pVRulerRightCBox, "vrulerright");
+    get (m_pVMetric, "vrulercombobox");
+    get (m_pSmoothCBox, "smoothscroll");
+
+    get (m_pGrfCB, "graphics");
+    get (m_pTblCB, "tables");
+    get (m_pDrwCB, "drawings");
+    get (m_pFldNameCB, "fieldcodes");
+    get (m_pPostItCB, "comments");
+
+    get (m_pSettingsFrame, "settingsframe");
+    get (m_pSettingsLabel, "settingslabel");
+    get (m_pMetricLabel, "measureunitlabel");
+    get (m_pMetricLB, "measureunit");
+
+    /* This part is visible only with Writer/Web->View dialogue. */
     const SfxPoolItem* pItem;
-    if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_HTML_MODE, sal_False, &pItem )
-        && ((SfxUInt16Item*)pItem)->GetValue() & HTMLMODE_ON)
+    if (! (SFX_ITEM_SET == rCoreSet.GetItemState(SID_HTML_MODE, sal_False, &pItem )
+           && ((SfxUInt16Item*)pItem)->GetValue() & HTMLMODE_ON))
     {
-        aMetricLB.Show();
-        aSettingsFL.Show();
-        aMetricFT.Show();
+        m_pSettingsFrame->Hide();
+        m_pSettingsLabel->Hide();
+        m_pMetricLabel->Hide();
+        m_pMetricLB->Hide();
     }
+
     SvtCJKOptions aCJKOptions;
     if(aCJKOptions.IsVerticalTextEnabled() )
     {
-        Point aSmoothPos(aSmoothCBox.GetPosPixel());
-        aSmoothPos.Y() += aSmoothPos.Y() - aVRulerCBox.GetPosPixel().Y();
-        aSmoothCBox.SetPosPixel(aSmoothPos);
+        Point aSmoothPos(m_pSmoothCBox->GetPosPixel());
+        aSmoothPos.Y() += aSmoothPos.Y() - m_pVRulerCBox->GetPosPixel().Y();
+        m_pSmoothCBox->SetPosPixel(aSmoothPos);
     }
     else
-        aVRulerRightCBox.Hide();
-    aVRulerCBox.SetClickHdl(LINK(this, SwContentOptPage, VertRulerHdl ));
-    aAnyRulerCB.SetClickHdl(LINK(this, SwContentOptPage, AnyRulerHdl));
+        m_pVRulerRightCBox->Hide();
+    m_pVRulerCBox->SetClickHdl(LINK(this, SwContentOptPage, VertRulerHdl ));
+    m_pAnyRulerCB->SetClickHdl(LINK(this, SwContentOptPage, AnyRulerHdl));
 
     SvxStringArray aMetricArr( SW_RES( STR_ARR_METRIC ) );
     for ( sal_uInt16 i = 0; i < aMetricArr.Count(); ++i )
@@ -137,16 +143,16 @@
                 // there isn't 'line' unit in HTML format
                 if ( eFUnit != FUNIT_LINE )
                 {
-                   sal_uInt16 nPos = aMetricLB.InsertEntry( sMetric );
-                   aMetricLB.SetEntryData( nPos, (void*)(long)eFUnit );
-                   aHMetric.InsertEntry( sMetric );
-                   aHMetric.SetEntryData( nPos, (void*)(long)eFUnit );
+                   sal_uInt16 nPos = m_pMetricLB->InsertEntry( sMetric );
+                   m_pMetricLB->SetEntryData( nPos, (void*)(long)eFUnit );
+                   m_pHMetric->InsertEntry( sMetric );
+                   m_pHMetric->SetEntryData( nPos, (void*)(long)eFUnit );
                 }
                 // a vertical ruler has not the 'character' unit
                 if ( eFUnit != FUNIT_CHAR )
                 {
-                   sal_uInt16 nPos = aVMetric.InsertEntry( sMetric );
-                   aVMetric.SetEntryData( nPos, (void*)(long)eFUnit );
+                   sal_uInt16 nPos = m_pVMetric->InsertEntry( sMetric );
+                   m_pVMetric->SetEntryData( nPos, (void*)(long)eFUnit );
                 }
             }
             default:;//prevent warning
@@ -164,22 +170,22 @@
     return new SwContentOptPage(pParent, rAttrSet);
 }
 
-static void lcl_SelectMetricLB(ListBox& rMetric, sal_uInt16 nSID, const SfxItemSet& rSet)
+static void lcl_SelectMetricLB(ListBox* rMetric, sal_uInt16 nSID, const SfxItemSet& rSet)
 {
     const SfxPoolItem* pItem;
     if( rSet.GetItemState( nSID, sal_False, &pItem ) >= SFX_ITEM_AVAILABLE )
     {
         FieldUnit eFieldUnit = (FieldUnit)((SfxUInt16Item*)pItem)->GetValue();
-        for ( sal_uInt16 i = 0; i < rMetric.GetEntryCount(); ++i )
+        for ( sal_uInt16 i = 0; i < rMetric->GetEntryCount(); ++i )
         {
-            if ( (int)(sal_IntPtr)rMetric.GetEntryData( i ) == (int)eFieldUnit )
+            if ( (int)(sal_IntPtr)rMetric->GetEntryData( i ) == (int)eFieldUnit )
             {
-                rMetric.SelectEntryPos( i );
+                rMetric->SelectEntryPos( i );
                 break;
             }
         }
     }
-    rMetric.SaveValue();
+    rMetric->SaveValue();
 }
 
 void SwContentOptPage::Reset(const SfxItemSet& rSet)
@@ -190,25 +196,25 @@
                                     (const SfxPoolItem**)&pElemAttr );
     if(pElemAttr)
     {
-        aTblCB      .Check  (pElemAttr->bTable                );
-        aGrfCB.Check  (pElemAttr->bGraphic              );
-        aDrwCB      .Check  (pElemAttr->bDrawing              );
-        aFldNameCB  .Check  (pElemAttr->bFieldName            );
-        aPostItCB   .Check  (pElemAttr->bNotes                );
-        aCrossCB   .Check( pElemAttr->bCrosshair        );
-        aHScrollBox.Check( pElemAttr->bHorzScrollbar     );
-        aVScrollBox.Check( pElemAttr->bVertScrollbar     );
-        aAnyRulerCB.Check( pElemAttr->bAnyRuler );
-        aHRulerCBox.Check( pElemAttr->bHorzRuler         );
-        aVRulerCBox.Check( pElemAttr->bVertRuler         );
-        aVRulerRightCBox.Check(pElemAttr->bVertRulerRight);
-        aSmoothCBox.Check( pElemAttr->bSmoothScroll      );
+        m_pTblCB->Check (pElemAttr->bTable);
+        m_pGrfCB->Check (pElemAttr->bGraphic);
+        m_pDrwCB->Check (pElemAttr->bDrawing);
+        m_pFldNameCB->Check (pElemAttr->bFieldName);
+        m_pPostItCB->Check (pElemAttr->bNotes);
+        m_pCrossCB->Check (pElemAttr->bCrosshair);
+        m_pHScrollBox->Check (pElemAttr->bHorzScrollbar);
+        m_pVScrollBox->Check (pElemAttr->bVertScrollbar);
+        m_pAnyRulerCB->Check (pElemAttr->bAnyRuler);
+        m_pHRulerCBox->Check (pElemAttr->bHorzRuler);
+        m_pVRulerCBox->Check (pElemAttr->bVertRuler);
+        m_pVRulerRightCBox->Check (pElemAttr->bVertRulerRight);
+        m_pSmoothCBox->Check (pElemAttr->bSmoothScroll);
     }
-    aMetricLB.SetNoSelection();
-    lcl_SelectMetricLB(aMetricLB, SID_ATTR_METRIC, rSet);
-    lcl_SelectMetricLB(aHMetric, FN_HSCROLL_METRIC, rSet);
-    lcl_SelectMetricLB(aVMetric, FN_VSCROLL_METRIC, rSet);
-    AnyRulerHdl(&aAnyRulerCB);
+    m_pMetricLB->SetNoSelection();
+    lcl_SelectMetricLB(m_pMetricLB, SID_ATTR_METRIC, rSet);
+    lcl_SelectMetricLB(m_pHMetric, FN_HSCROLL_METRIC, rSet);
+    lcl_SelectMetricLB(m_pVMetric, FN_VSCROLL_METRIC, rSet);
+    AnyRulerHdl(m_pAnyRulerCB);
 }
 
 sal_Bool SwContentOptPage::FillItemSet(SfxItemSet& rSet)
@@ -219,47 +225,48 @@
     SwElemItem aElem;
     if(pOldAttr)
         aElem = *pOldAttr;
-    aElem.bTable                = aTblCB        .IsChecked();
-    aElem.bGraphic              = aGrfCB.IsChecked();
-    aElem.bDrawing              = aDrwCB        .IsChecked();
-    aElem.bFieldName            = aFldNameCB    .IsChecked();
-    aElem.bNotes                = aPostItCB     .IsChecked();
-    aElem.bCrosshair     = aCrossCB   .IsChecked();
-    aElem.bHorzScrollbar = aHScrollBox.IsChecked();
-    aElem.bVertScrollbar = aVScrollBox.IsChecked();
-    aElem.bAnyRuler = aAnyRulerCB.IsChecked();
-    aElem.bHorzRuler     = aHRulerCBox.IsChecked();
-    aElem.bVertRuler     = aVRulerCBox.IsChecked();
-    aElem.bVertRulerRight= aVRulerRightCBox.IsChecked();
-    aElem.bSmoothScroll  = aSmoothCBox.IsChecked();
+    aElem.bTable                = m_pTblCB->IsChecked();
+    aElem.bGraphic              = m_pGrfCB->IsChecked();
+    aElem.bDrawing              = m_pDrwCB->IsChecked();
+    aElem.bFieldName            = m_pFldNameCB->IsChecked();
+    aElem.bNotes                = m_pPostItCB->IsChecked();
+    aElem.bCrosshair            = m_pCrossCB->IsChecked();
+    aElem.bHorzScrollbar        = m_pHScrollBox->IsChecked();
+    aElem.bVertScrollbar        = m_pVScrollBox->IsChecked();
+    aElem.bAnyRuler             = m_pAnyRulerCB->IsChecked();
+    aElem.bHorzRuler            = m_pHRulerCBox->IsChecked();
+    aElem.bVertRuler            = m_pVRulerCBox->IsChecked();
+    aElem.bVertRulerRight       = m_pVRulerRightCBox->IsChecked();
+    aElem.bSmoothScroll         = m_pSmoothCBox->IsChecked();
 
 
     sal_Bool bRet = !pOldAttr || aElem != *pOldAttr;
     if(bRet)
         bRet = 0 != rSet.Put(aElem);
-    sal_uInt16 nMPos = aMetricLB.GetSelectEntryPos();
+
+    sal_uInt16 nMPos = m_pMetricLB->GetSelectEntryPos();
     sal_uInt16 nGlobalMetricPos = nMPos;
-    if ( nMPos != aMetricLB.GetSavedValue() )
+    if ( nMPos != m_pMetricLB->GetSavedValue() )
     {
         // Double-Cast for VA3.0
-        sal_uInt16 nFieldUnit = (sal_uInt16)(long)aMetricLB.GetEntryData( nMPos );
+        sal_uInt16 nFieldUnit = (sal_uInt16)(long)m_pMetricLB->GetEntryData( nMPos );
         rSet.Put( SfxUInt16Item( SID_ATTR_METRIC, (sal_uInt16)nFieldUnit ) );
         bRet = sal_True;
     }
 
-    nMPos = aHMetric.GetSelectEntryPos();
-    if ( nMPos != aHMetric.GetSavedValue() || nMPos != nGlobalMetricPos )
+    nMPos = m_pHMetric->GetSelectEntryPos();
+    if ( nMPos != m_pHMetric->GetSavedValue() || nMPos != nGlobalMetricPos )
     {
         // Double-Cast for VA3.0
-        sal_uInt16 nFieldUnit = (sal_uInt16)(long)aHMetric.GetEntryData( nMPos );
+        sal_uInt16 nFieldUnit = (sal_uInt16)(long)m_pHMetric->GetEntryData( nMPos );
         rSet.Put( SfxUInt16Item( FN_HSCROLL_METRIC, (sal_uInt16)nFieldUnit ) );
         bRet = sal_True;
     }
-    nMPos = aVMetric.GetSelectEntryPos();
-    if ( nMPos != aVMetric.GetSavedValue() || nMPos != nGlobalMetricPos )
+    nMPos = m_pVMetric->GetSelectEntryPos();
+    if ( nMPos != m_pVMetric->GetSavedValue() || nMPos != nGlobalMetricPos )
     {
         // Double-Cast for VA3.0
-        sal_uInt16 nFieldUnit = (sal_uInt16)(long)aVMetric.GetEntryData( nMPos );
+        sal_uInt16 nFieldUnit = (sal_uInt16)(long)m_pVMetric->GetEntryData( nMPos );
         rSet.Put( SfxUInt16Item( FN_VSCROLL_METRIC, (sal_uInt16)nFieldUnit ) );
         bRet = sal_True;
     }
@@ -268,18 +275,18 @@
 
 IMPL_LINK(SwContentOptPage, VertRulerHdl, CheckBox*, pBox)
 {
-    aVRulerRightCBox.Enable(pBox->IsEnabled() && pBox->IsChecked());
+    m_pVRulerRightCBox->Enable(pBox->IsEnabled() && pBox->IsChecked());
     return 0;
 }
 
 IMPL_LINK( SwContentOptPage, AnyRulerHdl, CheckBox*, pBox)
 {
     sal_Bool bChecked = pBox->IsChecked();
-    aHRulerCBox      .Enable(bChecked);
-    aHMetric         .Enable(bChecked);
-    aVRulerCBox      .Enable(bChecked);
-    aVMetric         .Enable(bChecked);
-    VertRulerHdl(&aVRulerCBox);
+    m_pHRulerCBox->Enable(bChecked);
+    m_pHMetric->Enable(bChecked);
+    m_pVRulerCBox->Enable(bChecked);
+    m_pVMetric->Enable(bChecked);
+    VertRulerHdl(m_pVRulerCBox);
     return 0;
 }
 /*------------------------------------------------------
diff --git a/sw/source/ui/inc/optpage.hxx b/sw/source/ui/inc/optpage.hxx
index 88ea2a9..e61c847 100644
--- a/sw/source/ui/inc/optpage.hxx
+++ b/sw/source/ui/inc/optpage.hxx
@@ -37,35 +37,34 @@
 class SwWrtShell;
 class FontList;
 
+/*--------------------------------------------------------
+ Tools->Options->Writer->View
+ Tools->Options->Writer/Web->View
+--------------------------------------------------------- */
 class SwContentOptPage : public SfxTabPage
 {
-    //visual aids
-    FixedLine   aLineFL;
-    CheckBox    aCrossCB;
+    CheckBox*   m_pCrossCB;
 
-    //view
-    FixedLine   aWindowFL;
-    CheckBox    aHScrollBox;
-    CheckBox    aVScrollBox;
-    CheckBox    aAnyRulerCB;
-    CheckBox    aHRulerCBox;
-    ListBox     aHMetric;
-    CheckBox    aVRulerCBox;
-    CheckBox    aVRulerRightCBox;
-    ListBox     aVMetric;
-    CheckBox    aSmoothCBox;
+    CheckBox*   m_pHScrollBox;
+    CheckBox*   m_pVScrollBox;
+    CheckBox*   m_pAnyRulerCB;
+    CheckBox*   m_pHRulerCBox;
+    ListBox*    m_pHMetric;
+    CheckBox*   m_pVRulerCBox;
+    CheckBox*   m_pVRulerRightCBox;
+    ListBox*    m_pVMetric;
+    CheckBox*   m_pSmoothCBox;
 
-    //display
-    FixedLine   aDispFL;
-    CheckBox    aGrfCB;
-    CheckBox    aTblCB;
-    CheckBox    aDrwCB;
-    CheckBox    aFldNameCB;
-    CheckBox    aPostItCB;
+    CheckBox*   m_pGrfCB;
+    CheckBox*   m_pTblCB;
+    CheckBox*   m_pDrwCB;
+    CheckBox*   m_pFldNameCB;
+    CheckBox*   m_pPostItCB;
 
-    FixedLine   aSettingsFL;
-    FixedText   aMetricFT;
-    ListBox     aMetricLB;
+    VclFrame*   m_pSettingsFrame;
+    FixedText*  m_pSettingsLabel;
+    FixedText*  m_pMetricLabel;
+    ListBox*    m_pMetricLB;
 
     DECL_LINK(VertRulerHdl, CheckBox*);
     DECL_LINK(AnyRulerHdl, CheckBox*);
diff --git a/sw/uiconfig/swriter/ui/viewoptionspage.ui b/sw/uiconfig/swriter/ui/viewoptionspage.ui
new file mode 100644
index 0000000..2283271
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/viewoptionspage.ui
@@ -0,0 +1,482 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkBox" id="ViewOptionsPage">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="orientation">vertical</property>
+    <property name="spacing">12</property>
+    <child>
+      <object class="GtkGrid" id="grid2">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="row_spacing">6</property>
+        <property name="column_spacing">6</property>
+        <property name="column_homogeneous">True</property>
+        <child>
+          <object class="GtkBox" id="box1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
+            <child>
+              <object class="GtkFrame" id="guidesframe">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label_xalign">0</property>
+                <property name="shadow_type">none</property>
+                <child>
+                  <object class="GtkAlignment" id="alignment1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="top_padding">6</property>
+                    <property name="left_padding">12</property>
+                    <child>
+                      <object class="GtkGrid" id="grid1">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <child>
+                          <object class="GtkCheckButton" id="helplines">
+                            <property name="label" translatable="yes">Helplines While Moving</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</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>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="guideslabel">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Guides</property>
+                    <attributes>
+                      <attribute name="weight" value="bold"/>
+                    </attributes>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkFrame" id="displayframe">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label_xalign">0</property>
+                <property name="shadow_type">none</property>
+                <child>
+                  <object class="GtkAlignment" id="alignment2">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="top_padding">6</property>
+                    <property name="left_padding">12</property>
+                    <child>
+                      <object class="GtkGrid" id="grid3">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <child>
+                          <object class="GtkCheckButton" id="graphics">
+                            <property name="label" translatable="yes">Graphics and objects</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</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="tables">
+                            <property name="label" translatable="yes">Tables</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</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="drawings">
+                            <property name="label" translatable="yes">Drawings and controls</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</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>
+                        <child>
+                          <object class="GtkCheckButton" id="fieldcodes">
+                            <property name="label" translatable="yes">Field codes</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="xalign">0</property>
+                            <property name="draw_indicator">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">0</property>
+                            <property name="top_attach">3</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkCheckButton" id="comments">
+                            <property name="label" translatable="yes">Comments</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="xalign">0</property>
+                            <property name="draw_indicator">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">0</property>
+                            <property name="top_attach">4</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="displaylabel">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Display</property>
+                    <attributes>
+                      <attribute name="weight" value="bold"/>
+                    </attributes>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </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>
+        <child>
+          <object class="GtkBox" id="box2">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
+            <child>
+              <object class="GtkFrame" id="viewframe">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label_xalign">0</property>
+                <property name="shadow_type">none</property>
+                <child>
+                  <object class="GtkAlignment" id="alignment3">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="top_padding">6</property>
+                    <property name="left_padding">12</property>
+                    <child>
+                      <object class="GtkGrid" id="grid4">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <child>
+                          <object class="GtkCheckButton" id="hscrollbar">
+                            <property name="label" translatable="yes">Horizontal scrollbar</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</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="vscrollbar">
+                            <property name="label" translatable="yes">Vertical scrollbar</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</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="ruler">
+                            <property name="label" translatable="yes">Ruler</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</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>
+                        <child>
+                          <object class="GtkBox" id="box3">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="margin_left">18</property>
+                            <property name="homogeneous">True</property>
+                            <child>
+                              <object class="GtkCheckButton" id="hruler">
+                                <property name="label" translatable="yes">Horizontal ruler</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="xalign">0</property>
+                                <property name="draw_indicator">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkComboBox" id="hrulercombobox">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="left_attach">0</property>
+                            <property name="top_attach">3</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkBox" id="box4">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="margin_left">18</property>
+                            <property name="homogeneous">True</property>
+                            <child>
+                              <object class="GtkCheckButton" id="vruler">
+                                <property name="label" translatable="yes">Vertical ruler</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="xalign">0</property>
+                                <property name="draw_indicator">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkComboBox" id="vrulercombobox">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="left_attach">0</property>
+                            <property name="top_attach">4</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkCheckButton" id="vrulerright">
+                            <property name="label" translatable="yes">Right-aligned</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="margin_left">36</property>
+                            <property name="xalign">0</property>
+                            <property name="draw_indicator">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">0</property>
+                            <property name="top_attach">5</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkCheckButton" id="smoothscroll">
+                            <property name="label" translatable="yes">Smooth scroll</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="xalign">0</property>
+                            <property name="draw_indicator">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">0</property>
+                            <property name="top_attach">6</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
+                          </packing>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="label3">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">View</property>
+                    <attributes>
+                      <attribute name="weight" value="bold"/>
+                    </attributes>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkFrame" id="settingsframe">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label_xalign">0</property>
+                <property name="shadow_type">none</property>
+                <child>
+                  <object class="GtkAlignment" id="alignment4">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="top_padding">6</property>
+                    <property name="left_padding">12</property>
+                    <child>
+                      <object class="GtkGrid" id="grid5">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="column_spacing">10</property>
+                        <child>
+                          <object class="GtkComboBox" id="measureunit">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</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>
+                        <child>
+                          <object class="GtkLabel" id="measureunitlabel">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">Measurement unit</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>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="settingslabel">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Settings</property>
+                    <attributes>
+                      <attribute name="weight" value="bold"/>
+                    </attributes>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </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>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+        <property name="position">0</property>
+      </packing>
+    </child>
+  </object>
+</interface>

-- 
To view, visit https://gerrit.libreoffice.org/3325
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifa11da48867303dbecd2ef104f2c0842aaeb5d72
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Pavel Kačer <pkacer at suse.com>



More information about the LibreOffice mailing list