1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "fltoptint.hxx"
21 #include "objshimp.hxx"
22 #include <sfx2/app.hxx>
23 #include <sfx2/brokenpackageint.hxx>
24 #include <sfx2/dispatch.hxx>
25 #include <sfx2/docfile.hxx>
26 #include <sfx2/fcontnr.hxx>
27 #include <sfx2/frame.hxx>
28 #include <sfx2/module.hxx>
29 #include <sfx2/msg.hxx>
30 #include <sfx2/msgpool.hxx>
31 #include <sfx2/objsh.hxx>
32 #include <sfx2/request.hxx>
33 #include <sfx2/sfxbasecontroller.hxx>
34 #include <sfx2/sfxsids.hrc>
35 #include <sfx2/sfxuno.hxx>
36 #include <sfx2/unoctitm.hxx>
37 #include "sfxslots.hxx"
38 #include "sfxtypes.hxx"
40 #include <sal/config.h>
41 #include <basic/basmgr.hxx>
42 #include <basic/sberrors.hxx>
43 #include <basic/sbmeth.hxx>
44 #include <basic/sbuno.hxx>
45 #include <basic/sbx.hxx>
46 #include <basic/sbxcore.hxx>
47 #include <basic/sbxmeth.hxx>
48 #include <basic/sbxobj.hxx>
49 #include <comphelper/interaction.hxx>
50 #include <framework/documentundoguard.hxx>
51 #include <svl/eitem.hxx>
52 #include <svl/intitem.hxx>
53 #include <svl/itempool.hxx>
54 #include <svl/lckbitem.hxx>
55 #include <svl/ownlist.hxx>
56 #include <svl/rectitem.hxx>
57 #include <svl/slstitm.hxx>
58 #include <svl/stritem.hxx>
59 #include <tools/config.hxx>
60 #include <tools/debug.hxx>
61 #include <tools/urlobj.hxx>
63 #include <com/sun/star/document/FilterOptionsRequest.hpp>
64 #include <com/sun/star/frame/XFrame.hpp>
65 #include <com/sun/star/frame/XModel.hpp>
66 #include <com/sun/star/io/XInputStream.hpp>
67 #include <com/sun/star/task/XInteractionHandler.hpp>
68 #include <com/sun/star/ucb/XContent.hpp>
70 #include <boost/scoped_ptr.hpp>
72 using namespace ::com::sun::star
;
73 using namespace ::com::sun::star::ucb
;
74 using namespace ::com::sun::star::uno
;
75 using namespace ::com::sun::star::registry
;
76 using namespace ::com::sun::star::frame
;
77 using namespace ::com::sun::star::beans
;
78 using namespace ::com::sun::star::io
;
80 // needs to be converted to a better data structure
81 SfxFormalArgument aFormalArgs
[] = {
82 { reinterpret_cast<SfxType
*>(&aSfxStringItem_Impl
), "SuggestedSaveAsName", SID_DEFAULTFILENAME
},
83 { reinterpret_cast<SfxType
*>(&aSfxStringItem_Impl
), "SuggestedSaveAsDir", SID_DEFAULTFILEPATH
},
84 { reinterpret_cast<SfxType
*>(&aSfxStringItem_Impl
), "VersionAuthor", SID_DOCINFO_AUTHOR
},
85 { reinterpret_cast<SfxType
*>(&aSfxStringItem_Impl
), "VersionComment", SID_DOCINFO_COMMENTS
},
86 { reinterpret_cast<SfxType
*>(&aSfxBoolItem_Impl
), "VersionMajor", SID_DOCINFO_MAJOR
},
87 { reinterpret_cast<SfxType
*>(&aSfxStringItem_Impl
), "FilterOptions", SID_FILE_FILTEROPTIONS
},
88 { reinterpret_cast<SfxType
*>(&aSfxStringItem_Impl
), "FilterName", SID_FILTER_NAME
},
89 // { reinterpret_cast<SfxType*>(&aSfxStringItem_Impl), "FileName", SID_FILE_NAME },
90 { reinterpret_cast<SfxType
*>(&aSfxStringItem_Impl
), "URL", SID_FILE_NAME
},
91 { reinterpret_cast<SfxType
*>(&aSfxStringItem_Impl
), "OpenFlags", SID_OPTIONS
},
92 { reinterpret_cast<SfxType
*>(&aSfxBoolItem_Impl
), "Overwrite", SID_OVERWRITE
},
93 { reinterpret_cast<SfxType
*>(&aSfxStringItem_Impl
), "Password", SID_PASSWORD
},
94 { reinterpret_cast<SfxType
*>(&aSfxBoolItem_Impl
), "PasswordInteraction", SID_PASSWORDINTERACTION
},
95 { reinterpret_cast<SfxType
*>(&aSfxStringItem_Impl
), "Referer", SID_REFERER
},
96 { reinterpret_cast<SfxType
*>(&aSfxBoolItem_Impl
), "SaveTo", SID_SAVETO
},
97 { reinterpret_cast<SfxType
*>(&aSfxStringItem_Impl
), "TemplateName", SID_TEMPLATE_NAME
},
98 { reinterpret_cast<SfxType
*>(&aSfxStringItem_Impl
), "TemplateRegion", SID_TEMPLATE_REGIONNAME
},
99 // { reinterpret_cast<SfxType*>(&aSfxStringItem_Impl), "Region", SID_TEMPLATE_REGIONNAME },
100 // { reinterpret_cast<SfxType*>(&aSfxStringItem_Impl), "Name", SID_TEMPLATE_NAME },
101 { reinterpret_cast<SfxType
*>(&aSfxBoolItem_Impl
), "Unpacked", SID_UNPACK
},
102 { reinterpret_cast<SfxType
*>(&aSfxInt16Item_Impl
), "Version", SID_VERSION
},
103 { reinterpret_cast<SfxType
*>(&aSfxBoolItem_Impl
), "SaveACopy", SID_SAVEACOPYITEM
},
106 static sal_uInt16 nMediaArgsCount
= sizeof(aFormalArgs
) / sizeof (SfxFormalArgument
);
108 static char const sTemplateRegionName
[] = "TemplateRegionName";
109 static char const sTemplateName
[] = "TemplateName";
110 static char const sAsTemplate
[] = "AsTemplate";
111 static char const sOpenNewView
[] = "OpenNewView";
112 static char const sViewId
[] = "ViewId";
113 static char const sPluginMode
[] = "PluginMode";
114 static char const sReadOnly
[] = "ReadOnly";
115 static char const sDdeReconnect
[] = "DDEReconnect";
116 static char const sStartPresentation
[] = "StartPresentation";
117 static char const sFrameName
[] = "FrameName";
118 static char const sMediaType
[] = "MediaType";
119 static char const sPostData
[] = "PostData";
120 static char const sCharacterSet
[] = "CharacterSet";
121 static char const sInputStream
[] = "InputStream";
122 static char const sStream
[] = "Stream";
123 static char const sOutputStream
[] = "OutputStream";
124 static char const sHidden
[] = "Hidden";
125 static char const sPreview
[] = "Preview";
126 static char const sViewOnly
[] = "ViewOnly";
127 static char const sDontEdit
[] = "DontEdit";
128 static char const sSilent
[] = "Silent";
129 static char const sJumpMark
[] = "JumpMark";
130 static char const sFileName
[] = "FileName";
131 static char const sSalvagedFile
[] = "SalvagedFile";
132 static char const sStatusInd
[] = "StatusIndicator";
133 static char const sModel
[] = "Model";
134 static char const sFrame
[] = "Frame";
135 static char const sViewData
[] = "ViewData";
136 static char const sFilterData
[] = "FilterData";
137 static char const sSelectionOnly
[] = "SelectionOnly";
138 static char const sFilterFlags
[] = "FilterFlags";
139 static char const sMacroExecMode
[] = "MacroExecutionMode";
140 static char const sUpdateDocMode
[] = "UpdateDocMode";
141 static char const sMinimized
[] = "Minimized";
142 static char const sInteractionHdl
[] = "InteractionHandler";
143 static char const sUCBContent
[] = "UCBContent";
144 static char const sRepairPackage
[] = "RepairPackage";
145 static char const sDocumentTitle
[] = "DocumentTitle";
146 static char const sComponentData
[] = "ComponentData";
147 static char const sComponentContext
[] = "ComponentContext";
148 static char const sDocumentBaseURL
[] = "DocumentBaseURL";
149 static char const sHierarchicalDocumentName
[] = "HierarchicalDocumentName";
150 static char const sCopyStreamIfPossible
[] = "CopyStreamIfPossible";
151 static char const sNoAutoSave
[] = "NoAutoSave";
152 static char const sFolderName
[] = "FolderName";
153 static char const sUseSystemDialog
[] = "UseSystemDialog";
154 static char const sStandardDir
[] = "StandardDir";
155 static char const sBlackList
[] = "BlackList";
156 static char const sModifyPasswordInfo
[] = "ModifyPasswordInfo";
157 static char const sSuggestedSaveAsDir
[] = "SuggestedSaveAsDir";
158 static char const sSuggestedSaveAsName
[] = "SuggestedSaveAsName";
159 static char const sEncryptionData
[] = "EncryptionData";
160 static char const sFailOnWarning
[] = "FailOnWarning";
161 static char const sDocumentService
[] = "DocumentService";
162 static char const sFilterProvider
[] = "FilterProvider";
164 static bool isMediaDescriptor( sal_uInt16 nSlotId
)
166 return ( nSlotId
== SID_OPENDOC
|| nSlotId
== SID_EXPORTDOC
||
167 nSlotId
== SID_SAVEASDOC
|| nSlotId
== SID_SAVEDOC
||
168 nSlotId
== SID_SAVETO
|| nSlotId
== SID_EXPORTDOCASPDF
||
169 nSlotId
== SID_DIRECTEXPORTDOCASPDF
|| nSlotId
== SID_SAVEACOPY
||
170 nSlotId
== SID_SAVEACOPYITEM
);
173 void TransformParameters( sal_uInt16 nSlotId
, const uno::Sequence
<beans::PropertyValue
>& rArgs
, SfxAllItemSet
& rSet
, const SfxSlot
* pSlot
)
176 pSlot
= SFX_SLOTPOOL().GetSlot( nSlotId
);
181 if ( nSlotId
== SID_OPENURL
)
182 nSlotId
= SID_OPENDOC
;
183 if ( nSlotId
== SID_SAVEASURL
)
184 nSlotId
= SID_SAVEASDOC
;
186 sal_Int32 nCount
= rArgs
.getLength();
190 const beans::PropertyValue
* pPropsVal
= rArgs
.getConstArray();
191 if ( !pSlot
->IsMode(SfxSlotMode::METHOD
) )
193 // slot is a property
194 const SfxType
* pType
= pSlot
->GetType();
195 boost::scoped_ptr
<SfxPoolItem
> pItem(pType
->CreateItem());
200 OStringBuffer
aStr("No creator method for item: ");
201 aStr
.append(static_cast<sal_Int32
>(nSlotId
));
202 OSL_FAIL(aStr
.getStr());
207 sal_uInt16 nWhich
= rSet
.GetPool()->GetWhich(nSlotId
);
208 bool bConvertTwips
= ( rSet
.GetPool()->GetMetric( nWhich
) == SFX_MAPUNIT_TWIP
);
209 pItem
->SetWhich( nWhich
);
210 sal_uInt16 nSubCount
= pType
->nAttribs
;
212 const beans::PropertyValue
& rProp
= pPropsVal
[0];
213 OUString aName
= rProp
.Name
;
214 if ( nCount
== 1 && aName
== OUString( pSlot
->pUnoName
, strlen( pSlot
->pUnoName
), RTL_TEXTENCODING_UTF8
) )
216 // there is only one parameter and its name matches the name of the property,
217 // so it's either a simple property or a complex property in one single UNO struct
218 if( pItem
->PutValue( rProp
.Value
, bConvertTwips
? CONVERT_TWIPS
: 0 ) )
219 // only use successfully converted items
224 OStringBuffer
aStr("Property not convertible: ");
225 aStr
.append(pSlot
->pUnoName
);
226 OSL_FAIL( aStr
.getStr() );
231 else if ( nSubCount
== 0 )
233 // for a simple property there can be only one parameter and its name *must* match
234 SAL_WARN("sfx.appl", "Property name does not match: " << aName
);
239 // there is more than one parameter and the property is a complex one
241 // if the dispatch API is used for UI purposes or from the testtool,
242 // it is possible to skip some or all arguments,
243 // but it indicates an error for macro recording;
244 // so this should be notified as a warning only
245 if ( nCount
!= nSubCount
)
247 OStringBuffer
aStr("MacroPlayer: wrong number of parameters for slot: ");
248 aStr
.append(static_cast<sal_Int32
>(nSlotId
));
249 DBG_WARNING(aStr
.getStr());
252 // complex property; collect sub items from the parameter set and reconstruct complex item
254 for ( sal_uInt16 n
=0; n
<nCount
; n
++ )
256 const beans::PropertyValue
& rPropValue
= pPropsVal
[n
];
258 for ( nSub
=0; nSub
<nSubCount
; nSub
++ )
260 // search sub item by name
262 aStr
.append(pSlot
->pUnoName
).append('.').append(pType
->aAttrib
[nSub
].pName
);
263 if ( rPropValue
.Name
.equalsAsciiL(aStr
.getStr(), aStr
.getLength()) )
265 sal_uInt8 nSubId
= (sal_uInt8
) (sal_Int8
) pType
->aAttrib
[nSub
].nAID
;
267 nSubId
|= CONVERT_TWIPS
;
268 if ( pItem
->PutValue( rPropValue
.Value
, nSubId
) )
273 OStringBuffer
aDbgStr("Property not convertible: ");
274 aDbgStr
.append(pSlot
->pUnoName
);
275 OSL_FAIL( aDbgStr
.getStr() );
283 if ( nSub
>= nSubCount
)
285 // there was a parameter with a name that didn't match to any of the members
286 OStringBuffer
aStr("Property name does not match: ");
287 aStr
.append(OUStringToOString(rPropValue
.Name
, RTL_TEXTENCODING_UTF8
));
288 OSL_FAIL( aStr
.getStr() );
293 // at least one part of the complex item must be present; other parts can have default values
301 OSL_ASSERT(nCount
> 0);
304 // detect parameters that don't match to any formal argument or one of its members
305 sal_Int32 nFoundArgs
= 0;
308 bool bIsMediaDescriptor
= isMediaDescriptor( nSlotId
);
309 sal_uInt16 nMaxArgs
= bIsMediaDescriptor
? nMediaArgsCount
: pSlot
->nArgDefCount
;
310 for ( sal_uInt16 nArgs
=0; nArgs
<nMaxArgs
; nArgs
++ )
312 const SfxFormalArgument
&rArg
= bIsMediaDescriptor
? aFormalArgs
[nArgs
] : pSlot
->GetFormalArgument( nArgs
);
313 boost::scoped_ptr
<SfxPoolItem
> pItem(rArg
.CreateItem());
317 OStringBuffer
aStr("No creator method for argument: ");
318 aStr
.append(rArg
.pName
);
319 OSL_FAIL( aStr
.getStr() );
324 sal_uInt16 nWhich
= rSet
.GetPool()->GetWhich(rArg
.nSlotId
);
325 bool bConvertTwips
= ( rSet
.GetPool()->GetMetric( nWhich
) == SFX_MAPUNIT_TWIP
);
326 pItem
->SetWhich( nWhich
);
327 const SfxType
* pType
= rArg
.pType
;
328 sal_uInt16 nSubCount
= pType
->nAttribs
;
329 if ( nSubCount
== 0 )
331 // "simple" (base type) argument
332 for ( sal_uInt16 n
=0; n
<nCount
; n
++ )
334 const beans::PropertyValue
& rProp
= pPropsVal
[n
];
335 OUString aName
= rProp
.Name
;
336 if ( aName
== OUString( rArg
.pName
, strlen(rArg
.pName
), RTL_TEXTENCODING_UTF8
) )
341 if( pItem
->PutValue( rProp
.Value
) )
342 // only use successfully converted items
347 OStringBuffer
aStr("Property not convertible: ");
348 aStr
.append(rArg
.pName
);
349 OSL_FAIL( aStr
.getStr() );
358 // complex argument, could be passed in one struct
359 bool bAsWholeItem
= false;
360 for ( sal_uInt16 n
=0; n
<nCount
; n
++ )
362 const beans::PropertyValue
& rProp
= pPropsVal
[n
];
363 OUString aName
= rProp
.Name
;
364 if ( aName
== OUString(rArg
.pName
, strlen(rArg
.pName
), RTL_TEXTENCODING_UTF8
) )
370 if( pItem
->PutValue( rProp
.Value
) )
371 // only use successfully converted items
376 OStringBuffer
aStr("Property not convertible: ");
377 aStr
.append(rArg
.pName
);
378 OSL_FAIL( aStr
.getStr() );
386 // complex argument; collect sub items from argument array and reconstruct complex item
387 // only put item if at least one member was found and had the correct type
388 // (is this a good idea?! Should we ask for *all* members?)
390 for ( sal_uInt16 n
=0; n
<nCount
; n
++ )
392 const beans::PropertyValue
& rProp
= pPropsVal
[n
];
393 for ( sal_uInt16 nSub
=0; nSub
<nSubCount
; nSub
++ )
395 // search sub item by name
397 aStr
.append(rArg
.pName
).append('.').append(pType
->aAttrib
[nSub
].pName
);
398 if ( rProp
.Name
.equalsAsciiL(aStr
.getStr(), aStr
.getLength()) )
400 // at least one member found ...
405 sal_uInt8 nSubId
= (sal_uInt8
) (sal_Int8
) pType
->aAttrib
[nSub
].nAID
;
407 nSubId
|= CONVERT_TWIPS
;
408 if (!pItem
->PutValue( rProp
.Value
, nSubId
) )
410 // ... but it was not convertible
413 OStringBuffer
aDbgStr("Property not convertible: ");
414 aDbgStr
.append(rArg
.pName
);
415 OSL_FAIL( aDbgStr
.getStr() );
425 // only use successfully converted items
432 // special additional parameters for some slots not seen in the slot definitions
433 // Some of these slots are not considered to be used for macro recording, because they shouldn't be recorded as slots,
434 // but as dispatching or factory or arbitrary URLs to the frame
435 // Some also can use additional arguments that are not recordable (will be changed later,
436 // f.e. "SaveAs" shouldn't support parameters not in the slot definition!)
437 if ( nSlotId
== SID_NEWWINDOW
)
439 for ( sal_uInt16 n
=0; n
<nCount
; n
++ )
441 const beans::PropertyValue
& rProp
= pPropsVal
[n
];
442 OUString aName
= rProp
.Name
;
443 if ( aName
== sFrame
)
445 Reference
< XFrame
> xFrame
;
446 OSL_VERIFY( rProp
.Value
>>= xFrame
);
447 rSet
.Put( SfxUnoFrameItem( SID_FILLFRAME
, xFrame
) );
450 if ( aName
== sHidden
)
453 if (rProp
.Value
>>= bVal
)
454 rSet
.Put( SfxBoolItem( SID_HIDDEN
, bVal
) );
458 else if ( bIsMediaDescriptor
)
460 for ( sal_uInt16 n
=0; n
<nCount
; n
++ )
465 const beans::PropertyValue
& rProp
= pPropsVal
[n
];
466 const OUString
& aName
= rProp
.Name
;
467 if ( aName
== sModel
)
468 rSet
.Put( SfxUnoAnyItem( SID_DOCUMENT
, rProp
.Value
) );
469 else if ( aName
== sComponentData
)
471 rSet
.Put( SfxUnoAnyItem( SID_COMPONENTDATA
, rProp
.Value
) );
473 else if ( aName
== sComponentContext
)
475 rSet
.Put( SfxUnoAnyItem( SID_COMPONENTCONTEXT
, rProp
.Value
) );
477 else if ( aName
== sStatusInd
)
479 Reference
<task::XStatusIndicator
> xVal
;
480 bool bOK
= (rProp
.Value
>>= xVal
);
481 DBG_ASSERT( bOK
, "invalid type for StatusIndicator" );
482 if (bOK
&& xVal
.is())
483 rSet
.Put( SfxUnoAnyItem( SID_PROGRESS_STATUSBAR_CONTROL
, rProp
.Value
) );
485 else if ( aName
== sInteractionHdl
)
487 Reference
<task::XInteractionHandler
> xVal
;
488 bool bOK
= (rProp
.Value
>>= xVal
);
489 DBG_ASSERT( bOK
, "invalid type for InteractionHandler" );
490 if (bOK
&& xVal
.is())
491 rSet
.Put( SfxUnoAnyItem( SID_INTERACTIONHANDLER
, rProp
.Value
) );
493 else if ( aName
== sViewData
)
494 rSet
.Put( SfxUnoAnyItem( SID_VIEW_DATA
, rProp
.Value
) );
495 else if ( aName
== sFilterData
)
496 rSet
.Put( SfxUnoAnyItem( SID_FILTER_DATA
, rProp
.Value
) );
497 else if ( aName
== sInputStream
)
499 Reference
< XInputStream
> xVal
;
500 bool bOK
= ((rProp
.Value
>>= xVal
) && xVal
.is());
501 DBG_ASSERT( bOK
, "invalid type for InputStream" );
503 rSet
.Put( SfxUnoAnyItem( SID_INPUTSTREAM
, rProp
.Value
) );
505 else if ( aName
== sStream
)
507 Reference
< XInputStream
> xVal
;
508 bool bOK
= ((rProp
.Value
>>= xVal
) && xVal
.is());
509 DBG_ASSERT( bOK
, "invalid type for Stream" );
511 rSet
.Put( SfxUnoAnyItem( SID_STREAM
, rProp
.Value
) );
513 else if ( aName
== sUCBContent
)
515 Reference
< XContent
> xVal
;
516 bool bOK
= ((rProp
.Value
>>= xVal
) && xVal
.is());
517 DBG_ASSERT( bOK
, "invalid type for UCBContent" );
519 rSet
.Put( SfxUnoAnyItem( SID_CONTENT
, rProp
.Value
) );
521 else if ( aName
== sOutputStream
)
523 Reference
< XOutputStream
> xVal
;
524 bool bOK
= ((rProp
.Value
>>= xVal
) && xVal
.is());
525 DBG_ASSERT( bOK
, "invalid type for OutputStream" );
527 rSet
.Put( SfxUnoAnyItem( SID_OUTPUTSTREAM
, rProp
.Value
) );
529 else if ( aName
== sPostData
)
531 Reference
< XInputStream
> xVal
;
532 bool bOK
= (rProp
.Value
>>= xVal
);
533 DBG_ASSERT( bOK
, "invalid type for PostData" );
535 rSet
.Put( SfxUnoAnyItem( SID_POSTDATA
, rProp
.Value
) );
537 else if ( aName
== sFrame
)
539 Reference
< XFrame
> xFrame
;
540 bool bOK
= (rProp
.Value
>>= xFrame
);
541 DBG_ASSERT( bOK
, "invalid type for Frame" );
543 rSet
.Put( SfxUnoFrameItem( SID_FILLFRAME
, xFrame
) );
545 else if ( aName
== sAsTemplate
)
548 bool bOK
= (rProp
.Value
>>= bVal
);
549 DBG_ASSERT( bOK
, "invalid type for AsTemplate" );
551 rSet
.Put( SfxBoolItem( SID_TEMPLATE
, bVal
) );
553 else if ( aName
== sOpenNewView
)
556 bool bOK
= (rProp
.Value
>>= bVal
);
557 DBG_ASSERT( bOK
, "invalid type for OpenNewView" );
559 rSet
.Put( SfxBoolItem( SID_OPEN_NEW_VIEW
, bVal
) );
561 else if ( aName
== sFailOnWarning
)
564 bool bOK
= (rProp
.Value
>>= bVal
);
565 DBG_ASSERT( bOK
, "invalid type for FailOnWarning" );
567 rSet
.Put( SfxBoolItem( SID_FAIL_ON_WARNING
, bVal
) );
569 else if ( aName
== sViewId
)
572 bool bOK
= ((rProp
.Value
>>= nVal
) && (nVal
!= -1));
573 DBG_ASSERT( bOK
, "invalid type for ViewId" );
575 rSet
.Put( SfxUInt16Item( SID_VIEW_ID
, nVal
) );
577 else if ( aName
== sPluginMode
)
580 bool bOK
= ((rProp
.Value
>>= nVal
) && (nVal
!= -1));
581 DBG_ASSERT( bOK
, "invalid type for PluginMode" );
583 rSet
.Put( SfxUInt16Item( SID_PLUGIN_MODE
, nVal
) );
585 else if ( aName
== sReadOnly
)
588 bool bOK
= (rProp
.Value
>>= bVal
);
589 DBG_ASSERT( bOK
, "invalid type for ReadOnly" );
591 rSet
.Put( SfxBoolItem( SID_DOC_READONLY
, bVal
) );
593 else if ( aName
== sDdeReconnect
)
596 bool bOK
= (rProp
.Value
>>= bVal
);
597 DBG_ASSERT( bOK
, "invalid type for DDEReconnect" );
599 rSet
.Put( SfxBoolItem( SID_DDE_RECONNECT_ONLOAD
, bVal
) );
601 else if ( aName
== sStartPresentation
)
604 bool bOK
= (rProp
.Value
>>= bVal
);
605 DBG_ASSERT( bOK
, "invalid type for StartPresentation" );
607 rSet
.Put( SfxBoolItem( SID_DOC_STARTPRESENTATION
, bVal
) );
609 else if ( aName
== sSelectionOnly
)
612 bool bOK
= (rProp
.Value
>>= bVal
);
613 DBG_ASSERT( bOK
, "invalid type for SelectionOnly" );
615 rSet
.Put( SfxBoolItem( SID_SELECTION
, bVal
) );
617 else if ( aName
== sHidden
)
620 bool bOK
= (rProp
.Value
>>= bVal
);
621 DBG_ASSERT( bOK
, "invalid type for Hidden" );
623 rSet
.Put( SfxBoolItem( SID_HIDDEN
, bVal
) );
625 else if ( aName
== sMinimized
)
628 bool bOK
= (rProp
.Value
>>= bVal
);
629 DBG_ASSERT( bOK
, "invalid type for Minimized" );
631 rSet
.Put( SfxBoolItem( SID_MINIMIZED
, bVal
) );
633 else if ( aName
== sSilent
)
636 bool bOK
= (rProp
.Value
>>= bVal
);
637 DBG_ASSERT( bOK
, "invalid type for Silent" );
639 rSet
.Put( SfxBoolItem( SID_SILENT
, bVal
) );
641 else if ( aName
== sPreview
)
644 bool bOK
= (rProp
.Value
>>= bVal
);
645 DBG_ASSERT( bOK
, "invalid type for Preview" );
647 rSet
.Put( SfxBoolItem( SID_PREVIEW
, bVal
) );
649 else if ( aName
== sViewOnly
)
652 bool bOK
= (rProp
.Value
>>= bVal
);
653 DBG_ASSERT( bOK
, "invalid type for ViewOnly" );
655 rSet
.Put( SfxBoolItem( SID_VIEWONLY
, bVal
) );
657 else if ( aName
== sDontEdit
)
660 bool bOK
= (rProp
.Value
>>= bVal
);
661 DBG_ASSERT( bOK
, "invalid type for ViewOnly" );
663 rSet
.Put( SfxBoolItem( SID_EDITDOC
, !bVal
) );
665 else if ( aName
== sUseSystemDialog
)
668 bool bOK
= (rProp
.Value
>>= bVal
);
669 DBG_ASSERT( bOK
, "invalid type for ViewOnly" );
671 rSet
.Put( SfxBoolItem( SID_FILE_DIALOG
, bVal
) );
673 else if ( aName
== sStandardDir
)
676 bool bOK
= ((rProp
.Value
>>= sVal
) && !sVal
.isEmpty());
677 DBG_ASSERT( bOK
, "invalid type or value for StandardDir" );
679 rSet
.Put( SfxStringItem( SID_STANDARD_DIR
, sVal
) );
681 else if ( aName
== sBlackList
)
683 uno::Sequence
<OUString
> xVal
;
684 bool bOK
= (rProp
.Value
>>= xVal
);
685 DBG_ASSERT( bOK
, "invalid type or value for BlackList" );
688 SfxStringListItem
stringList(SID_BLACK_LIST
);
689 stringList
.SetStringList( xVal
);
690 rSet
.Put( stringList
);
693 else if ( aName
== sFileName
)
696 bool bOK
= ((rProp
.Value
>>= sVal
) && !sVal
.isEmpty());
697 DBG_ASSERT( bOK
, "invalid type or value for FileName" );
699 rSet
.Put( SfxStringItem( SID_FILE_NAME
, sVal
) );
701 else if ( aName
== sSalvagedFile
)
704 bool bOK
= (rProp
.Value
>>= sVal
);
705 DBG_ASSERT( bOK
, "invalid type or value for SalvagedFile" );
707 rSet
.Put( SfxStringItem( SID_DOC_SALVAGE
, sVal
) );
709 else if ( aName
== sFolderName
)
712 bool bOK
= (rProp
.Value
>>= sVal
);
713 DBG_ASSERT( bOK
, "invalid type or value for FolderName" );
715 rSet
.Put( SfxStringItem( SID_PATH
, sVal
) );
717 else if ( aName
== sFrameName
)
720 bool bOK
= (rProp
.Value
>>= sVal
);
721 DBG_ASSERT( bOK
, "invalid type for FrameName" );
722 if (bOK
&& !sVal
.isEmpty())
723 rSet
.Put( SfxStringItem( SID_TARGETNAME
, sVal
) );
725 else if ( aName
== sMediaType
)
728 bool bOK
= ((rProp
.Value
>>= sVal
) && !sVal
.isEmpty());
729 DBG_ASSERT( bOK
, "invalid type or value for MediaType" );
731 rSet
.Put( SfxStringItem( SID_CONTENTTYPE
, sVal
) );
733 else if ( aName
== sTemplateName
)
736 bool bOK
= ((rProp
.Value
>>= sVal
) && !sVal
.isEmpty());
737 DBG_ASSERT( bOK
, "invalid type or value for TemplateName" );
739 rSet
.Put( SfxStringItem( SID_TEMPLATE_NAME
, sVal
) );
741 else if ( aName
== sTemplateRegionName
)
744 bool bOK
= ((rProp
.Value
>>= sVal
) && !sVal
.isEmpty());
745 DBG_ASSERT( bOK
, "invalid type or value for TemplateRegionName" );
747 rSet
.Put( SfxStringItem( SID_TEMPLATE_REGIONNAME
, sVal
) );
749 else if ( aName
== sJumpMark
)
752 bool bOK
= ((rProp
.Value
>>= sVal
) && !sVal
.isEmpty());
753 DBG_ASSERT( bOK
, "invalid type or value for JumpMark" );
755 rSet
.Put( SfxStringItem( SID_JUMPMARK
, sVal
) );
757 else if ( aName
== sCharacterSet
)
760 bool bOK
= ((rProp
.Value
>>= sVal
) && !sVal
.isEmpty());
761 DBG_ASSERT( bOK
, "invalid type or value for CharacterSet" );
763 rSet
.Put( SfxStringItem( SID_CHARSET
, sVal
) );
765 else if ( aName
== sFilterFlags
)
768 bool bOK
= ((rProp
.Value
>>= sVal
) && !sVal
.isEmpty());
769 DBG_ASSERT( bOK
, "invalid type or value for FilterFlags" );
771 rSet
.Put( SfxStringItem( SID_FILE_FILTEROPTIONS
, sVal
) );
773 else if ( aName
== sMacroExecMode
)
776 bool bOK
= ((rProp
.Value
>>= nVal
) && (nVal
!= -1));
777 DBG_ASSERT( bOK
, "invalid type for MacroExecMode" );
779 rSet
.Put( SfxUInt16Item( SID_MACROEXECMODE
, nVal
) );
781 else if ( aName
== sUpdateDocMode
)
784 bool bOK
= ((rProp
.Value
>>= nVal
) && (nVal
!= -1));
785 DBG_ASSERT( bOK
, "invalid type for UpdateDocMode" );
787 rSet
.Put( SfxUInt16Item( SID_UPDATEDOCMODE
, nVal
) );
789 else if ( aName
== sRepairPackage
)
792 bool bOK
= (rProp
.Value
>>= bVal
);
793 DBG_ASSERT( bOK
, "invalid type for RepairPackage" );
795 rSet
.Put( SfxBoolItem( SID_REPAIRPACKAGE
, bVal
) );
797 else if ( aName
== sDocumentTitle
)
800 bool bOK
= ((rProp
.Value
>>= sVal
) && !sVal
.isEmpty());
801 DBG_ASSERT( bOK
, "invalid type or value for DocumentTitle" );
803 rSet
.Put( SfxStringItem( SID_DOCINFO_TITLE
, sVal
) );
805 else if ( aName
== sDocumentBaseURL
)
808 // the base url can be set to empty ( for embedded objects for example )
809 bool bOK
= (rProp
.Value
>>= sVal
);
810 DBG_ASSERT( bOK
, "invalid type or value for DocumentBaseURL" );
812 rSet
.Put( SfxStringItem( SID_DOC_BASEURL
, sVal
) );
814 else if ( aName
== sHierarchicalDocumentName
)
817 bool bOK
= ((rProp
.Value
>>= sVal
) && !sVal
.isEmpty());
818 DBG_ASSERT( bOK
, "invalid type or value for HierarchicalDocumentName" );
820 rSet
.Put( SfxStringItem( SID_DOC_HIERARCHICALNAME
, sVal
) );
822 else if ( aName
== sCopyStreamIfPossible
)
825 bool bOK
= (rProp
.Value
>>= bVal
);
826 DBG_ASSERT( bOK
, "invalid type for CopyStreamIfPossible" );
828 rSet
.Put( SfxBoolItem( SID_COPY_STREAM_IF_POSSIBLE
, bVal
) );
830 else if ( aName
== sNoAutoSave
)
833 bool bOK
= (rProp
.Value
>>= bVal
);
834 DBG_ASSERT( bOK
, "invalid type for NoAutoSave" );
836 rSet
.Put( SfxBoolItem( SID_NOAUTOSAVE
, bVal
) );
838 else if ( aName
== sModifyPasswordInfo
)
840 rSet
.Put( SfxUnoAnyItem( SID_MODIFYPASSWORDINFO
, rProp
.Value
) );
842 else if ( aName
== sEncryptionData
)
844 rSet
.Put( SfxUnoAnyItem( SID_ENCRYPTIONDATA
, rProp
.Value
) );
846 else if ( aName
== sSuggestedSaveAsDir
)
849 bool bOK
= ((rProp
.Value
>>= sVal
) && !sVal
.isEmpty());
850 DBG_ASSERT( bOK
, "invalid type or value for SuggestedSaveAsDir" );
852 rSet
.Put( SfxStringItem( SID_SUGGESTEDSAVEASDIR
, sVal
) );
854 else if ( aName
== sSuggestedSaveAsName
)
857 bool bOK
= ((rProp
.Value
>>= sVal
) && !sVal
.isEmpty());
858 DBG_ASSERT( bOK
, "invalid type or value for SuggestedSaveAsName" );
860 rSet
.Put( SfxStringItem( SID_SUGGESTEDSAVEASNAME
, sVal
) );
862 else if (aName
== sDocumentService
)
865 bool bOK
= ((rProp
.Value
>>= aVal
) && !aVal
.isEmpty());
867 rSet
.Put(SfxStringItem(SID_DOC_SERVICE
, aVal
));
869 else if (aName
== sFilterProvider
)
872 bool bOK
= ((rProp
.Value
>>= aVal
) && !aVal
.isEmpty());
874 rSet
.Put(SfxStringItem(SID_FILTER_PROVIDER
, aVal
));
882 // API to raise options dialog with a specified options ab page (#i83757#)
885 // transform parameter "OptionsPageURL" of slot "OptionsTreeDialog"
886 OUString
sSlotName( "OptionsTreeDialog" );
887 OUString
sPropName( "OptionsPageURL" );
888 if ( sSlotName
== OUString( pSlot
->pUnoName
, strlen(pSlot
->pUnoName
), RTL_TEXTENCODING_UTF8
) )
890 for ( sal_uInt16 n
= 0; n
< nCount
; ++n
)
892 const PropertyValue
& rProp
= pPropsVal
[n
];
893 OUString
sName( rProp
.Name
);
894 if ( sName
== sPropName
)
897 if ( rProp
.Value
>>= sURL
)
898 rSet
.Put( SfxStringItem( SID_OPTIONS_PAGEURL
, sURL
) );
905 if ( nFoundArgs
== nCount
)
907 // except for the "special" slots: assure that every argument was convertible
908 OStringBuffer
aStr("MacroPlayer: Some properties didn't match to any formal argument for slot: ");
909 aStr
.append(pSlot
->pUnoName
);
910 DBG_WARNING( aStr
.getStr() );
915 void TransformItems( sal_uInt16 nSlotId
, const SfxItemSet
& rSet
, uno::Sequence
<beans::PropertyValue
>& rArgs
, const SfxSlot
* pSlot
)
918 pSlot
= SFX_SLOTPOOL().GetSlot( nSlotId
);
923 if ( nSlotId
== SID_OPENURL
)
924 nSlotId
= SID_OPENDOC
;
925 if ( nSlotId
== SID_SAVEASURL
)
926 nSlotId
= SID_SAVEASDOC
;
928 // find number of properties to avoid permanent reallocations in the sequence
932 // trace number of items and compare with number of properties for debugging purposes
936 const SfxType
*pType
= pSlot
->GetType();
937 if ( !pSlot
->IsMode(SfxSlotMode::METHOD
) )
939 // slot is a property
940 sal_uInt16 nWhich
= rSet
.GetPool()->GetWhich(nSlotId
);
941 if ( rSet
.GetItemState( nWhich
) == SfxItemState::SET
) //???
943 sal_uInt16 nSubCount
= pType
->nAttribs
;
945 // it's a complex property, we want it split into simple types
946 // so we expect to get as many items as we have (sub) members
949 // simple property: we expect to get exactly one item
955 // we will not rely on the "toggle" ability of some property slots
956 OStringBuffer
aStr("Processing property slot without argument: ");
957 aStr
.append(static_cast<sal_Int32
>(nSlotId
));
958 OSL_FAIL(aStr
.getStr());
969 bool bIsMediaDescriptor
= isMediaDescriptor( nSlotId
);
970 sal_uInt16 nFormalArgs
= bIsMediaDescriptor
? nMediaArgsCount
: pSlot
->GetFormalArgumentCount();
971 for ( sal_uInt16 nArg
=0; nArg
<nFormalArgs
; ++nArg
)
973 // check every formal argument of the method
974 const SfxFormalArgument
&rArg
= bIsMediaDescriptor
? aFormalArgs
[nArg
] : pSlot
->GetFormalArgument( nArg
);
976 sal_uInt16 nWhich
= rSet
.GetPool()->GetWhich( rArg
.nSlotId
);
977 if ( rSet
.GetItemState( nWhich
) == SfxItemState::SET
) //???
979 sal_uInt16 nSubCount
= rArg
.pType
->nAttribs
;
981 // argument has a complex type, we want it split into simple types
982 // so for this argument we expect to get as many items as we have (sub) members
985 // argument of simple type: we expect to get exactly one item for it
993 // special treatment for slots that are *not* meant to be recorded as slots (except SaveAs/To)
994 if ( bIsMediaDescriptor
)
996 sal_Int32 nAdditional
=0;
997 if ( rSet
.GetItemState( SID_PROGRESS_STATUSBAR_CONTROL
) == SfxItemState::SET
)
999 if ( rSet
.GetItemState( SID_INTERACTIONHANDLER
) == SfxItemState::SET
)
1001 if ( rSet
.GetItemState( SID_DOC_SALVAGE
) == SfxItemState::SET
)
1003 if ( rSet
.GetItemState( SID_PATH
) == SfxItemState::SET
)
1005 if ( rSet
.GetItemState( SID_FILE_DIALOG
) == SfxItemState::SET
)
1007 if ( rSet
.GetItemState( SID_STANDARD_DIR
) == SfxItemState::SET
)
1009 if ( rSet
.GetItemState( SID_BLACK_LIST
) == SfxItemState::SET
)
1011 if ( rSet
.GetItemState( SID_CONTENT
) == SfxItemState::SET
)
1013 if ( rSet
.GetItemState( SID_INPUTSTREAM
) == SfxItemState::SET
)
1015 if ( rSet
.GetItemState( SID_STREAM
) == SfxItemState::SET
)
1017 if ( rSet
.GetItemState( SID_OUTPUTSTREAM
) == SfxItemState::SET
)
1019 if ( rSet
.GetItemState( SID_TEMPLATE
) == SfxItemState::SET
)
1021 if ( rSet
.GetItemState( SID_OPEN_NEW_VIEW
) == SfxItemState::SET
)
1023 if ( rSet
.GetItemState( SID_FAIL_ON_WARNING
) == SfxItemState::SET
)
1025 if ( rSet
.GetItemState( SID_VIEW_ID
) == SfxItemState::SET
)
1027 if ( rSet
.GetItemState( SID_VIEW_DATA
) == SfxItemState::SET
)
1029 if ( rSet
.GetItemState( SID_FILTER_DATA
) == SfxItemState::SET
)
1031 if ( rSet
.GetItemState( SID_PLUGIN_MODE
) == SfxItemState::SET
)
1033 if ( rSet
.GetItemState( SID_DOC_READONLY
) == SfxItemState::SET
)
1035 if ( rSet
.GetItemState( SID_DDE_RECONNECT_ONLOAD
) == SfxItemState::SET
)
1037 if ( rSet
.GetItemState( SID_DOC_STARTPRESENTATION
) == SfxItemState::SET
)
1039 if ( rSet
.GetItemState( SID_SELECTION
) == SfxItemState::SET
)
1041 if ( rSet
.GetItemState( SID_CONTENTTYPE
) == SfxItemState::SET
)
1043 if ( rSet
.GetItemState( SID_POSTDATA
) == SfxItemState::SET
)
1045 if ( rSet
.GetItemState( SID_FILLFRAME
) == SfxItemState::SET
)
1047 if ( rSet
.GetItemState( SID_CHARSET
) == SfxItemState::SET
)
1049 if ( rSet
.GetItemState( SID_TARGETNAME
) == SfxItemState::SET
)
1051 if ( rSet
.GetItemState( SID_TEMPLATE_NAME
) == SfxItemState::SET
)
1053 if ( rSet
.GetItemState( SID_TEMPLATE_REGIONNAME
) == SfxItemState::SET
)
1055 if ( rSet
.GetItemState( SID_HIDDEN
) == SfxItemState::SET
)
1057 if ( rSet
.GetItemState( SID_MINIMIZED
) == SfxItemState::SET
)
1059 if ( rSet
.GetItemState( SID_PREVIEW
) == SfxItemState::SET
)
1061 if ( rSet
.GetItemState( SID_VIEWONLY
) == SfxItemState::SET
)
1063 if ( rSet
.GetItemState( SID_EDITDOC
) == SfxItemState::SET
)
1065 if ( rSet
.GetItemState( SID_SILENT
) == SfxItemState::SET
)
1067 if ( rSet
.GetItemState( SID_JUMPMARK
) == SfxItemState::SET
)
1069 if ( rSet
.GetItemState( SID_DOCUMENT
) == SfxItemState::SET
)
1071 if ( rSet
.GetItemState( SID_MACROEXECMODE
) == SfxItemState::SET
)
1073 if ( rSet
.GetItemState( SID_UPDATEDOCMODE
) == SfxItemState::SET
)
1075 if ( rSet
.GetItemState( SID_REPAIRPACKAGE
) == SfxItemState::SET
)
1077 if ( rSet
.GetItemState( SID_DOCINFO_TITLE
) == SfxItemState::SET
)
1079 if ( rSet
.GetItemState( SID_COMPONENTDATA
) == SfxItemState::SET
)
1081 if ( rSet
.GetItemState( SID_COMPONENTCONTEXT
) == SfxItemState::SET
)
1083 if ( rSet
.GetItemState( SID_DOC_BASEURL
) == SfxItemState::SET
)
1085 if ( rSet
.GetItemState( SID_DOC_HIERARCHICALNAME
) == SfxItemState::SET
)
1087 if ( rSet
.GetItemState( SID_COPY_STREAM_IF_POSSIBLE
) == SfxItemState::SET
)
1089 if ( rSet
.GetItemState( SID_NOAUTOSAVE
) == SfxItemState::SET
)
1091 if ( rSet
.GetItemState( SID_MODIFYPASSWORDINFO
) == SfxItemState::SET
)
1093 if ( rSet
.GetItemState( SID_SUGGESTEDSAVEASDIR
) == SfxItemState::SET
)
1095 if ( rSet
.GetItemState( SID_ENCRYPTIONDATA
) == SfxItemState::SET
)
1097 if ( rSet
.GetItemState( SID_SUGGESTEDSAVEASNAME
) == SfxItemState::SET
)
1099 if ( rSet
.GetItemState( SID_DOC_SERVICE
) == SfxItemState::SET
)
1101 if (rSet
.HasItem(SID_FILTER_PROVIDER
))
1104 // consider additional arguments
1105 nProps
+= nAdditional
;
1107 nItems
+= nAdditional
;
1113 // now check the itemset: is there any item that is not convertible using the list of formal arguments
1114 // or the table of additional items?!
1115 if ( rSet
.Count() != nItems
)
1117 // detect unknown item and present error message
1118 const sal_uInt16
*pRanges
= rSet
.GetRanges();
1121 for(sal_uInt16 nId
= *pRanges
++; nId
<= *pRanges
; ++nId
)
1123 if ( rSet
.GetItemState(nId
) < SfxItemState::SET
) //???
1127 if ( !pSlot
->IsMode(SfxSlotMode::METHOD
) && nId
== rSet
.GetPool()->GetWhich( pSlot
->GetSlotId() ) )
1130 bool bIsMediaDescriptor
= isMediaDescriptor( nSlotId
);
1131 sal_uInt16 nFormalArgs
= bIsMediaDescriptor
? nMediaArgsCount
: pSlot
->nArgDefCount
;
1133 for ( nArg
=0; nArg
<nFormalArgs
; ++nArg
)
1135 const SfxFormalArgument
&rArg
= bIsMediaDescriptor
? aFormalArgs
[nArg
] : pSlot
->GetFormalArgument( nArg
);
1136 sal_uInt16 nWhich
= rSet
.GetPool()->GetWhich( rArg
.nSlotId
);
1137 if ( nId
== nWhich
)
1141 if ( nArg
<nFormalArgs
)
1144 if ( bIsMediaDescriptor
)
1146 if ( nId
== SID_DOCFRAME
)
1148 if ( nId
== SID_PROGRESS_STATUSBAR_CONTROL
)
1150 if ( nId
== SID_INTERACTIONHANDLER
)
1152 if ( nId
== SID_VIEW_DATA
)
1154 if ( nId
== SID_FILTER_DATA
)
1156 if ( nId
== SID_DOCUMENT
)
1158 if ( nId
== SID_CONTENT
)
1160 if ( nId
== SID_INPUTSTREAM
)
1162 if ( nId
== SID_STREAM
)
1164 if ( nId
== SID_OUTPUTSTREAM
)
1166 if ( nId
== SID_POSTDATA
)
1168 if ( nId
== SID_FILLFRAME
)
1170 if ( nId
== SID_TEMPLATE
)
1172 if ( nId
== SID_OPEN_NEW_VIEW
)
1174 if ( nId
== SID_VIEW_ID
)
1176 if ( nId
== SID_PLUGIN_MODE
)
1178 if ( nId
== SID_DOC_READONLY
)
1180 if ( nId
== SID_DOC_STARTPRESENTATION
)
1182 if ( nId
== SID_SELECTION
)
1184 if ( nId
== SID_HIDDEN
)
1186 if ( nId
== SID_MINIMIZED
)
1188 if ( nId
== SID_SILENT
)
1190 if ( nId
== SID_PREVIEW
)
1192 if ( nId
== SID_VIEWONLY
)
1194 if ( nId
== SID_EDITDOC
)
1196 if ( nId
== SID_TARGETNAME
)
1198 if ( nId
== SID_DOC_SALVAGE
)
1200 if ( nId
== SID_PATH
)
1202 if ( nId
== SID_FILE_DIALOG
)
1204 if ( nId
== SID_STANDARD_DIR
)
1206 if ( nId
== SID_BLACK_LIST
)
1208 if ( nId
== SID_CONTENTTYPE
)
1210 if ( nId
== SID_TEMPLATE_NAME
)
1212 if ( nId
== SID_TEMPLATE_REGIONNAME
)
1214 if ( nId
== SID_JUMPMARK
)
1216 if ( nId
== SID_CHARSET
)
1218 if ( nId
== SID_MACROEXECMODE
)
1220 if ( nId
== SID_UPDATEDOCMODE
)
1222 if ( nId
== SID_REPAIRPACKAGE
)
1224 if ( nId
== SID_DOCINFO_TITLE
)
1226 if ( nId
== SID_COMPONENTDATA
)
1228 if ( nId
== SID_COMPONENTCONTEXT
)
1230 if ( nId
== SID_DOC_BASEURL
)
1232 if ( nId
== SID_DOC_HIERARCHICALNAME
)
1234 if ( nId
== SID_COPY_STREAM_IF_POSSIBLE
)
1236 if ( nId
== SID_NOAUTOSAVE
)
1238 if ( nId
== SID_ENCRYPTIONDATA
)
1240 if ( nId
== SID_DOC_SERVICE
)
1242 if (nId
== SID_FILTER_PROVIDER
)
1245 // used only internally
1246 if ( nId
== SID_SAVETO
)
1248 if ( nId
== SID_SAVEACOPYITEM
)
1250 if ( nId
== SID_MODIFYPASSWORDINFO
)
1252 if ( nId
== SID_SUGGESTEDSAVEASDIR
)
1254 if ( nId
== SID_SUGGESTEDSAVEASNAME
)
1258 OStringBuffer
aDbg("Unknown item detected: ");
1259 aDbg
.append(static_cast<sal_Int32
>(nId
));
1260 DBG_ASSERT(nArg
<nFormalArgs
, aDbg
.getStr());
1269 // convert every item into a property
1270 uno::Sequence
<beans::PropertyValue
> aSequ(nProps
);
1271 beans::PropertyValue
*pValue
= aSequ
.getArray();
1273 sal_Int32 nActProp
=0;
1274 if ( !pSlot
->IsMode(SfxSlotMode::METHOD
) )
1276 // slot is a property
1277 sal_uInt16 nWhich
= rSet
.GetPool()->GetWhich(nSlotId
);
1278 bool bConvertTwips
= ( rSet
.GetPool()->GetMetric( nWhich
) == SFX_MAPUNIT_TWIP
);
1279 SFX_ITEMSET_ARG( &rSet
, pItem
, SfxPoolItem
, nWhich
, false );
1282 sal_uInt16 nSubCount
= pType
->nAttribs
;
1285 pValue
[nActProp
].Name
= OUString::createFromAscii(pSlot
->pUnoName
) ;
1286 if ( !pItem
->QueryValue( pValue
[nActProp
].Value
) )
1288 OStringBuffer
aStr("Item not convertible: ");
1289 aStr
.append(static_cast<sal_Int32
>(nSlotId
));
1290 OSL_FAIL(aStr
.getStr());
1295 // complex type, add a property value for every member of the struct
1296 for ( sal_uInt16 n
=1; n
<=nSubCount
; ++n
)
1298 sal_uInt8 nSubId
= (sal_uInt8
) (sal_Int8
) pType
->aAttrib
[n
-1].nAID
;
1299 if ( bConvertTwips
)
1300 nSubId
|= CONVERT_TWIPS
;
1302 DBG_ASSERT(( pType
->aAttrib
[n
-1].nAID
) <= 127, "Member ID out of range" );
1303 OUString
aName( OUString::createFromAscii( pSlot
->pUnoName
) ) ;
1305 aName
+= OUString::createFromAscii( pType
->aAttrib
[n
-1].pName
) ;
1306 pValue
[nActProp
].Name
= aName
;
1307 if ( !pItem
->QueryValue( pValue
[nActProp
++].Value
, nSubId
) )
1309 OStringBuffer
aStr("Sub item ");
1310 aStr
.append(static_cast<sal_Int32
>(
1311 pType
->aAttrib
[n
-1].nAID
));
1312 aStr
.append(" not convertible in slot: ");
1313 aStr
.append(static_cast<sal_Int32
>(nSlotId
));
1314 OSL_FAIL( aStr
.getStr() );
1325 sal_uInt16 nFormalArgs
= pSlot
->GetFormalArgumentCount();
1326 for ( sal_uInt16 nArg
=0; nArg
<nFormalArgs
; ++nArg
)
1328 const SfxFormalArgument
&rArg
= pSlot
->GetFormalArgument( nArg
);
1329 sal_uInt16 nWhich
= rSet
.GetPool()->GetWhich( rArg
.nSlotId
);
1330 bool bConvertTwips
= ( rSet
.GetPool()->GetMetric( nWhich
) == SFX_MAPUNIT_TWIP
);
1331 SFX_ITEMSET_ARG( &rSet
, pItem
, SfxPoolItem
, nWhich
, false );
1334 sal_uInt16 nSubCount
= rArg
.pType
->nAttribs
;
1337 pValue
[nActProp
].Name
= OUString::createFromAscii( rArg
.pName
) ;
1338 if ( !pItem
->QueryValue( pValue
[nActProp
++].Value
) )
1340 OStringBuffer
aStr("Item not convertible: ");
1341 aStr
.append(static_cast<sal_Int32
>(rArg
.nSlotId
));
1342 OSL_FAIL(aStr
.getStr());
1347 // complex type, add a property value for every member of the struct
1348 for ( sal_uInt16 n
= 1; n
<= nSubCount
; ++n
)
1350 sal_uInt8 nSubId
= (sal_uInt8
) (sal_Int8
) rArg
.pType
->aAttrib
[n
-1].nAID
;
1351 if ( bConvertTwips
)
1352 nSubId
|= CONVERT_TWIPS
;
1354 DBG_ASSERT((rArg
.pType
->aAttrib
[n
-1].nAID
) <= 127, "Member ID out of range" );
1355 OUString
aName( OUString::createFromAscii( rArg
.pName
) ) ;
1357 aName
+= OUString::createFromAscii( rArg
.pType
->aAttrib
[n
-1].pName
) ;
1358 pValue
[nActProp
].Name
= aName
;
1359 if ( !pItem
->QueryValue( pValue
[nActProp
++].Value
, nSubId
) )
1361 OStringBuffer
aStr("Sub item ");
1362 aStr
.append(static_cast<sal_Int32
>(
1363 rArg
.pType
->aAttrib
[n
-1].nAID
));
1364 aStr
.append(" not convertible in slot: ");
1365 aStr
.append(static_cast<sal_Int32
>(rArg
.nSlotId
));
1366 OSL_FAIL(aStr
.getStr());
1373 if ( nSlotId
== SID_OPENDOC
|| nSlotId
== SID_EXPORTDOC
|| nSlotId
== SID_SAVEASDOC
|| nSlotId
== SID_SAVEDOC
||
1374 nSlotId
== SID_SAVETO
|| nSlotId
== SID_EXPORTDOCASPDF
|| nSlotId
== SID_DIRECTEXPORTDOCASPDF
||
1375 nSlotId
== SID_SAVEACOPY
)
1377 const SfxPoolItem
*pItem
=0;
1378 if ( rSet
.GetItemState( SID_COMPONENTDATA
, false, &pItem
) == SfxItemState::SET
)
1380 pValue
[nActProp
].Name
= sComponentData
;
1381 pValue
[nActProp
++].Value
= static_cast<const SfxUnoAnyItem
*>(pItem
)->GetValue();
1383 if ( rSet
.GetItemState( SID_COMPONENTCONTEXT
, false, &pItem
) == SfxItemState::SET
)
1385 pValue
[nActProp
].Name
= sComponentContext
;
1386 pValue
[nActProp
++].Value
= static_cast<const SfxUnoAnyItem
*>(pItem
)->GetValue();
1388 if ( rSet
.GetItemState( SID_PROGRESS_STATUSBAR_CONTROL
, false, &pItem
) == SfxItemState::SET
)
1390 pValue
[nActProp
].Name
= sStatusInd
;
1391 pValue
[nActProp
++].Value
= static_cast<const SfxUnoAnyItem
*>(pItem
)->GetValue();
1393 if ( rSet
.GetItemState( SID_INTERACTIONHANDLER
, false, &pItem
) == SfxItemState::SET
)
1395 pValue
[nActProp
].Name
= sInteractionHdl
;
1396 pValue
[nActProp
++].Value
= static_cast<const SfxUnoAnyItem
*>(pItem
)->GetValue();
1398 if ( rSet
.GetItemState( SID_VIEW_DATA
, false, &pItem
) == SfxItemState::SET
)
1400 pValue
[nActProp
].Name
= sViewData
;
1401 pValue
[nActProp
++].Value
= static_cast<const SfxUnoAnyItem
*>(pItem
)->GetValue();
1403 if ( rSet
.GetItemState( SID_FILTER_DATA
, false, &pItem
) == SfxItemState::SET
)
1405 pValue
[nActProp
].Name
= sFilterData
;
1406 pValue
[nActProp
++].Value
= static_cast<const SfxUnoAnyItem
*>(pItem
)->GetValue();
1408 if ( rSet
.GetItemState( SID_DOCUMENT
, false, &pItem
) == SfxItemState::SET
)
1410 pValue
[nActProp
].Name
= sModel
;
1411 pValue
[nActProp
++].Value
= static_cast<const SfxUnoAnyItem
*>(pItem
)->GetValue();
1413 if ( rSet
.GetItemState( SID_CONTENT
, false, &pItem
) == SfxItemState::SET
)
1415 pValue
[nActProp
].Name
= sUCBContent
;
1416 pValue
[nActProp
++].Value
= static_cast<const SfxUnoAnyItem
*>(pItem
)->GetValue();
1418 if ( rSet
.GetItemState( SID_INPUTSTREAM
, false, &pItem
) == SfxItemState::SET
)
1420 pValue
[nActProp
].Name
= sInputStream
;
1421 pValue
[nActProp
++].Value
= static_cast<const SfxUnoAnyItem
*>(pItem
)->GetValue();
1423 if ( rSet
.GetItemState( SID_STREAM
, false, &pItem
) == SfxItemState::SET
)
1425 pValue
[nActProp
].Name
= sStream
;
1426 pValue
[nActProp
++].Value
= static_cast<const SfxUnoAnyItem
*>(pItem
)->GetValue();
1428 if ( rSet
.GetItemState( SID_OUTPUTSTREAM
, false, &pItem
) == SfxItemState::SET
)
1430 pValue
[nActProp
].Name
= sOutputStream
;
1431 pValue
[nActProp
++].Value
= static_cast<const SfxUnoAnyItem
*>(pItem
)->GetValue();
1433 if ( rSet
.GetItemState( SID_POSTDATA
, false, &pItem
) == SfxItemState::SET
)
1435 pValue
[nActProp
].Name
= sPostData
;
1436 pValue
[nActProp
++].Value
= static_cast<const SfxUnoAnyItem
*>(pItem
)->GetValue();
1438 if ( rSet
.GetItemState( SID_FILLFRAME
, false, &pItem
) == SfxItemState::SET
)
1440 pValue
[nActProp
].Name
= sFrame
;
1441 if ( pItem
->ISA( SfxUsrAnyItem
) )
1443 OSL_FAIL( "TransformItems: transporting an XFrame via an SfxUsrAnyItem is not deprecated!" );
1444 pValue
[nActProp
++].Value
= static_cast< const SfxUsrAnyItem
* >( pItem
)->GetValue();
1446 else if ( pItem
->ISA( SfxUnoFrameItem
) )
1447 pValue
[nActProp
++].Value
<<= static_cast< const SfxUnoFrameItem
* >( pItem
)->GetFrame();
1449 OSL_FAIL( "TransformItems: invalid item type for SID_FILLFRAME!" );
1451 if ( rSet
.GetItemState( SID_TEMPLATE
, false, &pItem
) == SfxItemState::SET
)
1453 pValue
[nActProp
].Name
= sAsTemplate
;
1454 pValue
[nActProp
++].Value
<<= static_cast<const SfxBoolItem
*>(pItem
)->GetValue();
1456 if ( rSet
.GetItemState( SID_OPEN_NEW_VIEW
, false, &pItem
) == SfxItemState::SET
)
1458 pValue
[nActProp
].Name
= sOpenNewView
;
1459 pValue
[nActProp
++].Value
<<= static_cast<const SfxBoolItem
*>(pItem
)->GetValue();
1461 if ( rSet
.GetItemState( SID_FAIL_ON_WARNING
, false, &pItem
) == SfxItemState::SET
)
1463 pValue
[nActProp
].Name
= sFailOnWarning
;
1464 pValue
[nActProp
++].Value
<<= static_cast<const SfxBoolItem
*>(pItem
)->GetValue();
1466 if ( rSet
.GetItemState( SID_VIEW_ID
, false, &pItem
) == SfxItemState::SET
)
1468 pValue
[nActProp
].Name
= sViewId
;
1469 pValue
[nActProp
++].Value
<<= (sal_Int16
) static_cast<const SfxUInt16Item
*>(pItem
)->GetValue();
1471 if ( rSet
.GetItemState( SID_PLUGIN_MODE
, false, &pItem
) == SfxItemState::SET
)
1473 pValue
[nActProp
].Name
= sPluginMode
;
1474 pValue
[nActProp
++].Value
<<= (sal_Int16
) static_cast<const SfxUInt16Item
*>(pItem
)->GetValue();
1476 if ( rSet
.GetItemState( SID_DOC_READONLY
, false, &pItem
) == SfxItemState::SET
)
1478 pValue
[nActProp
].Name
= sReadOnly
;
1479 pValue
[nActProp
++].Value
<<= static_cast<const SfxBoolItem
*>(pItem
)->GetValue();
1481 if ( rSet
.GetItemState( SID_DDE_RECONNECT_ONLOAD
, false, &pItem
) == SfxItemState::SET
)
1483 pValue
[nActProp
].Name
= sDdeReconnect
;
1484 pValue
[nActProp
++].Value
<<= static_cast<const SfxBoolItem
*>(pItem
)->GetValue();
1486 if ( rSet
.GetItemState( SID_DOC_STARTPRESENTATION
, false, &pItem
) == SfxItemState::SET
)
1488 pValue
[nActProp
].Name
= sStartPresentation
;
1489 pValue
[nActProp
++].Value
<<= static_cast<const SfxBoolItem
*>(pItem
)->GetValue();
1491 if ( rSet
.GetItemState( SID_SELECTION
, false, &pItem
) == SfxItemState::SET
)
1493 pValue
[nActProp
].Name
= sSelectionOnly
;
1494 pValue
[nActProp
++].Value
<<= static_cast<const SfxBoolItem
*>(pItem
)->GetValue();
1496 if ( rSet
.GetItemState( SID_HIDDEN
, false, &pItem
) == SfxItemState::SET
)
1498 pValue
[nActProp
].Name
= sHidden
;
1499 pValue
[nActProp
++].Value
<<= static_cast<const SfxBoolItem
*>(pItem
)->GetValue();
1501 if ( rSet
.GetItemState( SID_MINIMIZED
, false, &pItem
) == SfxItemState::SET
)
1503 pValue
[nActProp
].Name
= sMinimized
;
1504 pValue
[nActProp
++].Value
<<= static_cast<const SfxBoolItem
*>(pItem
)->GetValue();
1506 if ( rSet
.GetItemState( SID_SILENT
, false, &pItem
) == SfxItemState::SET
)
1508 pValue
[nActProp
].Name
= sSilent
;
1509 pValue
[nActProp
++].Value
<<= static_cast<const SfxBoolItem
*>(pItem
)->GetValue();
1511 if ( rSet
.GetItemState( SID_PREVIEW
, false, &pItem
) == SfxItemState::SET
)
1513 pValue
[nActProp
].Name
= sPreview
;
1514 pValue
[nActProp
++].Value
<<= static_cast<const SfxBoolItem
*>(pItem
)->GetValue();
1516 if ( rSet
.GetItemState( SID_VIEWONLY
, false, &pItem
) == SfxItemState::SET
)
1518 pValue
[nActProp
].Name
= sViewOnly
;
1519 pValue
[nActProp
++].Value
<<= static_cast<const SfxBoolItem
*>(pItem
)->GetValue();
1521 if ( rSet
.GetItemState( SID_EDITDOC
, false, &pItem
) == SfxItemState::SET
)
1523 pValue
[nActProp
].Name
= sDontEdit
;
1524 pValue
[nActProp
++].Value
<<= !static_cast<const SfxBoolItem
*>(pItem
)->GetValue();
1526 if ( rSet
.GetItemState( SID_FILE_DIALOG
, false, &pItem
) == SfxItemState::SET
)
1528 pValue
[nActProp
].Name
= sUseSystemDialog
;
1529 pValue
[nActProp
++].Value
<<= static_cast<const SfxBoolItem
*>(pItem
)->GetValue();
1531 if ( rSet
.GetItemState( SID_STANDARD_DIR
, false, &pItem
) == SfxItemState::SET
)
1533 pValue
[nActProp
].Name
= sStandardDir
;
1534 pValue
[nActProp
++].Value
<<= OUString( static_cast<const SfxStringItem
*>(pItem
)->GetValue());
1536 if ( rSet
.GetItemState( SID_BLACK_LIST
, false, &pItem
) == SfxItemState::SET
)
1538 pValue
[nActProp
].Name
= sBlackList
;
1540 com::sun::star::uno::Sequence
< OUString
> aList
;
1541 static_cast<const SfxStringListItem
*>(pItem
)->GetStringList( aList
);
1542 pValue
[nActProp
++].Value
<<= aList
;
1544 if ( rSet
.GetItemState( SID_TARGETNAME
, false, &pItem
) == SfxItemState::SET
)
1546 pValue
[nActProp
].Name
= sFrameName
;
1547 pValue
[nActProp
++].Value
<<= OUString( static_cast<const SfxStringItem
*>(pItem
)->GetValue() );
1549 if ( rSet
.GetItemState( SID_DOC_SALVAGE
, false, &pItem
) == SfxItemState::SET
)
1551 pValue
[nActProp
].Name
= sSalvagedFile
;
1552 pValue
[nActProp
++].Value
<<= static_cast<const SfxStringItem
*>(pItem
)->GetValue();
1554 if ( rSet
.GetItemState( SID_PATH
, false, &pItem
) == SfxItemState::SET
)
1556 pValue
[nActProp
].Name
= sFolderName
;
1557 pValue
[nActProp
++].Value
<<= static_cast<const SfxStringItem
*>(pItem
)->GetValue();
1559 if ( rSet
.GetItemState( SID_CONTENTTYPE
, false, &pItem
) == SfxItemState::SET
)
1561 pValue
[nActProp
].Name
= sMediaType
;
1562 pValue
[nActProp
++].Value
<<= static_cast<const SfxStringItem
*>(pItem
)->GetValue();
1564 if ( rSet
.GetItemState( SID_TEMPLATE_NAME
, false, &pItem
) == SfxItemState::SET
)
1566 pValue
[nActProp
].Name
= sTemplateName
;
1567 pValue
[nActProp
++].Value
<<= static_cast<const SfxStringItem
*>(pItem
)->GetValue();
1569 if ( rSet
.GetItemState( SID_TEMPLATE_REGIONNAME
, false, &pItem
) == SfxItemState::SET
)
1571 pValue
[nActProp
].Name
= sTemplateRegionName
;
1572 pValue
[nActProp
++].Value
<<= static_cast<const SfxStringItem
*>(pItem
)->GetValue();
1574 if ( rSet
.GetItemState( SID_JUMPMARK
, false, &pItem
) == SfxItemState::SET
)
1576 pValue
[nActProp
].Name
= sJumpMark
;
1577 pValue
[nActProp
++].Value
<<= static_cast<const SfxStringItem
*>(pItem
)->GetValue();
1580 if ( rSet
.GetItemState( SID_CHARSET
, false, &pItem
) == SfxItemState::SET
)
1582 pValue
[nActProp
].Name
= sCharacterSet
;
1583 pValue
[nActProp
++].Value
<<= static_cast<const SfxStringItem
*>(pItem
)->GetValue();
1585 if ( rSet
.GetItemState( SID_MACROEXECMODE
, false, &pItem
) == SfxItemState::SET
)
1587 pValue
[nActProp
].Name
= sMacroExecMode
;
1588 pValue
[nActProp
++].Value
<<= (sal_Int16
) static_cast<const SfxUInt16Item
*>(pItem
)->GetValue();
1590 if ( rSet
.GetItemState( SID_UPDATEDOCMODE
, false, &pItem
) == SfxItemState::SET
)
1592 pValue
[nActProp
].Name
= sUpdateDocMode
;
1593 pValue
[nActProp
++].Value
<<= (sal_Int16
) static_cast<const SfxUInt16Item
*>(pItem
)->GetValue();
1595 if ( rSet
.GetItemState( SID_REPAIRPACKAGE
, false, &pItem
) == SfxItemState::SET
)
1597 pValue
[nActProp
].Name
= sRepairPackage
;
1598 pValue
[nActProp
++].Value
<<= static_cast<const SfxBoolItem
*>(pItem
)->GetValue() ;
1600 if ( rSet
.GetItemState( SID_DOCINFO_TITLE
, false, &pItem
) == SfxItemState::SET
)
1602 pValue
[nActProp
].Name
= sDocumentTitle
;
1603 pValue
[nActProp
++].Value
<<= static_cast<const SfxStringItem
*>(pItem
)->GetValue();
1605 if ( rSet
.GetItemState( SID_DOC_BASEURL
, false, &pItem
) == SfxItemState::SET
)
1607 pValue
[nActProp
].Name
= sDocumentBaseURL
;
1608 pValue
[nActProp
++].Value
<<= static_cast<const SfxStringItem
*>(pItem
)->GetValue();
1610 if ( rSet
.GetItemState( SID_DOC_HIERARCHICALNAME
, false, &pItem
) == SfxItemState::SET
)
1612 pValue
[nActProp
].Name
= sHierarchicalDocumentName
;
1613 pValue
[nActProp
++].Value
<<= static_cast<const SfxStringItem
*>(pItem
)->GetValue();
1615 if ( rSet
.GetItemState( SID_COPY_STREAM_IF_POSSIBLE
, false, &pItem
) == SfxItemState::SET
)
1617 pValue
[nActProp
].Name
= sCopyStreamIfPossible
;
1618 pValue
[nActProp
++].Value
= static_cast<const SfxUnoAnyItem
*>(pItem
)->GetValue();
1620 if ( rSet
.GetItemState( SID_NOAUTOSAVE
, false, &pItem
) == SfxItemState::SET
)
1622 pValue
[nActProp
].Name
= sNoAutoSave
;
1623 pValue
[nActProp
++].Value
<<= static_cast<const SfxBoolItem
*>(pItem
)->GetValue() ;
1625 if ( rSet
.GetItemState( SID_MODIFYPASSWORDINFO
, false, &pItem
) == SfxItemState::SET
)
1627 pValue
[nActProp
].Name
= sModifyPasswordInfo
;
1628 pValue
[nActProp
++].Value
= static_cast<const SfxUnoAnyItem
*>(pItem
)->GetValue();
1630 if ( rSet
.GetItemState( SID_ENCRYPTIONDATA
, false, &pItem
) == SfxItemState::SET
)
1632 pValue
[nActProp
].Name
= sEncryptionData
;
1633 pValue
[nActProp
++].Value
= static_cast<const SfxUnoAnyItem
*>(pItem
)->GetValue();
1635 if ( rSet
.GetItemState( SID_SUGGESTEDSAVEASDIR
, false, &pItem
) == SfxItemState::SET
)
1637 pValue
[nActProp
].Name
= sSuggestedSaveAsDir
;
1638 pValue
[nActProp
++].Value
<<= static_cast<const SfxStringItem
*>(pItem
)->GetValue();
1640 if ( rSet
.GetItemState( SID_SUGGESTEDSAVEASNAME
, false, &pItem
) == SfxItemState::SET
)
1642 pValue
[nActProp
].Name
= sSuggestedSaveAsName
;
1643 pValue
[nActProp
++].Value
<<= static_cast<const SfxStringItem
*>(pItem
)->GetValue();
1645 if ( rSet
.GetItemState( SID_DOC_SERVICE
, false, &pItem
) == SfxItemState::SET
)
1647 pValue
[nActProp
].Name
= sDocumentService
;
1648 pValue
[nActProp
++].Value
<<= static_cast<const SfxStringItem
*>(pItem
)->GetValue();
1650 if (rSet
.HasItem(SID_FILTER_PROVIDER
, &pItem
))
1652 pValue
[nActProp
].Name
= sFilterProvider
;
1653 pValue
[nActProp
++].Value
<<= static_cast<const SfxStringItem
*>(pItem
)->GetValue();
1660 void SAL_CALL
FilterOptionsContinuation::setFilterOptions(
1661 const uno::Sequence
<beans::PropertyValue
>& rProps
)
1662 throw (uno::RuntimeException
, std::exception
)
1664 rProperties
= rProps
;
1667 uno::Sequence
< beans::PropertyValue
> SAL_CALL
1668 FilterOptionsContinuation::getFilterOptions()
1669 throw (uno::RuntimeException
, std::exception
)
1676 RequestFilterOptions::RequestFilterOptions( uno::Reference
< frame::XModel
> rModel
,
1677 const uno::Sequence
< beans::PropertyValue
>& rProperties
)
1680 uno::Reference
< uno::XInterface
> temp2
;
1681 document::FilterOptionsRequest
aOptionsRequest( temp
,
1686 m_aRequest
<<= aOptionsRequest
;
1688 m_pAbort
= new comphelper::OInteractionAbort
;
1689 m_pOptions
= new FilterOptionsContinuation
;
1691 m_lContinuations
.realloc( 2 );
1692 m_lContinuations
[0] = uno::Reference
< task::XInteractionContinuation
>( m_pAbort
);
1693 m_lContinuations
[1] = uno::Reference
< task::XInteractionContinuation
>( m_pOptions
);
1696 uno::Any SAL_CALL
RequestFilterOptions::getRequest()
1697 throw( uno::RuntimeException
, std::exception
)
1702 uno::Sequence
< uno::Reference
< task::XInteractionContinuation
> >
1703 SAL_CALL
RequestFilterOptions::getContinuations()
1704 throw( uno::RuntimeException
, std::exception
)
1706 return m_lContinuations
;
1710 class RequestPackageReparation_Impl
: public ::cppu::WeakImplHelper1
< task::XInteractionRequest
>
1712 uno::Any m_aRequest
;
1713 uno::Sequence
< uno::Reference
< task::XInteractionContinuation
> > m_lContinuations
;
1714 comphelper::OInteractionApprove
* m_pApprove
;
1715 comphelper::OInteractionDisapprove
* m_pDisapprove
;
1718 RequestPackageReparation_Impl( const OUString
& aName
);
1720 virtual uno::Any SAL_CALL
getRequest() throw( uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
1721 virtual uno::Sequence
< uno::Reference
< task::XInteractionContinuation
> > SAL_CALL
getContinuations()
1722 throw( uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
1725 RequestPackageReparation_Impl::RequestPackageReparation_Impl( const OUString
& aName
)
1728 uno::Reference
< uno::XInterface
> temp2
;
1729 document::BrokenPackageRequest
aBrokenPackageRequest( temp
,
1732 m_aRequest
<<= aBrokenPackageRequest
;
1733 m_pApprove
= new comphelper::OInteractionApprove
;
1734 m_pDisapprove
= new comphelper::OInteractionDisapprove
;
1735 m_lContinuations
.realloc( 2 );
1736 m_lContinuations
[0] = uno::Reference
< task::XInteractionContinuation
>( m_pApprove
);
1737 m_lContinuations
[1] = uno::Reference
< task::XInteractionContinuation
>( m_pDisapprove
);
1740 bool RequestPackageReparation_Impl::isApproved()
1742 return m_pApprove
->wasSelected();
1745 uno::Any SAL_CALL
RequestPackageReparation_Impl::getRequest()
1746 throw( uno::RuntimeException
, std::exception
)
1751 uno::Sequence
< uno::Reference
< task::XInteractionContinuation
> >
1752 SAL_CALL
RequestPackageReparation_Impl::getContinuations()
1753 throw( uno::RuntimeException
, std::exception
)
1755 return m_lContinuations
;
1758 RequestPackageReparation::RequestPackageReparation( const OUString
& aName
)
1760 pImp
= new RequestPackageReparation_Impl( aName
);
1764 RequestPackageReparation::~RequestPackageReparation()
1769 bool RequestPackageReparation::isApproved()
1771 return pImp
->isApproved();
1774 com::sun::star::uno::Reference
< task::XInteractionRequest
> RequestPackageReparation::GetRequest()
1776 return com::sun::star::uno::Reference
< task::XInteractionRequest
>(pImp
);
1780 class NotifyBrokenPackage_Impl
: public ::cppu::WeakImplHelper1
< task::XInteractionRequest
>
1782 uno::Any m_aRequest
;
1783 uno::Sequence
< uno::Reference
< task::XInteractionContinuation
> > m_lContinuations
;
1784 comphelper::OInteractionAbort
* m_pAbort
;
1787 NotifyBrokenPackage_Impl( const OUString
& aName
);
1788 virtual uno::Any SAL_CALL
getRequest() throw( uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
1789 virtual uno::Sequence
< uno::Reference
< task::XInteractionContinuation
> > SAL_CALL
getContinuations()
1790 throw( uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
1793 NotifyBrokenPackage_Impl::NotifyBrokenPackage_Impl( const OUString
& aName
)
1796 uno::Reference
< uno::XInterface
> temp2
;
1797 document::BrokenPackageRequest
aBrokenPackageRequest( temp
,
1800 m_aRequest
<<= aBrokenPackageRequest
;
1801 m_pAbort
= new comphelper::OInteractionAbort
;
1802 m_lContinuations
.realloc( 1 );
1803 m_lContinuations
[0] = uno::Reference
< task::XInteractionContinuation
>( m_pAbort
);
1806 uno::Any SAL_CALL
NotifyBrokenPackage_Impl::getRequest()
1807 throw( uno::RuntimeException
, std::exception
)
1812 uno::Sequence
< uno::Reference
< task::XInteractionContinuation
> >
1813 SAL_CALL
NotifyBrokenPackage_Impl::getContinuations()
1814 throw( uno::RuntimeException
, std::exception
)
1816 return m_lContinuations
;
1819 NotifyBrokenPackage::NotifyBrokenPackage( const OUString
& aName
)
1821 pImp
= new NotifyBrokenPackage_Impl( aName
);
1825 NotifyBrokenPackage::~NotifyBrokenPackage()
1830 com::sun::star::uno::Reference
< task::XInteractionRequest
> NotifyBrokenPackage::GetRequest()
1832 return com::sun::star::uno::Reference
< task::XInteractionRequest
>(pImp
);
1835 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */