[Libreoffice-commits] core.git: 3 commits - formula/source include/formula reportdesign/inc svx/source

Caolán McNamara caolanm at redhat.com
Tue Jul 8 12:50:11 PDT 2014


 formula/source/ui/dlg/formdlgs.src |  165 -------------------------------------
 formula/source/ui/dlg/formula.cxx  |   24 +----
 formula/source/ui/inc/ForResId.hrc |    3 
 include/formula/formula.hxx        |    2 
 reportdesign/inc/helpids.hrc       |    4 
 svx/source/svdraw/svdfmtf.cxx      |   33 ++++---
 svx/source/svdraw/svdfmtf.hxx      |    5 -
 7 files changed, 31 insertions(+), 205 deletions(-)

New commits:
commit 005ed48e70114e1f7edee76ca514049895df27bd
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jul 8 16:44:10 2014 +0100

    drop unused helpids
    
    Change-Id: I43c8e1327731796498c6da42179ff085c26279b9

diff --git a/reportdesign/inc/helpids.hrc b/reportdesign/inc/helpids.hrc
index 69a581a..3abc428 100644
--- a/reportdesign/inc/helpids.hrc
+++ b/reportdesign/inc/helpids.hrc
@@ -41,10 +41,6 @@
 #define HID_RPT_SORTORDER                             "REPORTDESIGN_HID_RPT_SORTORDER"
 #define HID_RPT_GROUPSBRW                             "REPORTDESIGN_HID_RPT_GROUPSBRW"
 #define HID_RPT_GROUPSSORTING_DLG                     "REPORTDESIGN_HID_RPT_GROUPSSORTING_DLG"
-#define HID_RPT_CONDFORMAT_DLG                        "REPORTDESIGN_HID_RPT_CONDFORMAT_DLG"
-#define HID_RPT_CONDFORMAT_TB                         "REPORTDESIGN_HID_RPT_CONDFORMAT_TB"
-#define HID_RPT_CRTL_FORMAT_PREVIEW                   "REPORTDESIGN_HID_RPT_CRTL_FORMAT_PREVIEW"
-#define HID_RPT_COND_DLG                              "REPORTDESIGN_HID_RPT_COND_DLG"
 #define HID_RPT_POPUP_COLOR_CTRL                      "REPORTDESIGN_HID_RPT_POPUP_COLOR_CTRL"
 #define HID_RPT_POPUP_COLOR                           "REPORTDESIGN_HID_RPT_POPUP_COLOR"
 #define HID_RPT_FIELD_SEL                             "REPORTDESIGN_HID_RPT_FIELD_SEL"
commit a86d511c1f4e0f006697edfcfaff1821c524afdf
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jul 8 16:32:21 2014 +0100

    trivial conversion of RID_FORMULADLG_FORMULA_MODAL to .ui
    
    Change-Id: I25f29821079cf4fa4759daffe78bec8c4b48abbc

diff --git a/formula/source/ui/dlg/formdlgs.src b/formula/source/ui/dlg/formdlgs.src
index 91bee16..ee99d15 100644
--- a/formula/source/ui/dlg/formdlgs.src
+++ b/formula/source/ui/dlg/formdlgs.src
@@ -57,171 +57,6 @@ String STR_STRUCT_ERR2
     Text [ en-US ] = "Error" ;
 };
 
