merge the formfield patch from ooo-build
[ooovba.git] / applied_patches / 0523-fit-list-to-size-popup.diff
bloba18a9e49cdbf76ffa47678b047e26a273c6d96b8
1 sd/inc/app.hrc | 1
2 sd/sdi/_drvwsh.sdi | 5 ++
3 sd/sdi/sdraw.sdi | 27 +++++++++++++
4 sd/source/ui/app/menuids_tmpl.src | 8 ++++
5 sd/source/ui/app/popup2_tmpl.src | 43 ++++++++++++++++++++
6 sd/source/ui/inc/res_bmp.hrc | 2 +
7 sd/source/ui/view/drviews2.cxx | 25 ++++++++++++
8 sd/source/ui/view/drviews4.cxx | 6 ++-
9 sd/source/ui/view/drviewsj.cxx | 19 ++++++---
10 .../Linux_X86_64rc | 2 -
11 .../unorc | 2 -
12 11 files changed, 130 insertions(+), 10 deletions(-)
15 diff --git sd/inc/app.hrc sd/inc/app.hrc
16 index 83cfa86..9bd8aee 100644
17 --- sd/inc/app.hrc
18 +++ sd/inc/app.hrc
19 @@ -459,11 +459,12 @@
20 #define SID_DISPLAY_MASTER_OBJECTS (SID_SD_START+437)
21 #define SID_INSERTPAGE_LAYOUT_MENU (SID_SD_START+438)
22 #define SID_TP_EDIT_MASTER (SID_SD_START+439)
23 +#define SID_OUTLINE_TEXT_AUTOFIT (SID_SD_START+440)
25 // Add companion for the SID_HIDE_SLIDE (that is defined in svx)
26 -#define SID_SHOW_SLIDE (SID_SD_START+440)
27 +#define SID_SHOW_SLIDE (SID_SD_START+441)
29 -#define SID_ADD_MOTION_PATH (SID_SD_START+441)
30 -#define SID_TABLE_TOOLBOX (SID_SD_START+442)
31 +#define SID_ADD_MOTION_PATH (SID_SD_START+442)
32 +#define SID_TABLE_TOOLBOX (SID_SD_START+443)
34 #endif
35 diff --git sd/sdi/_drvwsh.sdi sd/sdi/_drvwsh.sdi
36 index c895d2e..44a6ae0 100644
37 --- sd/sdi/_drvwsh.sdi
38 +++ sd/sdi/_drvwsh.sdi
39 @@ -665,6 +665,11 @@ interface DrawView
40 ExecMethod = FuPermanent ;
41 StateMethod = GetMenuState ;
43 + SID_OUTLINE_TEXT_AUTOFIT // ole : no, status : ?
44 + [
45 + ExecMethod = FuTemporary ;
46 + StateMethod = GetMenuState ;
47 + ]
48 SID_TEXT_FITTOSIZE_VERTICAL // ole : no, status : ?
50 ExecMethod = FuPermanent ;
51 diff --git sd/sdi/sdraw.sdi sd/sdi/sdraw.sdi
52 index c4d7bad..fae94ab 100644
53 --- sd/sdi/sdraw.sdi
54 +++ sd/sdi/sdraw.sdi
55 @@ -6377,6 +6377,33 @@ SfxBoolItem TextFitToSizeTool SID_TEXT_FITTOSIZE
58 //--------------------------------------------------------------------------
59 +SfxBoolItem TextAutoFitToSize SID_OUTLINE_TEXT_AUTOFIT
62 + /* flags: */
63 + AutoUpdate = TRUE,
64 + Cachable = Cachable,
65 + FastCall = FALSE,
66 + HasCoreId = FALSE,
67 + HasDialog = FALSE,
68 + ReadOnlyDoc = FALSE,
69 + Toggle = FALSE,
70 + Container = FALSE,
71 + RecordAbsolute = FALSE,
72 + RecordPerSet;
73 + Synchron;
75 + Readonly = FALSE,
77 + /* config: */
78 + AccelConfig = TRUE,
79 + MenuConfig = TRUE,
80 + StatusBarConfig = FALSE,
81 + ToolBoxConfig = TRUE,
82 + GroupId = GID_FORMAT;
85 +//--------------------------------------------------------------------------
86 TbxImageItem TextToolbox SID_DRAWTBX_TEXT
89 diff --git sd/source/ui/app/menuids_tmpl.src sd/source/ui/app/menuids_tmpl.src
90 index feb34df..d35dc60 100644
91 --- sd/source/ui/app/menuids_tmpl.src
92 +++ sd/source/ui/app/menuids_tmpl.src
93 @@ -307,6 +307,14 @@
94 Text [ en-US ] = "~Text..." ; \
97 +#define MN_OUTLINE_TEXT_AUTOFIT \
98 + MenuItem\
99 + {\
100 + Identifier = SID_OUTLINE_TEXT_AUTOFIT ; \
101 + HelpID = SID_OUTLINE_TEXT_AUTOFIT ; \
102 + Text [ en-US ] = "~Autofit Text" ; \
103 + };
105 #define MN_CONNECTION \
106 MenuItem\
108 diff --git sd/source/ui/app/popup2_tmpl.src sd/source/ui/app/popup2_tmpl.src
109 index 63ad153..c5340a9 100644
110 --- sd/source/ui/app/popup2_tmpl.src
111 +++ sd/source/ui/app/popup2_tmpl.src
112 @@ -82,6 +82,49 @@
116 +// OUTLINETEXTOBJ_POPUP
118 +#if SD_POPUP == RID_DRAW_TEXTOBJ_POPUP
119 + Menu RID_DRAW_OUTLINETEXTOBJ_POPUP
120 +#elif SD_POPUP == RID_GRAPHIC_TEXTOBJ_POPUP
121 + Menu RID_GRAPHIC_OUTLINETEXTOBJ_POPUP
122 +#endif
124 + ItemList =
126 + MN_SET_DEFAULT
127 + SEPARATOR
128 + MN_LINE
129 + MN_AREA
130 + MN_TEXTATTR
131 + MN_OUTLINE_TEXT_AUTOFIT
132 + MN_TRANSFORM
133 + MN_FONTWORK
134 + SEPARATOR
135 + MN_CHAR_PARAGRAPH
136 + SEPARATOR
137 + MN_POSITION
138 + MN_OBJECT_ALIGN
139 + MN_DISTRIBUTE
140 + MNSUB_CONVERT
142 + //-#i68101#----------------------
143 + SEPARATOR
144 + MN_OBJECT_TITLE_DESCRIPTION
145 + MN_NAME_GROUP
146 + //-#i68101#----------------------
148 +#if SD_POPUP == RID_DRAW_TEXTOBJ_POPUP
149 + SEPARATOR
150 + MN_EFFECT
151 + MN_ACTION
152 +#endif
153 + SEPARATOR
154 + MN_STYLEDT
155 + };
159 // GEOMOBJ_POPUP
161 #if SD_POPUP == RID_DRAW_TEXTOBJ_POPUP
162 diff --git sd/source/ui/inc/res_bmp.hrc sd/source/ui/inc/res_bmp.hrc
163 index d4914a3..8565e1b 100644
164 --- sd/source/ui/inc/res_bmp.hrc
165 +++ sd/source/ui/inc/res_bmp.hrc
166 @@ -301,6 +301,9 @@
168 #define RID_TASKPANE_CURRENT_MASTERPAGESSELECTOR_POPUP RID_APP_START+93
170 +#define RID_DRAW_OUTLINETEXTOBJ_POPUP RID_APP_START+95
171 +#define RID_GRAPHIC_OUTLINETEXTOBJ_POPUP RID_APP_START+96
174 * Pointer (Mauszeiger)
176 diff --git sd/source/ui/view/drviews2.cxx sd/source/ui/view/drviews2.cxx
177 index f55b303..605716f 100644
178 --- sd/source/ui/view/drviews2.cxx
179 +++ sd/source/ui/view/drviews2.cxx
180 @@ -175,6 +175,31 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
182 switch ( nSId )
184 + case SID_OUTLINE_TEXT_AUTOFIT:
186 + SfxUndoManager* pUndoManager = GetDocSh()->GetUndoManager();
187 + SdrObject* pObj = NULL;
188 + const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
189 + if( rMarkList.GetMarkCount() == 1 )
191 + pUndoManager->EnterListAction( String(), String() );
192 + mpDrawView->BegUndo();
194 + pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
195 + bool bSet = ((const SdrTextFitToSizeTypeItem*)pObj->GetMergedItemSet().GetItem(SDRATTR_TEXT_FITTOSIZE))->GetValue() != SDRTEXTFIT_NONE;
197 + mpDrawView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj));
199 + pObj->SetMergedItem(SdrTextFitToSizeTypeItem(bSet ? SDRTEXTFIT_NONE : SDRTEXTFIT_AUTOFIT));
201 + mpDrawView->EndUndo();
202 + pUndoManager->LeaveListAction();
204 + Cancel();
205 + rReq.Done();
207 + break;
209 // Flaechen und Linien-Attribute:
210 // Sollten (wie StateMethode) eine eigene
211 // Execute-Methode besitzen
212 diff --git sd/source/ui/view/drviews4.cxx sd/source/ui/view/drviews4.cxx
213 index 66482d4..8a9b122 100644
214 --- sd/source/ui/view/drviews4.cxx
215 +++ sd/source/ui/view/drviews4.cxx
216 @@ -669,9 +669,13 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin)
218 switch ( nId )
220 + case OBJ_OUTLINETEXT:
221 + nSdResId = bGraphicShell ? RID_GRAPHIC_OUTLINETEXTOBJ_POPUP :
222 + RID_DRAW_OUTLINETEXTOBJ_POPUP;
223 + break;
225 case OBJ_CAPTION:
226 case OBJ_TITLETEXT:
227 - case OBJ_OUTLINETEXT:
228 case OBJ_TEXT:
229 nSdResId = bGraphicShell ? RID_GRAPHIC_TEXTOBJ_POPUP :
230 RID_DRAW_TEXTOBJ_POPUP;
231 diff --git sd/source/ui/view/drviewsj.cxx sd/source/ui/view/drviewsj.cxx
232 index 5892f63..eceea7a 100644
233 --- sd/source/ui/view/drviewsj.cxx
234 +++ sd/source/ui/view/drviewsj.cxx
235 @@ -213,9 +213,6 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
236 rSet.DisableItem( SID_CHANGEPOLYGON );
239 - if(nInv == SdrInventor && (nId == OBJ_TITLETEXT || nId == OBJ_OUTLINETEXT))
240 - rSet.DisableItem( SID_TEXTATTR_DLG );
242 if(nInv == SdrInventor && nId == OBJ_TABLE )
244 rSet.DisableItem( SID_TEXTATTR_DLG );
245 @@ -308,6 +305,17 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
246 else
247 rSet.DisableItem( SID_MODIFY_FIELD );
249 + if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OUTLINE_TEXT_AUTOFIT ) )
251 + bool bSet = false;
252 + const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
253 + if( rMarkList.GetMarkCount() == 1 )
255 + SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
256 + bSet = ((const SdrTextFitToSizeTypeItem*)pObj->GetMergedItemSet().GetItem(SDRATTR_TEXT_FITTOSIZE))->GetValue() != SDRTEXTFIT_NONE;
258 + rSet.Put(SfxBoolItem(SID_OUTLINE_TEXT_AUTOFIT, bSet));
261 rSet.DisableItem( SID_GROUP );
262 rSet.DisableItem( SID_COMBINE );
263 @@ -357,7 +365,6 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
264 BOOL bGraf = FALSE;
265 BOOL bDrawObj = FALSE;
266 BOOL b3dObj = FALSE;
267 - BOOL bTitOutText = FALSE;
268 bool bTable = false;
269 BOOL bMeasureObj = FALSE;
270 BOOL bEdgeObj = FALSE; // Connector
271 @@ -397,8 +404,6 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
273 case OBJ_GRAF: bGraf = TRUE; break;
275 - case OBJ_TITLETEXT:
276 - case OBJ_OUTLINETEXT: bTitOutText = TRUE; break;
277 case OBJ_TABLE: bTable = true; break;
280 @@ -446,7 +451,7 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
282 rSet.DisableItem( SID_UNGROUP );
284 - if( bTitOutText || bTable )
285 + if( bTable )
286 rSet.DisableItem( SID_TEXTATTR_DLG );
288 if( !bMeasureObj )