[Libreoffice-commits] .: 2 commits - cui/source drawinglayer/Library_drawinglayer.mk drawinglayer/source editeng/source

Stephan Bergmann sbergmann at kemper.freedesktop.org
Wed Dec 7 07:44:15 PST 2011


 cui/source/options/optgdlg.cxx                       |    1 
 drawinglayer/Library_drawinglayer.mk                 |    1 
 drawinglayer/source/processor2d/canvasprocessor.cxx  |   21 +-------
 drawinglayer/source/processor2d/getdigitlanguage.cxx |   49 +++++++++++++++++++
 drawinglayer/source/processor2d/getdigitlanguage.hxx |   46 +++++++++++++++++
 drawinglayer/source/processor2d/vclprocessor2d.cxx   |   22 +-------
 editeng/source/editeng/editeng.cxx                   |    1 
 7 files changed, 102 insertions(+), 39 deletions(-)

New commits:
commit 400b458911a777dfb0d504ba65ed9496c441e556
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Dec 7 16:40:49 2011 +0100

    Unused includes.

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index dabc5a7..42a6c21 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -54,7 +54,6 @@
 #include <sfx2/objsh.hxx>
 #include <comphelper/string.hxx>
 #include <comphelper/types.hxx>
-#include <svl/ctloptions.hxx>
 #include <svtools/langtab.hxx>
 #include <unotools/localfilehelper.hxx>
 #include <unotools/configmgr.hxx>
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index 796578f..0c7a746 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -34,7 +34,6 @@
 
 #define USE_SVXFONT
 
-#include <svl/ctloptions.hxx>
 #include <svtools/ctrltool.hxx>
 
 #include <editeng/svxfont.hxx>
commit 8576bd17844d9c5843e84c330a7d2df79d79db7f
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Dec 7 16:34:32 2011 +0100

    Factored out common getDigitLanguage.

diff --git a/drawinglayer/Library_drawinglayer.mk b/drawinglayer/Library_drawinglayer.mk
index 7b88414..d2934d7 100644
--- a/drawinglayer/Library_drawinglayer.mk
+++ b/drawinglayer/Library_drawinglayer.mk
@@ -153,6 +153,7 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
     drawinglayer/source/processor2d/baseprocessor2d \
     drawinglayer/source/processor2d/canvasprocessor \
     drawinglayer/source/processor2d/contourextractor2d \
+    drawinglayer/source/processor2d/getdigitlanguage \
     drawinglayer/source/processor2d/helperchartrenderer \
     drawinglayer/source/processor2d/helperwrongspellrenderer \
     drawinglayer/source/processor2d/hittestprocessor2d \
diff --git a/drawinglayer/source/processor2d/canvasprocessor.cxx b/drawinglayer/source/processor2d/canvasprocessor.cxx
index 1365c5d..e916b29 100644
--- a/drawinglayer/source/processor2d/canvasprocessor.cxx
+++ b/drawinglayer/source/processor2d/canvasprocessor.cxx
@@ -36,8 +36,6 @@
 #include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
 #include <drawinglayer/primitive2d/transformprimitive2d.hxx>
 #include <canvas/canvastools.hxx>
-#include <svl/ctloptions.hxx>
-#include <vcl/svapp.hxx>
 #include <drawinglayer/primitive2d/maskprimitive2d.hxx>
 #include <basegfx/polygon/b2dpolygonclipper.hxx>
 #include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx>
@@ -69,6 +67,8 @@
 #include <helperwrongspellrenderer.hxx>
 #include <basegfx/matrix/b2dhommatrixtools.hxx>
 
+#include "getdigitlanguage.hxx"
+
 //////////////////////////////////////////////////////////////////////////////
 
 using namespace com::sun::star;
@@ -969,29 +969,14 @@ namespace drawinglayer
             maBColorModifierStack(),
             maDrawinglayerOpt(),
             maClipPolyPolygon(),
