sw/inc/view.hxx                    |    1 
 sw/inc/viewsh.hxx                  |    5 ----
 sw/source/core/view/viewsh.cxx     |    2 -
 sw/source/core/view/vnew.cxx       |    3 --
 sw/source/ui/config/optpage.cxx    |   42 ++-----------------------------------
 sw/source/uibase/docvw/srcedtw.cxx |   10 --------
 sw/source/uibase/inc/optpage.hxx   |    4 ---
 sw/source/uibase/uiview/view.cxx   |    2 -
 8 files changed, 4 insertions(+), 65 deletions(-)

New commits:
commit 65d2d2647ead42e5bbb7800f14c047f383fe450b
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Nov 8 16:10:51 2018 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Nov 9 12:26:44 2018 +0100

    loplugin:singlevalfields in sw
    
    Change-Id: Icdb155f9fa7ae79fc193c2da436d9500e7be4d29
    Reviewed-on: https://gerrit.libreoffice.org/63126
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index b5c29997fd22..fe33f94e6dd9 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -197,7 +197,6 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
 
     VclPtr<SvxRuler>    m_pHRuler,
                         m_pVRuler;
-    VclPtr<ImageButton> m_pTogglePageBtn;
 
     std::unique_ptr<SwGlossaryHdl> m_pGlosHdl;          // handle text block
     std::unique_ptr<SwDrawBase>    m_pDrawActual;
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index fe904ffcd36e..bf09c8118590 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -113,11 +113,6 @@ class SW_DLLPUBLIC SwViewShell : public 
sw::Ring<SwViewShell>
 
     VclPtr<vcl::Window>   mpWin;     ///< = 0 during printing or pdf export
     VclPtr<OutputDevice>  mpOut;     ///< Window, Printer, VirtDev, ...
-    VclPtr<OutputDevice>  mpTmpRef;  // Temporary reference device. Is used
-                                     // during (printer depending) prospect
-                                     // and page preview printing
-                                     // (because a scaling has to be set at
-                                     // the original printer)
 
     std::unique_ptr<SwViewOption> mpOpt;
     std::unique_ptr<SwAccessibilityOptions> mpAccOptions;
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 31f7c64712fb..273692a86aa7 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -2089,8 +2089,6 @@ OutputDevice& SwViewShell::GetRefDev() const
           GetViewOptions()->getBrowseMode() &&
          !GetViewOptions()->IsPrtFormat() )
         pTmpOut = GetWin();
-    else if ( mpTmpRef )
-        pTmpOut = mpTmpRef;
     else
         pTmpOut = GetDoc()->getIDocumentDeviceAccess().getReferenceDevice( 
true );
 
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index bef6f80521eb..2dd39f081668 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -151,7 +151,6 @@ SwViewShell::SwViewShell( SwDoc& rDocument, vcl::Window 
*pWindow,
     mpOut( pOutput ? pOutput
                   : pWindow ? static_cast<OutputDevice*>(pWindow)
                             : 
static_cast<OutputDevice*>(rDocument.getIDocumentDeviceAccess().getPrinter( 
true ))),
-    mpTmpRef( nullptr ),
     mpAccOptions( new SwAccessibilityOptions ),
     mbShowHeaderSeparator( false ),
     mbShowFooterSeparator( false ),
@@ -222,7 +221,6 @@ SwViewShell::SwViewShell( SwViewShell& rShell, vcl::Window 
*pWindow,
     mpOut( pOutput ? pOutput
                   : pWindow ? static_cast<OutputDevice*>(pWindow)
                             : 
static_cast<OutputDevice*>(rShell.GetDoc()->getIDocumentDeviceAccess().getPrinter(
 true ))),
-    mpTmpRef( nullptr ),
     mpAccOptions( new SwAccessibilityOptions ),
     mbShowHeaderSeparator( false ),
     mbShowFooterSeparator( false ),
@@ -356,7 +354,6 @@ SwViewShell::~SwViewShell()
         }
     }
 
