[Libreoffice-commits] core.git: cui/source include/sfx2 sfx2/source sw/source

Oliver Specht oliver.specht at cib.de
Fri Sep 11 04:13:48 PDT 2015


 cui/source/inc/border.hxx        |    1 
 cui/source/inc/chardlg.hxx       |    3 ++
 cui/source/inc/cuitabarea.hxx    |    2 +
 cui/source/inc/paragrph.hxx      |    4 +++
 cui/source/tabpages/border.cxx   |    7 +++++
 cui/source/tabpages/chardlg.cxx  |   34 +++++++++++++++++++++------
 cui/source/tabpages/paragrph.cxx |   48 +++++++++++++++++++++++++++++++++------
 cui/source/tabpages/tparea.cxx   |   31 ++++++++++++++++++++++---
 include/sfx2/tabdlg.hxx          |    1 
 sfx2/source/dialog/tabdlg.cxx    |   15 +++++++++++-
 sw/source/ui/chrdlg/numpara.cxx  |   12 ++++++++-
 sw/source/uibase/inc/numpara.hxx |    1 
 12 files changed, 139 insertions(+), 20 deletions(-)

New commits:
commit a212ef2b6ebadb22a9abf6d042aa2b5fd9ac1cf0
Author: Oliver Specht <oliver.specht at cib.de>
Date:   Thu Sep 10 11:01:26 2015 +0200

    tdf#93901: apply handling in style/edit dialog improved
    
    introduced SfxTabPage::ChangesApplied() to enable resetting values
    to their initial state while editing styles
    
    Change-Id: I60fd68d8464e12e795b0e0d2f2e53882a225c181
    Reviewed-on: https://gerrit.libreoffice.org/18467
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/cui/source/inc/border.hxx b/cui/source/inc/border.hxx
index 23d107b..f6d8abe 100644
--- a/cui/source/inc/border.hxx
+++ b/cui/source/inc/border.hxx
@@ -54,6 +54,7 @@ public:
 
     virtual bool        FillItemSet( SfxItemSet* rCoreAttrs ) SAL_OVERRIDE;
     virtual void        Reset( const SfxItemSet* ) SAL_OVERRIDE;
+    virtual void        ChangesApplied() SAL_OVERRIDE;
 
     void                HideShadowControls();
     virtual void        PageCreated(const SfxAllItemSet& aSet) SAL_OVERRIDE;
diff --git a/cui/source/inc/chardlg.hxx b/cui/source/inc/chardlg.hxx
index 42cc172..4d5506e 100644
--- a/cui/source/inc/chardlg.hxx
+++ b/cui/source/inc/chardlg.hxx
@@ -151,6 +151,7 @@ public:
 
     virtual void        Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
     virtual bool        FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
+    virtual void        ChangesApplied() SAL_OVERRIDE;
 
     void                SetFontList( const SvxFontListItem& rItem );
     void                EnableRelativeMode();
@@ -233,6 +234,7 @@ public:
 
     virtual void        Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
     virtual bool        FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
+    virtual void        ChangesApplied() SAL_OVERRIDE;
 
     void                DisableControls( sal_uInt16 nDisable );
     void                EnableFlash();
@@ -316,6 +318,7 @@ public:
 
     virtual void        Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
     virtual bool        FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
+    virtual void        ChangesApplied() SAL_OVERRIDE;
     virtual void        FillUserData() SAL_OVERRIDE;
     ///                  the writer uses SID_ATTR_BRUSH as font background
     void                SetPreviewBackgroundToCharacter();
diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index f3b003d..29dbd03 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -163,6 +163,7 @@ public:
 
     virtual bool FillItemSet(SfxItemSet*) SAL_OVERRIDE;
     virtual void Reset(const SfxItemSet*) SAL_OVERRIDE;
+    virtual void ChangesApplied() SAL_OVERRIDE;
     virtual void ActivatePage(const SfxItemSet& rSet) SAL_OVERRIDE;
     virtual sfxpg DeactivatePage(SfxItemSet* pSet) SAL_OVERRIDE;
     virtual void PointChanged(vcl::Window* pWindow, RECT_POINT eRP) SAL_OVERRIDE;
