summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2010-10-05 11:24:49 -0400
committerKohei Yoshida <kyoshida@novell.com>2010-10-05 11:24:49 -0400
commit2efcf2da2055ad1cb3b00031b19145f8b104b122 (patch)
tree3da09abcea30ffcc4b3160bcbe8fde8f97d3696b
parente0185db43409456a5ccf47bd1f879888a5b04783 (diff)
Ported calc-distributed-cell-text-*.diff from ooo-build.
This feature enables horizontal 'distributed' alignment and vertical 'justified' and 'distributed' alignments for cell contents in Calc. Note that this feature relies on ODF 1.2 extended in order for the relevant cell attributes to be saved in ODS.
-rw-r--r--editeng/inc/editeng/editids.hrc4
-rw-r--r--editeng/inc/editeng/editrids.hrc20
-rw-r--r--editeng/inc/editeng/eeitem.hxx86
-rw-r--r--editeng/inc/editeng/justifyitem.hxx127
-rw-r--r--editeng/inc/editeng/memberids.hrc4
-rw-r--r--editeng/inc/editeng/svxenum.hxx9
-rw-r--r--editeng/source/editeng/editdoc.cxx16
-rw-r--r--editeng/source/editeng/eerdll.cxx93
-rwxr-xr-xediteng/source/editeng/impedit.hxx4
-rwxr-xr-xediteng/source/editeng/impedit2.cxx15
-rw-r--r--editeng/source/editeng/impedit3.cxx99
-rw-r--r--editeng/source/items/frmitems.cxx2
-rw-r--r--editeng/source/items/justifyitem.cxx484
-rw-r--r--editeng/source/items/makefile.mk1
-rw-r--r--editeng/source/items/svxitems.src51
-rw-r--r--svx/inc/svx/algitem.hxx71
-rwxr-xr-xsvx/inc/svx/svxids.hrc4
-rw-r--r--svx/inc/svx/svxitems.hrc14
-rw-r--r--svx/source/items/algitem.cxx329
-rw-r--r--svx/source/items/makefile.mk2
-rw-r--r--svx/source/items/rotmodit.cxx36
-rw-r--r--svx/source/items/svxitems.src40
-rw-r--r--xmloff/inc/xmlnmspe.hxx2
-rw-r--r--xmloff/inc/xmloff/xmltoken.hxx8
-rw-r--r--xmloff/source/core/xmlexp.cxx6
-rw-r--r--xmloff/source/core/xmlimp.cxx4
-rw-r--r--xmloff/source/core/xmltoken.cxx6
27 files changed, 948 insertions, 589 deletions
diff --git a/editeng/inc/editeng/editids.hrc b/editeng/inc/editeng/editids.hrc
index 49629a46c2f9..b0cedbd29fa1 100644
--- a/editeng/inc/editeng/editids.hrc
+++ b/editeng/inc/editeng/editids.hrc
@@ -129,6 +129,10 @@
// this ID didn't exist prior to the svx split
#define SID_ATTR_CHAR_OVERLINE ( SID_EDIT_START + 68 )
+#define SID_ATTR_ALIGN_HOR_JUSTIFY_METHOD ( SID_EDIT_START + 69 )
+#define SID_ATTR_ALIGN_VER_JUSTIFY_METHOD ( SID_EDIT_START + 70 )
+#define SID_ATTR_ALIGN_HOR_JUSTIFY ( SID_EDIT_START + 71 )
+#define SID_ATTR_ALIGN_VER_JUSTIFY ( SID_EDIT_START + 72 )
/*
// planned, but not doable: changing value of SIDs will break code that uses them for WhichRanges
diff --git a/editeng/inc/editeng/editrids.hrc b/editeng/inc/editeng/editrids.hrc
index dcef661d01b8..1b539531ebd7 100644
--- a/editeng/inc/editeng/editrids.hrc
+++ b/editeng/inc/editeng/editrids.hrc
@@ -420,7 +420,25 @@
#define RID_SVXSTR_A11Y_IMAGEBULLET_DESCRIPTION (RID_EDIT_START + 314)
#define RID_SVXSTR_A11Y_IMAGEBULLET_NAME (RID_EDIT_START + 315)
-#if 315 > (RID_EDIT_END-RID_EDIT_START)
+// enum SvxCellHorJustify
+#define RID_SVXITEMS_HORJUST_STANDARD (RID_EDIT_START + 316)
+#define RID_SVXITEMS_HORJUST_LEFT (RID_EDIT_START + 317)
+#define RID_SVXITEMS_HORJUST_CENTER (RID_EDIT_START + 318)
+#define RID_SVXITEMS_HORJUST_RIGHT (RID_EDIT_START + 319)
+#define RID_SVXITEMS_HORJUST_BLOCK (RID_EDIT_START + 320)
+#define RID_SVXITEMS_HORJUST_REPEAT (RID_EDIT_START + 321)
+
+// enum SvxCellVerJustify
+#define RID_SVXITEMS_VERJUST_STANDARD (RID_EDIT_START + 322)
+#define RID_SVXITEMS_VERJUST_TOP (RID_EDIT_START + 323)
+#define RID_SVXITEMS_VERJUST_CENTER (RID_EDIT_START + 324)
+#define RID_SVXITEMS_VERJUST_BOTTOM (RID_EDIT_START + 325)
+
+// enum SvxCellJustifyMethod
+#define RID_SVXITEMS_JUSTMETHOD_AUTO (RID_EDIT_START + 326)
+#define RID_SVXITEMS_JUSTMETHOD_DISTRIBUTE (RID_EDIT_START + 327)
+
+#if 327 > (RID_EDIT_END-RID_EDIT_START)
#error Resource-Ueberlauf in #line, #file
#endif
diff --git a/editeng/inc/editeng/eeitem.hxx b/editeng/inc/editeng/eeitem.hxx
index 3b4897fd86ed..87b4b35bbeef 100644
--- a/editeng/inc/editeng/eeitem.hxx
+++ b/editeng/inc/editeng/eeitem.hxx
@@ -30,7 +30,7 @@
#define EE_ITEMS_START 3989
-// Absatzattribute:
+// Paragraph attributes:
#define EE_PARA_START (EE_ITEMS_START+0)
#define EE_PARA_WRITINGDIR (EE_ITEMS_START+0)
#define EE_PARA_XMLATTRIBS (EE_ITEMS_START+1)
@@ -48,51 +48,53 @@
#define EE_PARA_SBL (EE_ITEMS_START+13)
#define EE_PARA_JUST (EE_ITEMS_START+14)
#define EE_PARA_TABS (EE_ITEMS_START+15)
-#define EE_PARA_END (EE_ITEMS_START+15)
+#define EE_PARA_JUST_METHOD (EE_ITEMS_START+16)
+#define EE_PARA_VER_JUST (EE_ITEMS_START+17)
+#define EE_PARA_END (EE_ITEMS_START+17)
-// Zeichenattribute:
-#define EE_CHAR_START (EE_ITEMS_START+16)
-#define EE_CHAR_COLOR (EE_ITEMS_START+16)
-#define EE_CHAR_FONTINFO (EE_ITEMS_START+17)
-#define EE_CHAR_FONTHEIGHT (EE_ITEMS_START+18)
-#define EE_CHAR_FONTWIDTH (EE_ITEMS_START+19)
-#define EE_CHAR_WEIGHT (EE_ITEMS_START+20)
-#define EE_CHAR_UNDERLINE (EE_ITEMS_START+21)
-#define EE_CHAR_STRIKEOUT (EE_ITEMS_START+22)
-#define EE_CHAR_ITALIC (EE_ITEMS_START+23)
-#define EE_CHAR_OUTLINE (EE_ITEMS_START+24)
-#define EE_CHAR_SHADOW (EE_ITEMS_START+25)
-#define EE_CHAR_ESCAPEMENT (EE_ITEMS_START+26)
-#define EE_CHAR_PAIRKERNING (EE_ITEMS_START+27)
-#define EE_CHAR_KERNING (EE_ITEMS_START+28)
-#define EE_CHAR_WLM (EE_ITEMS_START+29)
-#define EE_CHAR_LANGUAGE (EE_ITEMS_START+30)
-#define EE_CHAR_LANGUAGE_CJK (EE_ITEMS_START+31)
-#define EE_CHAR_LANGUAGE_CTL (EE_ITEMS_START+32)
-#define EE_CHAR_FONTINFO_CJK (EE_ITEMS_START+33)
-#define EE_CHAR_FONTINFO_CTL (EE_ITEMS_START+34)
-#define EE_CHAR_FONTHEIGHT_CJK (EE_ITEMS_START+35)
-#define EE_CHAR_FONTHEIGHT_CTL (EE_ITEMS_START+36)
-#define EE_CHAR_WEIGHT_CJK (EE_ITEMS_START+37)
-#define EE_CHAR_WEIGHT_CTL (EE_ITEMS_START+38)
-#define EE_CHAR_ITALIC_CJK (EE_ITEMS_START+39)
-#define EE_CHAR_ITALIC_CTL (EE_ITEMS_START+40)
-#define EE_CHAR_EMPHASISMARK (EE_ITEMS_START+41)
-#define EE_CHAR_RELIEF (EE_ITEMS_START+42)
-#define EE_CHAR_RUBI_DUMMY (EE_ITEMS_START+43)
-#define EE_CHAR_XMLATTRIBS (EE_ITEMS_START+44)
-#define EE_CHAR_OVERLINE (EE_ITEMS_START+45)
-#define EE_CHAR_END (EE_ITEMS_START+45)
+// Character attributes:
+#define EE_CHAR_START (EE_ITEMS_START+18)
+#define EE_CHAR_COLOR (EE_ITEMS_START+18)
+#define EE_CHAR_FONTINFO (EE_ITEMS_START+19)
+#define EE_CHAR_FONTHEIGHT (EE_ITEMS_START+20)
+#define EE_CHAR_FONTWIDTH (EE_ITEMS_START+21)
+#define EE_CHAR_WEIGHT (EE_ITEMS_START+22)
+#define EE_CHAR_UNDERLINE (EE_ITEMS_START+23)
+#define EE_CHAR_STRIKEOUT (EE_ITEMS_START+24)
+#define EE_CHAR_ITALIC (EE_ITEMS_START+25)
+#define EE_CHAR_OUTLINE (EE_ITEMS_START+26)
+#define EE_CHAR_SHADOW (EE_ITEMS_START+27)
+#define EE_CHAR_ESCAPEMENT (EE_ITEMS_START+28)
+#define EE_CHAR_PAIRKERNING (EE_ITEMS_START+29)
+#define EE_CHAR_KERNING (EE_ITEMS_START+30)
+#define EE_CHAR_WLM (EE_ITEMS_START+31)
+#define EE_CHAR_LANGUAGE (EE_ITEMS_START+32)
+#define EE_CHAR_LANGUAGE_CJK (EE_ITEMS_START+33)
+#define EE_CHAR_LANGUAGE_CTL (EE_ITEMS_START+34)
+#define EE_CHAR_FONTINFO_CJK (EE_ITEMS_START+35)
+#define EE_CHAR_FONTINFO_CTL (EE_ITEMS_START+36)
+#define EE_CHAR_FONTHEIGHT_CJK (EE_ITEMS_START+37)
+#define EE_CHAR_FONTHEIGHT_CTL (EE_ITEMS_START+38)
+#define EE_CHAR_WEIGHT_CJK (EE_ITEMS_START+39)
+#define EE_CHAR_WEIGHT_CTL (EE_ITEMS_START+40)
+#define EE_CHAR_ITALIC_CJK (EE_ITEMS_START+41)
+#define EE_CHAR_ITALIC_CTL (EE_ITEMS_START+42)
+#define EE_CHAR_EMPHASISMARK (EE_ITEMS_START+43)
+#define EE_CHAR_RELIEF (EE_ITEMS_START+44)
+#define EE_CHAR_RUBI_DUMMY (EE_ITEMS_START+45)
+#define EE_CHAR_XMLATTRIBS (EE_ITEMS_START+46)
+#define EE_CHAR_OVERLINE (EE_ITEMS_START+47)
+#define EE_CHAR_END (EE_ITEMS_START+47)
-#define EE_FEATURE_START (EE_ITEMS_START+46)
-#define EE_FEATURE_TAB (EE_ITEMS_START+46)
-#define EE_FEATURE_LINEBR (EE_ITEMS_START+47)
-#define EE_FEATURE_NOTCONV (EE_ITEMS_START+48)
-#define EE_FEATURE_FIELD (EE_ITEMS_START+49)
-#define EE_FEATURE_END (EE_ITEMS_START+49)
+#define EE_FEATURE_START (EE_ITEMS_START+48)
+#define EE_FEATURE_TAB (EE_ITEMS_START+48)
+#define EE_FEATURE_LINEBR (EE_ITEMS_START+49)
+#define EE_FEATURE_NOTCONV (EE_ITEMS_START+50)
+#define EE_FEATURE_FIELD (EE_ITEMS_START+51)
+#define EE_FEATURE_END (EE_ITEMS_START+51)
-#define EE_ITEMS_END (EE_ITEMS_START+49)
+#define EE_ITEMS_END (EE_ITEMS_START+51)
#define EDITITEMCOUNT ( EE_ITEMS_END - EE_ITEMS_START + 1 )
diff --git a/editeng/inc/editeng/justifyitem.hxx b/editeng/inc/editeng/justifyitem.hxx
new file mode 100644
index 000000000000..13b6d4205a49
--- /dev/null
+++ b/editeng/inc/editeng/justifyitem.hxx
@@ -0,0 +1,127 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef __EDITENG_JUSTIFYITEM_HXX__
+#define __EDITENG_JUSTIFYITEM_HXX__
+
+#include "editeng/editengdllapi.h"
+#include "editeng/svxenum.hxx"
+#include <svl/eitem.hxx>
+#include <sal/types.h>
+
+class EDITENG_DLLPUBLIC SvxHorJustifyItem: public SfxEnumItem
+{
+public:
+ TYPEINFO();
+
+ SvxHorJustifyItem( const USHORT nId );
+
+ SvxHorJustifyItem(
+ const SvxCellHorJustify eJustify /*= SVX_HOR_JUSTIFY_STANDARD*/,
+ const USHORT nId );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ String &rText, const IntlWrapper * = 0 ) const;
+
+ virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
+ virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
+
+ virtual USHORT GetValueCount() const;
+ virtual String GetValueText( USHORT nVal ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream& rStream, USHORT nVer ) const;
+
+ inline SvxHorJustifyItem& operator=(const SvxHorJustifyItem& rHorJustify)
+ {
+ SetValue( rHorJustify.GetValue() );
+ return *this;
+ }
+};
+
+//------------------------------------------------------------------------
+
+class EDITENG_DLLPUBLIC SvxVerJustifyItem: public SfxEnumItem
+{
+public:
+ TYPEINFO();
+
+ SvxVerJustifyItem( const USHORT nId );
+
+ SvxVerJustifyItem(
+ const SvxCellVerJustify eJustify /*= SVX_VER_JUSTIFY_STANDARD*/,
+ const USHORT nId );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ String &rText, const IntlWrapper * = 0 ) const;
+
+ virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
+ virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
+
+ virtual USHORT GetValueCount() const;
+ virtual String GetValueText( USHORT nVal ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream& rStream, USHORT nVer ) const;
+
+ inline SvxVerJustifyItem& operator=(const SvxVerJustifyItem& rVerJustify)
+ {
+ SetValue( rVerJustify.GetValue() );
+ return *this;
+ }
+};
+
+//------------------------------------------------------------------------
+
+class EDITENG_DLLPUBLIC SvxJustifyMethodItem: public SfxEnumItem
+{
+public:
+ SvxJustifyMethodItem( const USHORT nId );
+
+ SvxJustifyMethodItem(
+ const SvxCellJustifyMethod eMethod,
+ const USHORT nId );
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ String &rText, const IntlWrapper * = 0 ) const;
+
+ virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
+ virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
+
+ virtual USHORT GetValueCount() const;
+ virtual String GetValueText( USHORT nVal ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream& rStream, USHORT nVer ) const;
+
+ SvxJustifyMethodItem& operator=(const SvxJustifyMethodItem& r);
+};
+
+#endif
diff --git a/editeng/inc/editeng/memberids.hrc b/editeng/inc/editeng/memberids.hrc
index 6bd88ebf164d..c98b726a6eb8 100644
--- a/editeng/inc/editeng/memberids.hrc
+++ b/editeng/inc/editeng/memberids.hrc
@@ -191,6 +191,8 @@
#define MID_CASEMAP_VARIANT 0
#define MID_CASEMAP_TRANS 1
-
+// SvxHorJustifyItem
+#define MID_HORJUST_HORJUST 0
+#define MID_HORJUST_ADJUST 1
#endif
diff --git a/editeng/inc/editeng/svxenum.hxx b/editeng/inc/editeng/svxenum.hxx
index 6222f6ac85a1..856aefd93e33 100644
--- a/editeng/inc/editeng/svxenum.hxx
+++ b/editeng/inc/editeng/svxenum.hxx
@@ -124,12 +124,19 @@ enum SvxCellHorJustify
SVX_HOR_JUSTIFY_REPEAT
};
+enum SvxCellJustifyMethod
+{
+ SVX_JUSTIFY_METHOD_AUTO,
+ SVX_JUSTIFY_METHOD_DISTRIBUTE
+};
+
enum SvxCellVerJustify
{
SVX_VER_JUSTIFY_STANDARD,
SVX_VER_JUSTIFY_TOP,
SVX_VER_JUSTIFY_CENTER,
- SVX_VER_JUSTIFY_BOTTOM
+ SVX_VER_JUSTIFY_BOTTOM,
+ SVX_VER_JUSTIFY_BLOCK
};
enum SvxCellOrientation
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index 9ac179a2a47f..a1e9eddfc403 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -178,13 +178,15 @@ SfxItemInfo aItemInfos[EDITITEMCOUNT] = {
{ 0, SFX_ITEM_POOLABLE }, // EE_PARA_HYPHENATE
{ 0, SFX_ITEM_POOLABLE }, // EE_PARA_BULLETSTATE
{ 0, SFX_ITEM_POOLABLE }, // EE_PARA_OUTLLRSPACE
- { SID_ATTR_PARA_OUTLLEVEL, SFX_ITEM_POOLABLE },
- { SID_ATTR_PARA_BULLET, SFX_ITEM_POOLABLE },
- { SID_ATTR_LRSPACE, SFX_ITEM_POOLABLE },
- { SID_ATTR_ULSPACE, SFX_ITEM_POOLABLE },
- { SID_ATTR_PARA_LINESPACE, SFX_ITEM_POOLABLE },
- { SID_ATTR_PARA_ADJUST, SFX_ITEM_POOLABLE },
- { SID_ATTR_TABSTOP, SFX_ITEM_POOLABLE },
+ { SID_ATTR_PARA_OUTLLEVEL, SFX_ITEM_POOLABLE }, // EE_PARA_OUTLLEVEL
+ { SID_ATTR_PARA_BULLET, SFX_ITEM_POOLABLE }, // EE_PARA_BULLET
+ { SID_ATTR_LRSPACE, SFX_ITEM_POOLABLE }, // EE_PARA_LRSPACE
+ { SID_ATTR_ULSPACE, SFX_ITEM_POOLABLE }, // EE_PARA_ULSPACE
+ { SID_ATTR_PARA_LINESPACE, SFX_ITEM_POOLABLE }, // EE_PARA_SBL
+ { SID_ATTR_PARA_ADJUST, SFX_ITEM_POOLABLE }, // EE_PARA_JUST
+ { SID_ATTR_TABSTOP, SFX_ITEM_POOLABLE }, // EE_PARA_TABS
+ { SID_ATTR_ALIGN_HOR_JUSTIFY_METHOD, SFX_ITEM_POOLABLE }, // EE_PARA_JUST_METHOD
+ { SID_ATTR_ALIGN_VER_JUSTIFY, SFX_ITEM_POOLABLE }, // EE_PARA_VER_JUST
{ SID_ATTR_CHAR_COLOR, SFX_ITEM_POOLABLE },
{ SID_ATTR_CHAR_FONT, SFX_ITEM_POOLABLE },
{ SID_ATTR_CHAR_FONTHEIGHT, SFX_ITEM_POOLABLE },
diff --git a/editeng/source/editeng/eerdll.cxx b/editeng/source/editeng/eerdll.cxx
index 7d6df3f0fab4..886e8651a349 100644
--- a/editeng/source/editeng/eerdll.cxx
+++ b/editeng/source/editeng/eerdll.cxx
@@ -73,6 +73,7 @@
#include <editeng/frmdiritem.hxx>
#include <editeng/xmlcnitm.hxx>
#include <editeng/forbiddencharacterstable.hxx>
+#include <editeng/justifyitem.hxx>
#include <comphelper/processfactory.hxx>
static EditDLL* pDLL=0;
@@ -107,7 +108,7 @@ SfxPoolItem** GlobalEditData::GetDefItems()
{
ppDefItems = new SfxPoolItem*[EDITITEMCOUNT];
- // Absatzattribute:
+ // Paragraph attributes:
SvxNumRule aTmpNumRule( 0, 0, FALSE );
ppDefItems[0] = new SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR );
@@ -120,57 +121,59 @@ SfxPoolItem** GlobalEditData::GetDefItems()
ppDefItems[7] = new SfxBoolItem( EE_PARA_BULLETSTATE, TRUE );
ppDefItems[8] = new SvxLRSpaceItem( EE_PARA_OUTLLRSPACE );
ppDefItems[9] = new SfxInt16Item( EE_PARA_OUTLLEVEL, -1 );
- ppDefItems[10] = new SvxBulletItem( EE_PARA_BULLET );
- ppDefItems[11] = new SvxLRSpaceItem( EE_PARA_LRSPACE );
- ppDefItems[12] = new SvxULSpaceItem( EE_PARA_ULSPACE );
- ppDefItems[13] = new SvxLineSpacingItem( 0, EE_PARA_SBL );
- ppDefItems[14] = new SvxAdjustItem( SVX_ADJUST_LEFT, EE_PARA_JUST );
- ppDefItems[15] = new SvxTabStopItem( 0, 0, SVX_TAB_ADJUST_LEFT, EE_PARA_TABS );
-
- // Zeichenattribute:
- ppDefItems[16] = new SvxColorItem( Color( COL_AUTO ), EE_CHAR_COLOR );
- ppDefItems[17] = new SvxFontItem( EE_CHAR_FONTINFO );
- ppDefItems[18] = new SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT );
- ppDefItems[19] = new SvxCharScaleWidthItem( 100, EE_CHAR_FONTWIDTH );
- ppDefItems[20] = new SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT );
- ppDefItems[21] = new SvxUnderlineItem( UNDERLINE_NONE, EE_CHAR_UNDERLINE );
- ppDefItems[22] = new SvxCrossedOutItem( STRIKEOUT_NONE, EE_CHAR_STRIKEOUT );
- ppDefItems[23] = new SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC );
- ppDefItems[24] = new SvxContourItem( FALSE, EE_CHAR_OUTLINE );
- ppDefItems[25] = new SvxShadowedItem( FALSE, EE_CHAR_SHADOW );
- ppDefItems[26] = new SvxEscapementItem( 0, 100, EE_CHAR_ESCAPEMENT );
- ppDefItems[27] = new SvxAutoKernItem( FALSE, EE_CHAR_PAIRKERNING );
- ppDefItems[28] = new SvxKerningItem( 0, EE_CHAR_KERNING );
- ppDefItems[29] = new SvxWordLineModeItem( FALSE, EE_CHAR_WLM );
- ppDefItems[30] = new SvxLanguageItem( LANGUAGE_DONTKNOW, EE_CHAR_LANGUAGE );
- ppDefItems[31] = new SvxLanguageItem( LANGUAGE_DONTKNOW, EE_CHAR_LANGUAGE_CJK );
- ppDefItems[32] = new SvxLanguageItem( LANGUAGE_DONTKNOW, EE_CHAR_LANGUAGE_CTL );
- ppDefItems[33] = new SvxFontItem( EE_CHAR_FONTINFO_CJK );
- ppDefItems[34] = new SvxFontItem( EE_CHAR_FONTINFO_CTL );
- ppDefItems[35] = new SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT_CJK );
- ppDefItems[36] = new SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT_CTL );
- ppDefItems[37] = new SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CJK );
- ppDefItems[38] = new SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CTL );
- ppDefItems[39] = new SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CJK );
- ppDefItems[40] = new SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CTL );
- ppDefItems[41] = new SvxEmphasisMarkItem( EMPHASISMARK_NONE, EE_CHAR_EMPHASISMARK );
- ppDefItems[42] = new SvxCharReliefItem( RELIEF_NONE, EE_CHAR_RELIEF );
- ppDefItems[43] = new SfxVoidItem( EE_CHAR_RUBI_DUMMY );
+ ppDefItems[10] = new SvxBulletItem( EE_PARA_BULLET );
+ ppDefItems[11] = new SvxLRSpaceItem( EE_PARA_LRSPACE );
+ ppDefItems[12] = new SvxULSpaceItem( EE_PARA_ULSPACE );
+ ppDefItems[13] = new SvxLineSpacingItem( 0, EE_PARA_SBL );
+ ppDefItems[14] = new SvxAdjustItem( SVX_ADJUST_LEFT, EE_PARA_JUST );
+ ppDefItems[15] = new SvxTabStopItem( 0, 0, SVX_TAB_ADJUST_LEFT, EE_PARA_TABS );
+ ppDefItems[16] = new SvxJustifyMethodItem( SVX_JUSTIFY_METHOD_AUTO, EE_PARA_JUST_METHOD );
+ ppDefItems[17] = new SvxVerJustifyItem( SVX_VER_JUSTIFY_STANDARD, EE_PARA_VER_JUST );
+
+ // Character attributes:
+ ppDefItems[18] = new SvxColorItem( Color( COL_AUTO ), EE_CHAR_COLOR );
+ ppDefItems[19] = new SvxFontItem( EE_CHAR_FONTINFO );
+ ppDefItems[20] = new SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT );
+ ppDefItems[21] = new SvxCharScaleWidthItem( 100, EE_CHAR_FONTWIDTH );
+ ppDefItems[22] = new SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT );
+ ppDefItems[23] = new SvxUnderlineItem( UNDERLINE_NONE, EE_CHAR_UNDERLINE );
+ ppDefItems[24] = new SvxCrossedOutItem( STRIKEOUT_NONE, EE_CHAR_STRIKEOUT );
+ ppDefItems[25] = new SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC );
+ ppDefItems[26] = new SvxContourItem( FALSE, EE_CHAR_OUTLINE );
+ ppDefItems[27] = new SvxShadowedItem( FALSE, EE_CHAR_SHADOW );
+ ppDefItems[28] = new SvxEscapementItem( 0, 100, EE_CHAR_ESCAPEMENT );
+ ppDefItems[29] = new SvxAutoKernItem( FALSE, EE_CHAR_PAIRKERNING );
+ ppDefItems[30] = new SvxKerningItem( 0, EE_CHAR_KERNING );
+ ppDefItems[31] = new SvxWordLineModeItem( FALSE, EE_CHAR_WLM );
+ ppDefItems[32] = new SvxLanguageItem( LANGUAGE_DONTKNOW, EE_CHAR_LANGUAGE );
+ ppDefItems[33] = new SvxLanguageItem( LANGUAGE_DONTKNOW, EE_CHAR_LANGUAGE_CJK );
+ ppDefItems[34] = new SvxLanguageItem( LANGUAGE_DONTKNOW, EE_CHAR_LANGUAGE_CTL );
+ ppDefItems[35] = new SvxFontItem( EE_CHAR_FONTINFO_CJK );
+ ppDefItems[36] = new SvxFontItem( EE_CHAR_FONTINFO_CTL );
+ ppDefItems[37] = new SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT_CJK );
+ ppDefItems[38] = new SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT_CTL );
+ ppDefItems[39] = new SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CJK );
+ ppDefItems[40] = new SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CTL );
+ ppDefItems[41] = new SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CJK );
+ ppDefItems[42] = new SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CTL );
+ ppDefItems[43] = new SvxEmphasisMarkItem( EMPHASISMARK_NONE, EE_CHAR_EMPHASISMARK );
+ ppDefItems[44] = new SvxCharReliefItem( RELIEF_NONE, EE_CHAR_RELIEF );
+ ppDefItems[45] = new SfxVoidItem( EE_CHAR_RUBI_DUMMY );
#ifndef SVX_LIGHT
- ppDefItems[44] = new SvXMLAttrContainerItem( EE_CHAR_XMLATTRIBS );
+ ppDefItems[46] = new SvXMLAttrContainerItem( EE_CHAR_XMLATTRIBS );
#else
// no need to have alien attributes persistent
- ppDefItems[44] = new SfxVoidItem( EE_CHAR_XMLATTRIBS );
+ ppDefItems[46] = new SfxVoidItem( EE_CHAR_XMLATTRIBS );
#endif // #ifndef SVX_LIGHT
- ppDefItems[45] = new SvxOverlineItem( UNDERLINE_NONE, EE_CHAR_OVERLINE );
+ ppDefItems[47] = new SvxOverlineItem( UNDERLINE_NONE, EE_CHAR_OVERLINE );
// Features
- ppDefItems[46] = new SfxVoidItem( EE_FEATURE_TAB );
- ppDefItems[47] = new SfxVoidItem( EE_FEATURE_LINEBR );
- ppDefItems[48] = new SvxCharSetColorItem( Color( COL_RED ), RTL_TEXTENCODING_DONTKNOW, EE_FEATURE_NOTCONV );
- ppDefItems[49] = new SvxFieldItem( SvxFieldData(), EE_FEATURE_FIELD );
+ ppDefItems[48] = new SfxVoidItem( EE_FEATURE_TAB );
+ ppDefItems[49] = new SfxVoidItem( EE_FEATURE_LINEBR );
+ ppDefItems[50] = new SvxCharSetColorItem( Color( COL_RED ), RTL_TEXTENCODING_DONTKNOW, EE_FEATURE_NOTCONV );
+ ppDefItems[51] = new SvxFieldItem( SvxFieldData(), EE_FEATURE_FIELD );
- DBG_ASSERT( EDITITEMCOUNT == 50, "ITEMCOUNT geaendert, DefItems nicht angepasst!" );
+ DBG_ASSERT( EDITITEMCOUNT == 52, "ITEMCOUNT geaendert, DefItems nicht angepasst!" );
// Init DefFonts:
GetDefaultFonts( *(SvxFontItem*)ppDefItems[EE_CHAR_FONTINFO - EE_ITEMS_START],
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 77e068f8fa9a..e185bcc9e3e5 100755
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -666,6 +666,8 @@ private:
void SetBackgroundColor( const Color& rColor ) { maBackgroundColor = rColor; }
Color GetBackgroundColor() const { return maBackgroundColor; }
+ long CalcVertLineSpacing(Point& rStartPos) const;
+
Color GetAutoColor() const;
void EnableAutoColor( BOOL b ) { bUseAutoColor = b; }
BOOL IsAutoColorEnabled() const { return bUseAutoColor; }
@@ -988,6 +990,8 @@ public:
const SvxLRSpaceItem& GetLRSpaceItem( ContentNode* pNode );
SvxAdjust GetJustification( USHORT nPara ) const;
+ SvxCellJustifyMethod GetJustifyMethod( USHORT nPara ) const;
+ SvxCellVerJustify GetVerJustification( USHORT nPara ) const;
void SetCharStretching( sal_uInt16 nX, sal_uInt16 nY );
inline void GetCharStretching( sal_uInt16& rX, sal_uInt16& rY );
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 56b610c14436..cbc1d31bb217 100755
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -58,6 +58,7 @@
#include <editeng/scripttypeitem.hxx>
#include <editeng/frmdiritem.hxx>
#include <editeng/fontitem.hxx>
+#include <editeng/justifyitem.hxx>
#include <vcl/cmdevt.h>
#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
@@ -2136,6 +2137,20 @@ SvxAdjust ImpEditEngine::GetJustification( USHORT nPara ) const
return eJustification;
}
+SvxCellJustifyMethod ImpEditEngine::GetJustifyMethod( USHORT nPara ) const
+{
+ const SvxJustifyMethodItem& rItem = static_cast<const SvxJustifyMethodItem&>(
+ GetParaAttrib(nPara, EE_PARA_JUST_METHOD));
+ return static_cast<SvxCellJustifyMethod>(rItem.GetEnumValue());
+}
+
+SvxCellVerJustify ImpEditEngine::GetVerJustification( USHORT nPara ) const
+{
+ const SvxVerJustifyItem& rItem = static_cast<const SvxVerJustifyItem&>(
+ GetParaAttrib(nPara, EE_PARA_VER_JUST));
+ return static_cast<SvxCellVerJustify>(rItem.GetEnumValue());
+}
+
// ----------------------------------------------------------------------
// Textaenderung
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index c74b0250917f..258d0326151e 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -61,6 +61,7 @@
#include <editeng/scriptspaceitem.hxx>
#include <editeng/charscaleitem.hxx>
#include <editeng/numitem.hxx>
+#include <editeng/justifyitem.hxx>
#include <svtools/colorcfg.hxx>
#include <svl/ctloptions.hxx>
@@ -1427,9 +1428,10 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY )
break;
case SVX_ADJUST_BLOCK:
{
+ bool bDistLastLine = (GetJustifyMethod(nPara) == SVX_JUSTIFY_METHOD_DISTRIBUTE);
long nRemainingSpace = nMaxLineWidth - aTextSize.Width();
pLine->SetStartPosX( (sal_uInt16)nStartX );
- if ( !bEOC && ( nRemainingSpace > 0 ) ) // nicht die letzte Zeile...
+ if ( nRemainingSpace > 0 && (!bEOC || bDistLastLine) )
ImpAdjustBlocks( pParaPortion, pLine, nRemainingSpace );
}
break;
@@ -2003,22 +2005,42 @@ void ImpEditEngine::ImpAdjustBlocks( ParaPortion* pParaPortion, EditLine* pLine,
// Search blanks or Kashidas...
SvUShorts aPositions;
- USHORT nChar;
- for ( nChar = nFirstChar; nChar <= nLastChar; nChar++ )
+ USHORT nLastScript = i18n::ScriptType::LATIN;
+ for ( USHORT nChar = nFirstChar; nChar <= nLastChar; nChar++ )
{
+ EditPaM aPaM( pNode, nChar+1 );
+ LanguageType eLang = GetLanguage(aPaM);
+ USHORT nScript = GetScriptType(aPaM);
+ if ( MsLangId::getPrimaryLanguage( eLang) == LANGUAGE_ARABIC_PRIMARY_ONLY )
+ // Arabic script is handled later.
+ continue;
+
if ( pNode->GetChar(nChar) == ' ' )
{
- // Don't use blank if language is arabic
- LanguageType eLang = GetLanguage( EditPaM( pNode, nChar ) );
- if ( MsLangId::getPrimaryLanguage( eLang) != LANGUAGE_ARABIC_PRIMARY_ONLY )
- aPositions.Insert( nChar, aPositions.Count() );
+ // Normal latin script.
+ aPositions.Insert( nChar, aPositions.Count() );
+ }
+ else if (nChar > nFirstChar)
+ {
+ if (nLastScript == i18n::ScriptType::ASIAN)
+ {
+ // Set break position between this and the last character if
+ // the last character is asian script.
+ aPositions.Insert( nChar-1, aPositions.Count() );
+ }
+ else if (nScript == i18n::ScriptType::ASIAN)
+ {
+ // Set break position between a latin script and asian script.
+ aPositions.Insert( nChar-1, aPositions.Count() );
+ }
}
+
+ nLastScript = nScript;
}
// Kashidas ?
ImpFindKashidas( pNode, nFirstChar, nLastChar, aPositions );
-
if ( !aPositions.Count() )
return;
@@ -2058,12 +2080,13 @@ void ImpEditEngine::ImpAdjustBlocks( ParaPortion* pParaPortion, EditLine* pLine,
// Letztes Zeichen wird schon nicht mehr beachtet...
for ( USHORT n = 0; n < aPositions.Count(); n++ )
{
- nChar = aPositions[n];
+ USHORT nChar = aPositions[n];
if ( nChar < nLastChar )
{
USHORT nPortionStart, nPortion;
- nPortion = pParaPortion->GetTextPortions().FindPortion( nChar, nPortionStart );
+ nPortion = pParaPortion->GetTextPortions().FindPortion( nChar, nPortionStart, true );
TextPortion* pLastPortion = pParaPortion->GetTextPortions()[ nPortion ];
+ USHORT nPortionEnd = nPortionStart + pLastPortion->GetLen();
// Die Breite der Portion:
pLastPortion->GetSize().Width() += nMore4Everyone;
@@ -2072,7 +2095,7 @@ void ImpEditEngine::ImpAdjustBlocks( ParaPortion* pParaPortion, EditLine* pLine,
// Correct positions in array
// Even for kashidas just change positions, VCL will then draw the kashida automaticly
- USHORT nPortionEnd = nPortionStart + pLastPortion->GetLen();
+
for ( USHORT _n = nChar; _n < nPortionEnd; _n++ )
{
pLine->GetCharPosArray()[_n-nFirstChar] += nMore4Everyone;
@@ -2883,6 +2906,8 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta
// if( GetStatus().DoOnlineSpelling() && pActiveView )
// aCurPos = pActiveView->pImpEditView->GetEditSelections().Max();
+ long nVertLineSpacing = CalcVertLineSpacing(aStartPos);
+
// --------------------------------------------------
// Ueber alle Absaetze...
// --------------------------------------------------
@@ -2931,12 +2956,16 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta
aTmpPos.X() += pLine->GetStartPosX();
aTmpPos.Y() += pLine->GetMaxAscent();
aStartPos.Y() += pLine->GetHeight();
+ if (nLine != nLastLine)
+ aStartPos.Y() += nVertLineSpacing;
}
else
{
aTmpPos.Y() += pLine->GetStartPosX();
aTmpPos.X() -= pLine->GetMaxAscent();
aStartPos.X() -= pLine->GetHeight();
+ if (nLine != nLastLine)
+ aStartPos.X() -= nVertLineSpacing;
}
if ( ( !IsVertical() && ( aStartPos.Y() > aClipRec.Top() ) )
@@ -4038,6 +4067,54 @@ ParaPortion* ImpEditEngine::GetNextVisPortion( ParaPortion* pCurPortion )
return pPortion;
}
+long ImpEditEngine::CalcVertLineSpacing(Point& rStartPos) const
+{
+ long nTotalOccupiedHeight = 0;
+ sal_uInt16 nTotalLineCount = 0;
+ const ParaPortionList& rParaPortions = GetParaPortions();
+ sal_uInt16 nParaCount = rParaPortions.Count();
+
+ for (sal_uInt16 i = 0; i < nParaCount; ++i)
+ {
+ if (GetVerJustification(i) != SVX_VER_JUSTIFY_BLOCK)
+ // All paragraphs must have the block justification set.
+ return 0;
+
+ ParaPortion* pPortion = rParaPortions.GetObject(i);
+ nTotalOccupiedHeight += pPortion->GetFirstLineOffset();
+
+ const SvxLineSpacingItem& rLSItem = (const SvxLineSpacingItem&)pPortion->GetNode()->GetContentAttribs().GetItem(EE_PARA_SBL);
+ sal_uInt16 nSBL = ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX )
+ ? GetYValue( rLSItem.GetInterLineSpace() ) : 0;
+
+ const SvxULSpaceItem& rULItem = (const SvxULSpaceItem&)pPortion->GetNode()->GetContentAttribs().GetItem(EE_PARA_ULSPACE);
+ long nUL = GetYValue( rULItem.GetLower() );
+
+ EditLineList& rLines = pPortion->GetLines();
+ sal_uInt16 nLineCount = rLines.Count();
+ nTotalLineCount += nLineCount;
+ for (sal_uInt16 j = 0; j < nLineCount; ++j)
+ {
+ EditLine* pLine = rLines.GetObject(j);
+ nTotalOccupiedHeight += pLine->GetHeight();
+ if (j < nLineCount-1)
+ nTotalOccupiedHeight += nSBL;
+ nTotalOccupiedHeight += nUL;
+ }
+ }
+
+ long nTotalSpace = IsVertical() ? aPaperSize.Width() : aPaperSize.Height();
+ nTotalSpace -= nTotalOccupiedHeight;
+ if (nTotalSpace <= 0 || nTotalLineCount <= 1)
+ return 0;
+
+ if (IsVertical())
+ // Shift the text to the right for the asian layout mode.
+ rStartPos.X() += nTotalSpace;
+
+ return nTotalSpace / (nTotalLineCount-1);
+}
+
EditPaM ImpEditEngine::InsertParagraph( sal_uInt16 nPara )
{
EditPaM aPaM;
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index af92ed6e41e3..effe1e71fcfb 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -32,14 +32,12 @@
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/script/XTypeConverter.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/table/CellVertJustify.hpp>
#include <com/sun/star/table/ShadowLocation.hpp>
#include <com/sun/star/table/TableBorder.hpp>
#include <com/sun/star/table/ShadowFormat.hpp>
#include <com/sun/star/table/CellRangeAddress.hpp>
#include <com/sun/star/table/CellContentType.hpp>
#include <com/sun/star/table/TableOrientation.hpp>
-#include <com/sun/star/table/CellHoriJustify.hpp>
#include <com/sun/star/util/SortField.hpp>
#include <com/sun/star/util/SortFieldType.hpp>
#include <com/sun/star/table/CellOrientation.hpp>
diff --git a/editeng/source/items/justifyitem.cxx b/editeng/source/items/justifyitem.cxx
new file mode 100644
index 000000000000..65130b9990a7
--- /dev/null
+++ b/editeng/source/items/justifyitem.cxx
@@ -0,0 +1,484 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_editeng.hxx"
+
+// include ---------------------------------------------------------------
+
+#include "editeng/justifyitem.hxx"
+#include "editeng/memberids.hrc"
+#include "editeng/editrids.hrc"
+#include "editeng/eerdll.hxx"
+
+#include <tools/stream.hxx>
+
+#include <com/sun/star/table/CellHoriJustify.hpp>
+#include <com/sun/star/style/ParagraphAdjust.hpp>
+#include <com/sun/star/table/CellJustifyMethod.hpp>
+#include <com/sun/star/table/CellVertJustify2.hpp>
+#include <com/sun/star/style/VerticalAlignment.hpp>
+
+// STATIC DATA -----------------------------------------------------------
+
+TYPEINIT1_FACTORY( SvxHorJustifyItem, SfxEnumItem, new SvxHorJustifyItem(SVX_HOR_JUSTIFY_STANDARD, 0) );
+TYPEINIT1_FACTORY( SvxVerJustifyItem, SfxEnumItem, new SvxVerJustifyItem(SVX_VER_JUSTIFY_STANDARD, 0) );
+
+using namespace ::com::sun::star;
+
+// class SvxHorJustifyItem -----------------------------------------------
+
+
+SvxHorJustifyItem::SvxHorJustifyItem( const USHORT nId ) :
+ SfxEnumItem( nId, (USHORT)SVX_HOR_JUSTIFY_STANDARD )
+{
+}
+
+SvxHorJustifyItem::SvxHorJustifyItem( const SvxCellHorJustify eJustify,
+ const USHORT nId ) :
+ SfxEnumItem( nId, (USHORT)eJustify )
+{
+}
+
+//------------------------------------------------------------------------
+
+SfxItemPresentation SvxHorJustifyItem::GetPresentation
+(
+ SfxItemPresentation ePres,
+ SfxMapUnit /*eCoreUnit*/,
+ SfxMapUnit /*ePresUnit*/,
+ XubString& rText, const IntlWrapper *) const
+{
+ switch ( ePres )
+ {
+ case SFX_ITEM_PRESENTATION_NONE:
+ rText.Erase();
+ return SFX_ITEM_PRESENTATION_NONE;
+ case SFX_ITEM_PRESENTATION_NAMELESS:
+ case SFX_ITEM_PRESENTATION_COMPLETE:
+ rText = GetValueText( GetValue() );
+ return SFX_ITEM_PRESENTATION_COMPLETE;
+ default: ; //prevent warning
+ }
+ return SFX_ITEM_PRESENTATION_NONE;
+}
+
+//------------------------------------------------------------------------
+
+sal_Bool SvxHorJustifyItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
+{
+// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
+ nMemberId &= ~CONVERT_TWIPS;
+ switch ( nMemberId )
+ {
+ case MID_HORJUST_HORJUST:
+ {
+ table::CellHoriJustify eUno = table::CellHoriJustify_STANDARD;
+ switch ( (SvxCellHorJustify)GetValue() )
+ {
+ case SVX_HOR_JUSTIFY_STANDARD: eUno = table::CellHoriJustify_STANDARD; break;
+ case SVX_HOR_JUSTIFY_LEFT: eUno = table::CellHoriJustify_LEFT; break;
+ case SVX_HOR_JUSTIFY_CENTER: eUno = table::CellHoriJustify_CENTER; break;
+ case SVX_HOR_JUSTIFY_RIGHT: eUno = table::CellHoriJustify_RIGHT; break;
+ case SVX_HOR_JUSTIFY_BLOCK: eUno = table::CellHoriJustify_BLOCK; break;
+ case SVX_HOR_JUSTIFY_REPEAT: eUno = table::CellHoriJustify_REPEAT; break;
+ }
+ rVal <<= eUno;
+ }
+ break;
+ case MID_HORJUST_ADJUST:
+ {
+ // ParagraphAdjust values, as in SvxAdjustItem
+ // (same value for ParaAdjust and ParaLastLineAdjust)
+
+ sal_Int16 nAdjust = style::ParagraphAdjust_LEFT;
+ switch ( (SvxCellHorJustify)GetValue() )
+ {
+ // ParagraphAdjust_LEFT is used for STANDARD and REPEAT
+ case SVX_HOR_JUSTIFY_STANDARD:
+ case SVX_HOR_JUSTIFY_REPEAT:
+ case SVX_HOR_JUSTIFY_LEFT: nAdjust = style::ParagraphAdjust_LEFT; break;
+ case SVX_HOR_JUSTIFY_CENTER: nAdjust = style::ParagraphAdjust_CENTER; break;
+ case SVX_HOR_JUSTIFY_RIGHT: nAdjust = style::ParagraphAdjust_RIGHT; break;
+ case SVX_HOR_JUSTIFY_BLOCK: nAdjust = style::ParagraphAdjust_BLOCK; break;
+ }
+ rVal <<= nAdjust; // as sal_Int16
+ }
+ break;
+ }
+ return sal_True;
+}
+
+sal_Bool SvxHorJustifyItem::PutValue( const uno::Any& rVal, BYTE nMemberId )
+{
+// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
+ nMemberId &= ~CONVERT_TWIPS;
+ switch ( nMemberId )
+ {
+ case MID_HORJUST_HORJUST:
+ {
+ table::CellHoriJustify eUno;
+ if(!(rVal >>= eUno))
+ {
+ sal_Int32 nValue = 0;
+ if(!(rVal >>= nValue))
+ return sal_False;
+ eUno = (table::CellHoriJustify)nValue;
+ }
+ SvxCellHorJustify eSvx = SVX_HOR_JUSTIFY_STANDARD;
+ switch (eUno)
+ {
+ case table::CellHoriJustify_STANDARD: eSvx = SVX_HOR_JUSTIFY_STANDARD; break;
+ case table::CellHoriJustify_LEFT: eSvx = SVX_HOR_JUSTIFY_LEFT; break;
+ case table::CellHoriJustify_CENTER: eSvx = SVX_HOR_JUSTIFY_CENTER; break;
+ case table::CellHoriJustify_RIGHT: eSvx = SVX_HOR_JUSTIFY_RIGHT; break;
+ case table::CellHoriJustify_BLOCK: eSvx = SVX_HOR_JUSTIFY_BLOCK; break;
+ case table::CellHoriJustify_REPEAT: eSvx = SVX_HOR_JUSTIFY_REPEAT; break;
+ default: ; //prevent warning
+ }
+ SetValue( (USHORT)eSvx );
+ }
+ break;
+ case MID_HORJUST_ADJUST:
+ {
+ // property contains ParagraphAdjust values as sal_Int16
+ sal_Int16 nVal = sal_Int16();
+ if(!(rVal >>= nVal))
+ return sal_False;
+
+ SvxCellHorJustify eSvx = SVX_HOR_JUSTIFY_STANDARD;
+ switch (nVal)
+ {
+ // STRETCH is treated as BLOCK
+ case style::ParagraphAdjust_LEFT: eSvx = SVX_HOR_JUSTIFY_LEFT; break;
+ case style::ParagraphAdjust_RIGHT: eSvx = SVX_HOR_JUSTIFY_RIGHT; break;
+ case style::ParagraphAdjust_STRETCH:
+ case style::ParagraphAdjust_BLOCK: eSvx = SVX_HOR_JUSTIFY_BLOCK; break;
+ case style::ParagraphAdjust_CENTER: eSvx = SVX_HOR_JUSTIFY_CENTER; break;
+ }
+ SetValue( (USHORT)eSvx );
+ }
+ }
+ return sal_True;
+}
+
+//------------------------------------------------------------------------
+
+XubString SvxHorJustifyItem::GetValueText( USHORT nVal ) const
+{
+ DBG_ASSERT( nVal <= SVX_HOR_JUSTIFY_REPEAT, "enum overflow!" );
+ return EE_RESSTR(RID_SVXITEMS_HORJUST_STANDARD + nVal);
+}
+
+//------------------------------------------------------------------------
+
+SfxPoolItem* SvxHorJustifyItem::Clone( SfxItemPool* ) const
+{
+ return new SvxHorJustifyItem( *this );
+}
+
+//------------------------------------------------------------------------
+
+SfxPoolItem* SvxHorJustifyItem::Create( SvStream& rStream, USHORT ) const
+{
+ USHORT nVal;
+ rStream >> nVal;
+ return new SvxHorJustifyItem( (SvxCellHorJustify)nVal, Which() );
+}
+//------------------------------------------------------------------------
+
+USHORT SvxHorJustifyItem::GetValueCount() const
+{
+ return SVX_HOR_JUSTIFY_REPEAT + 1; // letzter Enum-Wert + 1
+}
+
+// class SvxVerJustifyItem -----------------------------------------------
+
+SvxVerJustifyItem::SvxVerJustifyItem( const USHORT nId ) :
+ SfxEnumItem( nId, (USHORT)SVX_VER_JUSTIFY_STANDARD )
+{
+}
+
+SvxVerJustifyItem::SvxVerJustifyItem( const SvxCellVerJustify eJustify,
+ const USHORT nId ) :
+ SfxEnumItem( nId, (USHORT)eJustify )
+{
+}
+
+//------------------------------------------------------------------------
+
+SfxItemPresentation SvxVerJustifyItem::GetPresentation
+(
+ SfxItemPresentation ePres,
+ SfxMapUnit /*eCoreUnit*/,
+ SfxMapUnit /*ePresUnit*/,
+ XubString& rText,
+ const IntlWrapper * ) const
+{
+ switch ( ePres )
+ {
+ case SFX_ITEM_PRESENTATION_NONE:
+ rText.Erase();
+ return SFX_ITEM_PRESENTATION_NONE;
+ case SFX_ITEM_PRESENTATION_NAMELESS:
+ case SFX_ITEM_PRESENTATION_COMPLETE:
+ rText = GetValueText( GetValue() );
+ return SFX_ITEM_PRESENTATION_COMPLETE;
+ default: ; //prevent warning
+ }
+ return SFX_ITEM_PRESENTATION_NONE;
+}
+
+//------------------------------------------------------------------------
+
+sal_Bool SvxVerJustifyItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
+{
+ nMemberId &= ~CONVERT_TWIPS;
+ switch ( nMemberId )
+ {
+ case MID_HORJUST_ADJUST:
+ {
+ style::VerticalAlignment eUno = style::VerticalAlignment_TOP;
+ switch ( (SvxCellVerJustify)GetValue() )
+ {
+ case SVX_VER_JUSTIFY_TOP: eUno = style::VerticalAlignment_TOP; break;
+ case SVX_VER_JUSTIFY_CENTER: eUno = style::VerticalAlignment_MIDDLE; break;
+ case SVX_VER_JUSTIFY_BOTTOM: eUno = style::VerticalAlignment_BOTTOM; break;
+ default: ; //prevent warning
+ }
+ rVal <<= eUno;
+ break;
+ }
+ default:
+ {
+ sal_Int32 nUno = table::CellVertJustify2::STANDARD;
+ switch ( (SvxCellVerJustify)GetValue() )
+ {
+ case SVX_VER_JUSTIFY_STANDARD: nUno = table::CellVertJustify2::STANDARD; break;
+ case SVX_VER_JUSTIFY_TOP: nUno = table::CellVertJustify2::TOP; break;
+ case SVX_VER_JUSTIFY_CENTER: nUno = table::CellVertJustify2::CENTER; break;
+ case SVX_VER_JUSTIFY_BOTTOM: nUno = table::CellVertJustify2::BOTTOM; break;
+ case SVX_VER_JUSTIFY_BLOCK: nUno = table::CellVertJustify2::BLOCK; break;
+ default: ; //prevent warning
+ }
+ rVal <<= nUno;
+ break;
+ }
+ }
+ return sal_True;
+}
+
+sal_Bool SvxVerJustifyItem::PutValue( const uno::Any& rVal, BYTE nMemberId )
+{
+ nMemberId &= ~CONVERT_TWIPS;
+ switch ( nMemberId )
+ {
+ case MID_HORJUST_ADJUST:
+ {
+ // property contains ParagraphAdjust values as sal_Int16
+ style::VerticalAlignment nVal = style::VerticalAlignment_TOP;
+ if(!(rVal >>= nVal))
+ return sal_False;
+
+ SvxCellVerJustify eSvx = SVX_VER_JUSTIFY_STANDARD;
+ switch (nVal)
+ {
+ case style::VerticalAlignment_TOP: eSvx = SVX_VER_JUSTIFY_TOP; break;
+ case style::VerticalAlignment_MIDDLE: eSvx = SVX_VER_JUSTIFY_CENTER; break;
+ case style::VerticalAlignment_BOTTOM: eSvx = SVX_VER_JUSTIFY_BOTTOM; break;
+ default:;
+ }
+ SetValue( (USHORT)eSvx );
+ break;
+ }
+ default:
+ {
+ sal_Int32 eUno;
+ if(!(rVal >>= eUno))
+ {
+ eUno = table::CellVertJustify2::STANDARD;
+ }
+
+ SvxCellVerJustify eSvx = SVX_VER_JUSTIFY_STANDARD;
+ switch (eUno)
+ {
+ case table::CellVertJustify2::STANDARD: eSvx = SVX_VER_JUSTIFY_STANDARD; break;
+ case table::CellVertJustify2::TOP: eSvx = SVX_VER_JUSTIFY_TOP; break;
+ case table::CellVertJustify2::CENTER: eSvx = SVX_VER_JUSTIFY_CENTER; break;
+ case table::CellVertJustify2::BOTTOM: eSvx = SVX_VER_JUSTIFY_BOTTOM; break;
+ case table::CellVertJustify2::BLOCK: eSvx = SVX_VER_JUSTIFY_BLOCK; break;
+ default: ; //prevent warning
+ }
+ SetValue( (USHORT)eSvx );
+ break;
+ }
+ }
+
+ return sal_True;
+}
+
+//------------------------------------------------------------------------
+
+XubString SvxVerJustifyItem::GetValueText( USHORT nVal ) const
+{
+ DBG_ASSERT( nVal <= SVX_VER_JUSTIFY_BOTTOM, "enum overflow!" );
+ return EE_RESSTR(RID_SVXITEMS_VERJUST_STANDARD + nVal);
+}
+
+//------------------------------------------------------------------------
+
+SfxPoolItem* SvxVerJustifyItem::Clone( SfxItemPool* ) const
+{
+ return new SvxVerJustifyItem( *this );
+}
+
+//------------------------------------------------------------------------
+
+SfxPoolItem* SvxVerJustifyItem::Create( SvStream& rStream, USHORT ) const
+{
+ USHORT nVal;
+ rStream >> nVal;
+ return new SvxVerJustifyItem( (SvxCellVerJustify)nVal, Which() );
+}
+
+//------------------------------------------------------------------------
+
+USHORT SvxVerJustifyItem::GetValueCount() const
+{
+ return SVX_VER_JUSTIFY_BOTTOM + 1; // letzter Enum-Wert + 1
+}
+
+
+// class SvxJustifyMethodItem -----------------------------------------------
+
+SvxJustifyMethodItem::SvxJustifyMethodItem( const USHORT nId ) :
+ SfxEnumItem( nId, (USHORT)SVX_JUSTIFY_METHOD_AUTO )
+{
+}
+
+SvxJustifyMethodItem::SvxJustifyMethodItem( const SvxCellJustifyMethod eJustify,
+ const USHORT nId ) :
+ SfxEnumItem( nId, (USHORT)eJustify )
+{
+}
+
+//------------------------------------------------------------------------
+
+SfxItemPresentation SvxJustifyMethodItem::GetPresentation
+(
+ SfxItemPresentation ePres,
+ SfxMapUnit /*eCoreUnit*/,
+ SfxMapUnit /*ePresUnit*/,
+ XubString& rText,
+ const IntlWrapper * ) const
+{
+ switch ( ePres )
+ {
+ case SFX_ITEM_PRESENTATION_NONE:
+ rText.Erase();
+ return SFX_ITEM_PRESENTATION_NONE;
+ case SFX_ITEM_PRESENTATION_NAMELESS:
+ case SFX_ITEM_PRESENTATION_COMPLETE:
+ rText = GetValueText( GetValue() );
+ return SFX_ITEM_PRESENTATION_COMPLETE;
+ default: ; //prevent warning
+ }
+ return SFX_ITEM_PRESENTATION_NONE;
+}
+
+//------------------------------------------------------------------------
+
+sal_Bool SvxJustifyMethodItem::QueryValue( uno::Any& rVal, BYTE /*nMemberId*/ ) const
+{
+ sal_Int32 nUno = table::CellJustifyMethod::AUTO;
+ switch (static_cast<SvxCellJustifyMethod>(GetValue()))
+ {
+ case SVX_JUSTIFY_METHOD_AUTO: nUno = table::CellJustifyMethod::AUTO; break;
+ case SVX_JUSTIFY_METHOD_DISTRIBUTE: nUno = table::CellJustifyMethod::DISTRIBUTE; break;
+ default:;
+ }
+ rVal <<= nUno;
+ return true;
+}
+
+sal_Bool SvxJustifyMethodItem::PutValue( const uno::Any& rVal, BYTE /*nMemberId*/ )
+{
+ sal_Int32 nVal = table::CellJustifyMethod::AUTO;
+ if (!(rVal >>= nVal))
+ return false;
+
+ SvxCellJustifyMethod eSvx = SVX_JUSTIFY_METHOD_AUTO;
+ switch (nVal)
+ {
+ case table::CellJustifyMethod::AUTO:
+ eSvx = SVX_JUSTIFY_METHOD_AUTO;
+ break;
+ case table::CellJustifyMethod::DISTRIBUTE:
+ eSvx = SVX_JUSTIFY_METHOD_DISTRIBUTE;
+ break;
+ default:;
+ }
+ SetValue(static_cast<USHORT>(eSvx));
+ return true;
+}
+
+//------------------------------------------------------------------------
+
+XubString SvxJustifyMethodItem::GetValueText( USHORT nVal ) const
+{
+ DBG_ASSERT( nVal <= SVX_VER_JUSTIFY_BOTTOM, "enum overflow!" );
+ return EE_RESSTR(RID_SVXITEMS_JUSTMETHOD_AUTO + nVal);
+}
+
+//------------------------------------------------------------------------
+
+SfxPoolItem* SvxJustifyMethodItem::Clone( SfxItemPool* ) const
+{
+ return new SvxJustifyMethodItem( *this );
+}
+
+//------------------------------------------------------------------------
+
+SfxPoolItem* SvxJustifyMethodItem::Create( SvStream& rStream, USHORT ) const
+{
+ USHORT nVal;
+ rStream >> nVal;
+ return new SvxJustifyMethodItem( (SvxCellJustifyMethod)nVal, Which() );
+}
+
+//------------------------------------------------------------------------
+
+USHORT SvxJustifyMethodItem::GetValueCount() const
+{
+ return SVX_JUSTIFY_METHOD_DISTRIBUTE + 1; // letzter Enum-Wert + 1
+}
+
+SvxJustifyMethodItem& SvxJustifyMethodItem::operator=(const SvxJustifyMethodItem& r)
+{
+ SetValue( r.GetValue() );
+ return *this;
+}
diff --git a/editeng/source/items/makefile.mk b/editeng/source/items/makefile.mk
index 512db7cc34bd..1a2424455ae6 100644
--- a/editeng/source/items/makefile.mk
+++ b/editeng/source/items/makefile.mk
@@ -56,6 +56,7 @@ SLOFILES= \
$(SLO)$/svdfield.obj \
$(SLO)$/writingmodeitem.obj \
$(SLO)$/frmitems.obj \
+ $(SLO)$/justifyitem.obj \
$(SLO)$/paraitem.obj \
$(SLO)$/textitem.obj \
$(SLO)$/flditem.obj \
diff --git a/editeng/source/items/svxitems.src b/editeng/source/items/svxitems.src
index d738a10a1ede..2158b97f66b5 100644
--- a/editeng/source/items/svxitems.src
+++ b/editeng/source/items/svxitems.src
@@ -1023,5 +1023,56 @@ String RID_SVXITEMS_CHARHIDDEN_TRUE
{
Text [ en-US ] = "Hidden";
};
+ // enum SvxCellHorJustify ----------------------------------------------------
+String RID_SVXITEMS_HORJUST_STANDARD
+{
+ Text [ en-US ] = "Horizontal alignment default" ;
+};
+String RID_SVXITEMS_HORJUST_LEFT
+{
+ Text [ en-US ] = "Align left" ;
+};
+String RID_SVXITEMS_HORJUST_CENTER
+{
+ Text [ en-US ] = "Centered horizontally" ;
+};
+String RID_SVXITEMS_HORJUST_RIGHT
+{
+ Text [ en-US ] = "Align right" ;
+};
+String RID_SVXITEMS_HORJUST_BLOCK
+{
+ Text [ en-US ] = "Justify" ;
+};
+String RID_SVXITEMS_HORJUST_REPEAT
+{
+ Text [ en-US ] = "Repeat alignment" ;
+};
+ // enum SvxCellVerJustify ----------------------------------------------------
+String RID_SVXITEMS_VERJUST_STANDARD
+{
+ Text [ en-US ] = "Vertical alignment default" ;
+};
+String RID_SVXITEMS_VERJUST_TOP
+{
+ Text [ en-US ] = "Align to top" ;
+};
+String RID_SVXITEMS_VERJUST_CENTER
+{
+ Text [ en-US ] = "Centered vertically" ;
+};
+String RID_SVXITEMS_VERJUST_BOTTOM
+{
+ Text [ en-US ] = "Align to bottom" ;
+};
+ // enum SvxCellJustifyMethod ----------------------------------------------------
+String RID_SVXITEMS_JUSTMETHOD_AUTO
+{
+ Text [ en-US ] = "Automatic" ;
+};
+String RID_SVXITEMS_JUSTMETHOD_DISTRIBUTE
+{
+ Text [ en-US ] = "Distributed" ;
+};
// ********************************************************************** EOF
diff --git a/svx/inc/svx/algitem.hxx b/svx/inc/svx/algitem.hxx
index 62dd8303d9e5..561d1ef9e4af 100644
--- a/svx/inc/svx/algitem.hxx
+++ b/svx/inc/svx/algitem.hxx
@@ -39,77 +39,6 @@ class SvStream;
//------------------------------------------------------------------------
-
-
-class SVX_DLLPUBLIC SvxHorJustifyItem: public SfxEnumItem
-{
-public:
- TYPEINFO();
-
- SvxHorJustifyItem( const USHORT nId );
-
- SvxHorJustifyItem(
- const SvxCellHorJustify eJustify /*= SVX_HOR_JUSTIFY_STANDARD*/,
- const USHORT nId );
-
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
- SfxMapUnit eCoreMetric,
- SfxMapUnit ePresMetric,
- String &rText, const IntlWrapper * = 0 ) const;
-
- virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
- virtual bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
-
- virtual USHORT GetValueCount() const;
- virtual String GetValueText( USHORT nVal ) const;
- virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
- virtual SfxPoolItem* Create( SvStream& rStream, USHORT nVer ) const;
-
- inline SvxHorJustifyItem& operator=(const SvxHorJustifyItem& rHorJustify)
- {
- SetValue( rHorJustify.GetValue() );
- return *this;
- }
-};
-
-
-//------------------------------------------------------------------------
-
-
-class SVX_DLLPUBLIC SvxVerJustifyItem: public SfxEnumItem
-{
-public:
- TYPEINFO();
-
- SvxVerJustifyItem( const USHORT nId );
-
- SvxVerJustifyItem(
- const SvxCellVerJustify eJustify /*= SVX_VER_JUSTIFY_STANDARD*/,
- const USHORT nId );
-
- virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
- SfxMapUnit eCoreMetric,
- SfxMapUnit ePresMetric,
- String &rText, const IntlWrapper * = 0 ) const;
-
- virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
- virtual bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
-
- virtual USHORT GetValueCount() const;
- virtual String GetValueText( USHORT nVal ) const;
- virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
- virtual SfxPoolItem* Create( SvStream& rStream, USHORT nVer ) const;
-
- inline SvxVerJustifyItem& operator=(const SvxVerJustifyItem& rVerJustify)
- {
- SetValue( rVerJustify.GetValue() );
- return *this;
- }
-};
-
-
-//------------------------------------------------------------------------
-
class SVX_DLLPUBLIC SvxOrientationItem: public SfxEnumItem
{
public:
diff --git a/svx/inc/svx/svxids.hrc b/svx/inc/svx/svxids.hrc
index 1cdfc9fb2b9e..6d1e5a119659 100755
--- a/svx/inc/svx/svxids.hrc
+++ b/svx/inc/svx/svxids.hrc
@@ -591,8 +591,8 @@
#define SID_ATTR_POSITION ( SID_SVX_START + 223 )
#define SID_ATTR_SIZE ( SID_SVX_START + 224 )
#define SID_TABLE_CELL ( SID_SVX_START + 225 )
-#define SID_ATTR_ALIGN_HOR_JUSTIFY ( SID_SVX_START + 226 )
-#define SID_ATTR_ALIGN_VER_JUSTIFY ( SID_SVX_START + 227 )
+//#define SID_ATTR_ALIGN_HOR_JUSTIFY ( SID_SVX_START + 226 )
+//#define SID_ATTR_ALIGN_VER_JUSTIFY ( SID_SVX_START + 227 )
#define SID_ATTR_ALIGN_MARGIN ( SID_SVX_START + 228 )
#define SID_ATTR_ALIGN_STACKED ( SID_SVX_START + 229 )
#define SID_ATTR_ALIGN_LINEBREAK ( SID_SVX_START + 230 )
diff --git a/svx/inc/svx/svxitems.hrc b/svx/inc/svx/svxitems.hrc
index 3f3e4aaa8613..4a526b9738e4 100644
--- a/svx/inc/svx/svxitems.hrc
+++ b/svx/inc/svx/svxitems.hrc
@@ -104,20 +104,6 @@
#define RID_SVXITEMS_CHARSET_SYSTEM (RID_SVXITEMS_START + 154)
#define RID_SVXITEMS_CHARSET_SYMBOL (RID_SVXITEMS_START + 155)
-// enum SvxCellHorJustify
-#define RID_SVXITEMS_HORJUST_STANDARD (RID_SVXITEMS_START + 400)
-#define RID_SVXITEMS_HORJUST_LEFT (RID_SVXITEMS_START + 401)
-#define RID_SVXITEMS_HORJUST_CENTER (RID_SVXITEMS_START + 402)
-#define RID_SVXITEMS_HORJUST_RIGHT (RID_SVXITEMS_START + 403)
-#define RID_SVXITEMS_HORJUST_BLOCK (RID_SVXITEMS_START + 404)
-#define RID_SVXITEMS_HORJUST_REPEAT (RID_SVXITEMS_START + 405)
-
-// enum SvxCellVerJustify
-#define RID_SVXITEMS_VERJUST_STANDARD (RID_SVXITEMS_START + 406)
-#define RID_SVXITEMS_VERJUST_TOP (RID_SVXITEMS_START + 407)
-#define RID_SVXITEMS_VERJUST_CENTER (RID_SVXITEMS_START + 408)
-#define RID_SVXITEMS_VERJUST_BOTTOM (RID_SVXITEMS_START + 409)
-
// enum SvxCellOrientation
#define RID_SVXITEMS_ORI_STANDARD (RID_SVXITEMS_START + 410)
#define RID_SVXITEMS_ORI_TOPBOTTOM (RID_SVXITEMS_START + 411)
diff --git a/svx/source/items/algitem.cxx b/svx/source/items/algitem.cxx
index 0229ec3876b2..9e525f32a68e 100644
--- a/svx/source/items/algitem.cxx
+++ b/svx/source/items/algitem.cxx
@@ -33,16 +33,12 @@
#include <tools/stream.hxx>
#include <com/sun/star/table/BorderLine.hpp>
-#include <com/sun/star/table/CellVertJustify.hpp>
#include <com/sun/star/table/ShadowLocation.hpp>
#include <com/sun/star/table/TableBorder.hpp>
#include <com/sun/star/table/ShadowFormat.hpp>
#include <com/sun/star/table/CellRangeAddress.hpp>
#include <com/sun/star/table/CellContentType.hpp>
#include <com/sun/star/table/TableOrientation.hpp>
-#include <com/sun/star/table/CellHoriJustify.hpp>
-#include <com/sun/star/style/ParagraphAdjust.hpp>
-#include "com/sun/star/style/VerticalAlignment.hpp"
#include <com/sun/star/util/SortField.hpp>
#include <com/sun/star/util/SortFieldType.hpp>
#include <com/sun/star/table/CellOrientation.hpp>
@@ -63,334 +59,9 @@ using namespace ::com::sun::star;
// STATIC DATA -----------------------------------------------------------
//TYPEINIT1_AUTOFACTORY( SvxHorJustifyItem, SfxEnumItem );
-TYPEINIT1_FACTORY( SvxHorJustifyItem, SfxEnumItem, new SvxHorJustifyItem(SVX_HOR_JUSTIFY_STANDARD, 0))
-TYPEINIT1_FACTORY( SvxVerJustifyItem, SfxEnumItem, new SvxVerJustifyItem(SVX_VER_JUSTIFY_STANDARD, 0) );
TYPEINIT1_FACTORY( SvxOrientationItem, SfxEnumItem, new SvxOrientationItem(SVX_ORIENTATION_STANDARD, 0) );
TYPEINIT1_FACTORY( SvxMarginItem, SfxPoolItem, new SvxMarginItem(0) );
-// class SvxHorJustifyItem -----------------------------------------------
-
-
-SvxHorJustifyItem::SvxHorJustifyItem( const USHORT nId ) :
- SfxEnumItem( nId, (USHORT)SVX_HOR_JUSTIFY_STANDARD )
-{
-}
-
-SvxHorJustifyItem::SvxHorJustifyItem( const SvxCellHorJustify eJustify,
- const USHORT nId ) :
- SfxEnumItem( nId, (USHORT)eJustify )
-{
-}
-
-//------------------------------------------------------------------------
-
-SfxItemPresentation SvxHorJustifyItem::GetPresentation
-(
- SfxItemPresentation ePres,
- SfxMapUnit /*eCoreUnit*/,
- SfxMapUnit /*ePresUnit*/,
- XubString& rText, const IntlWrapper *) const
-{
- switch ( ePres )
- {
- case SFX_ITEM_PRESENTATION_NONE:
- rText.Erase();
- return SFX_ITEM_PRESENTATION_NONE;
- case SFX_ITEM_PRESENTATION_NAMELESS:
- case SFX_ITEM_PRESENTATION_COMPLETE:
- rText = GetValueText( GetValue() );
- return SFX_ITEM_PRESENTATION_COMPLETE;
- default: ; //prevent warning
- }
- return SFX_ITEM_PRESENTATION_NONE;
-}
-
-//------------------------------------------------------------------------
-
-bool SvxHorJustifyItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
-{
-// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
- nMemberId &= ~CONVERT_TWIPS;
- switch ( nMemberId )
- {
- case MID_HORJUST_HORJUST:
- {
- table::CellHoriJustify eUno = table::CellHoriJustify_STANDARD;
- switch ( (SvxCellHorJustify)GetValue() )
- {
- case SVX_HOR_JUSTIFY_STANDARD: eUno = table::CellHoriJustify_STANDARD; break;
- case SVX_HOR_JUSTIFY_LEFT: eUno = table::CellHoriJustify_LEFT; break;
- case SVX_HOR_JUSTIFY_CENTER: eUno = table::CellHoriJustify_CENTER; break;
- case SVX_HOR_JUSTIFY_RIGHT: eUno = table::CellHoriJustify_RIGHT; break;
- case SVX_HOR_JUSTIFY_BLOCK: eUno = table::CellHoriJustify_BLOCK; break;
- case SVX_HOR_JUSTIFY_REPEAT: eUno = table::CellHoriJustify_REPEAT; break;
- }
- rVal <<= eUno;
- }
- break;
- case MID_HORJUST_ADJUST:
- {
- // ParagraphAdjust values, as in SvxAdjustItem
- // (same value for ParaAdjust and ParaLastLineAdjust)
-
- sal_Int16 nAdjust = style::ParagraphAdjust_LEFT;
- switch ( (SvxCellHorJustify)GetValue() )
- {
- // ParagraphAdjust_LEFT is used for STANDARD and REPEAT
- case SVX_HOR_JUSTIFY_STANDARD:
- case SVX_HOR_JUSTIFY_REPEAT:
- case SVX_HOR_JUSTIFY_LEFT: nAdjust = style::ParagraphAdjust_LEFT; break;
- case SVX_HOR_JUSTIFY_CENTER: nAdjust = style::ParagraphAdjust_CENTER; break;
- case SVX_HOR_JUSTIFY_RIGHT: nAdjust = style::ParagraphAdjust_RIGHT; break;
- case SVX_HOR_JUSTIFY_BLOCK: nAdjust = style::ParagraphAdjust_BLOCK; break;
- }
- rVal <<= nAdjust; // as sal_Int16
- }
- break;
- }
- return true;
-}
-
-bool SvxHorJustifyItem::PutValue( const uno::Any& rVal, BYTE nMemberId )
-{
-// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
- nMemberId &= ~CONVERT_TWIPS;
- switch ( nMemberId )
- {
- case MID_HORJUST_HORJUST:
- {
- table::CellHoriJustify eUno;
- if(!(rVal >>= eUno))
- {
- sal_Int32 nValue = 0;
- if(!(rVal >>= nValue))
- return sal_False;
- eUno = (table::CellHoriJustify)nValue;
- }
- SvxCellHorJustify eSvx = SVX_HOR_JUSTIFY_STANDARD;
- switch (eUno)
- {
- case table::CellHoriJustify_STANDARD: eSvx = SVX_HOR_JUSTIFY_STANDARD; break;
- case table::CellHoriJustify_LEFT: eSvx = SVX_HOR_JUSTIFY_LEFT; break;
- case table::CellHoriJustify_CENTER: eSvx = SVX_HOR_JUSTIFY_CENTER; break;
- case table::CellHoriJustify_RIGHT: eSvx = SVX_HOR_JUSTIFY_RIGHT; break;
- case table::CellHoriJustify_BLOCK: eSvx = SVX_HOR_JUSTIFY_BLOCK; break;
- case table::CellHoriJustify_REPEAT: eSvx = SVX_HOR_JUSTIFY_REPEAT; break;
- default: ; //prevent warning
- }
- SetValue( (USHORT)eSvx );
- }
- break;
- case MID_HORJUST_ADJUST:
- {
- // property contains ParagraphAdjust values as sal_Int16
- sal_Int16 nVal = sal_Int16();
- if(!(rVal >>= nVal))
- return sal_False;
-
- SvxCellHorJustify eSvx = SVX_HOR_JUSTIFY_STANDARD;
- switch (nVal)
- {
- // STRETCH is treated as BLOCK
- case style::ParagraphAdjust_LEFT: eSvx = SVX_HOR_JUSTIFY_LEFT; break;
- case style::ParagraphAdjust_RIGHT: eSvx = SVX_HOR_JUSTIFY_RIGHT; break;
- case style::ParagraphAdjust_STRETCH:
- case style::ParagraphAdjust_BLOCK: eSvx = SVX_HOR_JUSTIFY_BLOCK; break;
- case style::ParagraphAdjust_CENTER: eSvx = SVX_HOR_JUSTIFY_CENTER; break;
- }
- SetValue( (USHORT)eSvx );
- }
- }
- return true;
-}
-
-//------------------------------------------------------------------------
-
-XubString SvxHorJustifyItem::GetValueText( USHORT nVal ) const
-{
- DBG_ASSERT( nVal <= SVX_HOR_JUSTIFY_REPEAT, "enum overflow!" );
- return SVX_RESSTR(RID_SVXITEMS_HORJUST_STANDARD + nVal);
-}
-
-//------------------------------------------------------------------------
-
-SfxPoolItem* SvxHorJustifyItem::Clone( SfxItemPool* ) const
-{
- return new SvxHorJustifyItem( *this );
-}
-
-//------------------------------------------------------------------------
-
-SfxPoolItem* SvxHorJustifyItem::Create( SvStream& rStream, USHORT ) const
-{
- USHORT nVal;
- rStream >> nVal;
- return new SvxHorJustifyItem( (SvxCellHorJustify)nVal, Which() );
-}
-//------------------------------------------------------------------------
-
-USHORT SvxHorJustifyItem::GetValueCount() const
-{
- return SVX_HOR_JUSTIFY_REPEAT + 1; // letzter Enum-Wert + 1
-}
-
-// class SvxVerJustifyItem -----------------------------------------------
-
-SvxVerJustifyItem::SvxVerJustifyItem( const USHORT nId ) :
- SfxEnumItem( nId, (USHORT)SVX_VER_JUSTIFY_STANDARD )
-{
-}
-
-SvxVerJustifyItem::SvxVerJustifyItem( const SvxCellVerJustify eJustify,
- const USHORT nId ) :
- SfxEnumItem( nId, (USHORT)eJustify )
-{
-}
-
-//------------------------------------------------------------------------
-
-SfxItemPresentation SvxVerJustifyItem::GetPresentation
-(
- SfxItemPresentation ePres,
- SfxMapUnit /*eCoreUnit*/,
- SfxMapUnit /*ePresUnit*/,
- XubString& rText,
- const IntlWrapper * ) const
-{
- switch ( ePres )
- {
- case SFX_ITEM_PRESENTATION_NONE:
- rText.Erase();
- return SFX_ITEM_PRESENTATION_NONE;
- case SFX_ITEM_PRESENTATION_NAMELESS:
- case SFX_ITEM_PRESENTATION_COMPLETE:
- rText = GetValueText( GetValue() );
- return SFX_ITEM_PRESENTATION_COMPLETE;
- default: ; //prevent warning
- }
- return SFX_ITEM_PRESENTATION_NONE;
-}
-
-//------------------------------------------------------------------------
-
-bool SvxVerJustifyItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
-{
- nMemberId &= ~CONVERT_TWIPS;
- switch ( nMemberId )
- {
- case MID_HORJUST_ADJUST:
- {
- style::VerticalAlignment eUno = style::VerticalAlignment_TOP;
- switch ( (SvxCellVerJustify)GetValue() )
- {
- case SVX_VER_JUSTIFY_TOP: eUno = style::VerticalAlignment_TOP; break;
- case SVX_VER_JUSTIFY_CENTER: eUno = style::VerticalAlignment_MIDDLE; break;
- case SVX_VER_JUSTIFY_BOTTOM: eUno = style::VerticalAlignment_BOTTOM; break;
- default: ; //prevent warning
- }
- rVal <<= eUno;
- break;
- }
- default:
- {
- table::CellVertJustify eUno = table::CellVertJustify_STANDARD;
- switch ( (SvxCellVerJustify)GetValue() )
- {
- case SVX_VER_JUSTIFY_STANDARD: eUno = table::CellVertJustify_STANDARD; break;
- case SVX_VER_JUSTIFY_TOP: eUno = table::CellVertJustify_TOP; break;
- case SVX_VER_JUSTIFY_CENTER: eUno = table::CellVertJustify_CENTER; break;
- case SVX_VER_JUSTIFY_BOTTOM: eUno = table::CellVertJustify_BOTTOM; break;
- default: ; //prevent warning
- }
- rVal <<= eUno;
- break;
- }
- }
- return true;
-}
-
-bool SvxVerJustifyItem::PutValue( const uno::Any& rVal, BYTE nMemberId )
-{
- nMemberId &= ~CONVERT_TWIPS;
- switch ( nMemberId )
- {
- case MID_HORJUST_ADJUST:
- {
- // property contains ParagraphAdjust values as sal_Int16
- style::VerticalAlignment nVal = style::VerticalAlignment_TOP;
- if(!(rVal >>= nVal))
- return sal_False;
-
- SvxCellVerJustify eSvx = SVX_VER_JUSTIFY_STANDARD;
- switch (nVal)
- {
- case style::VerticalAlignment_TOP: eSvx = SVX_VER_JUSTIFY_TOP; break;
- case style::VerticalAlignment_MIDDLE: eSvx = SVX_VER_JUSTIFY_CENTER; break;
- case style::VerticalAlignment_BOTTOM: eSvx = SVX_VER_JUSTIFY_BOTTOM; break;
- default:;
- }
- SetValue( (USHORT)eSvx );
- break;
- }
- default:
- {
- table::CellVertJustify eUno;
- if(!(rVal >>= eUno))
- {
- sal_Int32 nValue = 0;
- if(!(rVal >>= nValue))
- return sal_False;
- eUno = (table::CellVertJustify)nValue;
- }
-
- SvxCellVerJustify eSvx = SVX_VER_JUSTIFY_STANDARD;
- switch (eUno)
- {
- case table::CellVertJustify_STANDARD: eSvx = SVX_VER_JUSTIFY_STANDARD; break;
- case table::CellVertJustify_TOP: eSvx = SVX_VER_JUSTIFY_TOP; break;
- case table::CellVertJustify_CENTER: eSvx = SVX_VER_JUSTIFY_CENTER; break;
- case table::CellVertJustify_BOTTOM: eSvx = SVX_VER_JUSTIFY_BOTTOM; break;
- default: ; //prevent warning
- }
- SetValue( (USHORT)eSvx );
- break;
- }
- }
-
- return true;
-}
-
-//------------------------------------------------------------------------
-
-XubString SvxVerJustifyItem::GetValueText( USHORT nVal ) const
-{
- DBG_ASSERT( nVal <= SVX_VER_JUSTIFY_BOTTOM, "enum overflow!" );
- return SVX_RESSTR(RID_SVXITEMS_VERJUST_STANDARD + nVal);
-}
-
-//------------------------------------------------------------------------
-
-SfxPoolItem* SvxVerJustifyItem::Clone( SfxItemPool* ) const
-{
- return new SvxVerJustifyItem( *this );
-}
-
-//------------------------------------------------------------------------
-
-SfxPoolItem* SvxVerJustifyItem::Create( SvStream& rStream, USHORT ) const
-{
- USHORT nVal;
- rStream >> nVal;
- return new SvxVerJustifyItem( (SvxCellVerJustify)nVal, Which() );
-}
-
-//------------------------------------------------------------------------
-
-USHORT SvxVerJustifyItem::GetValueCount() const
-{
- return SVX_VER_JUSTIFY_BOTTOM + 1; // letzter Enum-Wert + 1
-}
-
// class SvxOrientationItem ----------------------------------------------
SvxOrientationItem::SvxOrientationItem( const SvxCellOrientation eOrientation,
diff --git a/svx/source/items/makefile.mk b/svx/source/items/makefile.mk
index 188e6171bd26..6e1f2a3177bc 100644
--- a/svx/source/items/makefile.mk
+++ b/svx/source/items/makefile.mk
@@ -50,6 +50,7 @@ SRC1FILES = \
LIB1TARGET= $(SLB)$/$(TARGET)-core.lib
LIB1OBJFILES= \
+ $(SLO)$/algitem.obj \
$(SLO)$/drawitem.obj \
$(SLO)$/chrtitem.obj \
$(SLO)$/e3ditem.obj \
@@ -64,7 +65,6 @@ LIB2OBJFILES= \
$(SLO)$/hlnkitem.obj \
$(SLO)$/pageitem.obj \
$(SLO)$/viewlayoutitem.obj \
- $(SLO)$/algitem.obj \
$(SLO)$/rotmodit.obj \
$(SLO)$/numinf.obj \
$(SLO)$/svxerr.obj \
diff --git a/svx/source/items/rotmodit.cxx b/svx/source/items/rotmodit.cxx
index 3f74d0815c86..9221f2d7c49a 100644
--- a/svx/source/items/rotmodit.cxx
+++ b/svx/source/items/rotmodit.cxx
@@ -29,14 +29,13 @@
#include "precompiled_svx.hxx"
#include <tools/stream.hxx>
#include <com/sun/star/table/BorderLine.hpp>
-#include <com/sun/star/table/CellVertJustify.hpp>
+#include <com/sun/star/table/CellVertJustify2.hpp>
#include <com/sun/star/table/ShadowLocation.hpp>
#include <com/sun/star/table/TableBorder.hpp>
#include <com/sun/star/table/ShadowFormat.hpp>
#include <com/sun/star/table/CellRangeAddress.hpp>
#include <com/sun/star/table/CellContentType.hpp>
#include <com/sun/star/table/TableOrientation.hpp>
-#include <com/sun/star/table/CellHoriJustify.hpp>
#include <com/sun/star/util/SortField.hpp>
#include <com/sun/star/util/SortFieldType.hpp>
#include <com/sun/star/table/CellOrientation.hpp>
@@ -134,40 +133,35 @@ USHORT __EXPORT SvxRotateModeItem::GetVersion( USHORT /*nFileVersion*/ ) const
return 0;
}
-// QueryValue/PutValue: Der ::com::sun::star::table::CellVertJustify enum wird mitbenutzt...
-
bool SvxRotateModeItem::QueryValue( uno::Any& rVal, BYTE /*nMemberId*/ ) const
{
- table::CellVertJustify eUno = table::CellVertJustify_STANDARD;
+ sal_Int32 nUno = table::CellVertJustify2::STANDARD;
switch ( (SvxRotateMode)GetValue() )
{
- case SVX_ROTATE_MODE_STANDARD: eUno = table::CellVertJustify_STANDARD; break;
- case SVX_ROTATE_MODE_TOP: eUno = table::CellVertJustify_TOP; break;
- case SVX_ROTATE_MODE_CENTER: eUno = table::CellVertJustify_CENTER; break;
- case SVX_ROTATE_MODE_BOTTOM: eUno = table::CellVertJustify_BOTTOM; break;
+ case SVX_ROTATE_MODE_STANDARD: nUno = table::CellVertJustify2::STANDARD; break;
+ case SVX_ROTATE_MODE_TOP: nUno = table::CellVertJustify2::TOP; break;
+ case SVX_ROTATE_MODE_CENTER: nUno = table::CellVertJustify2::CENTER; break;
+ case SVX_ROTATE_MODE_BOTTOM: nUno = table::CellVertJustify2::BOTTOM; break;
}
- rVal <<= eUno;
+ rVal <<= nUno;
return true;
}
bool SvxRotateModeItem::PutValue( const uno::Any& rVal, BYTE /*nMemberId*/ )
{
- table::CellVertJustify eUno;
- if(!(rVal >>= eUno))
+ sal_Int32 nUno;
+ if(!(rVal >>= nUno))
{
- sal_Int32 nValue = 0;
- if(!(rVal >>= nValue))
- return sal_False;
- eUno = (table::CellVertJustify)nValue;
+ nUno = table::CellVertJustify2::STANDARD;
}
SvxRotateMode eSvx = SVX_ROTATE_MODE_STANDARD;
- switch (eUno)
+ switch (nUno)
{
- case table::CellVertJustify_STANDARD: eSvx = SVX_ROTATE_MODE_STANDARD; break;
- case table::CellVertJustify_TOP: eSvx = SVX_ROTATE_MODE_TOP; break;
- case table::CellVertJustify_CENTER: eSvx = SVX_ROTATE_MODE_CENTER; break;
- case table::CellVertJustify_BOTTOM: eSvx = SVX_ROTATE_MODE_BOTTOM; break;
+ case table::CellVertJustify2::STANDARD: eSvx = SVX_ROTATE_MODE_STANDARD; break;
+ case table::CellVertJustify2::TOP: eSvx = SVX_ROTATE_MODE_TOP; break;
+ case table::CellVertJustify2::CENTER: eSvx = SVX_ROTATE_MODE_CENTER; break;
+ case table::CellVertJustify2::BOTTOM: eSvx = SVX_ROTATE_MODE_BOTTOM; break;
default: ;//prevent warning
}
SetValue( (USHORT)eSvx );
diff --git a/svx/source/items/svxitems.src b/svx/source/items/svxitems.src
index e21ea8fc6e4b..0dd9dbf21593 100644
--- a/svx/source/items/svxitems.src
+++ b/svx/source/items/svxitems.src
@@ -216,46 +216,6 @@ String RID_SVXITEMS_BRUSHSTYLE_BITMAP
Text [ en-US ] = "Image" ;
};
-String RID_SVXITEMS_HORJUST_STANDARD
-{
- Text [ en-US ] = "Horizontal alignment default" ;
-};
-String RID_SVXITEMS_HORJUST_LEFT
-{
- Text [ en-US ] = "Align left" ;
-};
-String RID_SVXITEMS_HORJUST_CENTER
-{
- Text [ en-US ] = "Centered horizontally" ;
-};
-String RID_SVXITEMS_HORJUST_RIGHT
-{
- Text [ en-US ] = "Align right" ;
-};
-String RID_SVXITEMS_HORJUST_BLOCK
-{
- Text [ en-US ] = "Justify" ;
-};
-String RID_SVXITEMS_HORJUST_REPEAT
-{
- Text [ en-US ] = "Repeat alignment" ;
-};
-String RID_SVXITEMS_VERJUST_STANDARD
-{
- Text [ en-US ] = "Vertical alignment default" ;
-};
-String RID_SVXITEMS_VERJUST_TOP
-{
- Text [ en-US ] = "Align to top" ;
-};
-String RID_SVXITEMS_VERJUST_CENTER
-{
- Text [ en-US ] = "Centered vertically" ;
-};
-String RID_SVXITEMS_VERJUST_BOTTOM
-{
- Text [ en-US ] = "Align to bottom" ;
-};
String RID_SVXITEMS_ORI_STANDARD
{
Text [ en-US ] = "Default orientation" ;
diff --git a/xmloff/inc/xmlnmspe.hxx b/xmloff/inc/xmlnmspe.hxx
index 7b7b7e131ec7..ae194cfbf770 100644
--- a/xmloff/inc/xmlnmspe.hxx
+++ b/xmloff/inc/xmlnmspe.hxx
@@ -104,6 +104,6 @@ XML_OLD_NAMESPACE( META, 6U )
// experimental namespaces
XML_NAMESPACE( FIELD, 100U )
-
+XML_NAMESPACE( CSS3TEXT, 103U ) // CSS Text Level 3
#endif // _XMLOFF_XMLNMSPE_HXX
diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx
index 1c0b88f5d691..a2606ea12b96 100644
--- a/xmloff/inc/xmloff/xmltoken.hxx
+++ b/xmloff/inc/xmloff/xmltoken.hxx
@@ -148,9 +148,14 @@ namespace xmloff { namespace token {
XML_NP_TABLE_EXT,
XML_N_TABLE_EXT,
+
XML_NP_DRAW_EXT,
XML_N_DRAW_EXT,
+ // css text level 3
+ XML_NP_CSS3TEXT,
+ XML_N_CSS3TEXT,
+
// units
XML_UNIT_MM,
XML_UNIT_M,
@@ -606,6 +611,7 @@ namespace xmloff { namespace token {
XML_DISTANCE,
XML_DISTANCE_AFTER_SEP,
XML_DISTANCE_BEFORE_SEP,
+ XML_DISTRIBUTE,
XML_DISTRIBUTE_LETTER,
XML_DISTRIBUTE_SPACE,
XML_DIVIDE,
@@ -1776,6 +1782,7 @@ namespace xmloff { namespace token {
XML_TEXT_GLOBAL,
XML_TEXT_INDENT,
XML_TEXT_INPUT,
+ XML_TEXT_JUSTIFY,
XML_TEXT_OUTLINE,
XML_TEXT_POSITION,
XML_TEXT_ROTATION_ANGLE,
@@ -1909,6 +1916,7 @@ namespace xmloff { namespace token {
XML_VERSION_LIST,
XML_VERTICAL,
XML_VERTICAL_ALIGN,
+ XML_VERTICAL_JUSTIFY,
XML_VERTICAL_LINES,
XML_VERTICAL_POS,
XML_VERTICAL_REL,
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index b1ba8520c1db..3cdea25344fe 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -422,6 +422,12 @@ void SvXMLExport::_InitCtor()
mpNamespaceMap->Add( GetXMLToken(XML_NP_GRDDL),
GetXMLToken(XML_N_GRDDL), XML_NAMESPACE_GRDDL );
}
+ // CSS Text Level 3 for distributed text justification.
+ if ( (getExportFlags() & (EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_MASTERSTYLES)) != 0 )
+ {
+ mpNamespaceMap->Add(
+ GetXMLToken(XML_NP_CSS3TEXT), GetXMLToken(XML_N_CSS3TEXT), XML_NAMESPACE_CSS3TEXT );
+ }
mxAttrList = (xml::sax::XAttributeList*)mpAttrList;
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index c791fe4077d4..97ecaac68fa7 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -119,6 +119,7 @@ sal_Char __READONLY_DATA sXML_np__xsd[] = "_xsd";
sal_Char __READONLY_DATA sXML_np__xsi[] = "_xsi";
sal_Char __READONLY_DATA sXML_np__field[] = "_field";
sal_Char __READONLY_DATA sXML_np__xhtml[] = "_xhtml";
+sal_Char __READONLY_DATA sXML_np__css3text[] = "_css3text";
sal_Char __READONLY_DATA sXML_np__fo_old[] = "__fo";
sal_Char __READONLY_DATA sXML_np__xlink_old[] = "__xlink";
@@ -323,6 +324,9 @@ void SvXMLImport::_InitCtor()
mpNamespaceMap->Add(
OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__xhtml ) ),
GetXMLToken(XML_N_XHTML), XML_NAMESPACE_XHTML );
+ mpNamespaceMap->Add(
+ OUString( RTL_CONSTASCII_USTRINGPARAM( sXML_np__css3text ) ),
+ GetXMLToken(XML_N_CSS3TEXT), XML_NAMESPACE_CSS3TEXT );
}
msPackageProtocol = OUString( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.Package:" ) );
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 7538003a86fb..ab35644777b3 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -159,6 +159,9 @@ namespace xmloff { namespace token {
TOKEN( "drawooo", XML_NP_DRAW_EXT ),
TOKEN( "http://openoffice.org/2010/draw", XML_N_DRAW_EXT ),
+ TOKEN( "css3t", XML_NP_CSS3TEXT ),
+ TOKEN( "http://www.w3.org/TR/css3-text/", XML_N_CSS3TEXT ),
+
// units
TOKEN( "mm", XML_UNIT_MM ),
TOKEN( "m", XML_UNIT_M ),
@@ -614,6 +617,7 @@ namespace xmloff { namespace token {
TOKEN( "distance", XML_DISTANCE ),
TOKEN( "distance-after-sep", XML_DISTANCE_AFTER_SEP ),
TOKEN( "distance-before-sep", XML_DISTANCE_BEFORE_SEP ),
+ TOKEN( "distribute", XML_DISTRIBUTE ),
TOKEN( "distribute-letter", XML_DISTRIBUTE_LETTER ),
TOKEN( "distribute-space", XML_DISTRIBUTE_SPACE ),
TOKEN( "divide", XML_DIVIDE ),
@@ -1784,6 +1788,7 @@ namespace xmloff { namespace token {
TOKEN( "text-global", XML_TEXT_GLOBAL ),
TOKEN( "text-indent", XML_TEXT_INDENT ),
TOKEN( "text-input", XML_TEXT_INPUT ),
+ TOKEN( "text-justify", XML_TEXT_JUSTIFY ),
TOKEN( "text-outline", XML_TEXT_OUTLINE ),
TOKEN( "text-position", XML_TEXT_POSITION ),
TOKEN( "text-rotation-angle", XML_TEXT_ROTATION_ANGLE ),
@@ -1917,6 +1922,7 @@ namespace xmloff { namespace token {
TOKEN( "version-list", XML_VERSION_LIST ),
TOKEN( "vertical", XML_VERTICAL ),
TOKEN( "vertical-align", XML_VERTICAL_ALIGN ),
+ TOKEN( "vertical-justify", XML_VERTICAL_JUSTIFY ),
TOKEN( "vertical-lines", XML_VERTICAL_LINES ),
TOKEN( "vertical-pos", XML_VERTICAL_POS ),
TOKEN( "vertical-rel", XML_VERTICAL_REL ),