-    mpTmpRef.disposeAndClear();
     mpAccOptions.reset();
 }
 
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 02eb3015af0b..b6b02eb1c928 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -534,11 +534,8 @@ SwStdFontTabPage::SwStdFontTabPage( vcl::Window* pParent,
     m_bSetIdxDefault(true),
 
     m_bListHeightDefault    (false),
-    m_bSetListHeightDefault (false),
     m_bLabelHeightDefault   (false),
-    m_bSetLabelHeightDefault(false),
     m_bIndexHeightDefault     (false),
-    m_bSetIndexHeightDefault  (false),
 
     m_nFontGroup(FONT_GROUP_DEFAULT),
 
@@ -576,13 +573,6 @@ SwStdFontTabPage::SwStdFontTabPage( vcl::Window* pParent,
     m_pListBox    ->SetLoseFocusHdl( aFocusLink );
     m_pLabelBox   ->SetLoseFocusHdl( aFocusLink );
     m_pIdxBox     ->SetLoseFocusHdl( aFocusLink );
-
-    Link<Edit&,void> aModifyHeightLink( LINK( this, SwStdFontTabPage, 
ModifyHeightHdl));
-    m_pStandardHeightLB->SetModifyHdl( aModifyHeightLink );
-    m_pTitleHeightLB->   SetModifyHdl( aModifyHeightLink );
-    m_pListHeightLB->    SetModifyHdl( aModifyHeightLink );
-    m_pLabelHeightLB->   SetModifyHdl( aModifyHeightLink );
-    m_pIndexHeightLB->   SetModifyHdl( aModifyHeightLink );
 }
 
 SwStdFontTabPage::~SwStdFontTabPage()
@@ -648,9 +638,9 @@ bool SwStdFontTabPage::FillItemSet( SfxItemSet* )
 
     bool bStandardHeightChanged = 
m_pStandardHeightLB->IsValueChangedFromSaved();
     bool bTitleHeightChanged = m_pTitleHeightLB->IsValueChangedFromSaved();
-    bool bListHeightChanged = m_pListHeightLB->IsValueChangedFromSaved() && 
(!m_bListHeightDefault || !m_bSetListHeightDefault );
-    bool bLabelHeightChanged = m_pLabelHeightLB->IsValueChangedFromSaved() && 
(!m_bLabelHeightDefault || !m_bSetLabelHeightDefault );
-    bool bIndexHeightChanged = m_pIndexHeightLB->IsValueChangedFromSaved() && 
(!m_bIndexHeightDefault || !m_bSetIndexHeightDefault );
+    bool bListHeightChanged = m_pListHeightLB->IsValueChangedFromSaved() && 
!m_bListHeightDefault;
+    bool bLabelHeightChanged = m_pLabelHeightLB->IsValueChangedFromSaved() && 
!m_bLabelHeightDefault;
+    bool bIndexHeightChanged = m_pIndexHeightLB->IsValueChangedFromSaved() && 
!m_bIndexHeightDefault;
 
     m_pFontConfig->SetFontStandard(sStandard, m_nFontGroup);
     m_pFontConfig->SetFontOutline(sTitle, m_nFontGroup);
@@ -1006,32 +996,6 @@ IMPL_LINK( SwStdFontTabPage, ModifyHdl, Edit&, rBox, void 
)
     }
 }
 