@@ -296,6 +297,7 @@ public:
 
     virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
     virtual void Reset( const SfxItemSet * ) SAL_OVERRIDE;
+    virtual void ChangesApplied() SAL_OVERRIDE;
     virtual void ActivatePage( const SfxItemSet& rSet ) SAL_OVERRIDE;
     virtual sfxpg DeactivatePage( SfxItemSet* pSet ) SAL_OVERRIDE;
     virtual void PointChanged( vcl::Window* pWindow, RECT_POINT eRP ) SAL_OVERRIDE;
diff --git a/cui/source/inc/paragrph.hxx b/cui/source/inc/paragrph.hxx
index ee5c1dd..12e23f4 100644
--- a/cui/source/inc/paragrph.hxx
+++ b/cui/source/inc/paragrph.hxx
@@ -109,6 +109,7 @@ public:
 
     virtual bool            FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
     virtual void            Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
+    virtual void            ChangesApplied() SAL_OVERRIDE;
 
 
     void                    SetPageWidth( sal_uInt16 nPageWidth );
@@ -172,6 +173,7 @@ public:
 
     virtual bool            FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
     virtual void            Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
+    virtual void            ChangesApplied() SAL_OVERRIDE;
 
     void                    EnableJustifyExt();
     virtual void            PageCreated(const SfxAllItemSet& aSet) SAL_OVERRIDE;
@@ -207,6 +209,7 @@ public:
 
     virtual bool        FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
     virtual void        Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
+    virtual void        ChangesApplied() SAL_OVERRIDE;
 
     void                DisablePageBreak();
 
@@ -288,6 +291,7 @@ public:
 
     virtual bool        FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
     virtual void        Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
+    virtual void        ChangesApplied() SAL_OVERRIDE;
 
 };
 
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index 8a6839d..b79bdac 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -599,6 +599,13 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet )
     m_pSynchronizeCB->Check(mbSync);
 }
 
+void SvxBorderTabPage::ChangesApplied()
+{
+    m_pLeftMF->SaveValue();
+    m_pRightMF->SaveValue();
+    m_pTopMF->SaveValue();
+    m_pBottomMF->SaveValue();
+}
 
 
 SfxTabPage::sfxpg SvxBorderTabPage::DeactivatePage( SfxItemSet* _pSet )
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 3e7c56e..6a3cdfe 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -879,8 +879,6 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp
     pLangBox->SaveValueLBB();
 }
 
-
-
 bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp )
 {
     bool bModified = false;
@@ -1234,8 +1232,21 @@ void SvxCharNamePage::Reset( const SfxItemSet* rSet )
     SetPrevFontWidthScale( *rSet );
     UpdatePreview_Impl();
 }
-
-
+void  SvxCharNamePage::ChangesApplied()
+{
+    m_pWestFontNameLB->SaveValue();
+    m_pWestFontStyleLB->SaveValue();
+    m_pWestFontSizeLB->SaveValue();
+    m_pWestFontLanguageLB->SaveValueLBB();
+    m_pEastFontNameLB->SaveValue();
+    m_pEastFontStyleLB->SaveValue();
+    m_pEastFontSizeLB->SaveValue();
+    m_pEastFontLanguageLB->SaveValueLBB();
+    m_pCTLFontNameLB->SaveValue();
+    m_pCTLFontStyleLB->SaveValue();
+    m_pCTLFontSizeLB->SaveValue();
+    m_pCTLFontLanguageLB->SaveValueLBB();
+}
 
 bool SvxCharNamePage::FillItemSet( SfxItemSet* rSet )
 {
@@ -2216,6 +2227,11 @@ void SvxCharEffectsPage::Reset( const SfxItemSet* rSet )
     m_pPreviewWin->Invalidate();
 
     // save this settings
+    ChangesApplied();
+}
+
+void  SvxCharEffectsPage::ChangesApplied()
+{
     m_pUnderlineLB->SaveValue();
     m_pUnderlineColorLB->SaveValue();
     m_pOverlineLB->SaveValue();
@@ -2231,8 +2247,8 @@ void SvxCharEffectsPage::Reset( const SfxItemSet* rSet )
     m_pBlinkingBtn->SaveValue();
     m_pHiddenBtn->SaveValue();
     m_pFontColorLB->SaveValue();
-}
 
