summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/inc/docpool.hxx5
-rw-r--r--sc/inc/document.hxx6
-rw-r--r--sc/inc/scitems.hxx104
-rw-r--r--sc/inc/unonames.hxx5
-rw-r--r--sc/source/core/data/docpool.cxx35
-rw-r--r--sc/source/core/data/documen8.cxx29
-rw-r--r--sc/source/core/data/patattr.cxx13
-rw-r--r--sc/source/core/data/stlsheet.cxx13
-rw-r--r--sc/source/filter/xml/xmlstyle.cxx5
-rw-r--r--sc/source/ui/app/inputhdl.cxx6
-rw-r--r--sc/source/ui/app/inputwin.cxx81
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx10
-rw-r--r--sc/source/ui/unoobj/styleuno.cxx6
-rw-r--r--sc/source/ui/view/output2.cxx34
-rw-r--r--sc/source/ui/view/output3.cxx6
-rw-r--r--sc/source/ui/view/viewdata.cxx10
16 files changed, 256 insertions, 112 deletions
diff --git a/sc/inc/docpool.hxx b/sc/inc/docpool.hxx
index e68f19efc4e7..33d32afdfcb4 100644
--- a/sc/inc/docpool.hxx
+++ b/sc/inc/docpool.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: docpool.hxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: dr $ $Date: 2002-04-03 10:09:14 $
+ * last change: $Author: nn $ $Date: 2002-09-09 13:57:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -82,6 +82,7 @@ class ScDocumentPool: public SfxItemPool
static USHORT* pVersionMap6;
static USHORT* pVersionMap7;
static USHORT* pVersionMap8;
+ static USHORT* pVersionMap9;
public:
ScDocumentPool( SfxItemPool* pSecPool = NULL, BOOL bLoadRefCounts = FALSE );
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index b464d3c1b07b..c933e5300010 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: document.hxx,v $
*
- * $Revision: 1.58 $
+ * $Revision: 1.59 $
*
- * last change: $Author: sab $ $Date: 2002-09-06 08:53:02 $
+ * last change: $Author: nn $ $Date: 2002-09-09 13:57:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1413,6 +1413,8 @@ public:
BOOL IsValidAsianKerning() const;
void SetAsianKerning(BOOL bNew);
+ BYTE GetEditTextDirection(USHORT nTab) const; // EEHorizontalTextDirection values
+
ScLkUpdMode GetLinkMode() const { return eLinkMode ;}
void SetLinkMode( ScLkUpdMode nSet ) { eLinkMode = nSet;}
diff --git a/sc/inc/scitems.hxx b/sc/inc/scitems.hxx
index 4ab07be2ee29..dfa1afbac812 100644
--- a/sc/inc/scitems.hxx
+++ b/sc/inc/scitems.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: scitems.hxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: dr $ $Date: 2002-04-03 10:09:14 $
+ * last change: $Author: nn $ $Date: 2002-09-09 13:57:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -132,63 +132,64 @@
#define ATTR_ROTATE_VALUE 132
#define ATTR_ROTATE_MODE 133
#define ATTR_VERTICAL_ASIAN 134
-#define ATTR_LINEBREAK 135
-#define ATTR_MARGIN 136
-#define ATTR_MERGE 137
-#define ATTR_MERGE_FLAG 138
-#define ATTR_VALUE_FORMAT 139
-#define ATTR_LANGUAGE_FORMAT 140
-#define ATTR_BACKGROUND 141
-#define ATTR_PROTECTION 142
-#define ATTR_BORDER 143
-#define ATTR_BORDER_INNER 144 // innen, wg. Vorlagen-EditDialog
-#define ATTR_SHADOW 145
-#define ATTR_VALIDDATA 146
-#define ATTR_CONDITIONAL 147
+#define ATTR_WRITINGDIR 135
+#define ATTR_LINEBREAK 136
+#define ATTR_MARGIN 137
+#define ATTR_MERGE 138
+#define ATTR_MERGE_FLAG 139
+#define ATTR_VALUE_FORMAT 140
+#define ATTR_LANGUAGE_FORMAT 141
+#define ATTR_BACKGROUND 142
+#define ATTR_PROTECTION 143
+#define ATTR_BORDER 144
+#define ATTR_BORDER_INNER 145 // innen, wg. Vorlagen-EditDialog
+#define ATTR_SHADOW 146
+#define ATTR_VALIDDATA 147
+#define ATTR_CONDITIONAL 148
-#define ATTR_PATTERN_END 147 // Ende Zellattribut-Pattern
+#define ATTR_PATTERN_END 148 // Ende Zellattribut-Pattern
-#define ATTR_PATTERN 148
+#define ATTR_PATTERN 149
// Seitenattribute
-#define ATTR_LRSPACE 149 // Editor: PageDesc-TabPage
-#define ATTR_ULSPACE 150
-#define ATTR_PAGE 151
-#define ATTR_PAGE_PAPERTRAY 152
-#define ATTR_PAGE_PAPERBIN 153
-#define ATTR_PAGE_SIZE 154
-#define ATTR_PAGE_MAXSIZE 155
-#define ATTR_PAGE_HORCENTER 156
-#define ATTR_PAGE_VERCENTER 157
+#define ATTR_LRSPACE 150 // Editor: PageDesc-TabPage
+#define ATTR_ULSPACE 151
+#define ATTR_PAGE 152
+#define ATTR_PAGE_PAPERTRAY 153
+#define ATTR_PAGE_PAPERBIN 154
+#define ATTR_PAGE_SIZE 155
+#define ATTR_PAGE_MAXSIZE 156
+#define ATTR_PAGE_HORCENTER 157
+#define ATTR_PAGE_VERCENTER 158
-#define ATTR_PAGE_ON 158 // Editor: Header/Footer-Page
-#define ATTR_PAGE_DYNAMIC 159
-#define ATTR_PAGE_SHARED 160
+#define ATTR_PAGE_ON 159 // Editor: Header/Footer-Page
+#define ATTR_PAGE_DYNAMIC 160
+#define ATTR_PAGE_SHARED 161
-#define ATTR_PAGE_NOTES 161 // Editor: Tabelle
-#define ATTR_PAGE_GRID 162
-#define ATTR_PAGE_HEADERS 163
-#define ATTR_PAGE_CHARTS 164
-#define ATTR_PAGE_OBJECTS 165
-#define ATTR_PAGE_DRAWINGS 166
-#define ATTR_PAGE_TOPDOWN 167
-#define ATTR_PAGE_SCALE 168
-#define ATTR_PAGE_SCALETOPAGES 169
-#define ATTR_PAGE_FIRSTPAGENO 170
+#define ATTR_PAGE_NOTES 162 // Editor: Tabelle
+#define ATTR_PAGE_GRID 163
+#define ATTR_PAGE_HEADERS 164
+#define ATTR_PAGE_CHARTS 165
+#define ATTR_PAGE_OBJECTS 166
+#define ATTR_PAGE_DRAWINGS 167
+#define ATTR_PAGE_TOPDOWN 168
+#define ATTR_PAGE_SCALE 169
+#define ATTR_PAGE_SCALETOPAGES 170
+#define ATTR_PAGE_FIRSTPAGENO 171
-#define ATTR_PAGE_PRINTAREA 171 // Editor: Druckbereiche
-#define ATTR_PAGE_REPEATROW 172
-#define ATTR_PAGE_REPEATCOL 173
-#define ATTR_PAGE_PRINTTABLES 174
+#define ATTR_PAGE_PRINTAREA 172 // Editor: Druckbereiche
+#define ATTR_PAGE_REPEATROW 173
+#define ATTR_PAGE_REPEATCOL 174
+#define ATTR_PAGE_PRINTTABLES 175
-#define ATTR_PAGE_HEADERLEFT 175 // Inhalte der Kopf-/
-#define ATTR_PAGE_FOOTERLEFT 176 // Fusszeilen (links)
-#define ATTR_PAGE_HEADERRIGHT 177 // Inhalte der Kopf-/
-#define ATTR_PAGE_FOOTERRIGHT 178 // Fusszeilen (rechts)
-#define ATTR_PAGE_HEADERSET 179 // die Sets dazu...
-#define ATTR_PAGE_FOOTERSET 180
+#define ATTR_PAGE_HEADERLEFT 176 // Inhalte der Kopf-/
+#define ATTR_PAGE_FOOTERLEFT 177 // Fusszeilen (links)
+#define ATTR_PAGE_HEADERRIGHT 178 // Inhalte der Kopf-/
+#define ATTR_PAGE_FOOTERRIGHT 179 // Fusszeilen (rechts)
+#define ATTR_PAGE_HEADERSET 180 // die Sets dazu...
+#define ATTR_PAGE_FOOTERSET 181
-#define ATTR_PAGE_FORMULAS 181
-#define ATTR_PAGE_NULLVALS 182
+#define ATTR_PAGE_FORMULAS 182
+#define ATTR_PAGE_NULLVALS 183
#define ATTR_ENDINDEX ATTR_PAGE_NULLVALS // Ende Pool-Range
@@ -243,6 +244,7 @@
#define ITEMID_HORJUSTIFY ATTR_HOR_JUSTIFY
#define ITEMID_VERJUSTIFY ATTR_VER_JUSTIFY
#define ITEMID_ORIENTATION ATTR_ORIENTATION
+#define ITEMID_FRAMEDIR ATTR_WRITINGDIR
#define ITEMID_LINEBREAK ATTR_LINEBREAK
#define ITEMID_MARGIN ATTR_MARGIN
#define ITEMID_ESCAPEMENT 0
diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx
index 3a8afc5846e5..2e4b83638204 100644
--- a/sc/inc/unonames.hxx
+++ b/sc/inc/unonames.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unonames.hxx,v $
*
- * $Revision: 1.43 $
+ * $Revision: 1.44 $
*
- * last change: $Author: nn $ $Date: 2002-08-26 18:13:38 $
+ * last change: $Author: nn $ $Date: 2002-09-09 13:57:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -136,6 +136,7 @@
#define SC_UNONAME_ROTANG "RotateAngle"
#define SC_UNONAME_ROTREF "RotateReference"
#define SC_UNONAME_ASIANVERT "AsianVerticalMode"
+#define SC_UNONAME_WRITING "WritingMode"
#define SC_UNONAME_BOTTBORDER "BottomBorder"
#define SC_UNONAME_LEFTBORDER "LeftBorder"
diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx
index 48912eb1b6a5..204d69a12d40 100644
--- a/sc/source/core/data/docpool.cxx
+++ b/sc/source/core/data/docpool.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: docpool.cxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: dr $ $Date: 2002-04-03 10:10:59 $
+ * last change: $Author: nn $ $Date: 2002-09-09 13:57:54 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -82,6 +82,7 @@
#include <svx/fhgtitem.hxx>
#include <svx/fontitem.hxx>
#include <svx/forbiddenruleitem.hxx>
+#include <svx/frmdiritem.hxx>
#include <svx/hngpnctitem.hxx>
#include <svx/itemtype.hxx>
#include <svx/langitem.hxx>
@@ -122,6 +123,7 @@ USHORT* ScDocumentPool::pVersionMap5 = 0;
USHORT* ScDocumentPool::pVersionMap6 = 0;
USHORT* ScDocumentPool::pVersionMap7 = 0;
USHORT* ScDocumentPool::pVersionMap8 = 0;
+USHORT* ScDocumentPool::pVersionMap9 = 0;
// ATTR_FONT_TWOLINES (not used) was changed to ATTR_USERDEF (not saved in binary format) in 641c
@@ -162,6 +164,7 @@ static SfxItemInfo __READONLY_DATA aItemInfos[] =
{ SID_ATTR_ALIGN_DEGREES, SFX_ITEM_POOLABLE }, // ATTR_ROTATE_VALUE ab 367
{ SID_ATTR_ALIGN_LOCKPOS, SFX_ITEM_POOLABLE }, // ATTR_ROTATE_MODE ab 367
{ SID_ATTR_ALIGN_ASIANVERTICAL, SFX_ITEM_POOLABLE }, // ATTR_VERTICAL_ASIAN from 642
+ { SID_ATTR_FRAMEDIRECTION, SFX_ITEM_POOLABLE }, // ATTR_WRITINGDIR from 643
{ SID_ATTR_ALIGN_LINEBREAK, SFX_ITEM_POOLABLE }, // ATTR_LINEBREAK
{ SID_ATTR_ALIGN_MARGIN, SFX_ITEM_POOLABLE }, // ATTR_MARGIN
{ 0, SFX_ITEM_POOLABLE }, // ATTR_MERGE
@@ -289,6 +292,10 @@ ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool, BOOL bLoadRefCounts )
ppPoolDefaults[ ATTR_ROTATE_VALUE - ATTR_STARTINDEX ] = new SfxInt32Item( ATTR_ROTATE_VALUE, 0 );
ppPoolDefaults[ ATTR_ROTATE_MODE - ATTR_STARTINDEX ] = new SvxRotateModeItem( SVX_ROTATE_MODE_BOTTOM, ATTR_ROTATE_MODE );
ppPoolDefaults[ ATTR_VERTICAL_ASIAN - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_VERTICAL_ASIAN );
+ // The default for the ATTR_WRITINGDIR cell attribute must by FRMDIR_ENVIRONMENT,
+ // so that value is returned when asking for a default cell's attributes.
+ // The value from the page style is set as DefaultHorizontalTextDirection for the EditEngine.
+ ppPoolDefaults[ ATTR_WRITINGDIR - ATTR_STARTINDEX ] = new SvxFrameDirectionItem( FRMDIR_ENVIRONMENT, ATTR_WRITINGDIR );
ppPoolDefaults[ ATTR_LINEBREAK - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_LINEBREAK );
ppPoolDefaults[ ATTR_MARGIN - ATTR_STARTINDEX ] = new SvxMarginItem;
ppPoolDefaults[ ATTR_MERGE - ATTR_STARTINDEX ] = new ScMergeAttr;
@@ -376,6 +383,9 @@ ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool, BOOL bLoadRefCounts )
// ATTR_VERTICAL_ASIAN from 642q
SetVersionMap( 8, 100, 181, pVersionMap8 );
+
+ // ATTR_WRITINGDIR from 643y
+ SetVersionMap( 9, 100, 182, pVersionMap9 );
}
__EXPORT ScDocumentPool::~ScDocumentPool()
@@ -397,7 +407,8 @@ void ScDocumentPool::InitVersionMaps()
DBG_ASSERT( !pVersionMap1 && !pVersionMap2 &&
!pVersionMap3 && !pVersionMap4 &&
!pVersionMap5 && !pVersionMap6 &&
- !pVersionMap7 && !pVersionMap8, "InitVersionMaps call multiple times" );
+ !pVersionMap7 && !pVersionMap8 &&
+ !pVersionMap9, "InitVersionMaps call multiple times" );
// alte WhichId's mappen
// nicht mit ATTR_* zaehlen, falls die sich nochmal aendern
@@ -506,6 +517,19 @@ void ScDocumentPool::InitVersionMaps()
// 1 entry inserted
for ( i=nMap8New, j=nMap8Start+nMap8New+1; i < nMap8Count; i++, j++ )
pVersionMap8[i] = j;
+
+ // 9th map: ATTR_WRITINGDIR added in 643y
+
+ const USHORT nMap9Start = 100; // ATTR_STARTINDEX
+ const USHORT nMap9End = 182; // ATTR_ENDINDEX
+ const USHORT nMap9Count = nMap9End - nMap9Start + 1;
+ const USHORT nMap9New = 35; // ATTR_WRITINGDIR - ATTR_STARTINDEX
+ pVersionMap9 = new USHORT [ nMap9Count ];
+ for ( i=0, j=nMap9Start; i < nMap9New; i++, j++ )
+ pVersionMap9[i] = j;
+ // 1 entry inserted
+ for ( i=nMap9New, j=nMap9Start+nMap9New+1; i < nMap9Count; i++, j++ )
+ pVersionMap9[i] = j;
}
void ScDocumentPool::DeleteVersionMaps()
@@ -513,8 +537,11 @@ void ScDocumentPool::DeleteVersionMaps()
DBG_ASSERT( pVersionMap1 && pVersionMap2 &&
pVersionMap3 && pVersionMap4 &&
pVersionMap5 && pVersionMap6 &&
- pVersionMap7 && pVersionMap8, "DeleteVersionMaps without maps" );
+ pVersionMap7 && pVersionMap8 &&
+ pVersionMap9, "DeleteVersionMaps without maps" );
+ delete[] pVersionMap9;
+ pVersionMap9 = 0;
delete[] pVersionMap8;
pVersionMap8 = 0;
delete[] pVersionMap7;
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 3282148959f3..9f91f16d8d3d 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: documen8.cxx,v $
*
- * $Revision: 1.25 $
+ * $Revision: 1.26 $
*
- * last change: $Author: nn $ $Date: 2002-03-04 19:25:17 $
+ * last change: $Author: nn $ $Date: 2002-09-09 13:57:54 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -72,6 +72,7 @@
#include <tools/string.hxx>
#include <svx/editobj.hxx>
#include <svx/editstat.hxx>
+#include <svx/frmdiritem.hxx>
#include <svx/langitem.hxx>
#include <svx/linkmgr.hxx>
#include <svx/scripttypeitem.hxx>
@@ -410,6 +411,30 @@ BOOL ScDocument::RenamePageStyleInUse( const String& rOld, const String& rNew )
//------------------------------------------------------------------------
+BYTE ScDocument::GetEditTextDirection(USHORT nTab) const
+{
+ EEHorizontalTextDirection eRet = EE_HTEXTDIR_DEFAULT;
+
+ String aStyleName = GetPageStyle( nTab );
+ SfxStyleSheetBase* pStyle = xPoolHelper->GetStylePool()->Find( aStyleName, SFX_STYLE_FAMILY_PAGE );
+ if ( pStyle )
+ {
+ SfxItemSet& rStyleSet = pStyle->GetItemSet();
+ SvxFrameDirection eDirection = (SvxFrameDirection)
+ ((const SvxFrameDirectionItem&)rStyleSet.Get( ATTR_WRITINGDIR )).GetValue();
+
+ if ( eDirection == FRMDIR_HORI_LEFT_TOP )
+ eRet = EE_HTEXTDIR_L2R;
+ else if ( eDirection == FRMDIR_HORI_RIGHT_TOP )
+ eRet = EE_HTEXTDIR_R2L;
+ // else (invalid for EditEngine): keep "default"
+ }
+
+ return eRet;
+}
+
+//------------------------------------------------------------------------
+
void ScDocument::InvalidateTextWidth( const ScAddress* pAdrFrom,
const ScAddress* pAdrTo,
BOOL bBroadcast )
diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index 09e79db986b4..dea6f9246280 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: patattr.cxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: nn $ $Date: 2002-04-24 13:32:55 $
+ * last change: $Author: nn $ $Date: 2002-09-09 13:57:54 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -80,6 +80,7 @@
#include <svx/fhgtitem.hxx>
#include <svx/fontitem.hxx>
#include <svx/forbiddenruleitem.hxx>
+#include <svx/frmdiritem.hxx>
#include <svx/langitem.hxx>
#include <svx/postitem.hxx>
#include <svx/rotmodit.hxx>
@@ -478,6 +479,7 @@ void ScPatternAttr::FillEditItemSet( SfxItemSet* pEditSet, const SfxItemSet* pCo
FontRelief eRelief;
LanguageType eLang, eCjkLang, eCtlLang;
BOOL bHyphenate;
+ SvxFrameDirection eDirection;
//! additional parameter to control if language is needed?
@@ -573,6 +575,10 @@ void ScPatternAttr::FillEditItemSet( SfxItemSet* pEditSet, const SfxItemSet* pCo
if ( pCondSet->GetItemState( ATTR_HYPHENATE, TRUE, &pItem ) != SFX_ITEM_SET )
pItem = &rMySet.Get( ATTR_HYPHENATE );
bHyphenate = ((const SfxBoolItem*)pItem)->GetValue();
+
+ if ( pCondSet->GetItemState( ATTR_WRITINGDIR, TRUE, &pItem ) != SFX_ITEM_SET )
+ pItem = &rMySet.Get( ATTR_WRITINGDIR );
+ eDirection = (SvxFrameDirection)((const SvxFrameDirectionItem*)pItem)->GetValue();
}
else // alles direkt aus Pattern
{
@@ -621,6 +627,8 @@ void ScPatternAttr::FillEditItemSet( SfxItemSet* pEditSet, const SfxItemSet* pCo
rMySet.Get( ATTR_CTL_FONT_LANGUAGE )).GetLanguage();
bHyphenate = ((const SfxBoolItem&)
rMySet.Get( ATTR_HYPHENATE )).GetValue();
+ eDirection = (SvxFrameDirection)((const SvxFrameDirectionItem&)
+ rMySet.Get( ATTR_WRITINGDIR )).GetValue();
}
// kompatibel zu LogicToLogic rechnen, also 2540/1440 = 127/72, und runden
@@ -656,6 +664,7 @@ void ScPatternAttr::FillEditItemSet( SfxItemSet* pEditSet, const SfxItemSet* pCo
pEditSet->Put( SvxLanguageItem ( eCjkLang, EE_CHAR_LANGUAGE_CJK ) );
pEditSet->Put( SvxLanguageItem ( eCtlLang, EE_CHAR_LANGUAGE_CTL ) );
pEditSet->Put( SfxBoolItem ( EE_PARA_HYPHENATE, bHyphenate ) );
+ pEditSet->Put( SvxFrameDirectionItem( eDirection, EE_PARA_WRITINGDIR ) );
}
void ScPatternAttr::GetFromEditItemSet( const SfxItemSet* pEditSet )
diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx
index c1eb69304895..13e62e06cf71 100644
--- a/sc/source/core/data/stlsheet.cxx
+++ b/sc/source/core/data/stlsheet.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: stlsheet.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: nn $ $Date: 2001-09-27 08:25:19 $
+ * last change: $Author: nn $ $Date: 2002-09-09 13:57:54 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -72,6 +72,7 @@
#include "scitems.hxx"
#include <svx/boxitem.hxx>
+#include <svx/frmdiritem.hxx>
#include <svx/lrspitem.hxx>
#include <svx/pageitem.hxx>
#include <svx/paperinf.hxx>
@@ -185,6 +186,7 @@ SfxItemSet& __EXPORT ScStyleSheet::GetItemSet()
ATTR_BACKGROUND, ATTR_BACKGROUND,
ATTR_BORDER, ATTR_SHADOW,
ATTR_LRSPACE, ATTR_PAGE_NULLVALS,
+ ATTR_WRITINGDIR, ATTR_WRITINGDIR,
ATTR_USERDEF, ATTR_USERDEF,
0 );
@@ -247,6 +249,13 @@ SfxItemSet& __EXPORT ScStyleSheet::GetItemSet()
pSet->Put( aBoxInfoItem ); // PoolDefault wg. Formatvorlagen
// nicht ueberschreiben!
+ // Writing direction: not as pool default because the default for cells
+ // must remain FRMDIR_ENVIRONMENT, and each page style's setting is
+ // supposed to be saved in the file format.
+ // The page default may be read from a configuration item later.
+ SvxFrameDirection eDirection = FRMDIR_HORI_LEFT_TOP;
+ pSet->Put( SvxFrameDirectionItem( eDirection ), ATTR_WRITINGDIR );
+
rPool.SetPoolDefaultItem( aPageItem );
rPool.SetPoolDefaultItem( aPaperSizeItem );
rPool.SetPoolDefaultItem( aLRSpaceItem );
diff --git a/sc/source/filter/xml/xmlstyle.cxx b/sc/source/filter/xml/xmlstyle.cxx
index 483fe29da8f0..bf3442fbe67b 100644
--- a/sc/source/filter/xml/xmlstyle.cxx
+++ b/sc/source/filter/xml/xmlstyle.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlstyle.cxx,v $
*
- * $Revision: 1.44 $
+ * $Revision: 1.45 $
*
- * last change: $Author: sab $ $Date: 2002-04-05 06:43:44 $
+ * last change: $Author: nn $ $Date: 2002-09-09 13:58:35 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -172,6 +172,7 @@ const XMLPropertyMapEntry aXMLScCellStylesProperties[] =
MAP( "UserDefinedAttributes", XML_NAMESPACE_TEXT, XML_XMLNS, XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM, 0 ),
MAP( "ValidationXML", XML_NAMESPACE_TABLE, XML_CONTENT_VALIDATION, XML_TYPE_BUILDIN_CMP_ONLY, CTF_SC_VALIDATION ),
MAP( "VertJustify", XML_NAMESPACE_FO, XML_VERTICAL_ALIGN, XML_SC_TYPE_VERTJUSTIFY, 0),
+ MAP( "WritingMode", XML_NAMESPACE_STYLE, XML_WRITING_MODE, XML_TYPE_TEXT_WRITING_MODE_WITH_DEFAULT, 0 ),
{ 0L }
};
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 7964640c7290..69fbe7af64f3 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: inputhdl.cxx,v $
*
- * $Revision: 1.36 $
+ * $Revision: 1.37 $
*
- * last change: $Author: nn $ $Date: 2002-08-21 10:10:56 $
+ * last change: $Author: nn $ $Date: 2002-09-09 13:58:54 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -502,6 +502,8 @@ void ScInputHandler::UpdateSpellSettings( BOOL bFromStartTab )
pEngine->SetForbiddenCharsTable( pDoc->GetForbiddenCharacters() );
pEngine->SetAsianCompressionMode( pDoc->GetAsianCompression() );
pEngine->SetKernAsianPunctuation( pDoc->GetAsianKerning() );
+ pEngine->SetDefaultHorizontalTextDirection(
+ (EEHorizontalTextDirection)pDoc->GetEditTextDirection( pViewData->GetTabNo() ) );
}
// language is set separately, so the speller is needed only if online
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index e97f61d8e881..c9b356061713 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: inputwin.cxx,v $
*
- * $Revision: 1.23 $
+ * $Revision: 1.24 $
*
- * last change: $Author: sab $ $Date: 2002-08-08 13:18:38 $
+ * last change: $Author: nn $ $Date: 2002-09-09 13:58:54 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -81,6 +81,7 @@
#include <vcl/system.hxx>
#include <stdlib.h> // qsort
#include <svx/scriptspaceitem.hxx>
+#include <svx/scripttypeitem.hxx>
#ifndef _SFXSTRITEM_HXX //autogen
#include <svtools/stritem.hxx>
@@ -1024,36 +1025,56 @@ void ScTextWnd::SetTextString( const String& rNewString )
if (!pEditEngine)
{
- xub_StrLen nDifPos;
- if (rNewString.Len() > aString.Len())
- nDifPos = rNewString.Match(aString);
- else
- nDifPos = aString.Match(rNewString);
+ // test if CTL script type is involved
+ BYTE nOldScript = 0;
+ BYTE nNewScript = 0;
+ SfxObjectShell* pObjSh = SfxObjectShell::Current();
+ if ( pObjSh && pObjSh->ISA(ScDocShell) )
+ {
+ // any document can be used (used only for its break iterator)
+ ScDocument* pDoc = ((ScDocShell*)pObjSh)->GetDocument();
+ nOldScript = pDoc->GetStringScriptType( aString );
+ nNewScript = pDoc->GetStringScriptType( rNewString );
+ }
- long nSize1 = GetTextWidth(aString);
- long nSize2 = GetTextWidth(rNewString);
- if ( nSize1>0 && nSize2>0 )
- nTextSize = Max( nSize1, nSize2 );
+ if ( ( nOldScript & SCRIPTTYPE_COMPLEX ) || ( nNewScript & SCRIPTTYPE_COMPLEX ) )
+ {
+ // if CTL is involved, the whole text has to be redrawn
+ Invalidate();
+ }
else
- nTextSize = GetOutputSize().Width(); // Ueberlauf
-
- if (nDifPos == STRING_MATCH)
- nDifPos = 0;
-
- // -1 wegen Rundung und "A"
- Point aLogicStart = PixelToLogic(Point(TEXT_STARTPOS-1,0));
- nStartPos = aLogicStart.X();
- nInvPos = nStartPos;
- if (nDifPos)
- nInvPos += GetTextWidth(aString,0,nDifPos);
-
- USHORT nFlags = 0;
- if ( nDifPos == aString.Len() ) // only new characters appended
- nFlags = INVALIDATE_NOERASE; // then background is already clear
-
- Invalidate( Rectangle( nInvPos, 0,
- nStartPos+nTextSize, GetOutputSize().Height()-1 ),
- nFlags );
+ {
+ xub_StrLen nDifPos;
+ if (rNewString.Len() > aString.Len())
+ nDifPos = rNewString.Match(aString);
+ else
+ nDifPos = aString.Match(rNewString);
+
+ long nSize1 = GetTextWidth(aString);
+ long nSize2 = GetTextWidth(rNewString);
+ if ( nSize1>0 && nSize2>0 )
+ nTextSize = Max( nSize1, nSize2 );
+ else
+ nTextSize = GetOutputSize().Width(); // Ueberlauf
+
+ if (nDifPos == STRING_MATCH)
+ nDifPos = 0;
+
+ // -1 wegen Rundung und "A"
+ Point aLogicStart = PixelToLogic(Point(TEXT_STARTPOS-1,0));
+ nStartPos = aLogicStart.X();
+ nInvPos = nStartPos;
+ if (nDifPos)
+ nInvPos += GetTextWidth(aString,0,nDifPos);
+
+ USHORT nFlags = 0;
+ if ( nDifPos == aString.Len() ) // only new characters appended
+ nFlags = INVALIDATE_NOERASE; // then background is already clear
+
+ Invalidate( Rectangle( nInvPos, 0,
+ nStartPos+nTextSize, GetOutputSize().Height()-1 ),
+ nFlags );
+ }
}
else
{
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 00b7fe81f357..b2aad7eec5d1 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: cellsuno.cxx,v $
*
- * $Revision: 1.66 $
+ * $Revision: 1.67 $
*
- * last change: $Author: sab $ $Date: 2002-09-04 08:33:47 $
+ * last change: $Author: nn $ $Date: 2002-09-09 13:59:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -277,6 +277,7 @@ const SfxItemPropertyMap* lcl_GetCellsPropertyMap()
{MAP_CHAR_LEN(SC_UNONAME_VALILOC), SC_WID_UNO_VALILOC, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_VALIXML), SC_WID_UNO_VALIXML, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0 | beans::PropertyAttribute::READONLY, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLVJUS), ATTR_VER_JUSTIFY, &getCppuType((table::CellVertJustify*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_WRITING), ATTR_WRITINGDIR, &getCppuType((sal_Int16*)0), 0, 0 },
{0,0,0,0}
};
return aCellsPropertyMap_Impl;
@@ -369,6 +370,7 @@ const SfxItemPropertyMap* lcl_GetRangePropertyMap()
{MAP_CHAR_LEN(SC_UNONAME_VALILOC), SC_WID_UNO_VALILOC, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_VALIXML), SC_WID_UNO_VALIXML, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0 | beans::PropertyAttribute::READONLY, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLVJUS), ATTR_VER_JUSTIFY, &getCppuType((table::CellVertJustify*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_WRITING), ATTR_WRITINGDIR, &getCppuType((sal_Int16*)0), 0, 0 },
{0,0,0,0}
};
return aRangePropertyMap_Impl;
@@ -463,6 +465,7 @@ const SfxItemPropertyMap* lcl_GetCellPropertyMap()
{MAP_CHAR_LEN(SC_UNONAME_VALILOC), SC_WID_UNO_VALILOC, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_VALIXML), SC_WID_UNO_VALIXML, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0 | beans::PropertyAttribute::READONLY, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLVJUS), ATTR_VER_JUSTIFY, &getCppuType((table::CellVertJustify*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_WRITING), ATTR_WRITINGDIR, &getCppuType((sal_Int16*)0), 0, 0 },
{0,0,0,0}
};
return aCellPropertyMap_Impl;
@@ -561,6 +564,7 @@ const SfxItemPropertyMap* lcl_GetColumnPropertyMap()
{MAP_CHAR_LEN(SC_UNONAME_VALIXML), SC_WID_UNO_VALIXML, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0 | beans::PropertyAttribute::READONLY, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLVJUS), ATTR_VER_JUSTIFY, &getCppuType((table::CellVertJustify*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLWID), SC_WID_UNO_CELLWID, &getCppuType((sal_Int32*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_WRITING), ATTR_WRITINGDIR, &getCppuType((sal_Int16*)0), 0, 0 },
{0,0,0,0}
};
return aColumnPropertyMap_Impl;
@@ -656,6 +660,7 @@ const SfxItemPropertyMap* lcl_GetRowPropertyMap()
{MAP_CHAR_LEN(SC_UNONAME_VALILOC), SC_WID_UNO_VALILOC, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_VALIXML), SC_WID_UNO_VALIXML, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0 | beans::PropertyAttribute::READONLY, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLVJUS), ATTR_VER_JUSTIFY, &getCppuType((table::CellVertJustify*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_WRITING), ATTR_WRITINGDIR, &getCppuType((sal_Int16*)0), 0, 0 },
{0,0,0,0}
};
return aRowPropertyMap_Impl;
@@ -749,6 +754,7 @@ const SfxItemPropertyMap* lcl_GetSheetPropertyMap()
{MAP_CHAR_LEN(SC_UNONAME_VALILOC), SC_WID_UNO_VALILOC, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_VALIXML), SC_WID_UNO_VALIXML, &getCppuType((uno::Reference<beans::XPropertySet>*)0), 0 | beans::PropertyAttribute::READONLY, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLVJUS), ATTR_VER_JUSTIFY, &getCppuType((table::CellVertJustify*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_WRITING), ATTR_WRITINGDIR, &getCppuType((sal_Int16*)0), 0, 0 },
{0,0,0,0}
};
return aSheetPropertyMap_Impl;
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index 3e61816ad857..0e3eb5f48dd1 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: styleuno.cxx,v $
*
- * $Revision: 1.25 $
+ * $Revision: 1.26 $
*
- * last change: $Author: nn $ $Date: 2002-04-04 10:33:57 $
+ * last change: $Author: nn $ $Date: 2002-09-09 13:59:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -187,6 +187,7 @@ const SfxItemPropertyMap* lcl_GetCellStyleMap()
{MAP_CHAR_LEN(SC_UNONAME_TOPBORDER),ATTR_BORDER, &::getCppuType((const table::BorderLine*)0), 0, TOP_BORDER | CONVERT_TWIPS },
{MAP_CHAR_LEN(SC_UNONAME_USERDEF), ATTR_USERDEF, &getCppuType((uno::Reference<container::XNameContainer>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_CELLVJUS), ATTR_VER_JUSTIFY, &::getCppuType((const table::CellVertJustify*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_WRITING), ATTR_WRITINGDIR, &getCppuType((sal_Int16*)0), 0, 0 },
{0,0,0,0}
};
return aCellStyleMap_Impl;
@@ -303,6 +304,7 @@ const SfxItemPropertyMap* lcl_GetPageStyleMap()
{MAP_CHAR_LEN(OLD_UNO_PAGE_HDRBACKTRAN),SC_WID_UNO_HEADERSET,&::getBooleanCppuType(), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_USERDEF), ATTR_USERDEF, &getCppuType((uno::Reference<container::XNameContainer>*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNO_PAGE_WIDTH), ATTR_PAGE_SIZE, &::getCppuType((const sal_Int32*)0), 0, MID_SIZE_WIDTH | CONVERT_TWIPS },
+ {MAP_CHAR_LEN(SC_UNONAME_WRITING), ATTR_WRITINGDIR, &getCppuType((sal_Int16*)0), 0, 0 },
{0,0,0,0}
};
return aPageStyleMap_Impl;
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 5dddab4b82c2..42bc41e7e150 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: output2.cxx,v $
*
- * $Revision: 1.25 $
+ * $Revision: 1.26 $
*
- * last change: $Author: nn $ $Date: 2002-08-21 10:12:34 $
+ * last change: $Author: nn $ $Date: 2002-09-09 14:00:36 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1690,6 +1690,8 @@ void ScOutputData::DrawEdit(BOOL bPixelToLogic)
pEngine->SetAsianCompressionMode( pDoc->GetAsianCompression() );
pEngine->SetKernAsianPunctuation( pDoc->GetAsianKerning() );
pEngine->EnableAutoColor( bUseStyleColor );
+ pEngine->SetDefaultHorizontalTextDirection(
+ (EEHorizontalTextDirection)pDoc->GetEditTextDirection( nTab ) );
}
else
lcl_ClearEdit( *pEngine ); // also calls SetUpdateMode(FALSE)
@@ -2417,6 +2419,19 @@ void ScOutputData::DrawEdit(BOOL bPixelToLogic)
pEngine->SetPaperSize(aPaperLogic);
}
+ if ( pEngine->IsRightToLeft( 0 ) )
+ {
+ // For right-to-left, EditEngine always calculates its lines
+ // beginning from the right edge, but EditLine::nStartPosX is
+ // of USHORT type, so the PaperSize must be limited to USHRT_MAX.
+ Size aLogicPaper = pEngine->GetPaperSize();
+ if ( aLogicPaper.Width() > USHRT_MAX )
+ {
+ aLogicPaper.Width() = USHRT_MAX;
+ pEngine->SetPaperSize(aLogicPaper);
+ }
+ }
+
if ( bSimClip && !nOriVal && !bAsianVertical )
{
// kein hartes Clipping, aber nur die betroffenen
@@ -2524,6 +2539,8 @@ void ScOutputData::DrawRotated(BOOL bPixelToLogic)
pEngine->SetAsianCompressionMode( pDoc->GetAsianCompression() );
pEngine->SetKernAsianPunctuation( pDoc->GetAsianKerning() );
pEngine->EnableAutoColor( bUseStyleColor );
+ pEngine->SetDefaultHorizontalTextDirection(
+ (EEHorizontalTextDirection)pDoc->GetEditTextDirection( nTab ) );
}
else
lcl_ClearEdit( *pEngine ); // also calls SetUpdateMode(FALSE)
@@ -3181,6 +3198,19 @@ void ScOutputData::DrawRotated(BOOL bPixelToLogic)
//! bSimClip is not used here (because nOriVal is set)
+ if ( pEngine->IsRightToLeft( 0 ) )
+ {
+ // For right-to-left, EditEngine always calculates its lines
+ // beginning from the right edge, but EditLine::nStartPosX is
+ // of USHORT type, so the PaperSize must be limited to USHRT_MAX.
+ Size aLogicPaper = pEngine->GetPaperSize();
+ if ( aLogicPaper.Width() > USHRT_MAX )
+ {
+ aLogicPaper.Width() = USHRT_MAX;
+ pEngine->SetPaperSize(aLogicPaper);
+ }
+ }
+
pEngine->Draw( pDev, aLogicStart, (short)nOriVal );
if (bClip)
diff --git a/sc/source/ui/view/output3.cxx b/sc/source/ui/view/output3.cxx
index e3b1e118306c..a898e6a4b93d 100644
--- a/sc/source/ui/view/output3.cxx
+++ b/sc/source/ui/view/output3.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: output3.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: nn $ $Date: 2002-05-06 16:53:04 $
+ * last change: $Author: nn $ $Date: 2002-09-09 14:00:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -159,6 +159,8 @@ void ScOutputData::DrawSelectiveObjects( USHORT nLayer, const Rectangle& rRect,
SdrOutliner& rOutl = pModel->GetDrawOutliner();
rOutl.EnableAutoColor( bUseStyleColor );
+ rOutl.SetDefaultHorizontalTextDirection(
+ (EEHorizontalTextDirection)pDoc->GetEditTextDirection( nTab ) );
ExtOutputDevice* pXOut = new ExtOutputDevice( pDev );
pXOut->SetOutDev( pDev );
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index c02956effe52..1a83fbc385f2 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: viewdata.cxx,v $
*
- * $Revision: 1.29 $
+ * $Revision: 1.30 $
*
- * last change: $Author: nn $ $Date: 2002-08-30 15:09:21 $
+ * last change: $Author: nn $ $Date: 2002-09-09 14:00:39 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -2567,7 +2567,8 @@ BOOL ScViewData::UpdateFixY( USHORT nTab ) // TRUE = Wert geaendert
void ScViewData::UpdateOutlinerFlags( Outliner& rOutl ) const
{
- BOOL bOnlineSpell = GetDocument()->GetDocOptions().IsAutoSpell();
+ ScDocument* pLocalDoc = GetDocument();
+ BOOL bOnlineSpell = pLocalDoc->GetDocOptions().IsAutoSpell();
BOOL bHideSpell = GetOptions().IsHideAutoSpell();
ULONG nCntrl = rOutl.GetControlWord();
@@ -2595,6 +2596,9 @@ void ScViewData::UpdateOutlinerFlags( Outliner& rOutl ) const
com::sun::star::uno::Reference<com::sun::star::linguistic2::XSpellChecker1> xXSpellChecker1( LinguMgr::GetSpellChecker() );
rOutl.SetSpeller( xXSpellChecker1 );
}
+
+ rOutl.SetDefaultHorizontalTextDirection(
+ (EEHorizontalTextDirection)pLocalDoc->GetEditTextDirection( nTabNo ) );
}
ScAddress ScViewData::GetCurPos() const