From 555d702903fb0857122024e1ab78a72d122d3f16 Mon Sep 17 00:00:00 2001
From: Jens-Heiner Rechtien
Date: Wed, 26 Mar 2003 17:07:02 +0000
Subject: MWS_SRX644: migrate branch mws_srx644 -> HEAD
---
sc/source/ui/view/formatsh.cxx | 63 +++++++++++++++++++++++++++++-------------
1 file changed, 44 insertions(+), 19 deletions(-)
(limited to 'sc/source/ui/view/formatsh.cxx')
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 56b46ed61d19..120e12696c36 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: formatsh.cxx,v $
*
- * $Revision: 1.17 $
+ * $Revision: 1.18 $
*
- * last change: $Author: nn $ $Date: 2002-09-30 14:04:52 $
+ * last change: $Author: hr $ $Date: 2003-03-26 18:06:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -93,6 +93,9 @@
#define _ZFORLIST_DECLARE_TABLE
#include
#include
+#ifndef _SVTOOLS_LANGUAGEOPTIONS_HXX
+#include
+#endif
#include
#include
#include
@@ -109,7 +112,7 @@
#include
#include
#include
-#include
+#include
#include
#include "formatsh.hxx"
@@ -726,7 +729,18 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
Window* pParent = Application::GetDefDialogParent();
if ( !pParent || !pParent->IsDialog() )
- pParent = pTabViewShell->GetDialogParent();
+ {
+ // #107256# GetDefDialogParent currently doesn't return the window
+ // that was set with SetDefDialogParent (but dynamically finds the
+ // topmost parent of the focus window), so IsDialog above is FALSE
+ // even if called from the style catalog.
+ // -> Use NULL if a modal dialog is open, to enable the Dialog's
+ // default parent handling.
+ if ( Application::IsInModalMode() )
+ pParent = NULL;
+ else
+ pParent = pTabViewShell->GetDialogParent();
+ }
pTabViewShell->SetInFormatDialog(TRUE);
@@ -1589,7 +1603,7 @@ void ScFormatShell::GetAttrState( SfxItemSet& rSet )
{
Color aColor;
if ( nTrans == 255 )
- aColor.SetColor( SC_MOD()->GetColorConfig().GetColorValue(svx::DOCCOLOR).nColor );
+ aColor.SetColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor );
else
aColor = rBrushItem.GetColor();
rSet.Put( SvxColorItem( aColor, SID_BACKGROUND_COLOR ) );
@@ -1993,6 +2007,10 @@ void ScFormatShell::GetTextDirectionState( SfxItemSet& rSet )
eBidiDir = EE_HTEXTDIR_L2R;
}
+ SvtLanguageOptions aLangOpt;
+ BOOL bDisableCTLFont = !aLangOpt.IsCTLFontEnabled();
+ BOOL bDisableVerticalText = !aLangOpt.IsVerticalTextEnabled();
+
SfxWhichIter aIter( rSet );
USHORT nWhich = aIter.FirstWhich();
while( nWhich )
@@ -2000,28 +2018,35 @@ void ScFormatShell::GetTextDirectionState( SfxItemSet& rSet )
switch( nWhich )
{
case SID_TEXTDIRECTION_LEFT_TO_RIGHT:
- if( bVertDontCare )
- rSet.InvalidateItem( nWhich );
- else
- rSet.Put( SfxBoolItem( nWhich, bLeftRight ) );
- break;
case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
- if( bVertDontCare )
- rSet.InvalidateItem( nWhich );
+ if ( bDisableVerticalText )
+ rSet.DisableItem( nWhich );
else
- rSet.Put( SfxBoolItem( nWhich, bTopBottom ) );
+ {
+ if( bVertDontCare )
+ rSet.InvalidateItem( nWhich );
+ else if ( nWhich == SID_TEXTDIRECTION_LEFT_TO_RIGHT )
+ rSet.Put( SfxBoolItem( nWhich, bLeftRight ) );
+ else
+ rSet.Put( SfxBoolItem( nWhich, bTopBottom ) );
+ }
break;
case SID_ATTR_PARA_LEFT_TO_RIGHT:
case SID_ATTR_PARA_RIGHT_TO_LEFT:
- if ( bTopBottom )
+ if ( bDisableCTLFont )
rSet.DisableItem( nWhich );
- else if ( bBidiDontCare )
- rSet.InvalidateItem( nWhich );
- else if ( nWhich == SID_ATTR_PARA_LEFT_TO_RIGHT )
- rSet.Put( SfxBoolItem( nWhich, eBidiDir == EE_HTEXTDIR_L2R ) );
else
- rSet.Put( SfxBoolItem( nWhich, eBidiDir == EE_HTEXTDIR_R2L ) );
+ {
+ if ( bTopBottom )
+ rSet.DisableItem( nWhich );
+ else if ( bBidiDontCare )
+ rSet.InvalidateItem( nWhich );
+ else if ( nWhich == SID_ATTR_PARA_LEFT_TO_RIGHT )
+ rSet.Put( SfxBoolItem( nWhich, eBidiDir == EE_HTEXTDIR_L2R ) );
+ else
+ rSet.Put( SfxBoolItem( nWhich, eBidiDir == EE_HTEXTDIR_R2L ) );
+ }
}
nWhich = aIter.NextWhich();
}
--
cgit