summaryrefslogtreecommitdiff
path: root/sc/source/core
diff options
context:
space:
mode:
authorNiklas Nebel <nn@openoffice.org>2002-04-05 18:21:05 +0000
committerNiklas Nebel <nn@openoffice.org>2002-04-05 18:21:05 +0000
commit4b468e7584fd6cb367f8e4cc57ad4932f4b60736 (patch)
treeb4fabf6a51d9f15648dd9b4e1967e7289807b4cf /sc/source/core
parent1bab33e3eeb761dce4c47cc940bb9fcd4aaab659 (diff)
#98410# Asian vertical writing
Diffstat (limited to 'sc/source/core')
-rw-r--r--sc/source/core/data/column2.cxx33
-rw-r--r--sc/source/core/tool/editutil.cxx12
2 files changed, 35 insertions, 10 deletions
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 763dd2d418dc..11bf43583c46 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: column2.cxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: sab $ $Date: 2002-03-20 09:27:58 $
+ * last change: $Author: nn $ $Date: 2002-04-05 19:19:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -649,10 +649,7 @@ long ScColumn::GetNeededSize( USHORT nRow, OutputDevice* pDev,
else
bBreak = ((const SfxBoolItem&)pPattern->GetItem(ATTR_LINEBREAK)).GetValue();
- if ( bWidth && bBreak )
- return 0;
-
- // restliche Attribute aus Pattern und bedingter Formatierung zusammensuchen
+ // get other attributes from pattern and conditional formatting
SvxCellOrientation eOrient;
if (pCondSet &&
@@ -661,6 +658,14 @@ long ScColumn::GetNeededSize( USHORT nRow, OutputDevice* pDev,
else
eOrient = (SvxCellOrientation)((const SvxOrientationItem&)
pPattern->GetItem(ATTR_ORIENTATION)).GetValue();
+ BOOL bAsianVertical = ( eOrient == SVX_ORIENTATION_STACKED &&
+ ((const SfxBoolItem&)pPattern->GetItem( ATTR_VERTICAL_ASIAN, pCondSet )).GetValue() );
+ if ( bAsianVertical )
+ bBreak = FALSE;
+
+ if ( bWidth && bBreak ) // after determining bAsianVertical (bBreak may be reset)
+ return 0;
+
long nRotate = 0;
SvxRotateMode eRotMode = SVX_ROTATE_MODE_STANDARD;
if ( eOrient == SVX_ORIENTATION_STANDARD )
@@ -683,6 +688,7 @@ long ScColumn::GetNeededSize( USHORT nRow, OutputDevice* pDev,
eRotMode = SVX_ROTATE_MODE_STANDARD; // keinen Ueberlauf
}
}
+
const SvxMarginItem* pMargin;
if (pCondSet &&
pCondSet->GetItemState(ATTR_MARGIN, TRUE, &pCondItem) == SFX_ITEM_SET)
@@ -837,7 +843,7 @@ long ScColumn::GetNeededSize( USHORT nRow, OutputDevice* pDev,
}
Size aPaper = Size( 1000000, 1000000 );
- if (eOrient==SVX_ORIENTATION_STACKED)
+ if ( eOrient==SVX_ORIENTATION_STACKED && !bAsianVertical )
aPaper.Width() = 1;
else if (bBreak)
{
@@ -883,6 +889,8 @@ long ScColumn::GetNeededSize( USHORT nRow, OutputDevice* pDev,
pEngine->SetDefaults(pSet);
}
+ BOOL bEngineVertical = pEngine->IsVertical();
+ pEngine->SetVertical( bAsianVertical );
pEngine->SetUpdateMode( TRUE );
BOOL bEdWidth = bWidth;
@@ -952,10 +960,21 @@ long ScColumn::GetNeededSize( USHORT nRow, OutputDevice* pDev,
nValue += (long) ( nIndent * nPPT );
}
else
+ {
nValue += (long) ( pMargin->GetTopMargin() * nPPT ) +
(long) ( pMargin->GetBottomMargin() * nPPT );
+
+ if ( bAsianVertical && pDev->GetOutDevType() != OUTDEV_PRINTER )
+ {
+ // add 1pt extra (default margin value) for line breaks with SetVertical
+ nValue += (long) ( 20 * nPPT );
+ }
+ }
}
+ // EditEngine is cached and re-used, so the old vertical flag must be restored
+ pEngine->SetVertical( bEngineVertical );
+
pDocument->DisposeFieldEditEngine(pEngine);
pDev->SetMapMode( aOld );
diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx
index 0c515c6ca426..f77af6e60fc3 100644
--- a/sc/source/core/tool/editutil.cxx
+++ b/sc/source/core/tool/editutil.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: editutil.cxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: sab $ $Date: 2002-03-20 09:26:42 $
+ * last change: $Author: nn $ $Date: 2002-04-05 19:21:05 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -173,8 +173,14 @@ Rectangle ScEditUtil::GetEditArea( const ScPatternAttr* pPattern, BOOL bForceToT
long nTopMargin = (long) ( pMargin->GetTopMargin() * nPPTY );
SvxCellVerJustify eJust = (SvxCellVerJustify) ((const SvxVerJustifyItem&)pPattern->
GetItem(ATTR_VER_JUSTIFY)).GetValue();
+
+ // asian vertical is always edited top-aligned
+ BOOL bAsianVertical = (SvxCellOrientation)((const SvxOrientationItem&)
+ pPattern->GetItem(ATTR_ORIENTATION)).GetValue() == SVX_ORIENTATION_STACKED &&
+ ((const SfxBoolItem&)pPattern->GetItem( ATTR_VERTICAL_ASIAN )).GetValue();
+
if ( eJust == SVX_VER_JUSTIFY_TOP ||
- ( bForceToTop && SC_MOD()->GetInputOptions().GetTextWysiwyg() ) )
+ ( bForceToTop && ( SC_MOD()->GetInputOptions().GetTextWysiwyg() || bAsianVertical ) ) )
nPixDifY = nTopMargin;
else
{