+}
 
 
 bool SvxCharEffectsPage::FillItemSet( SfxItemSet* rSet )
@@ -3200,10 +3216,15 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet )
                                         SID_ATTR_CHAR_WIDTH_FIT_TO_LINE ) ))
             m_pFitToLineCB->Hide();
     }
+    ChangesApplied();
+}
 
+void SvxCharPositionPage::ChangesApplied()
+{
     m_pHighPosBtn->SaveValue();
     m_pNormalPosBtn->SaveValue();
     m_pLowPosBtn->SaveValue();
+    m_pHighLowRB->SaveValue();
     m_p0degRB->SaveValue();
     m_p90degRB->SaveValue();
     m_p270degRB->SaveValue();
@@ -3215,7 +3236,6 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet )
 }
 
 
-
 bool SvxCharPositionPage::FillItemSet( SfxItemSet* rSet )
 {
     //  Position (high, normal or low)
@@ -3555,8 +3575,6 @@ void SvxCharTwoLinesPage::Reset( const SfxItemSet* rSet )
     SetPrevFontWidthScale( *rSet );
 }
 
-
-
 bool SvxCharTwoLinesPage::FillItemSet( SfxItemSet* rSet )
 {
     const SfxItemSet& rOldSet = GetItemSet();
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index 1c19ea8..9571163 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -586,6 +586,20 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet* rSet )
     m_pContextualCB->SaveValue();
     m_pLineDist->SaveValue();
 }
+void SvxStdParagraphTabPage::ChangesApplied()
+{
+    m_pLeftIndent->SetValue(m_pLeftIndent->GetValue());
+    m_pRightIndent->SetValue(m_pRightIndent->GetValue());
+    m_pFLineIndent->SetValue(m_pFLineIndent->GetValue());
+    m_pLineDist->SaveValue();
+    m_pLineDistAtPercentBox->SaveValue();
+    m_pLineDistAtMetricBox->SaveValue();
+    m_pRegisterCB->SaveValue();
+    m_pTopDist->SetValue(m_pTopDist->GetValue());
+    m_pBottomDist->SetValue(m_pBottomDist->GetValue());
+    m_pContextualCB->SaveValue();
+    m_pAutoCB->SaveValue();
+}
 
 void SvxStdParagraphTabPage::EnableRelativeMode()
 {
@@ -1164,7 +1178,6 @@ bool SvxParaAlignTabPage::FillItemSet( SfxItemSet* rOutSet )
 
     return bModified;
 }
-
 void SvxParaAlignTabPage::Reset( const SfxItemSet* rSet )
 {
     sal_uInt16 _nWhich = GetWhich( SID_ATTR_PARA_ADJUST );
@@ -1261,6 +1274,18 @@ void SvxParaAlignTabPage::Reset( const SfxItemSet* rSet )
 
     UpdateExample_Impl();
 }
+void SvxParaAlignTabPage::ChangesApplied()
+{
+    m_pTextDirectionLB->SaveValue();
+    m_pSnapToGridCB->SaveValue();
+    m_pVertAlignLB->SaveValue();
+    m_pLeft->SaveValue();
+    m_pRight->SaveValue();
+    m_pCenter->SaveValue();
+    m_pJustify->SaveValue();
+    m_pLastLineLB->SaveValue();
+    m_pExpandCB->SaveValue();
+}
 
 IMPL_LINK_NOARG_TYPED(SvxParaAlignTabPage, AlignHdl_Impl, Button*, void)
 {
@@ -1548,7 +1573,6 @@ bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
 
     return bModified;
 }