-ModalDialog RID_FORMULADLG_FORMULA_MODAL
-{
-    SVLook = TRUE ;
-    Size = MAP_APPFONT ( 321 , 228 ) ;
-    Moveable = TRUE ;
-    TabControl TC_FUNCTION
-    {
-        HelpID = "formula:TabControl:RID_FORMULADLG_FORMULA_MODAL:TC_FUNCTION";
-        Pos = MAP_APPFONT ( 6 , 5 ) ;
-        Size = MAP_APPFONT ( 102 , 199 ) ;
-        PageList =
-        {
-            PageItem
-            {
-                Identifier = TP_FUNCTION ;
-                Text [ en-US ] = "Functions" ;
-            };
-            PageItem
-            {
-                Identifier = TP_STRUCT ;
-                Text [ en-US ] = "Structure" ;
-            };
-        };
-    };
-    FixedText FT_HEADLINE
-    {
-        Pos = MAP_APPFONT ( 115 , 24 ) ;
-        Size = MAP_APPFONT ( 194 , 8 ) ;
-        WordBreak = TRUE ;
-    };
-    FixedText FT_FUNCNAME
-    {
-        Pos = MAP_APPFONT ( 115 , 38 ) ;
-        Size = MAP_APPFONT ( 194 , 24 ) ;
-        WordBreak = TRUE ;
-    };
-    FixedText FT_FUNCDESC
-    {
-        Pos = MAP_APPFONT ( 115 , 68 ) ;
-        Size = MAP_APPFONT ( 194 , 64 ) ;
-        WordBreak = TRUE ;
-    };
-    FixedText FT_EDITNAME
-    {
-        Pos = MAP_APPFONT ( 113 , 6 ) ;
-        Size = MAP_APPFONT ( 83 , 10 ) ;
-    };
-    GroupBox GB_EDIT
-    {
-        Pos = MAP_APPFONT ( 112 , 18 ) ;
-        Size = MAP_APPFONT ( 203 , 128 ) ;
-    };
-    FixedText FT_FORMULA
-    {
-        Pos = MAP_APPFONT ( 112 , 151 ) ;
-        Size = MAP_APPFONT ( 50 , 10 ) ;
-        WordBreak = TRUE ;
-        Text [ en-US ] = "For~mula" ;
-    };
-    Control ED_FORMULA
-    {
-        Border = TRUE ;
-        Pos = MAP_APPFONT ( 112 , 161 ) ;
-        Size = MAP_APPFONT ( 203 , 43 ) ;
-    };
-    FixedText FT_RESULT
-    {
-        Pos = MAP_APPFONT ( 198 , 6 ) ;
-        Size = MAP_APPFONT ( 55 , 10 ) ;
-        Right = TRUE ;
-        Text [ en-US ] = "Function result" ;
-    };
-    FixedText WND_RESULT
-    {
-        Border = TRUE ;
-        Pos = MAP_APPFONT ( 255 , 4 ) ;
-        Size = MAP_APPFONT ( 60 , 12 ) ;
-        Text [ en-US ] = "Function result" ;
-    };
-    FixedText FT_FORMULA_RESULT
-    {
-        Pos = MAP_APPFONT ( 217 , 149 ) ;
-        Size = MAP_APPFONT ( 35 , 10 ) ;
-        Text [ en-US ] = "Result" ;
-        Right = TRUE ;
-    };
-    Window WND_FORMULA_RESULT
-    {
-        Border = TRUE ;
-        Pos = MAP_APPFONT ( 255 , 147 ) ;
-        Size = MAP_APPFONT ( 60 , 12 ) ;
-    };
-    CheckBox BTN_MATRIX
-    {
-        HelpID = "formula:CheckBox:RID_FORMULADLG_FORMULA_MODAL:BTN_MATRIX";
-        Pos = MAP_APPFONT ( 6 , 208 ) ;
-        Size = MAP_APPFONT ( 50 , 10 ) ;
-        TabStop = TRUE ;
-        Text [ en-US ] = "Array" ;
-    };
-    Edit ED_REF
-    {
-        HelpID = "formula:Edit:RID_FORMULADLG_FORMULA_MODAL:ED_REF";
-        Border = TRUE ;
-        Pos = MAP_APPFONT ( 76 , 205 ) ;
-        Size = MAP_APPFONT ( 66 , 12 ) ;
-    };
-    ImageButton RB_REF
-    {
-        HelpID = "formula:ImageButton:RID_FORMULADLG_FORMULA_MODAL:RB_REF";
-        Pos = MAP_APPFONT ( 144 , 205 ) ;
-        Size = MAP_APPFONT ( 13 , 15 ) ;
-        TabStop = FALSE ;
-        QuickHelpText [ en-US ] = "Maximize" ;
-    };
-    HelpButton BTN_HELP
-    {
-        Pos = MAP_APPFONT ( 72 , 208 ) ;
-        Size = MAP_APPFONT ( 45 , 14 ) ;
-        TabStop = TRUE ;
-    };
-    CancelButton BTN_CANCEL
-    {
-        Pos = MAP_APPFONT ( 121 , 208 ) ;
-        Size = MAP_APPFONT ( 45 , 14 ) ;
-        TabStop = TRUE ;
-    };
-    PushButton BTN_BACKWARD
-    {
-        HelpID = "formula:PushButton:RID_FORMULADLG_FORMULA_MODAL:BTN_BACKWARD";
-        Pos = MAP_APPFONT ( 171 , 208 ) ;
-        Size = MAP_APPFONT ( 45 , 14 ) ;
-        TabStop = TRUE ;
-        Text [ en-US ] = "<< ~Back" ;
-    };
-    PushButton BTN_FORWARD
-    {
-        HelpID = "formula:PushButton:RID_FORMULADLG_FORMULA_MODAL:BTN_FORWARD";
-        Pos = MAP_APPFONT ( 219 , 208 ) ;
-        Size = MAP_APPFONT ( 45 , 14 ) ;
-        TabStop = TRUE ;
-        Text [ en-US ] = "~Next >>" ;
-    };
-    OKButton BTN_END
-    {
-        Pos = MAP_APPFONT ( 270 , 208 ) ;
-        Size = MAP_APPFONT ( 45 , 14 ) ;
-        TabStop = TRUE ;
-        DefButton = TRUE ;
-    };
-    String STR_TITLE1
-    {
-        Text [ en-US ] = "Function Wizard" ;
-    };
-    String STR_TITLE2
-    {
-        Text [ en-US ] = "Function Wizard  -" ;
-    };
-    String STR_END
-    {
-        Text [ en-US ] = "~End" ;
-    };
-
-};
-
 String STR_TITLE1
 {
     Text [ en-US ] = "Function Wizard" ;
diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx
index 9f923ba..b4fc563 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -1641,38 +1641,29 @@ void FormulaDlg_Impl::SetEdSelection()
     } // if( pEd )
 }
 
