Factored out common getDigitLanguage.
This commit is contained in:
@@ -153,6 +153,7 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
|
|||||||
drawinglayer/source/processor2d/baseprocessor2d \
|
drawinglayer/source/processor2d/baseprocessor2d \
|
||||||
drawinglayer/source/processor2d/canvasprocessor \
|
drawinglayer/source/processor2d/canvasprocessor \
|
||||||
drawinglayer/source/processor2d/contourextractor2d \
|
drawinglayer/source/processor2d/contourextractor2d \
|
||||||
|
drawinglayer/source/processor2d/getdigitlanguage \
|
||||||
drawinglayer/source/processor2d/helperchartrenderer \
|
drawinglayer/source/processor2d/helperchartrenderer \
|
||||||
drawinglayer/source/processor2d/helperwrongspellrenderer \
|
drawinglayer/source/processor2d/helperwrongspellrenderer \
|
||||||
drawinglayer/source/processor2d/hittestprocessor2d \
|
drawinglayer/source/processor2d/hittestprocessor2d \
|
||||||
|
@@ -36,8 +36,6 @@
|
|||||||
#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
|
#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
|
||||||
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
|
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
|
||||||
#include <canvas/canvastools.hxx>
|
#include <canvas/canvastools.hxx>
|
||||||
#include <svl/ctloptions.hxx>
|
|
||||||
#include <vcl/svapp.hxx>
|
|
||||||
#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
|
#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
|
||||||
#include <basegfx/polygon/b2dpolygonclipper.hxx>
|
#include <basegfx/polygon/b2dpolygonclipper.hxx>
|
||||||
#include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx>
|
#include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx>
|
||||||
@@ -69,6 +67,8 @@
|
|||||||
#include <helperwrongspellrenderer.hxx>
|
#include <helperwrongspellrenderer.hxx>
|
||||||
#include <basegfx/matrix/b2dhommatrixtools.hxx>
|
#include <basegfx/matrix/b2dhommatrixtools.hxx>
|
||||||
|
|
||||||
|
#include "getdigitlanguage.hxx"
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
using namespace com::sun::star;
|
using namespace com::sun::star;
|
||||||
@@ -969,29 +969,14 @@ namespace drawinglayer
|
|||||||
maBColorModifierStack(),
|
maBColorModifierStack(),
|
||||||
maDrawinglayerOpt(),
|
maDrawinglayerOpt(),
|
||||||
maClipPolyPolygon(),
|
maClipPolyPolygon(),
|
||||||
meLang(LANGUAGE_SYSTEM)
|
meLang(drawinglayer::detail::getDigitLanguage())
|
||||||
{
|
{
|
||||||
const SvtCTLOptions aSvtCTLOptions;
|
|
||||||
|
|
||||||
canvas::tools::initViewState(maViewState);
|
canvas::tools::initViewState(maViewState);
|
||||||
canvas::tools::initRenderState(maRenderState);
|
canvas::tools::initRenderState(maRenderState);
|
||||||
canvas::tools::setViewStateTransform(maViewState, getViewInformation2D().getViewTransformation());
|
canvas::tools::setViewStateTransform(maViewState, getViewInformation2D().getViewTransformation());
|
||||||
|
|
||||||
// set digit language, derived from SvtCTLOptions to have the correct
|
// set digit language, derived from SvtCTLOptions to have the correct
|
||||||
// number display for arabic/hindi numerals
|
// 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);
|
rOutDev.SetDigitLanguage(meLang);
|
||||||
|
|
||||||
// prepare output directly to pixels
|
// prepare output directly to pixels
|
||||||
|
49
drawinglayer/source/processor2d/getdigitlanguage.cxx
Normal file
49
drawinglayer/source/processor2d/getdigitlanguage.cxx
Normal file
@@ -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@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: */
|
46
drawinglayer/source/processor2d/getdigitlanguage.hxx
Normal file
46
drawinglayer/source/processor2d/getdigitlanguage.hxx
Normal file
@@ -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@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: */
|
@@ -52,8 +52,6 @@
|
|||||||
#include <drawinglayer/primitive2d/markerarrayprimitive2d.hxx>
|
#include <drawinglayer/primitive2d/markerarrayprimitive2d.hxx>
|
||||||
#include <drawinglayer/primitive2d/pointarrayprimitive2d.hxx>
|
#include <drawinglayer/primitive2d/pointarrayprimitive2d.hxx>
|
||||||
#include <drawinglayer/primitive2d/wrongspellprimitive2d.hxx>
|
#include <drawinglayer/primitive2d/wrongspellprimitive2d.hxx>
|
||||||
#include <svl/ctloptions.hxx>
|
|
||||||
#include <vcl/svapp.hxx>
|
|
||||||
#include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx>
|
#include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx>
|
||||||
#include <tools/diagnose_ex.h>
|
#include <tools/diagnose_ex.h>
|
||||||
#include <vcl/metric.hxx>
|
#include <vcl/metric.hxx>
|
||||||
@@ -61,6 +59,8 @@
|
|||||||
#include <drawinglayer/primitive2d/epsprimitive2d.hxx>
|
#include <drawinglayer/primitive2d/epsprimitive2d.hxx>
|
||||||
#include <vcl/rendergraphicrasterizer.hxx>
|
#include <vcl/rendergraphicrasterizer.hxx>
|
||||||
|
|
||||||
|
#include "getdigitlanguage.hxx"
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
// control support
|
// control support
|
||||||
|
|
||||||
@@ -1566,23 +1566,7 @@ namespace drawinglayer
|
|||||||
{
|
{
|
||||||
// set digit language, derived from SvtCTLOptions to have the correct
|
// set digit language, derived from SvtCTLOptions to have the correct
|
||||||
// number display for arabic/hindi numerals
|
// number display for arabic/hindi numerals
|
||||||
const SvtCTLOptions aSvtCTLOptions;
|
rOutDev.SetDigitLanguage(drawinglayer::detail::getDigitLanguage());
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VclProcessor2D::~VclProcessor2D()
|
VclProcessor2D::~VclProcessor2D()
|
||||||
|
Reference in New Issue
Block a user