update ooo310-m15
[ooovba.git] / applied_patches / 0641-layout-simple-dialogs-sw.diff
bloba2f452c093f73b4a2592431cbcd97504e3de2388
1 diff --git sw/inc/mdiexp.hxx sw/inc/mdiexp.hxx
2 index fa7d9f6..97b3187 100644
3 --- sw/inc/mdiexp.hxx
4 +++ sw/inc/mdiexp.hxx
5 @@ -33,6 +33,7 @@
6 #include <tools/solar.h>
7 #include <tblenum.hxx>
8 #include <swdllapi.h>
9 +#include <layout/layout.hxx>
11 class UniString;
12 class SwRect;
13 @@ -63,7 +64,7 @@ void RescheduleProgress( SwDocShell *pDocShell );
15 void EnableCmdInterface(BOOL bEnable = TRUE);
17 -Dialog* GetSearchDialog();
18 +LAYOUT_NS Dialog* GetSearchDialog();
20 void RepaintPagePreview( ViewShell* pVwSh, const SwRect& rRect );
22 diff --git sw/source/core/crsr/viscrs.cxx sw/source/core/crsr/viscrs.cxx
23 index 871f09c..aa50883 100644
24 --- sw/source/core/crsr/viscrs.cxx
25 +++ sw/source/core/crsr/viscrs.cxx
26 @@ -996,7 +996,7 @@ SwCursor* SwShellCrsr::Create( SwPaM* pRing ) const
27 short SwShellCrsr::MaxReplaceArived()
29 short nRet = RET_YES;
30 - Window* pDlg = ::GetSearchDialog();
31 + Window* pDlg = LAYOUT_THIS_WINDOW (::GetSearchDialog());
32 if( pDlg )
34 // alte Actions beenden; die Tabellen-Frames werden angelegt und
35 diff --git sw/source/ui/dialog/makefile.mk sw/source/ui/dialog/makefile.mk
36 index 1f16883..17ca965 100644
37 --- sw/source/ui/dialog/makefile.mk
38 +++ sw/source/ui/dialog/makefile.mk
39 @@ -42,10 +42,6 @@ LIBTARGET=no
40 .INCLUDE : settings.mk
41 .INCLUDE : $(PRJ)$/inc$/sw.mk
43 -.IF "$(ENABLE_LAYOUT)" == "TRUE"
44 -CFLAGS+= -DENABLE_LAYOUT=1 -I../$(PRJ)/layout/inc -I../$(PRJ)/layout/$(INPATH)/inc
45 -.ENDIF # ENABLE_LAYOUT == TRUE
47 # --- Files --------------------------------------------------------
49 SRS1NAME=$(TARGET)
50 diff --git sw/source/ui/dialog/wordcountdialog.cxx sw/source/ui/dialog/wordcountdialog.cxx
51 index 8639a68..8ae35e6 100644
52 --- sw/source/ui/dialog/wordcountdialog.cxx
53 +++ sw/source/ui/dialog/wordcountdialog.cxx
54 @@ -41,6 +41,15 @@
55 #include <layout/layout-pre.hxx>
56 #include <wordcountdialog.hrc>
58 +#if ENABLE_LAYOUT
59 +#undef SW_RES
60 +#define SW_RES(x) #x
61 +#undef SfxModalDialog
62 +#define SfxModalDialog( parent, id ) Dialog( parent, "wordcount.xml", id )
63 +#define SW_WORDCOUNTDIALOG_HRC
64 +#include <helpid.h>
65 +#endif /* ENABLE_LAYOUT */
67 /*-- 06.04.2004 16:05:55---------------------------------------------------
69 -----------------------------------------------------------------------*/
70 @@ -67,6 +76,9 @@ SwWordCountDialog::SwWordCountDialog(Window* pParent) :
71 #pragma warning (default : 4355)
72 #endif
74 +#if ENABLE_LAYOUT
75 + SetHelpId (HID_DLG_WORDCOUNT);
76 +#endif /* ENABLE_LAYOUT */
77 FreeResource();
79 /*-- 06.04.2004 16:05:56---------------------------------------------------
80 diff --git sw/source/ui/docvw/edtwin3.cxx sw/source/ui/docvw/edtwin3.cxx
81 index af37a99..fbe37b1 100644
82 --- sw/source/ui/docvw/edtwin3.cxx
83 +++ sw/source/ui/docvw/edtwin3.cxx
84 @@ -150,7 +150,7 @@ BOOL SwEditWin::RulerMarginDrag( const MouseEvent& rMEvt,
86 // <--
88 -Dialog* GetSearchDialog()
89 +LAYOUT_NS Dialog* GetSearchDialog()
91 return SwView::GetSearchDialog();
93 diff --git sw/source/ui/inc/view.hxx sw/source/ui/inc/view.hxx
94 index fcb7241..f2f87c7 100644
95 --- sw/source/ui/inc/view.hxx
96 +++ sw/source/ui/inc/view.hxx
97 @@ -41,6 +41,7 @@
98 #include "swdllapi.h"
99 #include <swtypes.hxx>
100 #include <shellid.hxx>
101 +#include <layout/layout.hxx>
103 class SwBaseShell;
104 class Button;
105 @@ -488,7 +489,7 @@ public:
106 void SetVisArea( const Point&, BOOL bUpdateScrollbar = TRUE);
107 void CheckVisArea();
109 - static Dialog* GetSearchDialog();
110 + static LAYOUT_NS Dialog* GetSearchDialog();
112 static USHORT GetMoveType();
113 static void SetMoveType(USHORT nSet);
114 diff --git sw/source/ui/uiview/viewsrch.cxx sw/source/ui/uiview/viewsrch.cxx
115 index 984c2ee..4eb97d8 100644
116 --- sw/source/ui/uiview/viewsrch.cxx
117 +++ sw/source/ui/uiview/viewsrch.cxx
118 @@ -106,7 +106,7 @@ inline Window* GetParentWindow( SvxSearchDialog* pSrchDlg )
120 Window* pWin;
121 if( pSrchDlg && pSrchDlg->IsVisible() )
122 - pWin = pSrchDlg;
123 + pWin = LAYOUT_THIS_WINDOW (pSrchDlg);
124 else
125 pWin = 0;
126 return pWin;
127 @@ -168,7 +168,7 @@ void SwView::ExecSearch(SfxRequest& rReq, BOOL bNoMessage)
129 if ( pWrp )
131 - pSrchDlg = (SvxSearchDialog*)(pWrp->GetWindow());
132 + pSrchDlg = static_cast <SvxSearchDialog*> (pWrp->getDialog ());
133 // die Search / Replace -Items merken wir uns
134 const SearchAttrItemList* pList = pSrchDlg->GetSearchItemList();
135 if( pList && pList->Count() )
136 @@ -189,7 +189,7 @@ void SwView::ExecSearch(SfxRequest& rReq, BOOL bNoMessage)
137 SwView::SetMoveType(NID_SRCH_REP);
138 if ( pWrp )
140 - pSrchDlg = (SvxSearchDialog*)(pWrp->GetWindow());
141 + pSrchDlg = static_cast <SvxSearchDialog*> (pWrp->getDialog ());
143 else
144 pSrchDlg = 0;
145 @@ -493,7 +493,7 @@ BOOL SwView::SearchAndWrap(BOOL bApi)
147 const USHORT nId = SvxSearchDialogWrapper::GetChildWindowId();
148 SvxSearchDialogWrapper *pWrp = (SvxSearchDialogWrapper*)GetViewFrame()->GetChildWindow(nId);
149 - pSrchDlg = pWrp ? (SvxSearchDialog*)(pWrp->GetWindow()) : 0;
150 + pSrchDlg = pWrp ? static_cast <SvxSearchDialog*> (pWrp->getDialog ()) : 0;
152 // falls Startposition am Dokumentende / -anfang
153 if (aOpts.bDontWrap)
154 @@ -728,19 +728,17 @@ ULONG SwView::FUNC_Search( const SwSearchOptions& rOptions )
155 return nFound;
159 -Dialog* SwView::GetSearchDialog()
160 +LAYOUT_NS Dialog* SwView::GetSearchDialog()
162 const USHORT nId = SvxSearchDialogWrapper::GetChildWindowId();
163 SvxSearchDialogWrapper *pWrp = (SvxSearchDialogWrapper*)SfxViewFrame::Current()->GetChildWindow(nId);
164 if ( pWrp )
165 - pSrchDlg = (SvxSearchDialog*)(pWrp->GetWindow());
166 + pSrchDlg = pWrp->getDialog ();
167 else
168 pSrchDlg = 0;
169 return pSrchDlg;
173 void SwView::StateSearch(SfxItemSet &rSet)
175 SfxWhichIter aIter(rSet);
176 diff --git sw/uiconfig/layout/layout.mk sw/uiconfig/layout/layout.mk
177 deleted file mode 100644
178 index 88164bb..0000000
179 --- sw/uiconfig/layout/layout.mk
180 +++ /dev/null
181 @@ -1,33 +0,0 @@
182 -# TODO: move to solenv/inc
183 -# copies: sw/uiconfig/layout svx/uiconfig/layout
185 -TRALAY=tralay
186 -XML_DEST=$(DLLDEST)
187 -XML_LANGS=$(alllangiso)
189 -ALL_XMLS=$(foreach,i,$(XML_FILES) $(XML_DEST)/$i) $(foreach,i,$(XML_LANGS) $(foreach,j,$(XML_FILES) $(XML_DEST)/$i/$j))
191 -# Must remove the -j (no duplicate base file names) flag
192 -ZIPUPDATE=-u
193 -XML_ZIP = $(PRJNAME)-layout
195 -ALLTAR: $(XML_ZIP)
197 -$(XML_ZIP): $(ALL_XMLS)
199 -ZIP1DIR=$(XML_DEST)
200 -ZIP1TARGET=$(XML_ZIP)
201 -ZIP1LIST=$(ALL_XMLS:s@$(XML_DEST)/@@)
203 -$(foreach,i,$(XML_LANGS) $(XML_DEST)/$i/%.xml): %.xml
204 - -$(MKDIR) $(@:d)
205 - @echo $(foreach,i,$(XML_LANGS) $(XML_DEST)/$i/%.xml): %.xml
206 - $(TRALAY) -m localize.sdf -o $(XML_DEST) -l $(XML_LANGS:f:t" -l ") $<
208 -$(XML_DEST)/%.xml: %.xml
209 - -$(MKDIR) $(@:d)
210 - $(COPY) $< $@
212 -# Don't want to overwrite filled localize.sdf with empty template
213 -template.sdf:
214 - $(foreach,i,$(XML_FILES) $(TRALAY) -l en-US $i) > $@
215 diff --git sw/uiconfig/layout/makefile.mk sw/uiconfig/layout/makefile.mk
216 index b577653..5f4bc52 100644
217 --- sw/uiconfig/layout/makefile.mk
218 +++ sw/uiconfig/layout/makefile.mk
219 @@ -48,3 +48,8 @@ all .PHONY:
220 .ENDIF # ENABLE_LAYOUT != TRUE
222 .INCLUDE : target.mk
224 +localize.sdf: $(PRJ)/source/ui/dialog/localize.sdf
225 + grep wordcountdialog.src $(PRJ)/source/ui/dialog/localize.sdf | awk -F'\t' '{{printf "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n", "layout", "sw\\uiconfig\\layout\\wordcount.xml", $$3, "layout", $$6 "_label", "", "", $$8, "0", $$10, $$11, $$12, "", $$14, $$15}}' | sed -e 's/\(\(FL\|STR\)_[^\t]*\)_label/\1_text/' -e 's/\t_label/\tDLG_WORDCOUNT_title/' > wordcount-$@
226 + echo '#empty' | cat - wordcount-$@ > $@
227 + rm -f *-$@
228 diff --git sw/uiconfig/layout/wordcount.xml sw/uiconfig/layout/wordcount.xml
229 index ae33571..e922294 100644
230 --- sw/uiconfig/layout/wordcount.xml
231 +++ sw/uiconfig/layout/wordcount.xml
232 @@ -7,7 +7,7 @@
233 xmlns:cnt="http://openoffice.org/2007/layout/container"
234 help-id="HID_DLG_WORDCOUNT"
235 id="DLG_WORDCOUNT"
236 - sizeable="true" moveable="true" optimumsize="true"
237 + sizeable="true" moveable="true" optimumsize="true" closeable="true"
238 has_border="true" sv-look="true" _title="Word Count">
239 <vbox border="5" spacing="5">
240 <fixedline id="FL_CURRENT" _text="Current selection"/>
241 @@ -26,7 +26,7 @@
242 </vbox>
243 </hbox>
244 <!-- if we could do cnt:cnt:padding="-13" here, we would not have to close
245 - and reope the hbox/vbox thing !-->
246 + and reopen the hbox/vbox thing !-->
247 <fixedline id="FL_DOC" _text="Whole document"/>
248 <hbox>
249 <vbox cnt:padding="13" spacing="5">