summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/sdi/drwtxtsh.sdi13
-rw-r--r--sw/source/ui/shells/drwtxtex.cxx50
-rw-r--r--sw/uiconfig/sglobal/toolbar/drawtextobjectbar.xml2
-rw-r--r--sw/uiconfig/sweb/toolbar/drawtextobjectbar.xml2
-rw-r--r--sw/uiconfig/swform/toolbar/drawtextobjectbar.xml2
-rw-r--r--sw/uiconfig/swreport/toolbar/drawtextobjectbar.xml2
-rw-r--r--sw/uiconfig/swriter/toolbar/drawtextobjectbar.xml2
-rw-r--r--sw/uiconfig/swxform/toolbar/drawtextobjectbar.xml2
8 files changed, 75 insertions, 0 deletions
diff --git a/sw/sdi/drwtxtsh.sdi b/sw/sdi/drwtxtsh.sdi
index 23402a38f397..e019b76783b0 100644
--- a/sw/sdi/drwtxtsh.sdi
+++ b/sw/sdi/drwtxtsh.sdi
@@ -609,6 +609,19 @@ interface TextDrawText
StateMethod = GetStatePropPanelAttr ;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
+
+ FN_GROW_FONT_SIZE
+ [
+ ExecMethod = Execute ;
+ StateMethod = GetDrawTxtCtrlState ;
+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+ ]
+ FN_SHRINK_FONT_SIZE
+ [
+ ExecMethod = Execute ;
+ StateMethod = GetDrawTxtCtrlState ;
+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+ ]
}
interface TextDrawFont
diff --git a/sw/source/ui/shells/drwtxtex.cxx b/sw/source/ui/shells/drwtxtex.cxx
index 80a1049bf6da..43b0dfb54aec 100644
--- a/sw/source/ui/shells/drwtxtex.cxx
+++ b/sw/source/ui/shells/drwtxtex.cxx
@@ -101,6 +101,8 @@
#include "chrdlg.hrc"
#include "misc.hrc"
+const sal_uInt32 nFontInc = 40; // 2pt
+const sal_uInt32 nFontMaxSz = 19998; // 999.9pt
using namespace ::com::sun::star;
@@ -548,6 +550,32 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
rSh.GetView().AttrChangedNotify( &rSh );
}
return;
+
+ case FN_GROW_FONT_SIZE:
+ case FN_SHRINK_FONT_SIZE:
+ {
+ SfxItemPool* pPool2 = aEditAttr.GetPool()->GetSecondaryPool();
+ if( !pPool2 )
+ pPool2 = aEditAttr.GetPool();
+
+ SvxScriptSetItem aSetItem( SID_ATTR_CHAR_FONTHEIGHT, *pPool2 );
+ aSetItem.GetItemSet().Put( aEditAttr, false );
+
+ sal_uInt16 nScriptTypes = pOLV->GetSelectedScriptType();
+ SvxFontHeightItem aSize( *static_cast<const SvxFontHeightItem*>( aSetItem.GetItemOfScript( nScriptTypes ) ) );
+ sal_uInt32 nSize = aSize.GetHeight();
+
+ if( nSlot == FN_GROW_FONT_SIZE && ( nSize += nFontInc ) > nFontMaxSz )
+ nSize = nFontMaxSz;
+ else if( nSlot == FN_SHRINK_FONT_SIZE && ( nSize -= nFontInc ) < nFontInc )
+ nSize = nFontInc;
+
+ aSize.SetHeight( nSize );
+ aSetItem.PutItemForScriptType( nScriptTypes, aSize );
+ aNewAttr.Put( aSetItem.GetItemSet() );
+ }
+ break;
+
default:
OSL_ENSURE(!this, "wrong dispatcher");
return;
@@ -888,6 +916,28 @@ void SwDrawTextShell::GetDrawTxtCtrlState(SfxItemSet& rSet)
case SID_ATTR_CHAR_SCALEWIDTH: nEEWhich = EE_CHAR_FONTWIDTH;break;
case SID_ATTR_CHAR_AUTOKERN : nEEWhich = EE_CHAR_PAIRKERNING; break;
case SID_ATTR_CHAR_ESCAPEMENT: nEEWhich = EE_CHAR_ESCAPEMENT; break;
+ case FN_GROW_FONT_SIZE:
+ case FN_SHRINK_FONT_SIZE:
+ {
+ SfxItemPool* pEditPool = aEditAttr.GetPool()->GetSecondaryPool();
+ if( !pEditPool )
+ pEditPool = aEditAttr.GetPool();
+
+ SvxScriptSetItem aSetItem( SID_ATTR_CHAR_FONTHEIGHT, *pEditPool );
+ aSetItem.GetItemSet().Put( aEditAttr, false );
+ const SvxFontHeightItem* aSize( static_cast<const SvxFontHeightItem*>( aSetItem.GetItemOfScript( nScriptType ) ) );
+
+ if( !aSize )
+ rSet.DisableItem( nSlotId );
+ else
+ {
+ sal_uInt32 nSize = aSize->GetHeight();
+ if( nSize == nFontMaxSz )
+ rSet.DisableItem( FN_GROW_FONT_SIZE );
+ else if( nSize == nFontInc )
+ rSet.DisableItem( FN_SHRINK_FONT_SIZE );
+ }
+ }
}
if(nEEWhich)
rSet.Put(aEditAttr.Get(nEEWhich, sal_True), nWhich);
diff --git a/sw/uiconfig/sglobal/toolbar/drawtextobjectbar.xml b/sw/uiconfig/sglobal/toolbar/drawtextobjectbar.xml
index f6046059f5cc..5db228b3f98e 100644
--- a/sw/uiconfig/sglobal/toolbar/drawtextobjectbar.xml
+++ b/sw/uiconfig/sglobal/toolbar/drawtextobjectbar.xml
@@ -27,6 +27,8 @@
<toolbar:toolbaritem xlink:href=".uno:Underline"/>
<toolbar:toolbaritem xlink:href=".uno:SuperScript"/>
<toolbar:toolbaritem xlink:href=".uno:SubScript"/>
+ <toolbar:toolbaritem xlink:href=".uno:Grow"/>
+ <toolbar:toolbaritem xlink:href=".uno:Shrink"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:LeftPara" toolbar:style="radio"/>
<toolbar:toolbaritem xlink:href=".uno:CenterPara" toolbar:style="radio"/>
diff --git a/sw/uiconfig/sweb/toolbar/drawtextobjectbar.xml b/sw/uiconfig/sweb/toolbar/drawtextobjectbar.xml
index f6046059f5cc..5db228b3f98e 100644
--- a/sw/uiconfig/sweb/toolbar/drawtextobjectbar.xml
+++ b/sw/uiconfig/sweb/toolbar/drawtextobjectbar.xml
@@ -27,6 +27,8 @@
<toolbar:toolbaritem xlink:href=".uno:Underline"/>
<toolbar:toolbaritem xlink:href=".uno:SuperScript"/>
<toolbar:toolbaritem xlink:href=".uno:SubScript"/>
+ <toolbar:toolbaritem xlink:href=".uno:Grow"/>
+ <toolbar:toolbaritem xlink:href=".uno:Shrink"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:LeftPara" toolbar:style="radio"/>
<toolbar:toolbaritem xlink:href=".uno:CenterPara" toolbar:style="radio"/>
diff --git a/sw/uiconfig/swform/toolbar/drawtextobjectbar.xml b/sw/uiconfig/swform/toolbar/drawtextobjectbar.xml
index f6046059f5cc..5db228b3f98e 100644
--- a/sw/uiconfig/swform/toolbar/drawtextobjectbar.xml
+++ b/sw/uiconfig/swform/toolbar/drawtextobjectbar.xml
@@ -27,6 +27,8 @@
<toolbar:toolbaritem xlink:href=".uno:Underline"/>
<toolbar:toolbaritem xlink:href=".uno:SuperScript"/>
<toolbar:toolbaritem xlink:href=".uno:SubScript"/>
+ <toolbar:toolbaritem xlink:href=".uno:Grow"/>
+ <toolbar:toolbaritem xlink:href=".uno:Shrink"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:LeftPara" toolbar:style="radio"/>
<toolbar:toolbaritem xlink:href=".uno:CenterPara" toolbar:style="radio"/>
diff --git a/sw/uiconfig/swreport/toolbar/drawtextobjectbar.xml b/sw/uiconfig/swreport/toolbar/drawtextobjectbar.xml
index f6046059f5cc..5db228b3f98e 100644
--- a/sw/uiconfig/swreport/toolbar/drawtextobjectbar.xml
+++ b/sw/uiconfig/swreport/toolbar/drawtextobjectbar.xml
@@ -27,6 +27,8 @@
<toolbar:toolbaritem xlink:href=".uno:Underline"/>
<toolbar:toolbaritem xlink:href=".uno:SuperScript"/>
<toolbar:toolbaritem xlink:href=".uno:SubScript"/>
+ <toolbar:toolbaritem xlink:href=".uno:Grow"/>
+ <toolbar:toolbaritem xlink:href=".uno:Shrink"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:LeftPara" toolbar:style="radio"/>
<toolbar:toolbaritem xlink:href=".uno:CenterPara" toolbar:style="radio"/>
diff --git a/sw/uiconfig/swriter/toolbar/drawtextobjectbar.xml b/sw/uiconfig/swriter/toolbar/drawtextobjectbar.xml
index f6046059f5cc..5db228b3f98e 100644
--- a/sw/uiconfig/swriter/toolbar/drawtextobjectbar.xml
+++ b/sw/uiconfig/swriter/toolbar/drawtextobjectbar.xml
@@ -27,6 +27,8 @@
<toolbar:toolbaritem xlink:href=".uno:Underline"/>
<toolbar:toolbaritem xlink:href=".uno:SuperScript"/>
<toolbar:toolbaritem xlink:href=".uno:SubScript"/>
+ <toolbar:toolbaritem xlink:href=".uno:Grow"/>
+ <toolbar:toolbaritem xlink:href=".uno:Shrink"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:LeftPara" toolbar:style="radio"/>
<toolbar:toolbaritem xlink:href=".uno:CenterPara" toolbar:style="radio"/>
diff --git a/sw/uiconfig/swxform/toolbar/drawtextobjectbar.xml b/sw/uiconfig/swxform/toolbar/drawtextobjectbar.xml
index f6046059f5cc..5db228b3f98e 100644
--- a/sw/uiconfig/swxform/toolbar/drawtextobjectbar.xml
+++ b/sw/uiconfig/swxform/toolbar/drawtextobjectbar.xml
@@ -27,6 +27,8 @@
<toolbar:toolbaritem xlink:href=".uno:Underline"/>
<toolbar:toolbaritem xlink:href=".uno:SuperScript"/>
<toolbar:toolbaritem xlink:href=".uno:SubScript"/>
+ <toolbar:toolbaritem xlink:href=".uno:Grow"/>
+ <toolbar:toolbaritem xlink:href=".uno:Shrink"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:LeftPara" toolbar:style="radio"/>
<toolbar:toolbaritem xlink:href=".uno:CenterPara" toolbar:style="radio"/>