summaryrefslogtreecommitdiff
path: root/editeng/inc
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
commit59766998c4be373b8a8feb84d55157e94755c1c2 (patch)
treef13931dac4eb83698ae95cdd268b88bf4bc194cc /editeng/inc
parent5039415ee76af364e260492cfc8cde4b66ef35cf (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.
Diffstat (limited to 'editeng/inc')
-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
6 files changed, 205 insertions, 45 deletions
diff --git a/editeng/inc/editeng/editids.hrc b/editeng/inc/editeng/editids.hrc
index 0d1acb4615..386dd0b411 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 97c9a4b266..6e11e0617c 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 695ec8a8fb..64729a5f9c 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 0000000000..1db820dc4f
--- /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 0eaff89bbe..e9cb0b565b 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 fc0bb18946..1ab0bfe8c3 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