-
 FormulaModalDialog::FormulaModalDialog( Window* pParent
                                             , bool _bSupportFunctionResult
                                             , bool _bSupportResult
                                             , bool _bSupportMatrix
                                             , IFunctionManager* _pFunctionMgr
-                                            , IControlReferenceHandler* _pDlg ) :
-        ModalDialog( pParent, ModuleRes(RID_FORMULADLG_FORMULA_MODAL) ),
-        m_pImpl( new FormulaDlg_Impl(this,_bSupportFunctionResult
-                                            , _bSupportResult
-                                            , _bSupportMatrix
-                                            ,this,_pFunctionMgr,_pDlg))
+                                            , IControlReferenceHandler* _pDlg )
+    : ModalDialog(pParent, "FormulaDialog", "formula/ui/formuladialog.ui")
+    , m_pImpl(new FormulaDlg_Impl(this,_bSupportFunctionResult,
+        _bSupportResult, _bSupportMatrix, this, _pFunctionMgr, _pDlg))
 {
-    FreeResource();
     SetText(m_pImpl->aTitle1);
 }
-FormulaModalDialog::~FormulaModalDialog()
-{
-}
 
 void FormulaModalDialog::Update(const OUString& _sExp)
 {
     m_pImpl->Update(_sExp);
 }
 
-
 void FormulaModalDialog::SetMeText(const OUString& _sText)
 {
     m_pImpl->SetMeText(_sText);
 }
 