-            meLang(LANGUAGE_SYSTEM)
+            meLang(drawinglayer::detail::getDigitLanguage())
         {
-            const SvtCTLOptions aSvtCTLOptions;
-
             canvas::tools::initViewState(maViewState);
             canvas::tools::initRenderState(maRenderState);
             canvas::tools::setViewStateTransform(maViewState, getViewInformation2D().getViewTransformation());
 
             // set digit language, derived from SvtCTLOptions to have the correct
             // number display for arabic/hindi numerals
-            if(SvtCTLOptions::NUMERALS_HINDI == aSvtCTLOptions.GetCTLTextNumerals())
-            {
-                meLang = LANGUAGE_ARABIC_SAUDI_ARABIA;
-            }
-            else if(SvtCTLOptions::NUMERALS_ARABIC == aSvtCTLOptions.GetCTLTextNumerals())
-            {
-                meLang = LANGUAGE_ENGLISH;
-            }
-            else
-            {
-                meLang = (LanguageType)Application::GetSettings().GetLanguage();
-            }
-
             rOutDev.SetDigitLanguage(meLang);
 
             // prepare output directly to pixels
diff --git a/drawinglayer/source/processor2d/getdigitlanguage.cxx b/drawinglayer/source/processor2d/getdigitlanguage.cxx
new file mode 100644
index 0000000..000588e
--- /dev/null
+++ b/drawinglayer/source/processor2d/getdigitlanguage.cxx
@@ -0,0 +1,49 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * [ Copyright (C) 2011 Red Hat, Inc., Stephan Bergmann <sbergman at redhat.com>
+ *   (initial developer) ]
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include "sal/config.h"
+
+#include "i18npool/lang.h"
+#include "svl/ctloptions.hxx"
+#include "vcl/svapp.hxx"
+
+#include "getdigitlanguage.hxx"
+
+LanguageType drawinglayer::detail::getDigitLanguage() {
+    switch (SvtCTLOptions().GetCTLTextNumerals()) {
+    case SvtCTLOptions::NUMERALS_ARABIC:
+        return LANGUAGE_ENGLISH;
+    case SvtCTLOptions::NUMERALS_HINDI:
+        return LANGUAGE_ARABIC_SAUDI_ARABIA;
+    default:
+        return Application::GetSettings().GetLanguage();
+    }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/drawinglayer/source/processor2d/getdigitlanguage.hxx b/drawinglayer/source/processor2d/getdigitlanguage.hxx
new file mode 100644
index 0000000..1f186f6
--- /dev/null
+++ b/drawinglayer/source/processor2d/getdigitlanguage.hxx
@@ -0,0 +1,46 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * [ Copyright (C) 2011 Red Hat, Inc., Stephan Bergmann <sbergman at redhat.com>
+ *   (initial developer) ]
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef INCLUDED_DRAWINGLAYER_SOURCE_PROCESSOR2D_GETDIGITLANGUAGE_HXX
+#define INCLUDED_DRAWINGLAYER_SOURCE_PROCESSOR2D_GETDIGITLANGUAGE_HXX
+
+#include "sal/config.h"
+
+#include "i18npool/lang.h"
+
+namespace drawinglayer { namespace detail {
+
+/// Get digit language derived from SvtCTLOptions
+LanguageType getDigitLanguage();
+
+} }
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 5598cde..d27826b 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -52,8 +52,6 @@
 #include <drawinglayer/primitive2d/markerarrayprimitive2d.hxx>
 #include <drawinglayer/primitive2d/pointarrayprimitive2d.hxx>
 #include <drawinglayer/primitive2d/wrongspellprimitive2d.hxx>
-#include <svl/ctloptions.hxx>
-#include <vcl/svapp.hxx>
 #include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx>
 #include <tools/diagnose_ex.h>
 #include <vcl/metric.hxx>
@@ -61,6 +59,8 @@
 #include <drawinglayer/primitive2d/epsprimitive2d.hxx>
 #include <vcl/rendergraphicrasterizer.hxx>
 
+#include "getdigitlanguage.hxx"
+
 //////////////////////////////////////////////////////////////////////////////
 // control support
 
@@ -1566,23 +1566,7 @@ namespace drawinglayer
         {
             // set digit language, derived from SvtCTLOptions to have the correct
             // number display for arabic/hindi numerals
-            const SvtCTLOptions aSvtCTLOptions;
-            LanguageType eLang(LANGUAGE_SYSTEM);
-
-            if(SvtCTLOptions::NUMERALS_HINDI == aSvtCTLOptions.GetCTLTextNumerals())
-            {
-                eLang = LANGUAGE_ARABIC_SAUDI_ARABIA;
-            }
-            else if(SvtCTLOptions::NUMERALS_ARABIC == aSvtCTLOptions.GetCTLTextNumerals())
-            {
-                eLang = LANGUAGE_ENGLISH;
-            }
-            else
-            {
-                eLang = (LanguageType)Application::GetSettings().GetLanguage();
-            }
-
-            rOutDev.SetDigitLanguage(eLang);
+            rOutDev.SetDigitLanguage(drawinglayer::detail::getDigitLanguage());
         }
 
         VclProcessor2D::~VclProcessor2D()


More information about the Libreoffice-commits mailing list