xref: /aoo41x/main/sc/source/ui/view/prevwsh2.cxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_sc.hxx"
30 
31 
32 
33 //------------------------------------------------------------------
34 
35 // TOOLS
36 #define _BIGINT_HXX
37 #define _SFXMULTISEL_HXX
38 #define _STACK_HXX
39 #define _QUEUE_HXX
40 #define _DYNARR_HXX
41 #define _TREELIST_HXX
42 #define _CACHESTR_HXX
43 #define _NEW_HXX
44 //#define _SHL_HXX
45 //#define _LINK_HXX
46 //#define _ERRCODE_HXX
47 //#define _GEN_HXX
48 //#define _FRACT_HXX
49 //#define _STRING_HXX
50 //#define _MTF_HXX
51 //#define _CONTNR_HXX
52 //#define _LIST_HXX
53 //#define _TABLE_HXX
54 #define _DYNARY_HXX
55 //#define _UNQIDX_HXX
56 #define _SVMEMPOOL_HXX
57 //#define _UNQID_HXX
58 //#define _DEBUG_HXX
59 //#define _DATE_HXX
60 //#define _TIME_HXX
61 //#define _DATETIME_HXX
62 //#define _INTN_HXX
63 //#define _WLDCRD_HXX
64 //#define _FSYS_HXX
65 //#define _STREAM_HXX
66 #define _CACHESTR_HXX
67 //#define _SV_MULTISEL_HXX
68 
69 //SV
70 //#define _CLIP_HXX ***
71 #define _CONFIG_HXX
72 #define _CURSOR_HXX
73 #define _FONTDLG_HXX
74 #define _PRVWIN_HXX
75 //#define _COLOR_HXX
76 //#define _PAL_HXX
77 //#define _BITMAP_HXX
78 //#define _GDIOBJ_HXX
79 //#define _POINTR_HXX
80 //#define _ICON_HXX
81 //#define _IMAGE_HXX
82 //#define _KEYCOD_HXX
83 //#define _EVENT_HXX
84 #define _HELP_HXX
85 //#define _APP_HXX
86 //#define _MDIAPP_HXX
87 //#define _TIMER_HXX
88 //#define _METRIC_HXX
89 //#define _REGION_HXX
90 //#define _OUTDEV_HXX
91 //#define _SYSTEM_HXX
92 //#define _VIRDEV_HXX
93 //#define _JOBSET_HXX
94 //#define _PRINT_HXX
95 //#define _WINDOW_HXX
96 //#define _SYSWIN_HXX
97 //#define _WRKWIN_HXX
98 #define _MDIWIN_HXX
99 //#define _FLOATWIN_HXX
100 //#define _DOCKWIN_HXX
101 //#define _CTRL_HXX
102 //#define _SCRBAR_HXX
103 //#define _BUTTON_HXX
104 //#define _IMAGEBTN_HXX
105 //#define _FIXED_HXX
106 //#define _GROUP_HXX
107 //#define _EDIT_HXX
108 //#define _COMBOBOX_HXX
109 //#define _LSTBOX_HXX
110 //#define _SELENG_HXX ***
111 //#define _SPLIT_HXX
112 #define _SPIN_HXX
113 //#define _FIELD_HXX
114 //#define _MOREBTN_HXX ***
115 //#define _TOOLBOX_HXX
116 //#define _STATUS_HXX ***
117 //#define _DIALOG_HXX
118 //#define _MSGBOX_HXX
119 //#define _SYSDLG_HXX
120 //#define _PRNDLG_HXX
121 #define _COLDLG_HXX
122 //#define _TABDLG_HXX
123 //#define _GDIMTF_HXX
124 //#define _POLY_HXX
125 //#define _ACCEL_HXX
126 //#define _GRAPH_HXX
127 #define _SOUND_HXX
128 
129 //svtools
130 #define _SCRWIN_HXX
131 #define _RULER_HXX
132 //#define _TABBAR_HXX
133 //#define _VALUESET_HXX
134 #define _STDMENU_HXX
135 //#define _STDCTRL_HXX
136 //#define _CTRLBOX_HXX
137 #define _CTRLTOOL_HXX
138 #define _EXTATTR_HXX
139 #define _FRM3D_HXX
140 #define _EXTATTR_HXX
141 
142 //SVTOOLS
143 //#define _SVTREELIST_HXX ***
144 #define _FILTER_HXX
145 //#define _SVLBOXITM_HXX ***
146 //#define _SVTREEBOX_HXX ***
147 #define _SVICNVW_HXX
148 #define _SVTABBX_HXX
149 
150 //sfxcore.hxx
151 //#define _SFXINIMGR_HXX ***
152 //#define _SFXCFGITEM_HXX
153 //#define _SFX_PRINTER_HXX
154 #define _SFXGENLINK_HXX
155 #define _SFXHINTPOST_HXX
156 #define _SFXDOCINF_HXX
157 #define _SFXLINKHDL_HXX
158 //#define _SFX_PROGRESS_HXX
159 
160 //sfxsh.hxx
161 //#define _SFX_SHELL_HXX
162 //#define _SFXAPP_HXX
163 //#define _SFXDISPATCH_HXX
164 //#define _SFXMSG_HXX ***
165 //#define _SFXOBJFACE_HXX ***
166 //#define _SFXREQUEST_HXX
167 #define _SFXMACRO_HXX
168 
169 // SFX
170 //#define _SFXAPPWIN_HXX ***
171 #define _SFX_SAVEOPT_HXX
172 //#define _SFX_CHILDWIN_HXX
173 //#define _SFXCTRLITEM_HXX
174 #define _SFXPRNMON_HXX
175 #define _INTRO_HXX
176 #define _SFXMSGDESCR_HXX
177 #define _SFXMSGPOOL_HXX
178 #define _SFXFILEDLG_HXX
179 #define _PASSWD_HXX
180 #define _SFXTBXCTRL_HXX
181 #define _SFXSTBITEM_HXX
182 #define _SFXMNUITEM_HXX
183 #define _SFXIMGMGR_HXX
184 #define _SFXTBXMGR_HXX
185 #define _SFXSTBMGR_HXX
186 #define _SFX_MINFITEM_HXX
187 #define _SFXEVENT_HXX
188 
189 //sfxdoc.hxx
190 //#define _SFX_OBJSH_HXX
191 //#define _SFX_CLIENTSH_HXX
192 //#define _SFXDOCINF_HXX
193 //#define _SFX_OBJFAC_HXX
194 #define _SFX_DOCFILT_HXX
195 //#define _SFXDOCFILE_HXX ***
196 //define _VIEWFAC_HXX
197 //#define _SFXVIEWFRM_HXX
198 //#define _SFXVIEWSH_HXX
199 //#define _MDIFRM_HXX ***
200 #define _SFX_IPFRM_HXX
201 //#define _SFX_INTERNO_HXX
202 
203 //sfxdlg.hxx
204 //#define _SFXTABDLG_HXX
205 //#define _BASEDLGS_HXX ***
206 #define _SFX_DINFDLG_HXX
207 #define _SFXDINFEDT_HXX
208 #define _SFX_MGETEMPL_HXX
209 #define _SFX_TPLPITEM_HXX
210 //#define _SFX_STYLEDLG_HXX
211 #define _NEWSTYLE_HXX
212 //#define _SFXDOCTEMPL_HXX ***
213 //#define _SFXDOCTDLG_HXX ***
214 //#define _SFX_TEMPLDLG_HXX ***
215 //#define _SFXNEW_HXX ***
216 #define _SFXDOCMAN_HXX
217 #define _SFXDOCKWIN_HXX
218 
219 //sfxitems.hxx
220 #define _SFX_WHMAP_HXX
221 //#define _ARGS_HXX ***
222 //#define _SFXPOOLITEM_HXX
223 //#define _SFXINTITEM_HXX
224 //#define _SFXENUMITEM_HXX
225 #define _SFXFLAGITEM_HXX
226 //#define _SFXSTRITEM_HXX
227 #define _SFXPTITEM_HXX
228 #define _SFXRECTITEM_HXX
229 //#define _SFXITEMPOOL_HXX
230 //#define _SFXITEMSET_HXX
231 #define _SFXITEMITER_HXX
232 #define _SFX_WHITER_HXX
233 #define _SFXPOOLCACH_HXX
234 //#define _AEITEM_HXX
235 #define _SFXRNGITEM_HXX
236 //#define _SFXSLSTITM_HXX
237 //#define _SFXSTYLE_HXX
238 
239 //xout.hxx
240 //#define _XENUM_HXX
241 //#define _XPOLY_HXX
242 //#define _XATTR_HXX
243 //#define _XOUTX_HXX
244 //#define _XPOOL_HXX
245 //#define _XTABLE_HXX
246 
247 //svdraw.hxx
248 #define _SDR_NOITEMS
249 #define _SDR_NOTOUCH
250 #define _SDR_NOTRANSFORM
251 //#define _SDR_NOOBJECTS
252 //#define _SDR_NOVIEWS
253 #define _SDR_NOTRANSFORM
254 #define _SDR_NOVIEWMARKER
255 #define _SDR_NODRAGMETHODS
256 #define _SDR_NOUNDO
257 #define _SDR_NOXOUTDEV
258 
259 
260 //#define SI_NOITEMS
261 //#define SI_NODRW
262 #define _SI_NOSBXCONTROLS
263 //#define _VCATTR_HXX
264 #define _VCONT_HXX
265 //#define _VCSBX_HXX
266 #define _SI_NOOTHERFORMS
267 #define _VCTRLS_HXX
268 //#define _VCDRWOBJ_HXX
269 #define _SI_NOCONTROL
270 #define _SETBRW_HXX
271 #define _VCBRW_HXX
272 #define _SI_NOSBXCONTROLS
273 //#define _SIDLL_HXX ***
274 
275 #define _SVX_DAILDLL_HXX
276 #define _SVX_HYPHEN_HXX
277 #define _SVX_IMPGRF_HXX
278 #define _SVX_OPTITEMS_HXX
279 #define _SVX_OPTGERL_HXX
280 #define _SVX_OPTSAVE_HXX
281 #define _SVX_OPTSPELL_HXX
282 #define _SVX_OPTPATH_HXX
283 #define _SVX_OPTLINGU_HXX
284 #define _SVX_RULER_HXX
285 #define _SVX_RULRITEM_HXX
286 #define _SVX_SPLWRAP_HXX
287 #define _SVX_SPLDLG_HXX
288 #define _SVX_THESDLG_HXX
289 
290 
291 
292 
293 // INCLUDE ---------------------------------------------------------------
294 
295 #include <svx/svdmodel.hxx>
296 #include <svl/smplhint.hxx>
297 
298 #include "prevwsh.hxx"
299 #include "docsh.hxx"
300 #include "preview.hxx"
301 #include "hints.hxx"
302 #include "sc.hrc"
303 
304 // STATIC DATA -----------------------------------------------------------
305 
306 // -----------------------------------------------------------------------
307 
308 void __EXPORT ScPreviewShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
309 {
310 	sal_Bool bDataChanged = sal_False;
311 
312 	if (rHint.ISA(SfxSimpleHint))
313 	{
314 		sal_uLong nSlot = ((const SfxSimpleHint&)rHint).GetId();
315 		switch ( nSlot )
316 		{
317 			case FID_DATACHANGED:
318 			case SID_SCPRINTOPTIONS:
319 				bDataChanged = sal_True;
320 				break;
321 			case SC_HINT_DRWLAYER_NEW:
322 				{
323 					SfxBroadcaster* pDrawBC = pDocShell->GetDocument()->GetDrawBroadcaster();
324 					if (pDrawBC)
325 						StartListening(*pDrawBC);
326 				}
327 				break;
328 		}
329 	}
330 	else if (rHint.ISA(ScPaintHint))
331 	{
332 		if ( ((const ScPaintHint&)rHint).GetPrintFlag() )
333 		{
334 			sal_uInt16 nParts = ((const ScPaintHint&)rHint).GetParts();
335 			if (nParts & ( PAINT_GRID | PAINT_LEFT | PAINT_TOP | PAINT_SIZE ))
336 				bDataChanged = sal_True;
337 		}
338 	}
339 	else if (rHint.ISA(SdrHint))
340 	{
341 		// SdrHints are no longer used for invalidating, thus react on objectchange instead
342 		if(HINT_OBJCHG == ((const SdrHint&)rHint).GetKind())
343 			bDataChanged = sal_True;
344 	}
345 
346 	if (bDataChanged)
347 		pPreview->DataChanged(sal_True);
348 }
349 
350 
351 
352 
353 
354