summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--svx/source/dialog/align.cxx72
-rw-r--r--svx/source/dialog/align.hrc5
-rw-r--r--svx/source/dialog/align.src11
3 files changed, 81 insertions, 7 deletions
diff --git a/svx/source/dialog/align.cxx b/svx/source/dialog/align.cxx
index 20ffe5d026b2..39d303d1d2f3 100644
--- a/svx/source/dialog/align.cxx
+++ b/svx/source/dialog/align.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: align.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: dr $ $Date: 2001-05-16 11:52:02 $
+ * last change: $Author: nn $ $Date: 2001-05-18 18:39:09 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -100,6 +100,7 @@ static USHORT pRanges[] =
SID_ATTR_ALIGN_INDENT,SID_ATTR_ALIGN_INDENT,
SID_ATTR_ALIGN_DEGREES,SID_ATTR_ALIGN_DEGREES,
SID_ATTR_ALIGN_LOCKPOS,SID_ATTR_ALIGN_LOCKPOS,
+ SID_ATTR_ALIGN_HYPHENATION,SID_ATTR_ALIGN_HYPHENATION,
0
};
@@ -136,10 +137,13 @@ SvxAlignmentTabPage::SvxAlignmentTabPage( Window* pParent,
aEdBottomSpace ( this, ResId( ED_BOTTOMSPACE ) ),
aFlWrap ( this, ResId( FL_WRAP ) ),
- aBtnWrap ( this, ResId( BTN_WRAP ) )
+ aBtnWrap ( this, ResId( BTN_WRAP ) ),
+ aBtnHyphen ( this, ResId( BTN_HYPH ) ),
+ bHyphenDisabled ( FALSE )
{
aLbHorAlign.SetSelectHdl( LINK( this, SvxAlignmentTabPage, HorAlignSelectHdl_Impl ) );
+ aBtnWrap.SetClickHdl( LINK( this, SvxAlignmentTabPage, WrapClickHdl_Impl ) );
// diese Page braucht ExchangeSupport
SetExchangeSupport();
@@ -328,6 +332,26 @@ void SvxAlignmentTabPage::Reset( const SfxItemSet& rCoreAttrs )
aBtnWrap.SetState( TriState( STATE_DONTKNOW ) );
}
+ if (rCoreAttrs.GetItemState(GetWhich(SID_ATTR_ALIGN_HYPHENATION),TRUE) == SFX_ITEM_UNKNOWN)
+ bHyphenDisabled = TRUE;
+ else
+ {
+ pItem = GetItem( rCoreAttrs, SID_ATTR_ALIGN_HYPHENATION );
+
+ if ( pItem )
+ {
+ aBtnHyphen.EnableTriState( FALSE );
+ aBtnHyphen.SetState( ( (const SfxBoolItem*)pItem )->GetValue()
+ ? TriState( STATE_CHECK )
+ : TriState( STATE_NOCHECK ) );
+ }
+ else
+ {
+ aBtnHyphen.EnableTriState();
+ aBtnHyphen.SetState( TriState( STATE_DONTKNOW ) );
+ }
+ }
+
HorAlignSelectHdl_Impl( NULL );
aBtnWrap.SaveValue(); // TriStateButton
@@ -497,6 +521,21 @@ BOOL SvxAlignmentTabPage::FillItemSet( SfxItemSet& rCoreAttrs )
}
else if ( rOldSet.GetItemState( nWhich, FALSE ) == SFX_ITEM_DEFAULT )
rCoreAttrs.ClearItem( nWhich );
+
+ // Hyphenation
+ nWhich = GetWhich( SID_ATTR_ALIGN_HYPHENATION );
+ eState = aBtnHyphen.GetState();
+ pOld = GetOldItem( rCoreAttrs, SID_ATTR_ALIGN_HYPHENATION );
+
+ if ( !pOld || ( (const SfxBoolItem*)pOld )->GetValue()
+ != ( eState == STATE_CHECK ) )
+ {
+ rCoreAttrs.Put( SfxBoolItem( nWhich, (eState == STATE_CHECK) ) );
+ bAttrsChanged = TRUE;
+ }
+ else if ( rOldSet.GetItemState( nWhich, FALSE ) == SFX_ITEM_DEFAULT )
+ rCoreAttrs.ClearItem( nWhich );
+
return bAttrsChanged;
}
@@ -516,11 +555,30 @@ IMPL_LINK( SvxAlignmentTabPage, HorAlignSelectHdl_Impl, ListBox *, EMPTYARG )
BOOL bChecked = (aLbHorAlign.GetSelectEntryPos() == ALIGNDLG_HORALIGN_LEFT);
aFtIndent.Enable( bChecked );
aEdIndent.Enable( bChecked );
+ EnableHyphen_Impl();
return 0;
}
//------------------------------------------------------------------------
+IMPL_LINK( SvxAlignmentTabPage, WrapClickHdl_Impl, TriStateBox *, EMPTYARG )
+{
+ EnableHyphen_Impl();
+ return 0;
+}
+
+//------------------------------------------------------------------------
+
+void SvxAlignmentTabPage::EnableHyphen_Impl()
+{
+ BOOL bWrap = (aBtnWrap.GetState() == STATE_CHECK);
+ BOOL bBlock = (aLbHorAlign.GetSelectEntryPos() == ALIGNDLG_HORALIGN_BLOCK);
+ BOOL bEnable = ( ( bWrap || bBlock ) && !bHyphenDisabled );
+ aBtnHyphen.Enable( bEnable );
+}
+
+//------------------------------------------------------------------------
+
void SvxAlignmentTabPage::SetFlags( USHORT nFlags )
/* [Beschreibung]
@@ -540,6 +598,14 @@ void SvxAlignmentTabPage::SetFlags( USHORT nFlags )
aBtnWrap.Disable();
}
+ if ( nFlags & ( WBA_NO_LINEBREAK | WBA_NO_HYPHENATION ) )
+ {
+ // WBA_NO_LINEBREAK also disables hyphenation
+
+ bHyphenDisabled = TRUE;
+ aBtnHyphen.Disable();
+ }
+
if ( ( nFlags & WBA_NO_HORIZONTAL ) == WBA_NO_HORIZONTAL )
{
aFtHorAlign.Disable();
diff --git a/svx/source/dialog/align.hrc b/svx/source/dialog/align.hrc
index 81cf2b3b73c1..7c49199df2cc 100644
--- a/svx/source/dialog/align.hrc
+++ b/svx/source/dialog/align.hrc
@@ -2,9 +2,9 @@
*
* $RCSfile: align.hrc,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: dr $ $Date: 2001-05-16 11:52:02 $
+ * last change: $Author: nn $ $Date: 2001-05-18 18:39:09 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -92,6 +92,7 @@
#define FL_WRAP 40
#define BTN_WRAP 41
+#define BTN_HYPH 42
//#define ED_INDENT1 100
diff --git a/svx/source/dialog/align.src b/svx/source/dialog/align.src
index cbabfa2626a0..62eb26ad864b 100644
--- a/svx/source/dialog/align.src
+++ b/svx/source/dialog/align.src
@@ -2,9 +2,9 @@
*
* $RCSfile: align.src,v $
*
- * $Revision: 1.16 $
+ * $Revision: 1.17 $
*
- * last change: $Author: kz $ $Date: 2001-05-18 11:44:05 $
+ * last change: $Author: nn $ $Date: 2001-05-18 18:39:09 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -597,6 +597,13 @@ TabPage RID_SVXPAGE_ALIGNMENT
Text[ language_user1 ] = " ";
Text[ catalan ] = "Salto de ~lnea";
};
+ TriStateBox BTN_HYPH
+ {
+ Pos = MAP_APPFONT ( 12 , 172 ) ;
+ Size = MAP_APPFONT ( 100 , 10 ) ;
+ Text = "Silben~trennung aktiv" ;
+ Text [ ENGLISH ] = "Hyphenation active" ;
+ };
ImageList IL_LOCK_BMPS
{
ImageBitmap = Bitmap { File = "lockmode.bmp" ; };