[Libreoffice-commits] core.git: 2 commits - icon-themes/crystal icon-themes/galaxy icon-themes/hicontrast icon-themes/human icon-themes/oxygen officecfg/registry sw/inc sw/Library_swui.mk sw/sdi sw/source writerfilter/source

Zolnai Tamás tamas.zolnai at collabora.com
Wed Feb 26 23:34:03 PST 2014


 icon-themes/crystal/cmd/lc_borderdialog.png                         |binary
 icon-themes/crystal/cmd/sc_borderdialog.png                         |binary
 icon-themes/galaxy/cmd/lc_borderdialog.png                          |binary
 icon-themes/galaxy/cmd/sc_borderdialog.png                          |binary
 icon-themes/hicontrast/cmd/lc_borderdialog.png                      |binary
 icon-themes/hicontrast/cmd/sc_borderdialog.png                      |binary
 icon-themes/human/cmd/lc_borderdialog.png                           |binary
 icon-themes/human/cmd/sc_borderdialog.png                           |binary
 icon-themes/oxygen/cmd/lc_borderdialog.png                          |binary
 icon-themes/oxygen/cmd/sc_borderdialog.png                          |binary
 officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu |    8 +
 sw/Library_swui.mk                                                  |    1 
 sw/inc/cmdid.h                                                      |    1 
 sw/inc/dialog.hrc                                                   |    1 
 sw/inc/swabstdlg.hxx                                                |    1 
 sw/sdi/_basesh.sdi                                                  |    6 
 sw/sdi/swriter.sdi                                                  |   25 +++
 sw/source/ui/dialog/swdlgfact.cxx                                   |   18 ++
 sw/source/ui/dialog/swdlgfact.hxx                                   |    1 
 sw/source/ui/frmdlg/frmui.src                                       |    4 
 sw/source/ui/frmdlg/uiborder.cxx                                    |   58 ++++++++
 sw/source/ui/inc/frmui.hrc                                          |    1 
 sw/source/ui/inc/uiborder.hxx                                       |   41 ++++++
 sw/source/ui/shells/basesh.cxx                                      |   67 ++++++++++
 writerfilter/source/dmapper/ConversionHelper.cxx                    |   14 --
 writerfilter/source/dmapper/ConversionHelper.hxx                    |    1 
 writerfilter/source/dmapper/DomainMapper.cxx                        |    3 
 27 files changed, 234 insertions(+), 17 deletions(-)

New commits:
commit f73ffb91b85422067274fafc0d411aef8a6e6abb
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date:   Thu Feb 27 08:32:54 2014 +0100

    fdo#73159 Make back border dialog work again
    
    I removed border dialog with commit
    8560fb88c7252e5ad60674e447f2e194298f08de
    because it seems unused and when the corresponding
    command was called only a blank window was opened.
    It seems it was just bugous, so revert this commit
    and fix the dialog.
    
    Conflicts:
    	sw/inc/swabstdlg.hxx
    	sw/source/ui/dialog/swdlgfact.cxx
    	sw/source/ui/dialog/swdlgfact.hxx
    
    Change-Id: I68f8c13457e899a894f03bdd60ebedfb2b70afea