-
 void SvxExtParagraphTabPage::Reset( const SfxItemSet* rSet )
 {
     sal_uInt16 _nWhich = GetWhich( SID_ATTR_PARA_HYPHENZONE );
@@ -1810,11 +1834,14 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* rSet )
     KeepTogetherHdl_Impl( 0 );
     WidowHdl_Impl( 0 );
     OrphanHdl_Impl( 0 );
-
+    ChangesApplied();
+}
+void SvxExtParagraphTabPage::ChangesApplied()
+{
     m_pHyphenBox->SaveValue();
-    m_pExtHyphenBeforeBox->SaveValue();
-    m_pExtHyphenAfterBox->SaveValue();
-    m_pMaxHyphenEdit->SaveValue();
+    m_pExtHyphenBeforeBox->SetValue(m_pExtHyphenBeforeBox->GetValue());
+    m_pExtHyphenAfterBox->SetValue(m_pExtHyphenAfterBox->GetValue());
+    m_pMaxHyphenEdit->SetValue(m_pMaxHyphenEdit->GetValue());
     m_pPageBreakBox->SaveValue();
     m_pBreakPositionLB->SaveValue();
     m_pBreakTypeLB->SaveValue();
@@ -1825,6 +1852,8 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* rSet )
     m_pKeepParaBox->SaveValue();
     m_pWidowBox->SaveValue();
     m_pOrphanBox->SaveValue();
+    m_pOrphanRowNo->SetValue(m_pOrphanRowNo->GetValue());
+    m_pWidowRowNo->SetValue(m_pWidowRowNo->GetValue());
 }
 
 SfxTabPage::sfxpg SvxExtParagraphTabPage::DeactivatePage( SfxItemSet* _pSet )
@@ -2251,7 +2280,12 @@ void SvxAsianTabPage::Reset( const SfxItemSet* rSet )
     //character distance not yet available
     lcl_SetBox(*rSet, SID_ATTR_PARA_SCRIPTSPACE, *m_pScriptSpaceCB );
 }
-
+void SvxAsianTabPage::ChangesApplied()
+{
+    m_pForbiddenRulesCB->SaveValue();
+    m_pHangingPunctCB->SaveValue();
+    m_pScriptSpaceCB->SaveValue();
+}
 IMPL_STATIC_LINK_TYPED( SvxAsianTabPage, ClickHdl_Impl, Button*, pBox, void )
 {
     static_cast<CheckBox*>(pBox)->EnableTriState( false );
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index 96b8fa4..288fc2f 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -461,6 +461,13 @@ void SvxTransparenceTabPage::Reset(const SfxItemSet* rAttrs)
     }
 
     // save values
+    ChangesApplied();
+    bool bActive = InitPreview ( *rAttrs );
+    InvalidatePreview ( bActive );
+}
+
+void SvxTransparenceTabPage::ChangesApplied()
+{
     m_pMtrTransparent->SaveValue();
     m_pLbTrgrGradientType->SaveValue();
     m_pMtrTrgrCenterX->SaveValue();
@@ -469,9 +476,6 @@ void SvxTransparenceTabPage::Reset(const SfxItemSet* rAttrs)
     m_pMtrTrgrBorder->SaveValue();
     m_pMtrTrgrStartValue->SaveValue();
     m_pMtrTrgrEndValue->SaveValue();
-
-    bool bActive = InitPreview ( *rAttrs );
-    InvalidatePreview ( bActive );
 }
 
 void SvxTransparenceTabPage::ActivatePage(const SfxItemSet& rSet)
@@ -1815,6 +1819,27 @@ void SvxAreaTabPage::Reset( const SfxItemSet* rAttrs )
     m_pMtrFldYOffset->SaveValue();
 }
 
