summaryrefslogtreecommitdiff
path: root/svx/source/dialog
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2007-07-12 09:55:39 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2007-07-12 09:55:39 +0000
commit1acccec80de7083e17b4dc8a5a8b92d0bdb9a0da (patch)
treecc71d718366037d6e53c6ae44a0878f4c287b32a /svx/source/dialog
parentfd9f4bac3fcba41f8cb320e9a1407f457698cfca (diff)
INTEGRATION: CWS os98 (1.10.76); FILE MERGED
2007/06/19 07:59:00 os 1.10.76.1: #i76723# RTL numbering preview
Diffstat (limited to 'svx/source/dialog')
-rw-r--r--svx/source/dialog/svxbmpnumvalueset.cxx62
1 files changed, 54 insertions, 8 deletions
diff --git a/svx/source/dialog/svxbmpnumvalueset.cxx b/svx/source/dialog/svxbmpnumvalueset.cxx
index 6581248d42e5..e879d802e493 100644
--- a/svx/source/dialog/svxbmpnumvalueset.cxx
+++ b/svx/source/dialog/svxbmpnumvalueset.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: svxbmpnumvalueset.cxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: hr $ $Date: 2007-06-27 17:41:50 $
+ * last change: $Author: ihi $ $Date: 2007-07-12 10:55:39 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -66,6 +66,9 @@
#ifndef _SV_SVAPP_HXX
#include <vcl/svapp.hxx>
#endif
+#ifndef _SV_SALLAYOUT_HXX
+#include <vcl/plug/vcl/sallayout.hxx>
+#endif
#ifndef _GALLERY_HXX_ //autogen
#include <gallery.hxx>
#endif
@@ -226,8 +229,21 @@ static void lcl_PaintLevel(OutputDevice* pVDev, sal_Int16 nNumberingType,
else
{
pVDev->SetFont(rTextFont);
- pVDev->DrawText(rLeft, rText);
- rLeft.X() += pVDev->GetTextWidth(rText);
+ if (Application::GetSettings().GetLayoutRTL())
+ {
+ String sTmpText(rText);
+ sTmpText.Reverse();
+ for(sal_uInt16 j = 0; j < sTmpText.Len(); j++)
+ sTmpText.SetChar(j, static_cast< sal_Unicode>(GetMirroredChar(sTmpText.GetChar(j))));
+ OUString osTmpText(sTmpText);
+ pVDev->DrawText(rLeft, osTmpText);
+ rLeft.X() += pVDev->GetTextWidth(osTmpText);
+ }
+ else
+ {
+ pVDev->DrawText(rLeft, rText);
+ rLeft.X() += pVDev->GetTextWidth(rText);
+ }
}
}
void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt )
@@ -342,6 +358,12 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt )
rValue.Name = sValue;
rValue.Value <<= (sal_Int32)(i + 1);
sText = xFormatter->makeNumberingString( aLevel, aLocale );
+ if (Application::GetSettings().GetLayoutRTL())
+ {
+ sText.Reverse();
+ for(sal_uInt16 j = 0; j < sText.Len(); j++)
+ sText.SetChar(j, static_cast< sal_Unicode>(GetMirroredChar(sText.GetChar(j))));
+ }
}
catch(Exception&)
{
@@ -426,8 +448,20 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt )
sPrefixes[i].getStr()[0] != 0)
{
pVDev->SetFont(aFont);
- pVDev->DrawText(aLeft, sPrefixes[i]);
- aLeft.X() += pDev->GetTextWidth(sPrefixes[i]);
+ if (Application::GetSettings().GetLayoutRTL())
+ {
+ String sTmpPref(sPrefixes[i]);
+ for(sal_uInt16 j = 0; j < sTmpPref.Len(); j++)
+ sTmpPref.SetChar(j, static_cast< sal_Unicode>(GetMirroredChar(sTmpPref.GetChar(j))));
+ OUString osTmpPref(sTmpPref);
+ pVDev->DrawText(aLeft, osTmpPref);
+ aLeft.X() += pDev->GetTextWidth(osTmpPref);
+ }
+ else
+ {
+ pVDev->DrawText(aLeft, sPrefixes[i]);
+ aLeft.X() += pDev->GetTextWidth(sPrefixes[i]);
+ }
}
if(aParentNumberings[i])
{
@@ -460,8 +494,20 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt )
sSuffixes[i].getStr()[0] != 0)
{
pVDev->SetFont(aFont);
- pVDev->DrawText(aLeft, sSuffixes[i]);
- aLeft.X() += pDev->GetTextWidth(sSuffixes[i]);
+ if (Application::GetSettings().GetLayoutRTL())
+ {
+ String sTmpSuff(sSuffixes[i]);
+ for( sal_uInt16 j = 0; j < sTmpSuff.Len(); j++)
+ sTmpSuff.SetChar(j, static_cast< sal_Unicode>(GetMirroredChar(sTmpSuff.GetChar(j))));
+ OUString osTmpSuff(sTmpSuff);
+ pVDev->DrawText(aLeft, osTmpSuff);
+ aLeft.X() += pDev->GetTextWidth(osTmpSuff);
+ }
+ else
+ {
+ pVDev->DrawText(aLeft, sSuffixes[i]);
+ aLeft.X() += pDev->GetTextWidth(sSuffixes[i]);
+ }
}
long nLineTop = nStartY + nRectHeight * aLinesArr[2 * i + 1]/100 ;