diff --git a/icon-themes/crystal/cmd/lc_borderdialog.png b/icon-themes/crystal/cmd/lc_borderdialog.png
new file mode 100644
index 0000000..c0ca4f6
Binary files /dev/null and b/icon-themes/crystal/cmd/lc_borderdialog.png differ
diff --git a/icon-themes/crystal/cmd/sc_borderdialog.png b/icon-themes/crystal/cmd/sc_borderdialog.png
new file mode 100644
index 0000000..6b6ab48
Binary files /dev/null and b/icon-themes/crystal/cmd/sc_borderdialog.png differ
diff --git a/icon-themes/galaxy/cmd/lc_borderdialog.png b/icon-themes/galaxy/cmd/lc_borderdialog.png
new file mode 100644
index 0000000..0cd8935
Binary files /dev/null and b/icon-themes/galaxy/cmd/lc_borderdialog.png differ
diff --git a/icon-themes/galaxy/cmd/sc_borderdialog.png b/icon-themes/galaxy/cmd/sc_borderdialog.png
new file mode 100644
index 0000000..c8b915b
Binary files /dev/null and b/icon-themes/galaxy/cmd/sc_borderdialog.png differ
diff --git a/icon-themes/hicontrast/cmd/lc_borderdialog.png b/icon-themes/hicontrast/cmd/lc_borderdialog.png
new file mode 100644
index 0000000..a61a1a6
Binary files /dev/null and b/icon-themes/hicontrast/cmd/lc_borderdialog.png differ
diff --git a/icon-themes/hicontrast/cmd/sc_borderdialog.png b/icon-themes/hicontrast/cmd/sc_borderdialog.png
new file mode 100644
index 0000000..6c65b36
Binary files /dev/null and b/icon-themes/hicontrast/cmd/sc_borderdialog.png differ
diff --git a/icon-themes/human/cmd/lc_borderdialog.png b/icon-themes/human/cmd/lc_borderdialog.png
new file mode 100644
index 0000000..323a8df
Binary files /dev/null and b/icon-themes/human/cmd/lc_borderdialog.png differ
diff --git a/icon-themes/human/cmd/sc_borderdialog.png b/icon-themes/human/cmd/sc_borderdialog.png
new file mode 100644
index 0000000..d71ad45
Binary files /dev/null and b/icon-themes/human/cmd/sc_borderdialog.png differ
diff --git a/icon-themes/oxygen/cmd/lc_borderdialog.png b/icon-themes/oxygen/cmd/lc_borderdialog.png
new file mode 100644
index 0000000..c0ca4f6
Binary files /dev/null and b/icon-themes/oxygen/cmd/lc_borderdialog.png differ
diff --git a/icon-themes/oxygen/cmd/sc_borderdialog.png b/icon-themes/oxygen/cmd/sc_borderdialog.png
new file mode 100644
index 0000000..6b6ab48
Binary files /dev/null and b/icon-themes/oxygen/cmd/sc_borderdialog.png differ
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index 0e871e4..247d2d1 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -826,6 +826,14 @@
           <value xml:lang="en-US">Name...</value>
         </prop>
       </node>
+      <node oor:name=".uno:BorderDialog" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Borders</value>
+        </prop>
+        <prop oor:name="Properties" oor:type="xs:int">
+          <value>1</value>
+        </prop>
+      </node>
       <node oor:name=".uno:PageColumnDialog" oor:op="replace">
         <prop oor:name="Label" oor:type="xs:string">
           <value xml:lang="en-US">Page Columns</value>