-
 bool FormulaModalDialog::CheckMatrix(OUString& aFormula)
 {
     return m_pImpl->CheckMatrix(aFormula);
@@ -1682,10 +1673,12 @@ void FormulaModalDialog::Update()
 {
     m_pImpl->Update();
 }
+
 ::std::pair<RefButton*,RefEdit*> FormulaModalDialog::RefInputStartBefore( RefEdit* pEdit, RefButton* pButton )
 {
     return m_pImpl->RefInputStartBefore( pEdit, pButton );
 }
+
 void FormulaModalDialog::RefInputStartAfter( RefEdit* pEdit, RefButton* pButton )
 {
     m_pImpl->RefInputStartAfter( pEdit, pButton );
@@ -1745,10 +1738,6 @@ FormulaDlg::FormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
     SetText(m_pImpl->aTitle1);
 }
 
-FormulaDlg::~FormulaDlg()
-{
-}
-
 void FormulaDlg::Update(const OUString& _sExp)
 {
     m_pImpl->Update(_sExp);
@@ -1760,7 +1749,6 @@ void FormulaDlg::SetMeText(const OUString& _sText)
     m_pImpl->SetMeText(_sText);
 }
 
-
 FormulaDlgMode FormulaDlg::SetMeText(const OUString& _sText, sal_Int32 PrivStart, sal_Int32 PrivEnd, bool bMatrix, bool _bSelect, bool _bUpdate)
 {
     return m_pImpl->SetMeText(_sText,PrivStart, PrivEnd,bMatrix,_bSelect,_bUpdate);
diff --git a/formula/source/ui/inc/ForResId.hrc b/formula/source/ui/inc/ForResId.hrc
index 2ac1f70..3109a8d 100644
--- a/formula/source/ui/inc/ForResId.hrc
+++ b/formula/source/ui/inc/ForResId.hrc
@@ -59,9 +59,6 @@
 #define BMP_STR_ERROR                               (RID_BITMAP_START + 6)
 #define BMP_FX                                      (RID_BITMAP_START + 7)
 
-// pages
-#define RID_FORMULADLG_FORMULA_MODAL                (RID_PAGE_START + 4)
-
 #endif          // FORMULA_FORRESID_HRC
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/formula/formula.hxx b/include/formula/formula.hxx
index 62f22d1..28ecc1e 100644
--- a/include/formula/formula.hxx
+++ b/include/formula/formula.hxx
@@ -56,7 +56,6 @@ public:
                                             , bool _bSupportMatrix
                                             ,IFunctionManager* _pFunctionMgr
                                             ,IControlReferenceHandler* _pDlg = NULL );
-                    virtual ~FormulaModalDialog();
 private:
     SAL_WNODEPRECATED_DECLARATIONS_PUSH
     ::std::auto_ptr<FormulaDlg_Impl> m_pImpl;
@@ -96,7 +95,6 @@ public:
                                     , bool _bSupportMatrix
                                     , IFunctionManager* _pFunctionMgr
                                     , IControlReferenceHandler* _pDlg = NULL );
-                    virtual ~FormulaDlg();
 private:
     SAL_WNODEPRECATED_DECLARATIONS_PUSH
     ::std::auto_ptr<FormulaDlg_Impl> m_pImpl;
commit 25deea83f38804504b7b275a201d47e4e243f8fc
Author: Armin Le Grand <alg at apache.org>
Date:   Mon Jul 7 15:19:08 2014 +0000

    Resolves: #i125211# corrected breaking metafiles with gradient actions
    
    (cherry picked from commit 87637364387e5fd87d3b880ce230caa053ec555d)
    
    Conflicts:
    	svx/source/svdraw/svdfmtf.cxx
    
    Change-Id: I853f3499121c8708a7de9d04ff2856037061c6ed

diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx
index 070acad..ef3874a 100644
--- a/svx/source/svdraw/svdfmtf.cxx
+++ b/svx/source/svdraw/svdfmtf.cxx
@@ -172,7 +172,10 @@ void ImpSdrGDIMetaFileImport::DoLoopActions(GDIMetaFile& rMtf, SvdProgressInfo*
             case META_PUSH_ACTION           : DoAction((MetaPushAction           &)*pAct); break;
             case META_POP_ACTION            : DoAction((MetaPopAction            &)*pAct); break;
             case META_HATCH_ACTION          : DoAction((MetaHatchAction          &)*pAct); break;
-            case META_COMMENT_ACTION        : DoAction((MetaCommentAction        &)*pAct, &rMtf); break;
+
+            // #i125211# MetaCommentAction may change index, thus hand it over
+            case META_COMMENT_ACTION        : DoAction((MetaCommentAction&)*pAct, rMtf, a);
+                break;
 
             // missing actions added
             case META_TEXTRECT_ACTION       : DoAction((MetaTextRectAction&)*pAct); break;
@@ -1144,7 +1147,8 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaHatchAction& rAct )
         {
             const Hatch& rHatch = rAct.GetHatch();
             SdrPathObj* pPath = new SdrPathObj(OBJ_POLY, aSource);
-            SfxItemSet aHatchAttr(mpModel->GetItemPool(), XATTR_FILLSTYLE, XATTR_FILLSTYLE, XATTR_FILLHATCH, XATTR_FILLHATCH, 0, 0);
+            // #i125211# Use the ranges from the SdrObject to create a new empty SfxItemSet
+            SfxItemSet aHatchAttr(mpModel->GetItemPool(), pPath->GetMergedItemSet().GetRanges());
             XHatchStyle eStyle;
 
             switch(rHatch.GetStyle())
@@ -1215,13 +1219,14 @@ void ImpSdrGDIMetaFileImport::MapScaling()
 
 
 
-void ImpSdrGDIMetaFileImport::DoAction( MetaCommentAction& rAct, GDIMetaFile* pMtf )
+void ImpSdrGDIMetaFileImport::DoAction( MetaCommentAction& rAct, GDIMetaFile& rMtf, sal_uLong& a) // GDIMetaFile* pMtf )
 {
     bool aSkipComment = false;
 
-    if (rAct.GetComment().equalsIgnoreAsciiCase("XGRAD_SEQ_BEGIN"))
+    if (a < rMtf.GetActionSize() && rAct.GetComment().equalsIgnoreAsciiCase("XGRAD_SEQ_BEGIN"))
     {
-        MetaGradientExAction* pAct = (MetaGradientExAction*) pMtf->NextAction();
+        // #i125211# Check if next action is a MetaGradientExAction
+        MetaGradientExAction* pAct = dynamic_cast< MetaGradientExAction* >(rMtf.GetAction(a + 1));
 
         if( pAct && pAct->GetType() == META_GRADIENTEX_ACTION )
         {
@@ -1234,7 +1239,8 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaCommentAction& rAct, GDIMetaFile* pM
                 {
                     const Gradient& rGrad = pAct->GetGradient();
                     SdrPathObj* pPath = new SdrPathObj(OBJ_POLY, aSource);
-                    SfxItemSet aGradAttr(mpModel->GetItemPool(), XATTR_FILLSTYLE, XATTR_FILLSTYLE, XATTR_FILLGRADIENT, XATTR_FILLGRADIENT, 0, 0);
+                    // #i125211# Use the ranges from the SdrObject to create a new empty SfxItemSet
+                    SfxItemSet aGradAttr(mpModel->GetItemPool(), pPath->GetMergedItemSet().GetRanges());
                     XGradient aXGradient;
 
                     aXGradient.SetGradientStyle((XGradientStyle)rGrad.GetStyle());
@@ -1272,13 +1278,14 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaCommentAction& rAct, GDIMetaFile* pM
 
     if(aSkipComment)
     {
-        MetaAction* pSkipAct = pMtf->NextAction();
+        // #i125211# forward until closing MetaCommentAction
+        MetaAction* pSkipAct = rMtf.GetAction(++a);
 
         while( pSkipAct
             && ((pSkipAct->GetType() != META_COMMENT_ACTION )
                 || !(((MetaCommentAction*)pSkipAct)->GetComment().equalsIgnoreAsciiCase("XGRAD_SEQ_END"))))
         {
-            pSkipAct = pMtf->NextAction();
+            pSkipAct = rMtf.GetAction(++a);
         }
     }
 }
@@ -1407,7 +1414,8 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaGradientAction& rAct)
                 floor(aRange.getMinY()),
                 ceil(aRange.getMaxX()),
                 ceil(aRange.getMaxY())));
-        SfxItemSet aGradientAttr(mpModel->GetItemPool(), XATTR_FILLSTYLE, XATTR_FILLSTYLE, XATTR_FILLGRADIENT, XATTR_FILLGRADIENT, 0, 0);
+        // #i125211# Use the ranges from the SdrObject to create a new empty SfxItemSet
+        SfxItemSet aGradientAttr(mpModel->GetItemPool(), pRect->GetMergedItemSet().GetRanges());
         const XGradientStyle aXGradientStyle(getXGradientStyleFromGradientStyle(rGradient.GetStyle()));
         const XFillGradientItem aXFillGradientItem(
             XGradient(
@@ -1423,7 +1431,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaGradientAction& rAct)
                 rGradient.GetSteps()));
 
         SetAttributes(pRect);