-IMPL_LINK( SwStdFontTabPage, ModifyHeightHdl, Edit&, rBox, void )
-{
-    if(&rBox == m_pStandardHeightLB)
-    {
-        sal_Int64 nValue = 
static_cast<FontSizeBox&>(rBox).GetValue(FieldUnit::TWIP);
-        if(m_bSetListHeightDefault && m_bListHeightDefault)
-            m_pListHeightLB->SetValue(nValue, FieldUnit::TWIP);
-        if(m_bSetLabelHeightDefault && m_bLabelHeightDefault)
-            m_pLabelHeightLB->SetValue(nValue, FieldUnit::TWIP);
-        if(m_bSetIndexHeightDefault && m_bIndexHeightDefault)
-            m_pIndexHeightLB->SetValue(nValue, FieldUnit::TWIP);
-    }
-    else if(&rBox == m_pListHeightLB)
-    {
-        m_bSetListHeightDefault = false;
-    }
-    else if(&rBox == m_pLabelHeightLB)
-    {
-        m_bSetLabelHeightDefault = false;
-    }
-    else if(&rBox == m_pIndexHeightLB)
-    {
-        m_bSetIndexHeightDefault = false;
-    }
-}
-
 IMPL_LINK( SwStdFontTabPage, LoseFocusHdl, Control&, rControl, void )
 {
     ComboBox* pBox = static_cast<ComboBox*>(&rControl);
diff --git a/sw/source/uibase/docvw/srcedtw.cxx 
b/sw/source/uibase/docvw/srcedtw.cxx
index 288bcd774716..f8f825abd129 100644
--- a/sw/source/uibase/docvw/srcedtw.cxx
+++ b/sw/source/uibase/docvw/srcedtw.cxx
@@ -52,7 +52,6 @@ namespace
 
 struct TextPortion
 {
-    sal_uInt16 nLine;
     sal_uInt16 nStart, nEnd;
     svtools::ColorConfigEntry eType;
 };
@@ -91,7 +90,6 @@ static void lcl_Highlight(const OUString& rSource, 
TextPortions& aPortionList)
             // insert 'empty' portion
             if(nPortEnd < nActPos - 1 )
             {
-                aText.nLine = 0;
                 // don't move at the beginning
                 aText.nStart = nPortEnd;
                 if(nInsert)
@@ -185,7 +183,6 @@ static void lcl_Highlight(const OUString& rSource, 
TextPortions& aPortionList)
                 if(bFound ||(eFoundType == svtools::HTMLCOMMENT))
                 {
                     TextPortion aTextPortion;
-                    aTextPortion.nLine = 0;
                     aTextPortion.nStart = nPortStart + 1;
                     aTextPortion.nEnd = nPortEnd;
                     aTextPortion.eType = eFoundType;
@@ -199,7 +196,6 @@ static void lcl_Highlight(const OUString& rSource, 
TextPortions& aPortionList)
     }
     if(nInsert && nPortEnd < nActPos - 1)
     {
-        aText.nLine = 0;
         aText.nStart = nPortEnd + 1;
         aText.nEnd = nActPos - 1;
         aText.eType = svtools::HTMLUNKNOWN;
@@ -694,9 +690,6 @@ void SwSrcEditWindow::ImpDoHighlight( const OUString& 
rSource, sal_uInt16 nLineO
         for ( size_t i = 0; i < nCount; i++ )
         {
             TextPortion& r = aPortionList[i];
-            SAL_WARN_IF(
-                r.nLine != aPortionList[0].nLine, "sw.level2",
-                "multiple lines after all?");
             if ( r.nStart > r.nEnd )    // only until Bug from MD is resolved
                 continue;
 
@@ -722,8 +715,7 @@ void SwSrcEditWindow::ImpDoHighlight( const OUString& 
rSource, sal_uInt16 nLineO
             r.eType != svtools::HTMLUNKNOWN)
                 r.eType = svtools::HTMLUNKNOWN;
         Color aColor(SW_MOD()->GetColorConfig().GetColorValue(r.eType).nColor);
-        sal_uInt16 nLine = nLineOff+r.nLine;
-        m_pTextEngine->SetAttrib( TextAttribFontColor( aColor ), nLine, 
r.nStart, r.nEnd+1 );
+        m_pTextEngine->SetAttrib( TextAttribFontColor( aColor ), nLineOff, 
r.nStart, r.nEnd+1 );
     }
 }
 
diff --git a/sw/source/uibase/inc/optpage.hxx b/sw/source/uibase/inc/optpage.hxx
index f86d5ca0a47d..801230d09bc1 100644
--- a/sw/source/uibase/inc/optpage.hxx
+++ b/sw/source/uibase/inc/optpage.hxx
@@ -157,11 +157,8 @@ class SwStdFontTabPage : public SfxTabPage
     bool    m_bSetIdxDefault  :1;
 
     bool    m_bListHeightDefault    :1;
-    bool    m_bSetListHeightDefault :1;
     bool    m_bLabelHeightDefault   :1;
-    bool    m_bSetLabelHeightDefault :1;
     bool    m_bIndexHeightDefault     :1;
-    bool    m_bSetIndexHeightDefault  :1;
 
     sal_uInt8 m_nFontGroup; //fontcfg.hxx: FONT_GROUP_[STANDARD|CJK|CTL]
 
@@ -171,7 +168,6 @@ class SwStdFontTabPage : public SfxTabPage
 
     DECL_LINK(StandardHdl, Button*, void );
     DECL_LINK(ModifyHdl, Edit&, void );
-    DECL_LINK(ModifyHeightHdl, Edit&, void );
     DECL_LINK(LoseFocusHdl, Control&, void );
 
     SwStdFontTabPage(vcl::Window* pParent, const SfxItemSet& rSet);
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index 0138ba9242e7..39b1cb7081b3 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -729,7 +729,6 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh 
)
                                 SvxRulerSupportFlags::BORDERS | 
SvxRulerSupportFlags::REDUCED_METRIC,
                             GetViewFrame()->GetBindings(),
                             WB_VSCROLL |  WB_EXTRAFIELD | WB_BORDER )),
-    m_pTogglePageBtn(nullptr),
     m_pLastTableFormat(nullptr),
     m_pFormatClipboard(new SwFormatClipboard()),
     m_nSelectionType( SelectionType::All ),
@@ -1094,7 +1093,6 @@ SwView::~SwView()
     m_pVScrollbar.disposeAndClear();
     m_pHRuler.disposeAndClear();
     m_pVRuler.disposeAndClear();
-    m_pTogglePageBtn.disposeAndClear();
     m_pGlosHdl.reset();
     m_pViewImpl.reset();
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to