diff --git a/sw/Library_swui.mk b/sw/Library_swui.mk
index b9ef786..b6932f1 100644
--- a/sw/Library_swui.mk
+++ b/sw/Library_swui.mk
@@ -119,6 +119,7 @@ $(eval $(call gb_Library_add_exception_objects,swui,\
     sw/source/ui/frmdlg/frmdlg \
     sw/source/ui/frmdlg/frmpage \
     sw/source/ui/frmdlg/pattern \
+    sw/source/ui/frmdlg/uiborder \
     sw/source/ui/frmdlg/wrap \
     sw/source/ui/index/cntex \
     sw/source/ui/index/cnttab \
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 4ed35a4..303642a 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -326,6 +326,7 @@ included in c-context files, so c++ style stuff will cause problems.
 
 #define FN_FORMAT_PAGE_SETTING_DLG  (FN_FORMAT + 42)  /*  */
 #define FN_NUM_FORMAT_TABLE_DLG     (FN_FORMAT + 45)  /* number format in table */
+#define FN_FORMAT_BORDER_DLG        (FN_FORMAT + 48)  /* */
 #define FN_FORMAT_PAGE_COLUMN_DLG   (FN_FORMAT + 49)  /* columns per page */
 #define FN_FORMAT_BACKGROUND_DLG    (FN_FORMAT + 50)  /* background */
 #define FN_FORMAT_PAGE_DLG          (FN_FORMAT + 52)  /* page */
diff --git a/sw/inc/dialog.hrc b/sw/inc/dialog.hrc
index b395675..f95ef0f 100644
--- a/sw/inc/dialog.hrc
+++ b/sw/inc/dialog.hrc
@@ -54,6 +54,7 @@
 #define RC_DLG_ADDR         (RC_DIALOG_BEGIN + 90)
 #define RC_SWDLG_BACKGROUND     (RC_DIALOG_BEGIN + 91)
 #define RC_DLG_SWNUMFMTDLG      (RC_DIALOG_BEGIN + 92)
+#define RC_DLG_SWBORDERDLG      (RC_DIALOG_BEGIN + 93)
 #define RC_DLG_SWWRAPDLG        (RC_DIALOG_BEGIN + 94)
 #define RC_DLG_SWFLDEDITDLG     (RC_DIALOG_BEGIN + 95)
 // Ueberlaufpruefung ********************************************************
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index a6bfa51..925da1bf 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -373,6 +373,7 @@ public:
     virtual AbstractSwAutoFormatDlg * CreateSwAutoFormatDlg( Window* pParent, SwWrtShell* pShell,
                                                             sal_Bool bSetAutoFmt = sal_True,
                                                             const SwTableAutoFmt* pSelFmt = 0 ) = 0;
+    virtual SfxAbstractDialog * CreateSwBorderDlg ( Window* pParent, SfxItemSet& rSet, sal_uInt16 nType, int nResId ) = 0;
     virtual SfxAbstractDialog * CreateSwWrapDlg ( Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh, sal_Bool bDrawMode, int nResId ) = 0;
 
     virtual VclAbstractDialog * CreateSwTableWidthDlg(Window *pParent, SwTableFUNC &rFnc) = 0;
diff --git a/sw/sdi/_basesh.sdi b/sw/sdi/_basesh.sdi
index 66ab3fb..2891eba 100644
--- a/sw/sdi/_basesh.sdi
+++ b/sw/sdi/_basesh.sdi
@@ -274,6 +274,12 @@ interface BaseTextSelection
         DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
     ]
 
+    FN_FORMAT_BORDER_DLG // status(final|play)
+    [
+        ExecMethod = ExecDlg ;
+        DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+    ]
+
     SID_ATTR_BORDER_INNER // status()
     [
         StateMethod = GetBorderState ;
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 675540b..82d26838 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -624,6 +624,31 @@ SfxVoidItem SwBackspace FN_BACKSPACE
 ]
 
 //--------------------------------------------------------------------------
+SfxVoidItem BorderDialog FN_FORMAT_BORDER_DLG
+()
+[
+    /* flags: */
+    AutoUpdate = FALSE,
+    Cachable = Cachable,
+    FastCall = TRUE,
+    HasCoreId = FALSE,
+    HasDialog = TRUE,
+    ReadOnlyDoc = FALSE,
+    Toggle = FALSE,
+    Container = FALSE,
+    RecordAbsolute = FALSE,
+    RecordPerSet;
+    Asynchron;
+
+    /* config: */
+    AccelConfig = TRUE,
+    MenuConfig = TRUE,
+    StatusBarConfig = FALSE,
+    ToolBoxConfig = TRUE,
+    GroupId = GID_FORMAT;
+]
+
+//--------------------------------------------------------------------------
 SfxVoidItem BulletsAndNumberingDialog FN_NUMBER_BULLETS
 ()
 [
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index c363300..0b5e06c 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -90,6 +90,7 @@
 #include <svx/dialogs.hrc>
 #include <mailmergewizard.hxx>
 #include <mailconfigpage.hxx>
+#include <uiborder.hxx>
 
 using namespace ::com::sun::star;
 
@@ -848,6 +849,23 @@ AbstractSwAutoFormatDlg * SwAbstractDialogFactory_Impl::CreateSwAutoFormatDlg(Wi
     return new AbstractSwAutoFormatDlg_Impl(pDlg);
 }
 
+SfxAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwBorderDlg(Window* pParent, SfxItemSet& rSet, sal_uInt16 nType, int nResId )
+{
+    SfxModalDialog* pDlg=NULL;
+    switch ( nResId )
+    {
+        case RC_DLG_SWBORDERDLG :
+            pDlg = new SwBorderDlg( pParent, rSet, nType );
+            break;
+        default:
+            break;
+    }
+
+    if ( pDlg )
+        return new SwAbstractSfxDialog_Impl( pDlg );
+    return 0;
+}
+
 SfxAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwWrapDlg ( Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh, sal_Bool bDrawMode, int nResId )
 {
     SfxModalDialog* pDlg=NULL;
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index 94cc59f..12c3b0e 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -422,6 +422,7 @@ public:
     virtual AbstractSwAutoFormatDlg * CreateSwAutoFormatDlg( Window* pParent, SwWrtShell* pShell,
                                                             sal_Bool bSetAutoFmt = sal_True,
                                                             const SwTableAutoFmt* pSelFmt = 0 );
+    virtual SfxAbstractDialog * CreateSwBorderDlg (Window* pParent, SfxItemSet& rSet, sal_uInt16 nType, int nResId );
 
     virtual SfxAbstractDialog * CreateSwWrapDlg ( Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh, sal_Bool bDrawMode, int nResId );
     virtual VclAbstractDialog * CreateSwTableWidthDlg(Window *pParent, SwTableFUNC &rFnc);
diff --git a/sw/source/ui/frmdlg/frmui.src b/sw/source/ui/frmdlg/frmui.src
index 939f5af..c6d436a 100644
--- a/sw/source/ui/frmdlg/frmui.src
+++ b/sw/source/ui/frmdlg/frmui.src
@@ -102,6 +102,10 @@ String STR_COLL_HEADER
 {
     Text [ en-US ] = " (Template: " ;
 };
+String STR_FRMUI_BORDER
+{
+    Text [ en-US ] = "Borders" ;
+};
 String STR_FRMUI_PATTERN
 {
     Text [ en-US ] = "Background" ;
diff --git a/sw/source/ui/frmdlg/uiborder.cxx b/sw/source/ui/frmdlg/uiborder.cxx
new file mode 100644
index 0000000..5ed679f
--- /dev/null
+++ b/sw/source/ui/frmdlg/uiborder.cxx
@@ -0,0 +1,58 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include <svx/svxdlg.hxx>
+#include <svx/svxids.hrc>
+#include <svx/dialogs.hrc>
+#include <svl/itemset.hxx>
+#include <svx/flagsdef.hxx>
+#include <sfx2/tabdlg.hxx>
+#include <svl/intitem.hxx>
+
+#include "swtypes.hxx"
+#include "uiborder.hxx"
+#include "frmui.hrc"
+
+SwBorderDlg::SwBorderDlg(Window* pParent, SfxItemSet& rSet, sal_uInt16 nType) :
+    SfxSingleTabDialog(pParent, rSet)
+
+{
+    SetText(SW_RESSTR(STR_FRMUI_BORDER));
+
+    SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
+    OSL_ENSURE(pFact, "Dialogdiet fail!");
+    ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER );
+
+    if ( fnCreatePage )
+    {
+        SfxTabPage* pNewPage = (*fnCreatePage)( get_content_area(), rSet );
+        SfxAllItemSet aSet(*(rSet.GetPool()));
+        aSet.Put (SfxUInt16Item(SID_SWMODE_TYPE,nType));
+        if(SW_BORDER_MODE_TABLE == nType)
+            aSet.Put (SfxUInt32Item(SID_FLAG_TYPE,SVX_HIDESHADOWCTL));
+        pNewPage->PageCreated(aSet);
+        SetTabPage(pNewPage);
+    }
+}
+
+SwBorderDlg::~SwBorderDlg()
+{
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/frmui.hrc b/sw/source/ui/inc/frmui.hrc
index ae14bbb..4e765f9 100644
--- a/sw/source/ui/inc/frmui.hrc
+++ b/sw/source/ui/inc/frmui.hrc
@@ -44,6 +44,7 @@
 
 #define STR_TOPPRT              (STR_FRMDLG_BEGIN + 1)
 
+#define STR_BORDER              (STR_FRMDLG_BEGIN + 16)
 #define STR_COLUMN              (STR_FRMDLG_BEGIN + 17)
 #define STR_CHAR                (STR_FRMDLG_BEGIN + 19)
 
diff --git a/sw/source/ui/inc/uiborder.hxx b/sw/source/ui/inc/uiborder.hxx
new file mode 100644
index 0000000..78adaeb
--- /dev/null
+++ b/sw/source/ui/inc/uiborder.hxx
@@ -0,0 +1,41 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _UIBORDER_HXX
+#define _UIBORDER_HXX
+
+#include <sfx2/basedlgs.hxx>
+class Window;
+class SfxItemSet;
+
+class SwBorderDlg : public SfxSingleTabDialog
+{
+public:
+
+     // nType may be:
+     // SW_BORDER_MODE_PARA
+     // SW_BORDER_MODE_TABLE
+     // SW_BORDER_MODE_FRAME
+
+     SwBorderDlg(Window* pParent, SfxItemSet& rSet, sal_uInt16 nType);
+    ~SwBorderDlg();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx
index 75b25a3..7ce08aa 100644
--- a/sw/source/ui/shells/basesh.cxx
+++ b/sw/source/ui/shells/basesh.cxx
@@ -2375,6 +2375,73 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
             }
         }
         break;
+        case FN_FORMAT_BORDER_DLG:
+        {
+            SfxItemSet   aSet( rSh.GetAttrPool(),
+                               RES_BOX              , RES_SHADOW,
+                               SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
+                               0 );
+            SfxAbstractDialog * pDlg = 0;
+            // Table cell(s) selected?
+            if ( rSh.IsTableMode() )
+            {
+                // Set border attributes Get/SetTabBorders()
+                ::PrepareBoxInfo( aSet, rSh );
+                rSh.GetTabBorders( aSet );
+                SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
+                OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
+
+                pDlg = pFact->CreateSwBorderDlg( pMDI, aSet, SW_BORDER_MODE_TABLE, RC_DLG_SWBORDERDLG );
+                OSL_ENSURE(pDlg, "Dialogdiet fail!");
+                if ( pDlg->Execute() == RET_OK )
+                {
+                    rSh.SetTabBorders( *pDlg->GetOutputItemSet() );
+                    pOutSet = pDlg->GetOutputItemSet();
+                }
+            }
+            else if ( rSh.IsFrmSelected() )
+            {
+                // Set border attributes via Frame-Manager
+                SwFlyFrmAttrMgr aMgr( sal_False, &rSh, FRMMGR_TYPE_NONE );
+                aSet.Put( aMgr.GetAttrSet() );
+
+                SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
+                OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
+
+                pDlg = pFact->CreateSwBorderDlg( pMDI, aSet, SW_BORDER_MODE_FRAME, RC_DLG_SWBORDERDLG );
+                OSL_ENSURE(pDlg, "Dialogdiet fail!");
+                if ( pDlg->Execute() == RET_OK )
+                {
+                    aMgr.SetAttrSet( *pDlg->GetOutputItemSet() );
+                    aMgr.UpdateFlyFrm();
+                    pOutSet = pDlg->GetOutputItemSet();
+                }
+            }
+            else
+            {
+                // Set border attributes via Shell quite normal
+                rSh.GetCurAttr( aSet );
+                ::PrepareBoxInfo( aSet, rSh );
+
+                SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
+                OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
+
+                pDlg = pFact->CreateSwBorderDlg( pMDI, aSet, SW_BORDER_MODE_PARA, RC_DLG_SWBORDERDLG );
+                OSL_ENSURE(pDlg, "Dialogdiet fail!");
+                if ( pDlg->Execute() == RET_OK )
+                {
+                    rSh.SetAttrSet( *pDlg->GetOutputItemSet() );
+                    pOutSet = pDlg->GetOutputItemSet();
+                }
+            }
+            if(pOutSet)
+            {
+                rReq.Done(*pOutSet);
+                bDone = true;
+            }
+            delete pDlg;
+        }
+        break;
         case FN_FORMAT_BACKGROUND_DLG:
         {
             SfxItemSet aSet( rSh.GetAttrPool(),
commit 5c57c9b6eb30265fe7312ff2b4d6ce7363cf2006
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date:   Mon Feb 24 12:49:20 2014 +0100

    writerfilter: remove code duplication
    
    Change-Id: I55dfeb9b0505bb5f46d5bcf98b10bd2ba7b187f9

diff --git a/writerfilter/source/dmapper/ConversionHelper.cxx b/writerfilter/source/dmapper/ConversionHelper.cxx
index fb5071c..7f5e760 100644
--- a/writerfilter/source/dmapper/ConversionHelper.cxx
+++ b/writerfilter/source/dmapper/ConversionHelper.cxx
@@ -240,20 +240,6 @@ sal_Int32 convertEMUToMM100(sal_Int32 _t)
     return _t / 360;
 }
 
-/*-------------------------------------------------------------------------
-    contains a color from 0xTTRRGGBB to 0xTTRRGGBB
-  -----------------------------------------------------------------------*/
-sal_Int32 ConvertColor(sal_Int32 nWordColor)
-{
-    sal_uInt8
-        r(static_cast<sal_uInt8>(nWordColor&0xFF)),
-        g(static_cast<sal_uInt8>(((nWordColor)>>8)&0xFF)),
-        b(static_cast<sal_uInt8>((nWordColor>>16)&0xFF)),
-        t(static_cast<sal_uInt8>((nWordColor>>24)&0xFF));
-    sal_Int32 nRet = (t<<24) + (r<<16) + (g<<8) + b;
-    return nRet;
-}
-
 sal_Int16 convertTableJustification( sal_Int32 nIntValue )
 {
     sal_Int16 nOrient = text::HoriOrientation::LEFT_AND_WIDTH;
diff --git a/writerfilter/source/dmapper/ConversionHelper.hxx b/writerfilter/source/dmapper/ConversionHelper.hxx
index ff2fa7f..5b3b4fd 100644
--- a/writerfilter/source/dmapper/ConversionHelper.hxx
+++ b/writerfilter/source/dmapper/ConversionHelper.hxx
@@ -46,7 +46,6 @@ namespace ConversionHelper{
     sal_Int32 convertTwipToMM100(sal_Int32 _t);
     // probably the most useless unit in the world - English Metric Units (EMU) 360 000 EMU == 1cm
     sal_Int32 convertEMUToMM100(sal_Int32 _t);
-    sal_Int32 ConvertColor(sal_Int32 nWordColor );
     sal_Int16 convertTableJustification( sal_Int32 nIntValue );
     sal_Int16 ConvertNumberingType(sal_Int32 nFmt);
 
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 7daac77..7a51057 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1709,8 +1709,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
         // the following are not part of the official documentation
     case 0x6870: //TxtForeColor
         {
-            //contains a color as 0xTTRRGGBB while SO uses 0xTTRRGGBB
-            sal_Int32 nColor = ConversionHelper::ConvertColor(nIntValue);
+            sal_Int32 nColor = msfilter::util::BGRToRGB(nIntValue);
             rContext->Insert(PROP_CHAR_COLOR, uno::makeAny( nColor ) );
         }
         break;


More information about the Libreoffice-commits mailing list