[ooo-build-commit] .: sd/inc sd/sdi sd/source
Jan Holesovsky
kendy at kemper.freedesktop.org
Fri Sep 17 03:36:00 PDT 2010
sd/inc/app.hrc | 7 +++---
sd/sdi/_drvwsh.sdi | 17 ++++-----------
sd/sdi/sdraw.sdi | 27 +++++++++++++++++++++++
sd/source/core/stlpool.cxx | 2 +
sd/source/ui/app/menuids_tmpl.src | 8 +++++++
sd/source/ui/app/popup2_tmpl.src | 43 ++++++++++++++++++++++++++++++++++++++
sd/source/ui/inc/res_bmp.hrc | 3 ++
sd/source/ui/view/drviews2.cxx | 25 ++++++++++++++++++++++
sd/source/ui/view/drviews4.cxx | 6 ++++-
sd/source/ui/view/drviewsj.cxx | 19 ++++++++++------
10 files changed, 134 insertions(+), 23 deletions(-)
New commits:
commit b1918cc7d1d57ef977e78b0d19b88bf4679685aa
Author: Thorsten Behrens <tbehrens at novell.com>
Date: Fri Sep 17 10:11:29 2010 +0200
fit-list-to-size.diff: Shrink font automatically when text overflows.
i#94086
Scale-font-down if typing text in Impress and the text box becomes too small.
diff --git a/sd/inc/app.hrc b/sd/inc/app.hrc
index 57c7d28..84adc70 100755
--- a/sd/inc/app.hrc
+++ b/sd/inc/app.hrc
@@ -456,11 +456,12 @@
#define SID_DISPLAY_MASTER_OBJECTS (SID_SD_START+437)
#define SID_INSERTPAGE_LAYOUT_MENU (SID_SD_START+438)
#define SID_TP_EDIT_MASTER (SID_SD_START+439)
+#define SID_OUTLINE_TEXT_AUTOFIT (SID_SD_START+440)
// Add companion for the SID_HIDE_SLIDE (that is defined in svx)
-#define SID_SHOW_SLIDE (SID_SD_START+440)
+#define SID_SHOW_SLIDE (SID_SD_START+441)
-#define SID_ADD_MOTION_PATH (SID_SD_START+441)
-#define SID_TABLE_TOOLBOX (SID_SD_START+442)
+#define SID_ADD_MOTION_PATH (SID_SD_START+442)
+#define SID_TABLE_TOOLBOX (SID_SD_START+443)
#endif
diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi
index 6b338c7..e3462b4 100755
--- a/sd/sdi/_drvwsh.sdi
+++ b/sd/sdi/_drvwsh.sdi
@@ -25,18 +25,6 @@
*
************************************************************************/
-enum SdrFitToSizeType
-{
- SDRTEXTFIT_NONE ,
- SDRTEXTFIT_PROPORTIONAL ,
- SDRTEXTFIT_ALLLINES ,
- SDRTEXTFIT_RESIZEATTR
-}
-item UINT32 SvxObjectItem ;
-item BOOL SdrShadowItem ;
-item SdrFitToSizeType SdrTextFitToSizeTypeItem ;
-
-
interface DrawView
{
SID_JUMPTOMARK // ole : no, status : ?
@@ -674,6 +662,11 @@ interface DrawView
ExecMethod = FuPermanent ;
StateMethod = GetMenuState ;
]
+ SID_OUTLINE_TEXT_AUTOFIT // ole : no, status : ?
+ [
+ ExecMethod = FuTemporary ;
+ StateMethod = GetMenuState ;
+ ]
SID_TEXT_FITTOSIZE_VERTICAL // ole : no, status : ?
[
ExecMethod = FuPermanent ;
diff --git a/sd/sdi/sdraw.sdi b/sd/sdi/sdraw.sdi
index e1d39e7..4cf3c7f 100755
--- a/sd/sdi/sdraw.sdi
+++ b/sd/sdi/sdraw.sdi
@@ -6351,6 +6351,33 @@ SfxBoolItem TextFitToSizeTool SID_TEXT_FITTOSIZE
]
//--------------------------------------------------------------------------
+SfxBoolItem TextAutoFitToSize SID_OUTLINE_TEXT_AUTOFIT
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Synchron;
+
+ Readonly = FALSE,
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_FORMAT;
+]
+
+//--------------------------------------------------------------------------
TbxImageItem TextToolbox SID_DRAWTBX_TEXT
[
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx
index 1a7b4d2..2542f94 100755
--- a/sd/source/core/stlpool.cxx
+++ b/sd/source/core/stlpool.cxx
@@ -254,6 +254,8 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(const String& rLayoutName, sal_Bo
rSet.Put( SvxColorItem( Color(COL_AUTO), EE_CHAR_COLOR) );
rSet.Put( XLineStyleItem(XLINE_NONE) );
rSet.Put( XFillStyleItem(XFILL_NONE) );
+ rSet.Put( SdrTextFitToSizeTypeItem(SDRTEXTFIT_AUTOFIT) );
+ rSet.Put( SdrTextAutoGrowHeightItem(FALSE) );
// #i16874# enable kerning by default but only for new documents
rSet.Put( SvxAutoKernItem( TRUE, EE_CHAR_PAIRKERNING ) );
diff --git a/sd/source/ui/app/menuids_tmpl.src b/sd/source/ui/app/menuids_tmpl.src
index 6e89d6a..f9b1a3e 100644
--- a/sd/source/ui/app/menuids_tmpl.src
+++ b/sd/source/ui/app/menuids_tmpl.src
@@ -304,6 +304,14 @@
Text [ en-US ] = "~Text..." ; \
};
+#define MN_OUTLINE_TEXT_AUTOFIT \
+ MenuItem\
+ {\
+ Identifier = SID_OUTLINE_TEXT_AUTOFIT ; \
+ HelpID = SID_OUTLINE_TEXT_AUTOFIT ; \
+ Text [ en-US ] = "~Autofit Text" ; \
+ };
+
#define MN_CONNECTION \
MenuItem\
{\
diff --git a/sd/source/ui/app/popup2_tmpl.src b/sd/source/ui/app/popup2_tmpl.src
index 6bbba0e..6809571 100644
--- a/sd/source/ui/app/popup2_tmpl.src
+++ b/sd/source/ui/app/popup2_tmpl.src
@@ -79,6 +79,49 @@
};
//
+// OUTLINETEXTOBJ_POPUP
+//
+#if SD_POPUP == RID_DRAW_TEXTOBJ_POPUP
+ Menu RID_DRAW_OUTLINETEXTOBJ_POPUP
+#elif SD_POPUP == RID_GRAPHIC_TEXTOBJ_POPUP
+ Menu RID_GRAPHIC_OUTLINETEXTOBJ_POPUP
+#endif
+{
+ ItemList =
+ {
+ MN_SET_DEFAULT
+ SEPARATOR
+ MN_LINE
+ MN_AREA
+ MN_TEXTATTR
+ MN_OUTLINE_TEXT_AUTOFIT
+ MN_TRANSFORM
+ MN_FONTWORK
+ SEPARATOR
+ MN_CHAR_PARAGRAPH
+ SEPARATOR
+ MN_POSITION
+ MN_OBJECT_ALIGN
+ MN_DISTRIBUTE
+ MNSUB_CONVERT
+
+ //-#i68101#----------------------
+ SEPARATOR
+ MN_OBJECT_TITLE_DESCRIPTION
+ MN_NAME_GROUP
+ //-#i68101#----------------------
+
+#if SD_POPUP == RID_DRAW_TEXTOBJ_POPUP
+ SEPARATOR
+ MN_EFFECT
+ MN_ACTION
+#endif
+ SEPARATOR
+ MN_STYLEDT
+ };
+};
+
+//
// GEOMOBJ_POPUP
//
#if SD_POPUP == RID_DRAW_TEXTOBJ_POPUP
diff --git a/sd/source/ui/inc/res_bmp.hrc b/sd/source/ui/inc/res_bmp.hrc
index c8dd81d..192ee97 100755
--- a/sd/source/ui/inc/res_bmp.hrc
+++ b/sd/source/ui/inc/res_bmp.hrc
@@ -298,6 +298,9 @@
#define RID_DRAW_TABLEOBJ_INSIDE_POPUP RID_APP_START+94
+#define RID_DRAW_OUTLINETEXTOBJ_POPUP RID_APP_START+95
+#define RID_GRAPHIC_OUTLINETEXTOBJ_POPUP RID_APP_START+96
+
/*
* Pointer (Mauszeiger)
*/
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 08c1440..4c8cbd3 100755
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -130,6 +130,31 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
switch ( nSId )
{
+ case SID_OUTLINE_TEXT_AUTOFIT:
+ {
+ SfxUndoManager* pUndoManager = GetDocSh()->GetUndoManager();
+ SdrObject* pObj = NULL;
+ const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
+ if( rMarkList.GetMarkCount() == 1 )
+ {
+ pUndoManager->EnterListAction( String(), String() );
+ mpDrawView->BegUndo();
+
+ pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
+ bool bSet = ((const SdrTextFitToSizeTypeItem*)pObj->GetMergedItemSet().GetItem(SDRATTR_TEXT_FITTOSIZE))->GetValue() != SDRTEXTFIT_NONE;
+
+ mpDrawView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj));
+
+ pObj->SetMergedItem(SdrTextFitToSizeTypeItem(bSet ? SDRTEXTFIT_NONE : SDRTEXTFIT_AUTOFIT));
+
+ mpDrawView->EndUndo();
+ pUndoManager->LeaveListAction();
+ }
+ Cancel();
+ rReq.Done();
+ }
+ break;
+
// Flaechen und Linien-Attribute:
// Sollten (wie StateMethode) eine eigene
// Execute-Methode besitzen
diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx
index 7f604cc..b3a7b30 100644
--- a/sd/source/ui/view/drviews4.cxx
+++ b/sd/source/ui/view/drviews4.cxx
@@ -679,9 +679,13 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin)
{
switch ( nId )
{
+ case OBJ_OUTLINETEXT:
+ nSdResId = bGraphicShell ? RID_GRAPHIC_OUTLINETEXTOBJ_POPUP :
+ RID_DRAW_OUTLINETEXTOBJ_POPUP;
+ break;
+
case OBJ_CAPTION:
case OBJ_TITLETEXT:
- case OBJ_OUTLINETEXT:
case OBJ_TEXT:
nSdResId = bGraphicShell ? RID_GRAPHIC_TEXTOBJ_POPUP :
RID_DRAW_TEXTOBJ_POPUP;
diff --git a/sd/source/ui/view/drviewsj.cxx b/sd/source/ui/view/drviewsj.cxx
index 59580e4..4351ed1 100644
--- a/sd/source/ui/view/drviewsj.cxx
+++ b/sd/source/ui/view/drviewsj.cxx
@@ -208,9 +208,6 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
rSet.DisableItem( SID_CHANGEPOLYGON );
}
- if(nInv == SdrInventor && (nId == OBJ_TITLETEXT || nId == OBJ_OUTLINETEXT))
- rSet.DisableItem( SID_TEXTATTR_DLG );
-
if(nInv == SdrInventor && nId == OBJ_TABLE )
{
rSet.DisableItem( SID_TEXTATTR_DLG );
@@ -303,6 +300,17 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
else
rSet.DisableItem( SID_MODIFY_FIELD );
}
+ if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OUTLINE_TEXT_AUTOFIT ) )
+ {
+ bool bSet = false;
+ const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
+ if( rMarkList.GetMarkCount() == 1 )
+ {
+ SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
+ bSet = ((const SdrTextFitToSizeTypeItem*)pObj->GetMergedItemSet().GetItem(SDRATTR_TEXT_FITTOSIZE))->GetValue() != SDRTEXTFIT_NONE;
+ }
+ rSet.Put(SfxBoolItem(SID_OUTLINE_TEXT_AUTOFIT, bSet));
+ }
rSet.DisableItem( SID_GROUP );
rSet.DisableItem( SID_COMBINE );
@@ -352,7 +360,6 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
BOOL bGraf = FALSE;
BOOL bDrawObj = FALSE;
BOOL b3dObj = FALSE;
- BOOL bTitOutText = FALSE;
bool bTable = false;
BOOL bMeasureObj = FALSE;
BOOL bEdgeObj = FALSE; // Connector
@@ -392,8 +399,6 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
case OBJ_GRAF: bGraf = TRUE; break;
- case OBJ_TITLETEXT:
- case OBJ_OUTLINETEXT: bTitOutText = TRUE; break;
case OBJ_TABLE: bTable = true; break;
}
}
@@ -441,7 +446,7 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
{
rSet.DisableItem( SID_UNGROUP );
}
- if( bTitOutText || bTable )
+ if( bTable )
rSet.DisableItem( SID_TEXTATTR_DLG );
if( !bMeasureObj )
More information about the ooo-build-commit
mailing list