+void SvxAreaTabPage::ChangesApplied()
+{
+    m_pMtrFldXSize->SaveValue();
+    m_pMtrFldYSize->SaveValue();
+    m_pTypeLB->SaveValue();
+    m_pLbColor->SaveValue();
+    m_pLbGradient->SaveValue();
+    m_pLbHatching->SaveValue();
+    m_pLbHatchBckgrdColor->SaveValue();
+    m_pLbBitmap->SaveValue();
+    m_pTsbStepCount->SaveValue();
+    m_pNumFldStepCount->SaveValue();
+    m_pTsbTile->SaveValue();
+    m_pTsbStretch->SaveValue();
+    m_pTsbScale->SaveValue();
+    m_pRbtRow->SaveValue();
+    m_pRbtColumn->SaveValue();
+    m_pMtrFldOffset->SaveValue();
+    m_pMtrFldXOffset->SaveValue();
+    m_pMtrFldYOffset->SaveValue();
+}
 
 
 VclPtr<SfxTabPage> SvxAreaTabPage::Create( vcl::Window* pWindow,
diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx
index 603b1bd..728cbf8 100644
--- a/include/sfx2/tabdlg.hxx
+++ b/include/sfx2/tabdlg.hxx
@@ -264,6 +264,7 @@ public:
     virtual void            FillUserData();
     virtual bool            IsReadOnly() const;
     virtual void PageCreated (const SfxAllItemSet& aSet);
+    virtual void ChangesApplied();
     static const SfxPoolItem* GetItem( const SfxItemSet& rSet, sal_uInt16 nSlot, bool bDeep = true );
 
     void SetFrame(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame);
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 26a97b6..9879325 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -296,7 +296,9 @@ void SfxTabPage::PageCreated( const SfxAllItemSet& /*aSet*/ )
     DBG_ASSERT(false, "SfxTabPage::PageCreated should not be called");
 }
 
-
+void SfxTabPage::ChangesApplied()
+{
+}
 
 void SfxTabPage::AddItemConnection( sfx::ItemConnectionBase* pConnection )
 {
@@ -924,7 +926,18 @@ bool SfxTabDialog::Apply()
 {
     bool bApplied = false;
     if (PrepareLeaveCurrentPage())
+    {
          bApplied = (Ok() == RET_OK);
+         //let the pages update their saved values
+         GetInputSetImpl()->Put(*GetOutputItemSet());
+         sal_uInt16 pageCount = m_pTabCtrl->GetPageCount();
+         for (sal_uInt16 pageIdx = 0; pageIdx < pageCount; ++pageIdx)
+         {
+             SfxTabPage* pPage = dynamic_cast<SfxTabPage*> (m_pTabCtrl->GetTabPage(m_pTabCtrl->GetPageId(pageIdx)));
+             if (pPage)
+                pPage->ChangesApplied();
+         }
+    }
     return bApplied;
 }
 
diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx
index 41c68a4..70d7ae6 100644
--- a/sw/source/ui/chrdlg/numpara.cxx
+++ b/sw/source/ui/chrdlg/numpara.cxx
@@ -185,7 +185,17 @@ bool SwParagraphNumTabPage::FillItemSet( SfxItemSet* rSet )
     return bModified;
 }
 
-void    SwParagraphNumTabPage::Reset( const SfxItemSet* rSet )
+void SwParagraphNumTabPage::ChangesApplied()
+{
+    m_pOutlineLvLB->SaveValue();
+    m_pNumberStyleLB->SaveValue();
+    m_pNewStartCB->SaveValue();
+    m_pNewStartNumberCB->SaveValue();
+    m_pCountParaCB->SaveValue();
+    m_pRestartParaCountCB->SaveValue();
+    m_pRestartNF->SaveValue();
+}
+void    SwParagraphNumTabPage::Reset(const SfxItemSet* rSet)
 {
     bool bHasNumberStyle = false;
 
diff --git a/sw/source/uibase/inc/numpara.hxx b/sw/source/uibase/inc/numpara.hxx
index ed3630c..c80a3b4 100644
--- a/sw/source/uibase/inc/numpara.hxx
+++ b/sw/source/uibase/inc/numpara.hxx
@@ -77,6 +77,7 @@ public:
 
     virtual bool        FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
     virtual void        Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
+    virtual void        ChangesApplied() SAL_OVERRIDE;
 
     void                EnableNewStart();
     void                DisableOutline();


More information about the Libreoffice-commits mailing list