-        aGradientAttr.Put(XFillStyleItem(XFILL_HATCH));
+        aGradientAttr.Put(XFillStyleItem(XFILL_GRADIENT)); // #i125211#
         aGradientAttr.Put(aXFillGradientItem);
         pRect->SetMergedItemSet(aGradientAttr);
 
@@ -1476,7 +1484,8 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaGradientExAction& rAct)
         {
             const Gradient& rGradient = rAct.GetGradient();
             SdrPathObj* pPath = new SdrPathObj(OBJ_POLY, aSource);
-            SfxItemSet aGradientAttr(mpModel->GetItemPool(), XATTR_FILLSTYLE, XATTR_FILLSTYLE, XATTR_FILLGRADIENT, XATTR_FILLGRADIENT, 0, 0);
+            // #i125211# Use the ranges from the SdrObject to create a new empty SfxItemSet
+            SfxItemSet aGradientAttr(mpModel->GetItemPool(), pPath->GetMergedItemSet().GetRanges());
             const XGradientStyle aXGradientStyle(getXGradientStyleFromGradientStyle(rGradient.GetStyle()));
             const XFillGradientItem aXFillGradientItem(
                 XGradient(
@@ -1492,7 +1501,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaGradientExAction& rAct)
                     rGradient.GetSteps()));
 
             SetAttributes(pPath);
-            aGradientAttr.Put(XFillStyleItem(XFILL_HATCH));
+            aGradientAttr.Put(XFillStyleItem(XFILL_GRADIENT)); // #i125211#
             aGradientAttr.Put(aXFillGradientItem);
             pPath->SetMergedItemSet(aGradientAttr);
 
diff --git a/svx/source/svdraw/svdfmtf.hxx b/svx/source/svdraw/svdfmtf.hxx
index 40d8737..7333394 100644
--- a/svx/source/svdraw/svdfmtf.hxx
+++ b/svx/source/svdraw/svdfmtf.hxx
@@ -119,7 +119,10 @@ protected:
     void DoAction(MetaMoveClipRegionAction  & rAct) { rAct.Execute(&maVD); checkClip(); }
     void DoAction(MetaISectRectClipRegionAction& rAct) { rAct.Execute(&maVD); checkClip(); }
     void DoAction(MetaISectRegionClipRegionAction& rAct) { rAct.Execute(&maVD); checkClip(); }
-    void DoAction(MetaCommentAction& rAct, GDIMetaFile* pMtf);
+
+    // #i125211# The MetaCommentAction needs to advance (if used), thus
+    // give current metafile and index which may be changed
+    void DoAction(MetaCommentAction& rAct, GDIMetaFile& rMtf, sal_uLong& a);
 
     // missing actions added
     void DoAction(MetaTextRectAction& rAct);


More information about the Libreoffice-commits mailing list