Bug Summary

File:home/maarten/src/libreoffice/core/include/rtl/ref.hxx
Warning:line 113, column 13
Use of memory after it is freed

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-unknown-linux-gnu -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name ReportController.cxx -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=cplusplus -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -fno-split-dwarf-inlining -debugger-tuning=gdb -resource-dir /usr/lib64/clang/11.0.0 -D BOOST_ERROR_CODE_HEADER_ONLY -D BOOST_SYSTEM_NO_DEPRECATED -D CPPU_ENV=gcc3 -D LINUX -D OSL_DEBUG_LEVEL=1 -D SAL_LOG_INFO -D SAL_LOG_WARN -D UNIX -D UNX -D X86_64 -D _PTHREADS -D _REENTRANT -D EXCEPTIONS_ON -D LIBO_INTERNAL_ONLY -I /home/maarten/src/libreoffice/core/external/boost/include -I /home/maarten/src/libreoffice/core/workdir/UnpackedTarball/boost -I /home/maarten/src/libreoffice/core/include -I /usr/lib/jvm/java-11-openjdk-11.0.9.10-0.0.ea.fc33.x86_64/include -I /usr/lib/jvm/java-11-openjdk-11.0.9.10-0.0.ea.fc33.x86_64/include/linux -I /home/maarten/src/libreoffice/core/config_host -I /home/maarten/src/libreoffice/core/reportdesign/inc -I /home/maarten/src/libreoffice/core/reportdesign/source/inc -I /home/maarten/src/libreoffice/core/reportdesign/source/ui/inc -I /home/maarten/src/libreoffice/core/workdir/UnoApiHeadersTarget/udkapi/normal -I /home/maarten/src/libreoffice/core/workdir/UnoApiHeadersTarget/offapi/normal -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/10/../../../../include/c++/10 -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/10/../../../../include/c++/10/x86_64-redhat-linux -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/10/../../../../include/c++/10/backward -internal-isystem /usr/local/include -internal-isystem /usr/lib64/clang/11.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O0 -Wno-missing-braces -std=c++17 -fdeprecated-macro -fdebug-compilation-dir /home/maarten/src/libreoffice/core -ferror-limit 19 -fvisibility hidden -fvisibility-inlines-hidden -stack-protector 2 -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -debug-info-kind=constructor -analyzer-output=html -faddrsig -o /home/maarten/tmp/wis/scan-build-libreoffice/output/report/2020-10-07-141433-9725-1 -x c++ /home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx

/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx

1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#include <ReportController.hxx>
21#include <ReportDefinition.hxx>
22#include <CondFormat.hxx>
23#include <UITools.hxx>
24#include <AddField.hxx>
25#include <toolkit/helper/vclunohelper.hxx>
26#include <DateTime.hxx>
27
28#include <sfx2/filedlghelper.hxx>
29#include <tools/diagnose_ex.h>
30#include <rptui_slotid.hrc>
31#include <reportformula.hxx>
32
33#include <comphelper/documentconstants.hxx>
34#include <unotools/mediadescriptor.hxx>
35#include <comphelper/propertysequence.hxx>
36#include <comphelper/sequenceashashmap.hxx>
37#include <comphelper/types.hxx>
38
39#include <connectivity/dbtools.hxx>
40#include <com/sun/star/style/XStyle.hpp>
41#include <com/sun/star/style/ParagraphAdjust.hpp>
42#include <com/sun/star/util/NumberFormatter.hpp>
43#include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
44#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
45#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
46#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
47#include <com/sun/star/frame/FrameSearchFlag.hpp>
48#include <com/sun/star/container/XChild.hpp>
49#include <com/sun/star/report/XImageControl.hpp>
50#include <com/sun/star/report/XFixedLine.hpp>
51#include <com/sun/star/report/Function.hpp>
52#include <com/sun/star/awt/FontDescriptor.hpp>
53#include <com/sun/star/sdb/XParametersSupplier.hpp>
54#include <com/sun/star/sdb/CommandType.hpp>
55#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
56#include <com/sun/star/embed/EmbedMapUnits.hpp>
57#include <com/sun/star/awt/FontWeight.hpp>
58#include <com/sun/star/awt/FontUnderline.hpp>
59#include <com/sun/star/awt/FontSlant.hpp>
60#include <com/sun/star/frame/Desktop.hpp>
61#include <com/sun/star/frame/status/FontHeight.hpp>
62#include <com/sun/star/report/ReportEngine.hpp>
63#include <com/sun/star/report/XFormattedField.hpp>
64#include <com/sun/star/sdb/SQLContext.hpp>
65#include <com/sun/star/beans/PropertyAttribute.hpp>
66#include <com/sun/star/document/XUndoManagerSupplier.hpp>
67
68#include <vcl/svapp.hxx>
69
70#include <i18nutil/paper.hxx>
71#include <svx/fmview.hxx>
72#include <editeng/memberids.h>
73#include <svx/svxids.hrc>
74#include <svx/svdobj.hxx>
75#include <svx/unomid.hxx>
76#include <svx/dataaccessdescriptor.hxx>
77#include <svx/xfillit0.hxx>
78#include <svx/xflclit.hxx>
79#include <svx/xflgrit.hxx>
80#include <svx/xflhtit.hxx>
81#include <svx/xbtmpit.hxx>
82#include <svx/xflftrit.hxx>
83#include <svx/xsflclit.hxx>
84#include <svx/xflbckit.hxx>
85#include <svx/xflbmpit.hxx>
86#include <svx/xflbmsli.hxx>
87#include <svx/xflbmsxy.hxx>
88#include <svx/xflbmtit.hxx>
89#include <svx/xflboxy.hxx>
90#include <svx/xflbstit.hxx>
91#include <svx/xflbtoxy.hxx>
92#include <svx/xfltrit.hxx>
93#include <svx/xgrscit.hxx>
94#include <editeng/svxenum.hxx>
95#include <svx/pageitem.hxx>
96#include <editeng/lrspitem.hxx>
97#include <editeng/ulspitem.hxx>
98#include <editeng/sizeitem.hxx>
99#include <sfx2/zoomitem.hxx>
100#include <svx/zoomslideritem.hxx>
101#include <editeng/brushitem.hxx>
102#include <svx/flagsdef.hxx>
103#include <svx/svdpagv.hxx>
104#include <svx/svxdlg.hxx>
105
106#include <core_resource.hxx>
107#include <DesignView.hxx>
108#include <RptObject.hxx>
109#include <RptUndo.hxx>
110#include <strings.hxx>
111#include <RptDef.hxx>
112#include <ReportSection.hxx>
113#include <SectionView.hxx>
114#include <UndoActions.hxx>
115#include <dlgpage.hxx>
116#include <strings.hrc>
117
118#include <svl/itempool.hxx>
119#include <svl/itemset.hxx>
120#include <svtools/cliplistener.hxx>
121#include <unotools/syslocale.hxx>
122#include <unotools/viewoptions.hxx>
123#include <unotools/localedatawrapper.hxx>
124
125#include <osl/mutex.hxx>
126#include <PropertyForward.hxx>
127#include <SectionWindow.hxx>
128
129#include <toolkit/helper/convert.hxx>
130#include <GroupsSorting.hxx>
131#include <PageNumber.hxx>
132#include <UndoEnv.hxx>
133
134#include <memory>
135#include <string_view>
136
137#include <cppuhelper/exc_hlp.hxx>
138#include <unotools/confignode.hxx>
139
140#include <ReportControllerObserver.hxx>
141
142#define MAX_ROWS_FOR_PREVIEW20 20
143
144#define RPTUI_ID_LRSPACEXATTR_FILL_FIRST - 8 XATTR_FILL_FIRST - 8
145#define RPTUI_ID_ULSPACEXATTR_FILL_FIRST - 7 XATTR_FILL_FIRST - 7
146#define RPTUI_ID_PAGEXATTR_FILL_FIRST - 6 XATTR_FILL_FIRST - 6
147#define RPTUI_ID_SIZEXATTR_FILL_FIRST - 5 XATTR_FILL_FIRST - 5
148#define RPTUI_ID_PAGE_MODEXATTR_FILL_FIRST - 4 XATTR_FILL_FIRST - 4
149#define RPTUI_ID_STARTXATTR_FILL_FIRST - 3 XATTR_FILL_FIRST - 3
150#define RPTUI_ID_ENDXATTR_FILL_FIRST - 2 XATTR_FILL_FIRST - 2
151#define RPTUI_ID_BRUSHXATTR_FILL_FIRST - 1 XATTR_FILL_FIRST - 1
152#define RPTUI_ID_METRICXATTR_FILL_LAST + 1 XATTR_FILL_LAST + 1
153
154using namespace ::com::sun::star;
155using namespace uno;
156using namespace io;
157using namespace beans;
158using namespace frame;
159using namespace util;
160using namespace lang;
161using namespace container;
162using namespace sdbcx;
163using namespace sdbc;
164using namespace sdb;
165using namespace ui;
166using namespace ui::dialogs;
167using namespace ::dbtools;
168using namespace ::rptui;
169using namespace ::dbaui;
170using namespace ::comphelper;
171using namespace ::cppu;
172
173
174namespace
175{
176 void lcl_setFontWPU_nothrow(const uno::Reference< report::XReportControlFormat>& _xReportControlFormat,const sal_Int32 _nId)
177 {
178 if ( !_xReportControlFormat.is() )
179 return;
180
181 try
182 {
183 awt::FontDescriptor aFontDescriptor = _xReportControlFormat->getFontDescriptor();
184 switch(_nId)
185 {
186 case SID_ATTR_CHAR_WEIGHT( 10000 + 9 ):
187 aFontDescriptor.Weight = (awt::FontWeight::NORMAL + awt::FontWeight::BOLD) - aFontDescriptor.Weight;
188 break;
189 case SID_ATTR_CHAR_POSTURE( 10000 + 8 ):
190 aFontDescriptor.Slant = static_cast<awt::FontSlant>(static_cast<sal_Int16>(awt::FontSlant_ITALIC) - static_cast<sal_Int16>(aFontDescriptor.Slant));
191 break;
192 case SID_ATTR_CHAR_UNDERLINE( 10000 + 14 ):
193 aFontDescriptor.Underline = awt::FontUnderline::SINGLE - aFontDescriptor.Underline;
194 break;
195 default:
196 OSL_FAIL("Illegal value in default!")do { if (true && (((sal_Bool)1))) { sal_detail_logFormat
((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "196" ": "), "%s", "Illegal value in default!"); } } while
(false)
;
197 break;
198 }
199
200 _xReportControlFormat->setFontDescriptor(aFontDescriptor);
201 }
202 catch(const beans::UnknownPropertyException&)
203 {
204 }
205 }
206}
207
208
209static void lcl_getReportControlFormat(const Sequence< PropertyValue >& aArgs,
210 ODesignView* _pView,
211 uno::Reference< awt::XWindow>& _xWindow,
212 ::std::vector< uno::Reference< uno::XInterface > >& _rControlsFormats)
213{
214 uno::Reference< report::XReportControlFormat> xReportControlFormat;
215 if ( aArgs.hasElements() )
216 {
217 SequenceAsHashMap aMap(aArgs);
218 xReportControlFormat = aMap.getUnpackedValueOrDefault(REPORTCONTROLFORMAT"ReportControlFormat",uno::Reference< report::XReportControlFormat>());
219 _xWindow = aMap.getUnpackedValueOrDefault(CURRENT_WINDOW"CurrentWindow",uno::Reference< awt::XWindow>());
220 }
221
222 if ( !xReportControlFormat.is() )
223 {
224 _pView->fillControlModelSelection(_rControlsFormats);
225 }
226 else
227 {
228 uno::Reference<uno::XInterface> xInterface(xReportControlFormat);
229 _rControlsFormats.push_back(xInterface);
230 }
231
232 if ( !_xWindow.is() )
233 _xWindow = VCLUnoHelper::GetInterface(_pView);
234}
235
236OUString SAL_CALL OReportController::getImplementationName()
237{
238 return "com.sun.star.report.comp.ReportDesign";
239}
240
241Sequence< OUString> SAL_CALL OReportController::getSupportedServiceNames()
242{
243 return { "com.sun.star.sdb.ReportDesign" };
244}
245
246#define PROPERTY_ID_ZOOMVALUE1 1
247
248
249OReportController::OReportController(Reference< XComponentContext > const & xContext)
250 :OReportController_BASE(xContext)
251 ,OPropertyStateContainer(OGenericUnoController_Base::rBHelper)
252 ,m_aSelectionListeners( getMutex() )
253 ,m_sMode("normal")
254 ,m_nSplitPos(-1)
255 ,m_nPageNum(-1)
256 ,m_nSelectionCount(0)
257 ,m_nAspect(0)
258 ,m_nZoomValue(100)
259 ,m_eZoomType(SvxZoomType::PERCENT)
260 ,m_bShowRuler(true)
261 ,m_bGridVisible(true)
262 ,m_bGridUse(true)
263 ,m_bShowProperties(true)
264 ,m_bHelplinesMove(true)
265 ,m_bChartEnabled(false)
266 ,m_bChartEnabledAsked(false)
267 ,m_bInGeneratePreview(false)
268{
269 // new Observer
270 m_pReportControllerObserver = new OXReportControllerObserver(*this);
271 registerProperty("ZoomValue", PROPERTY_ID_ZOOMVALUE1,
272 beans::PropertyAttribute::BOUND | beans::PropertyAttribute::TRANSIENT,
273 &m_nZoomValue, ::cppu::UnoType<sal_Int16>::get());
274
275}
276
277OReportController::~OReportController()
278{
279}
280
281IMPLEMENT_FORWARD_XTYPEPROVIDER2(OReportController,OReportController_BASE,OReportController_Listener)css::uno::Sequence< css::uno::Type > OReportController::
getTypes( ) { return ::comphelper::concatSequences( OReportController_BASE
::getTypes(), OReportController_Listener::getTypes() ); } css
::uno::Sequence< sal_Int8 > OReportController::getImplementationId
( ) { return css::uno::Sequence<sal_Int8>(); }
282IMPLEMENT_FORWARD_XINTERFACE2(OReportController,OReportController_BASE,OReportController_Listener)void OReportController::acquire() throw() { OReportController_BASE
::acquire(); } void OReportController::release() throw() { OReportController_BASE
::release(); } css::uno::Any OReportController::queryInterface
( const css::uno::Type& _rType ) { css::uno::Any aReturn =
OReportController_BASE::queryInterface( _rType ); if ( !aReturn
.hasValue() ) aReturn = OReportController_Listener::queryInterface
( _rType ); return aReturn; }
283
284void OReportController::disposing()
285{
286
287 if ( m_pClipboardNotifier.is() )
288 {
289 m_pClipboardNotifier->ClearCallbackLink();
290 m_pClipboardNotifier->RemoveListener( getView() );
291 m_pClipboardNotifier.clear();
292 }
293 if ( m_xGroupsFloater )
294 {
295 SvtViewOptions aDlgOpt(EViewType::Window, OStringToOUString(m_xGroupsFloater->get_help_id(), RTL_TEXTENCODING_UTF8(((rtl_TextEncoding) 76))));
296 aDlgOpt.SetWindowState(OStringToOUString(m_xGroupsFloater->getDialog()->get_window_state(WindowStateMask::All), RTL_TEXTENCODING_ASCII_US(((rtl_TextEncoding) 11))));
297 if (m_xGroupsFloater->getDialog()->get_visible())
298 m_xGroupsFloater->response(RET_CANCEL);
299 m_xGroupsFloater.reset();
300 }
301
302 try
303 {
304 m_xHoldAlive.clear();
305 m_xColumns.clear();
306 ::comphelper::disposeComponent( m_xRowSet );
307 ::comphelper::disposeComponent( m_xRowSetMediator );
308 ::comphelper::disposeComponent( m_xFormatter );
309 }
310 catch(const uno::Exception&)
311 {
312 OSL_FAIL("Exception caught while disposing row sets.")do { if (true && (((sal_Bool)1))) { sal_detail_logFormat
((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "312" ": "), "%s", "Exception caught while disposing row sets."
); } } while (false)
;
313 }
314 m_xRowSet.clear();
315 m_xRowSetMediator.clear();
316
317 if ( m_xReportDefinition.is() )
318 {
319 try
320 {
321 OSectionWindow* pSectionWindow = nullptr;
322 if ( getDesignView() )
323 pSectionWindow = getDesignView()->getMarkedSection();
324 if ( pSectionWindow )
325 pSectionWindow->getReportSection().deactivateOle();
326 clearUndoManager();
327 if ( m_aReportModel )
328 listen(false);
329 m_pReportControllerObserver->Clear();
330 m_pReportControllerObserver.clear();
331 }
332 catch(const uno::Exception&)
333 {
334 DBG_UNHANDLED_EXCEPTION("reportdesign")DbgUnhandledException( DbgGetCaughtException(), __func__, "/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "334" ": ", "reportdesign" );
;
335 }
336 }
337
338 {
339 EventObject aDisposingEvent( *this );
340 m_aSelectionListeners.disposeAndClear( aDisposingEvent );
341 }
342
343 OReportController_BASE::disposing();
344
345
346 try
347 {
348 m_xReportDefinition.clear();
349 m_aReportModel.reset();
350 m_xFrameLoader.clear();
351 m_xReportEngine.clear();
352 }
353 catch(const uno::Exception&)
354 {
355 }
356 if ( getDesignView() )
357 EndListening( *getDesignView() );
358 clearView();
359}
360
361FeatureState OReportController::GetState(sal_uInt16 _nId) const
362{
363 FeatureState aReturn;
364 // (disabled automatically)
365 aReturn.bEnabled = false;
366 // check this first
367 if ( !getView() )
368 return aReturn;
369
370 switch (_nId)
371 {
372 case SID_RPT_TEXTDOCUMENT( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 139 )
:
373 aReturn.bEnabled = isEditable();
374 aReturn.bChecked = (m_xReportDefinition.is() && m_xReportDefinition->getMimeType() == MIMETYPE_OASIS_OPENDOCUMENT_TEXT_ASCII"application/vnd.oasis.opendocument.text");
375 break;
376 case SID_RPT_SPREADSHEET( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 140 )
:
377 aReturn.bEnabled = isEditable();
378 aReturn.bChecked = (m_xReportDefinition.is() && m_xReportDefinition->getMimeType() == MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_ASCII"application/vnd.oasis.opendocument.spreadsheet");
379 break;
380 case SID_REPORTHEADER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 10 )
:
381 case SID_REPORTFOOTER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 11 )
:
382 case SID_REPORTHEADERFOOTER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 1 )
:
383 {
384 aReturn.bEnabled = isEditable();
385 OUString sText = RptResId((m_xReportDefinition.is() && m_xReportDefinition->getReportHeaderOn()) ? RID_STR_REPORTHEADERFOOTER_DELETEreinterpret_cast<char const *>("RID_STR_REPORTHEADERFOOTER_DELETE"
"\004" u8"Delete Report Header/Footer")
: RID_STR_REPORTHEADERFOOTER_INSERTreinterpret_cast<char const *>("RID_STR_REPORTHEADERFOOTER_INSERT"
"\004" u8"Insert Report Header/Footer")
);
386 aReturn.sTitle = sText;
387 }
388 break;
389 case SID_PAGEHEADER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 8 )
:
390 case SID_PAGEFOOTER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 9 )
:
391 case SID_PAGEHEADERFOOTER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 0 )
:
392 {
393 aReturn.bEnabled = isEditable();
394 OUString sText = RptResId((m_xReportDefinition.is() && m_xReportDefinition->getPageHeaderOn()) ? RID_STR_PAGEHEADERFOOTER_DELETEreinterpret_cast<char const *>("RID_STR_PAGEHEADERFOOTER_DELETE"
"\004" u8"Delete Page Header/Footer")
: RID_STR_PAGEHEADERFOOTER_INSERTreinterpret_cast<char const *>("RID_STR_PAGEHEADERFOOTER_INSERT"
"\004" u8"Insert Page Header/Footer")
);
395 aReturn.sTitle = sText;
396 }
397 break;
398 case SID_GROUP_APPEND( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 18 )
:
399 case SID_GROUP_REMOVE( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 17 )
:
400 case SID_GROUPHEADER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 13 )
:
401 case SID_GROUPHEADER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 14 )
:
402 case SID_GROUPFOOTER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 15 )
:
403 case SID_GROUPFOOTER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 16 )
:
404 aReturn.bEnabled = isEditable();
405 break;
406 case SID_ADD_CONTROL_PAIR( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 22 )
:
407 aReturn.bEnabled = isEditable();
408 break;
409 case SID_REDO(5000 + 700):
410 case SID_UNDO(5000 + 701):
411 {
412 size_t ( SfxUndoManager::*retrieveCount )( bool const ) const =
413 ( _nId == SID_UNDO(5000 + 701) ) ? &SfxUndoManager::GetUndoActionCount : &SfxUndoManager::GetRedoActionCount;
414
415 SfxUndoManager& rUndoManager( getUndoManager() );
416 aReturn.bEnabled = ( rUndoManager.*retrieveCount )( SfxUndoManager::TopLevel ) > 0;
417 if ( aReturn.bEnabled )
418 {
419 // TODO: add "Undo/Redo: prefix"
420 OUString ( SfxUndoManager::*retrieveComment )( size_t, bool const ) const =
421 ( _nId == SID_UNDO(5000 + 701) ) ? &SfxUndoManager::GetUndoActionComment : &SfxUndoManager::GetRedoActionComment;
422 aReturn.sTitle = (rUndoManager.*retrieveComment)( 0, SfxUndoManager::TopLevel );
423 }
424 }
425 break;
426 case SID_GETUNDOSTRINGS( 10000 + 923 ):
427 case SID_GETREDOSTRINGS( 10000 + 924 ):
428 {
429 size_t ( SfxUndoManager::*retrieveCount )( bool const ) const =
430 ( _nId == SID_GETUNDOSTRINGS( 10000 + 923 ) ) ? &SfxUndoManager::GetUndoActionCount : &SfxUndoManager::GetRedoActionCount;
431
432 OUString ( SfxUndoManager::*retrieveComment )( size_t, bool const ) const =
433 ( _nId == SID_GETUNDOSTRINGS( 10000 + 923 ) ) ? &SfxUndoManager::GetUndoActionComment : &SfxUndoManager::GetRedoActionComment;
434
435 SfxUndoManager& rUndoManager( getUndoManager() );
436 size_t nCount(( rUndoManager.*retrieveCount )( SfxUndoManager::TopLevel ));
437 Sequence<OUString> aSeq(nCount);
438 for (size_t n = 0; n < nCount; ++n)
439 aSeq[n] = (rUndoManager.*retrieveComment)( n, SfxUndoManager::TopLevel );
440 aReturn.aValue <<= aSeq;
441 aReturn.bEnabled = true;
442 }
443 break;
444 case SID_OBJECT_RESIZING( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 147 )
:
445 case SID_OBJECT_SMALLESTWIDTH( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 143 )
:
446 case SID_OBJECT_SMALLESTHEIGHT( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 144 )
:
447 case SID_OBJECT_GREATESTWIDTH( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 145 )
:
448 case SID_OBJECT_GREATESTHEIGHT( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 146 )
:
449 aReturn.bEnabled = isEditable() && getDesignView()->HasSelection();
450 if ( aReturn.bEnabled )
451 aReturn.bEnabled = m_nSelectionCount > 1;
452 break;
453
454 case SID_DISTRIBUTE_HLEFT(5000 + 686):
455 case SID_DISTRIBUTE_HCENTER(5000 + 687):
456 case SID_DISTRIBUTE_HDISTANCE(5000 + 688):
457 case SID_DISTRIBUTE_HRIGHT(5000 + 689):
458 case SID_DISTRIBUTE_VTOP(5000 + 690):
459 case SID_DISTRIBUTE_VCENTER(5000 + 691):
460 case SID_DISTRIBUTE_VDISTANCE(5000 + 692):
461 case SID_DISTRIBUTE_VBOTTOM(5000 + 693):
462 aReturn.bEnabled = isEditable() && getDesignView()->HasSelection();
463 if ( aReturn.bEnabled )
464 {
465 OSectionView* pSectionView = getCurrentSectionView();
466 aReturn.bEnabled = pSectionView && pSectionView->GetMarkedObjectCount() > 2;
467 }
468 break;
469 case SID_ARRANGEMENU( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 148 )
:
470 case SID_FRAME_DOWN( 10000 + 1119 ):
471 case SID_FRAME_UP( 10000 + 1118 ):
472 case SID_FRAME_TO_TOP( 10000 + 286 ):
473 case SID_FRAME_TO_BOTTOM( 10000 + 287 ):
474 case SID_OBJECT_HEAVEN( 10000 + 283 ):
475 case SID_OBJECT_HELL( 10000 + 282 ):
476 aReturn.bEnabled = isEditable() && getDesignView()->HasSelection();
477 if ( aReturn.bEnabled )
478 {
479 OSectionView* pSectionView = getCurrentSectionView();
480 aReturn.bEnabled = pSectionView && pSectionView->OnlyShapesMarked();
481 if ( aReturn.bEnabled )
482 {
483 if ( SID_OBJECT_HEAVEN( 10000 + 283 ) == _nId )
484 aReturn.bEnabled = pSectionView->GetLayerIdOfMarkedObjects() != RPT_LAYER_FRONT;
485 else if ( SID_OBJECT_HELL( 10000 + 282 ) == _nId )
486 aReturn.bEnabled = pSectionView->GetLayerIdOfMarkedObjects() != RPT_LAYER_BACK;
487 }
488 }
489 break;
490
491 case SID_SECTION_SHRINK( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 163 )
:
492 case SID_SECTION_SHRINK_TOP( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 164 )
:
493 case SID_SECTION_SHRINK_BOTTOM( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 165 )
:
494 {
495 sal_Int32 nCount = 0;
496 uno::Reference<report::XSection> xSection = getDesignView()->getCurrentSection();
497 if ( xSection.is() )
498 {
499 nCount = xSection->getCount();
500 }
501 aReturn.bEnabled = isEditable() && nCount > 0;
502 }
503 break;
504 case SID_OBJECT_ALIGN( 10000 + 130 ):
505 case SID_OBJECT_ALIGN_LEFT( 10000 + 131 ):
506 case SID_OBJECT_ALIGN_CENTER( 10000 + 132 ):
507 case SID_OBJECT_ALIGN_RIGHT( 10000 + 133 ):
508 case SID_OBJECT_ALIGN_UP( 10000 + 134 ):
509 case SID_OBJECT_ALIGN_MIDDLE( 10000 + 135 ):
510 case SID_OBJECT_ALIGN_DOWN( 10000 + 136 ):
511 case SID_SECTION_ALIGN( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 152 )
:
512 case SID_SECTION_ALIGN_LEFT( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 153 )
:
513 case SID_SECTION_ALIGN_CENTER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 154 )
:
514 case SID_SECTION_ALIGN_RIGHT( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 155 )
:
515 case SID_SECTION_ALIGN_UP( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 156 )
:
516 case SID_SECTION_ALIGN_MIDDLE( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 157 )
:
517 case SID_SECTION_ALIGN_DOWN( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 158 )
:
518 aReturn.bEnabled = isEditable() && getDesignView()->HasSelection();
519 break;
520 case SID_CUT(5000 + 710):
521 aReturn.bEnabled = isEditable() && getDesignView()->HasSelection() && !getDesignView()->isHandleEvent();
522 break;
523 case SID_COPY(5000 + 711):
524 aReturn.bEnabled = getDesignView()->HasSelection() && !getDesignView()->isHandleEvent();
525 break;
526 case SID_PASTE(5000 + 712):
527 aReturn.bEnabled = isEditable() && !getDesignView()->isHandleEvent() && getDesignView()->IsPasteAllowed();
528 break;
529 case SID_SELECTALL(5000 + 723):
530 aReturn.bEnabled = !getDesignView()->isHandleEvent();
531 break;
532 case SID_SELECTALL_IN_SECTION( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 149 )
:
533 aReturn.bEnabled = !getDesignView()->isHandleEvent();
534 if ( aReturn.bEnabled )
535 aReturn.bEnabled = getCurrentSectionView() != nullptr;
536 break;
537 case SID_ESCAPE( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 21 )
:
538 aReturn.bEnabled = getDesignView()->GetMode() == DlgEdMode::Insert;
539 break;
540 case SID_TERMINATE_INPLACEACTIVATION(5000 + 1702):
541 aReturn.bEnabled = true;
542 break;
543 case SID_SELECT_ALL_EDITS( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 162 )
:
544 case SID_SELECT_ALL_LABELS( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 161 )
:
545 aReturn.bEnabled = true;
546 break;
547 case SID_RPT_NEW_FUNCTION( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 142 )
:
548 aReturn.bEnabled = isEditable();
549 break;
550 case SID_COLLAPSE_SECTION( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 167 )
:
551 case SID_EXPAND_SECTION( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 168 )
:
552 case SID_NEXT_MARK( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 159 )
:
553 case SID_PREV_MARK( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 160 )
:
554 aReturn.bEnabled = isEditable() && !getDesignView()->isHandleEvent();
555 break;
556 case SID_SELECT(5000 + 720):
557 case SID_SELECT_REPORT( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 12 )
:
558 aReturn.bEnabled = true;
559 break;
560 case SID_EXECUTE_REPORT( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 19 )
:
561 aReturn.bEnabled = isConnected() && m_xReportDefinition.is();
562 break;
563 case SID_DELETE(5000 + 713):
564 aReturn.bEnabled = isEditable() && getDesignView()->HasSelection() && !getDesignView()->isHandleEvent();
565 if ( aReturn.bEnabled )
566 {
567 OSectionWindow* pSectionWindow = getDesignView()->getMarkedSection();
568 if ( pSectionWindow )
569 aReturn.bEnabled = !pSectionWindow->getReportSection().isUiActive();
570 }
571 {
572 OUString sText = RptResId(RID_STR_DELETEreinterpret_cast<char const *>("RID_STR_DELETE" "\004" u8"Delete"
)
);
573 aReturn.sTitle = sText;
574 }
575 break;
576 case SID_GRID_VISIBLE(27000 +322):
577 aReturn.bEnabled = isEditable();
578 aReturn.bChecked = m_bGridVisible;
579 break;
580 case SID_GRID_USE(27000 +154):
581 aReturn.bEnabled = isEditable();
582 aReturn.bChecked = m_bGridUse;
583 break;
584 case SID_HELPLINES_MOVE(27000 +153):
585 aReturn.bEnabled = isEditable();
586 aReturn.bChecked = m_bHelplinesMove;
587 break;
588 case SID_RULER(27000 +40):
589 aReturn.bEnabled = isEditable();
590 aReturn.bChecked = m_bShowRuler;
591 break;
592 case SID_OBJECT_SELECT( 10000 + 128 ):
593 aReturn.bEnabled = true;
594 aReturn.bChecked = getDesignView()->GetMode() == DlgEdMode::Select;
595 break;
596 case SID_INSERT_DIAGRAM( 10000 + 140 ):
597 aReturn.bEnabled = isEditable();
598 aReturn.bInvisible = !m_bChartEnabled;
599 aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_OLE2;
600 break;
601 case SID_FM_FIXEDTEXT( 10000 + 597 ):
602 aReturn.bEnabled = isEditable();
603 aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_DLG_FIXEDTEXT(sal_uInt16(OBJ_MAXI) + 1);
604 break;
605 case SID_INSERT_HFIXEDLINE( 10000 + 928 ):
606 aReturn.bEnabled = isEditable();
607 aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_DLG_HFIXEDLINE(sal_uInt16(OBJ_MAXI) + 4);
608 break;
609 case SID_INSERT_VFIXEDLINE( 10000 + 929 ):
610 aReturn.bEnabled = isEditable();
611 aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_DLG_VFIXEDLINE(sal_uInt16(OBJ_MAXI) + 5);
612 break;
613 case SID_FM_EDIT( 10000 + 599 ):
614 aReturn.bEnabled = isEditable();
615 aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_DLG_FORMATTEDFIELD(sal_uInt16(OBJ_MAXI) + 3);
616 break;
617 case SID_FM_IMAGECONTROL( 10000 + 710 ):
618 aReturn.bEnabled = isEditable();
619 aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_DLG_IMAGECONTROLOBJ_FM_IMAGECONTROL;
620 break;
621 case SID_DRAWTBX_CS_BASIC( 10000 + 1047 ):
622 case SID_DRAWTBX_CS_BASIC1( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 26 )
:
623 case SID_DRAWTBX_CS_BASIC2( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 27 )
:
624 case SID_DRAWTBX_CS_BASIC3( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 28 )
:
625 case SID_DRAWTBX_CS_BASIC4( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 29 )
:
626 case SID_DRAWTBX_CS_BASIC5( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 30 )
:
627 case SID_DRAWTBX_CS_BASIC6( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 31 )
:
628 case SID_DRAWTBX_CS_BASIC7( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 32 )
:
629 case SID_DRAWTBX_CS_BASIC8( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 33 )
:
630 case SID_DRAWTBX_CS_BASIC9( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 34 )
:
631 case SID_DRAWTBX_CS_BASIC10( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 35 )
:
632 case SID_DRAWTBX_CS_BASIC11( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 36 )
:
633 case SID_DRAWTBX_CS_BASIC12( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 37 )
:
634 case SID_DRAWTBX_CS_BASIC13( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 38 )
:
635 case SID_DRAWTBX_CS_BASIC14( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 39 )
:
636 case SID_DRAWTBX_CS_BASIC15( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 40 )
:
637 case SID_DRAWTBX_CS_BASIC16( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 41 )
:
638 case SID_DRAWTBX_CS_BASIC17( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 42 )
:
639 case SID_DRAWTBX_CS_BASIC18( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 43 )
:
640 case SID_DRAWTBX_CS_BASIC19( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 44 )
:
641 case SID_DRAWTBX_CS_BASIC20( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 45 )
:
642 case SID_DRAWTBX_CS_BASIC21( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 46 )
:
643 case SID_DRAWTBX_CS_BASIC22( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 47 )
:
644 impl_fillCustomShapeState_nothrow("diamond",aReturn);
645 break;
646 case SID_DRAWTBX_CS_SYMBOL( 10000 + 1048 ):
647 case SID_DRAWTBX_CS_SYMBOL1( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 48 )
:
648 case SID_DRAWTBX_CS_SYMBOL2( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 49 )
:
649 case SID_DRAWTBX_CS_SYMBOL3( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 50 )
:
650 case SID_DRAWTBX_CS_SYMBOL4( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 51 )
:
651 case SID_DRAWTBX_CS_SYMBOL5( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 52 )
:
652 case SID_DRAWTBX_CS_SYMBOL6( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 53 )
:
653 case SID_DRAWTBX_CS_SYMBOL7( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 54 )
:
654 case SID_DRAWTBX_CS_SYMBOL8( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 55 )
:
655 case SID_DRAWTBX_CS_SYMBOL9( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 56 )
:
656 case SID_DRAWTBX_CS_SYMBOL10( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 57 )
:
657 case SID_DRAWTBX_CS_SYMBOL11( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 58 )
:
658 case SID_DRAWTBX_CS_SYMBOL12( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 59 )
:
659 case SID_DRAWTBX_CS_SYMBOL13( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 60 )
:
660 case SID_DRAWTBX_CS_SYMBOL14( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 61 )
:
661 case SID_DRAWTBX_CS_SYMBOL15( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 62 )
:
662 case SID_DRAWTBX_CS_SYMBOL16( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 63 )
:
663 case SID_DRAWTBX_CS_SYMBOL17( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 64 )
:
664 case SID_DRAWTBX_CS_SYMBOL18( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 65 )
:
665 impl_fillCustomShapeState_nothrow("smiley",aReturn);
666 break;
667 case SID_DRAWTBX_CS_ARROW( 10000 + 1049 ):
668 case SID_DRAWTBX_CS_ARROW1( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 66 )
:
669 case SID_DRAWTBX_CS_ARROW2( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 67 )
:
670 case SID_DRAWTBX_CS_ARROW3( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 68 )
:
671 case SID_DRAWTBX_CS_ARROW4( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 69 )
:
672 case SID_DRAWTBX_CS_ARROW5( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 70 )
:
673 case SID_DRAWTBX_CS_ARROW6( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 71 )
:
674 case SID_DRAWTBX_CS_ARROW7( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 72 )
:
675 case SID_DRAWTBX_CS_ARROW8( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 73 )
:
676 case SID_DRAWTBX_CS_ARROW9( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 74 )
:
677 case SID_DRAWTBX_CS_ARROW10( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 75 )
:
678 case SID_DRAWTBX_CS_ARROW11( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 76 )
:
679 case SID_DRAWTBX_CS_ARROW12( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 77 )
:
680 case SID_DRAWTBX_CS_ARROW13( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 78 )
:
681 case SID_DRAWTBX_CS_ARROW14( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 79 )
:
682 case SID_DRAWTBX_CS_ARROW15( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 80 )
:
683 case SID_DRAWTBX_CS_ARROW16( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 81 )
:
684 case SID_DRAWTBX_CS_ARROW17( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 82 )
:
685 case SID_DRAWTBX_CS_ARROW18( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 83 )
:
686 case SID_DRAWTBX_CS_ARROW19( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 84 )
:
687 case SID_DRAWTBX_CS_ARROW20( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 85 )
:
688 case SID_DRAWTBX_CS_ARROW21( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 86 )
:
689 case SID_DRAWTBX_CS_ARROW22( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 87 )
:
690 case SID_DRAWTBX_CS_ARROW23( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 88 )
:
691 case SID_DRAWTBX_CS_ARROW24( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 89 )
:
692 case SID_DRAWTBX_CS_ARROW25( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 90 )
:
693 case SID_DRAWTBX_CS_ARROW26( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 91 )
:
694 impl_fillCustomShapeState_nothrow("left-right-arrow",aReturn);
695 break;
696 case SID_DRAWTBX_CS_STAR( 10000 + 1052 ):
697 case SID_DRAWTBX_CS_STAR1( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 92 )
:
698 case SID_DRAWTBX_CS_STAR2( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 93 )
:
699 case SID_DRAWTBX_CS_STAR3( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 94 )
:
700 case SID_DRAWTBX_CS_STAR4( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 95 )
:
701 case SID_DRAWTBX_CS_STAR5( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 96 )
:
702 case SID_DRAWTBX_CS_STAR6( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 97 )
:
703 case SID_DRAWTBX_CS_STAR7( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 98 )
:
704 case SID_DRAWTBX_CS_STAR8( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 99 )
:
705 case SID_DRAWTBX_CS_STAR9( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 100 )
:
706 case SID_DRAWTBX_CS_STAR10( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 101 )
:
707 case SID_DRAWTBX_CS_STAR11( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 102 )
:
708 case SID_DRAWTBX_CS_STAR12( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 103 )
:
709 impl_fillCustomShapeState_nothrow("star5",aReturn);
710 break;
711 case SID_DRAWTBX_CS_FLOWCHART( 10000 + 1050 ):
712 case SID_DRAWTBX_CS_FLOWCHART1( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 104 )
:
713 case SID_DRAWTBX_CS_FLOWCHART2( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 105 )
:
714 case SID_DRAWTBX_CS_FLOWCHART3( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 106 )
:
715 case SID_DRAWTBX_CS_FLOWCHART4( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 107 )
:
716 case SID_DRAWTBX_CS_FLOWCHART5( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 108 )
:
717 case SID_DRAWTBX_CS_FLOWCHART6( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 109 )
:
718 case SID_DRAWTBX_CS_FLOWCHART7( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 110 )
:
719 case SID_DRAWTBX_CS_FLOWCHART8( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 111 )
:
720 case SID_DRAWTBX_CS_FLOWCHART9( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 112 )
:
721 case SID_DRAWTBX_CS_FLOWCHART10( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 113 )
:
722 case SID_DRAWTBX_CS_FLOWCHART11( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 114 )
:
723 case SID_DRAWTBX_CS_FLOWCHART12( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 115 )
:
724 case SID_DRAWTBX_CS_FLOWCHART13( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 116 )
:
725 case SID_DRAWTBX_CS_FLOWCHART14( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 117 )
:
726 case SID_DRAWTBX_CS_FLOWCHART15( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 118 )
:
727 case SID_DRAWTBX_CS_FLOWCHART16( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 119 )
:
728 case SID_DRAWTBX_CS_FLOWCHART17( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 120 )
:
729 case SID_DRAWTBX_CS_FLOWCHART18( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 121 )
:
730 case SID_DRAWTBX_CS_FLOWCHART19( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 122 )
:
731 case SID_DRAWTBX_CS_FLOWCHART20( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 123 )
:
732 case SID_DRAWTBX_CS_FLOWCHART21( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 124 )
:
733 case SID_DRAWTBX_CS_FLOWCHART22( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 125 )
:
734 case SID_DRAWTBX_CS_FLOWCHART23( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 126 )
:
735 case SID_DRAWTBX_CS_FLOWCHART24( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 127 )
:
736 case SID_DRAWTBX_CS_FLOWCHART25( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 128 )
:
737 case SID_DRAWTBX_CS_FLOWCHART26( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 129 )
:
738 case SID_DRAWTBX_CS_FLOWCHART27( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 130 )
:
739 case SID_DRAWTBX_CS_FLOWCHART28( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 131 )
:
740 impl_fillCustomShapeState_nothrow("flowchart-internal-storage",aReturn);
741 break;
742 case SID_DRAWTBX_CS_CALLOUT( 10000 + 1051 ):
743 case SID_DRAWTBX_CS_CALLOUT1( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 132 )
:
744 case SID_DRAWTBX_CS_CALLOUT2( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 133 )
:
745 case SID_DRAWTBX_CS_CALLOUT3( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 134 )
:
746 case SID_DRAWTBX_CS_CALLOUT4( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 135 )
:
747 case SID_DRAWTBX_CS_CALLOUT5( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 136 )
:
748 case SID_DRAWTBX_CS_CALLOUT6( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 137 )
:
749 case SID_DRAWTBX_CS_CALLOUT7( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 138 )
:
750 impl_fillCustomShapeState_nothrow("round-rectangular-callout",aReturn);
751 break;
752 case SID_RPT_SHOWREPORTEXPLORER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 141 )
:
753 aReturn.bEnabled = m_xReportDefinition.is();
754 aReturn.bChecked = getDesignView() && getDesignView()->isReportExplorerVisible();
755 break;
756 case SID_FM_ADD_FIELD( 10000 + 623 ):
757 aReturn.bEnabled = isConnected() && isEditable() && m_xReportDefinition.is()
758 && !m_xReportDefinition->getCommand().isEmpty();
759 aReturn.bChecked = getDesignView() && getDesignView()->isAddFieldVisible();
760 break;
761 case SID_SHOW_PROPERTYBROWSER( 10000 + 943 ):
762 aReturn.bEnabled = true;
763 aReturn.bChecked = m_bShowProperties;
764 break;
765 case SID_PROPERTYBROWSER_LAST_PAGE( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 24 )
:
766 aReturn.bEnabled = true;
767 aReturn.aValue <<= m_sLastActivePage;
768 break;
769 case SID_SPLIT_POSITION( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 23 )
:
770 aReturn.bEnabled = true;
771 aReturn.aValue <<= getSplitPos();
772 break;
773 case SID_SAVEDOC(5000 + 505):
774 case SID_SAVEASDOC(5000 + 502):
775 case SID_SAVEACOPY(5000 + 999):
776 aReturn.bEnabled = isConnected() && isEditable();
777 break;
778 case SID_EDITDOC(5000 + 1312):
779 aReturn.bChecked = isEditable();
780 break;
781 case SID_PAGEDIALOG( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 5 )
:
782 aReturn.bEnabled = isEditable();
783 break;
784 case SID_BACKGROUND_COLORTypedWhichId<SvxColorItem>( 10000 + 186 ):
785 impl_fillState_nothrow(PROPERTY_CONTROLBACKGROUND"ControlBackground",aReturn);
786 break;
787 case SID_ATTR_CHAR_COLOR_BACKGROUND(10000 + 489):
788 aReturn.bEnabled = isEditable();
789 {
790 uno::Reference<report::XSection> xSection = getDesignView()->getCurrentSection();
791 if ( xSection.is() )
792 try
793 {
794 aReturn.aValue <<= xSection->getBackColor();
795 const uno::Reference< report::XReportControlModel> xControlModel(getDesignView()->getCurrentControlModel(),uno::UNO_QUERY);
796 aReturn.bEnabled = !xControlModel.is();
797 }
798 catch(const beans::UnknownPropertyException&)
799 {
800 }
801 else
802 aReturn.bEnabled = false;
803 }
804 break;
805 case SID_SORTINGANDGROUPING( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 2 )
:
806 aReturn.bEnabled = true;
807 aReturn.bChecked = m_xGroupsFloater && m_xGroupsFloater->getDialog()->get_visible();
808 break;
809 case SID_ATTR_CHAR_WEIGHT( 10000 + 9 ):
810 case SID_ATTR_CHAR_POSTURE( 10000 + 8 ):
811 case SID_ATTR_CHAR_UNDERLINE( 10000 + 14 ):
812 impl_fillState_nothrow(PROPERTY_FONTDESCRIPTOR"FontDescriptor",aReturn);
813 if ( aReturn.bEnabled )
814 {
815 awt::FontDescriptor aFontDescriptor;
816 aReturn.aValue >>= aFontDescriptor;
817 aReturn.aValue.clear();
818
819 switch(_nId)
820 {
821 case SID_ATTR_CHAR_WEIGHT( 10000 + 9 ):
822 aReturn.bChecked = awt::FontWeight::BOLD == aFontDescriptor.Weight;
823 break;
824 case SID_ATTR_CHAR_POSTURE( 10000 + 8 ):
825 aReturn.bChecked = awt::FontSlant_ITALIC == aFontDescriptor.Slant;
826 break;
827 case SID_ATTR_CHAR_UNDERLINE( 10000 + 14 ):
828 aReturn.bChecked = awt::FontUnderline::SINGLE == aFontDescriptor.Underline;
829 break;
830 default:
831 ;
832 }
833 }
834 break;
835 case SID_ATTR_CHAR_COLOR( 10000 + 17 ):
836 case SID_ATTR_CHAR_COLOR2(10000 + 537):
837 impl_fillState_nothrow(PROPERTY_CHARCOLOR"CharColor",aReturn);
838 break;
839 case SID_ATTR_CHAR_FONT( 10000 + 7 ):
840 impl_fillState_nothrow(PROPERTY_FONTDESCRIPTOR"FontDescriptor",aReturn);
841 break;
842 case SID_ATTR_CHAR_FONTHEIGHT( 10000 + 15 ):
843 impl_fillState_nothrow(PROPERTY_CHARHEIGHT"CharHeight",aReturn);
844 if ( aReturn.aValue.hasValue() )
845 {
846 frame::status::FontHeight aFontHeight;
847 aReturn.aValue >>= aFontHeight.Height;
848 aReturn.aValue <<= aFontHeight; // another type is needed here, so
849 }
850 break;
851 case SID_ATTR_PARA_ADJUST_LEFT( 10000 + 28 ):
852 case SID_ATTR_PARA_ADJUST_CENTER( 10000 + 30 ):
853 case SID_ATTR_PARA_ADJUST_RIGHT( 10000 + 29 ):
854 case SID_ATTR_PARA_ADJUST_BLOCK( 10000 + 31 ):
855 impl_fillState_nothrow(PROPERTY_PARAADJUST"ParaAdjust",aReturn);
856 if ( aReturn.bEnabled )
857 {
858 ::sal_Int16 nParaAdjust = 0;
859 if ( aReturn.aValue >>= nParaAdjust )
860 {
861 switch(static_cast<style::ParagraphAdjust>(nParaAdjust))
862 {
863 case style::ParagraphAdjust_LEFT:
864 aReturn.bChecked = _nId == SID_ATTR_PARA_ADJUST_LEFT( 10000 + 28 );
865 break;
866 case style::ParagraphAdjust_RIGHT:
867 aReturn.bChecked = _nId == SID_ATTR_PARA_ADJUST_RIGHT( 10000 + 29 );
868 break;
869 case style::ParagraphAdjust_BLOCK:
870 case style::ParagraphAdjust_STRETCH:
871 aReturn.bChecked = _nId == SID_ATTR_PARA_ADJUST_BLOCK( 10000 + 31 );
872 break;
873 case style::ParagraphAdjust_CENTER:
874 aReturn.bChecked = _nId == SID_ATTR_PARA_ADJUST_CENTER( 10000 + 30 );
875 break;
876 default: break;
877 }
878 }
879 aReturn.aValue.clear();
880 }
881 break;
882
883 case SID_INSERT_GRAPHICTypedWhichId<SfxStringItem>( 10000 + 241 ):
884 aReturn.bEnabled = m_xReportDefinition.is() && isEditable() && getDesignView()->getCurrentSection().is();
885 break;
886 case SID_CHAR_DLG( 10000 + 296 ):
887 case SID_SETCONTROLDEFAULTS( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 6 )
:
888 aReturn.bEnabled = m_xReportDefinition.is() && isEditable();
889 if ( aReturn.bEnabled )
890 {
891 ::std::vector< uno::Reference< uno::XInterface > > aSelection;
892 getDesignView()->fillControlModelSelection(aSelection);
893 aReturn.bEnabled = !aSelection.empty()
894 && std::all_of(aSelection.begin(), aSelection.end(), [](const uno::Reference<uno::XInterface>& rxInterface) {
895 return !uno::Reference<report::XFixedLine>(rxInterface, uno::UNO_QUERY).is()
896 && !uno::Reference<report::XImageControl>(rxInterface, uno::UNO_QUERY).is()
897 && uno::Reference<report::XReportControlFormat>(rxInterface, uno::UNO_QUERY).is(); });
898 }
899 break;
900 case SID_CONDITIONALFORMATTING( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 4 )
:
901 {
902 const uno::Reference< report::XFormattedField> xFormattedField(getDesignView()->getCurrentControlModel(),uno::UNO_QUERY);
903 aReturn.bEnabled = xFormattedField.is();
904 }
905 break;
906 case SID_INSERT_FLD_PGNUMBER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 3 )
:
907 case SID_DATETIME( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 20 )
:
908 aReturn.bEnabled = m_xReportDefinition.is() && isEditable() && getDesignView()->getCurrentSection().is();
909 break;
910 case SID_EXPORTDOC(5000 + 829):
911 case SID_EXPORTDOCASPDF(5000 + 1673):
912 aReturn.bEnabled = m_xReportDefinition.is();
913 break;
914 case SID_PRINTPREVIEW(5000 + 325):
915 aReturn.bEnabled = false;
916 break;
917 case SID_ATTR_ZOOMTypedWhichId<SvxZoomItem>(10000 + 0):
918 aReturn.bEnabled = true;
919 {
920 SvxZoomItem aZoom(m_eZoomType,m_nZoomValue);
921 aZoom.SetValueSet(SvxZoomEnableFlags::N50|SvxZoomEnableFlags::N75|SvxZoomEnableFlags::N100|SvxZoomEnableFlags::N200);
922 aZoom.QueryValue(aReturn.aValue);
923 }
924 break;
925 case SID_ATTR_ZOOMSLIDER( 10000 + 1065 ):
926 aReturn.bEnabled = true;
927 {
928 SvxZoomSliderItem aZoomSlider(m_nZoomValue,20,400);
929 aZoomSlider.AddSnappingPoint(50);
930 aZoomSlider.AddSnappingPoint(75);
931 aZoomSlider.AddSnappingPoint(100);
932 aZoomSlider.AddSnappingPoint(200);
933 aZoomSlider.QueryValue(aReturn.aValue);
934 }
935 break;
936 default:
937 aReturn = OReportController_BASE::GetState(_nId);
938 }
939 return aReturn;
940}
941
942
943namespace
944{
945 /** extracts a background color from a dispatched SID_BACKGROUND_COLOR call
946
947 The dispatch might originate from either the toolbar, or the conditional
948 formatting dialog. In both cases, argument formats are different.
949 */
950 util::Color lcl_extractBackgroundColor( const Sequence< PropertyValue >& _rDispatchArgs )
951 {
952 util::Color aColor( COL_TRANSPARENT );
953 if ( _rDispatchArgs.getLength() == 1 )
954 {
955 OSL_VERIFY( _rDispatchArgs[0].Value >>= aColor )do { if (!(_rDispatchArgs[0].Value >>= aColor)) do { if
(true && (!(0))) { sal_detail_logFormat((SAL_DETAIL_LOG_LEVEL_WARN
), ("legacy.osl"), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "955" ": "), "OSL_ASSERT: %s", "0"); } } while (false); }
while (0)
;
956 }
957 else
958 {
959 SequenceAsHashMap aMap( _rDispatchArgs );
960 aColor = aMap.getUnpackedValueOrDefault( PROPERTY_FONTCOLOR"FontColor", aColor );
961 }
962 return aColor;
963 }
964}
965
966
967void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& aArgs)
968{
969 SolarMutexGuard aSolarGuard;
970 ::osl::MutexGuard aGuard( getMutex() );
971
972 bool bForceBroadcast = false;
973 switch(_nId)
974 {
975 case SID_RPT_TEXTDOCUMENT( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 139 )
:
976 if ( m_xReportDefinition.is() )
977 m_xReportDefinition->setMimeType( MIMETYPE_OASIS_OPENDOCUMENT_TEXT_ASCII"application/vnd.oasis.opendocument.text" );
978 break;
979 case SID_RPT_SPREADSHEET( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 140 )
:
980 if (m_xReportDefinition.is() )
981 m_xReportDefinition->setMimeType( MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_ASCII"application/vnd.oasis.opendocument.spreadsheet" );
982 break;
983 case SID_REPORTHEADER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 10 )
:
984 case SID_REPORTFOOTER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 11 )
:
985 case SID_REPORTHEADERFOOTER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 1 )
:
986 switchReportSection(_nId);
987 break;
988 case SID_PAGEHEADER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 8 )
:
989 case SID_PAGEFOOTER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 9 )
:
990 case SID_PAGEHEADERFOOTER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 0 )
:
991 switchPageSection(_nId);
992 break;
993 case SID_GROUP_APPEND( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 18 )
:
994 case SID_GROUP_REMOVE( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 17 )
:
995 modifyGroup(_nId == SID_GROUP_APPEND( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 18 )
,aArgs);
996 break;
997 case SID_GROUPHEADER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 13 )
:
998 case SID_GROUPHEADER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 14 )
:
999 createGroupSection(SID_GROUPHEADER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 14 )
== _nId,true,aArgs);
1000 break;
1001 case SID_GROUPFOOTER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 15 )
:
1002 case SID_GROUPFOOTER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 16 )
:
1003 createGroupSection(SID_GROUPFOOTER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 16 )
== _nId,false,aArgs);
1004 break;
1005 case SID_ADD_CONTROL_PAIR( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 22 )
:
1006 addPairControls(aArgs);
1007 break;
1008 case SID_REDO(5000 + 700):
1009 case SID_UNDO(5000 + 701):
1010 {
1011 const OXUndoEnvironment::OUndoMode aLock( m_aReportModel->GetUndoEnv() );
1012 bool ( SfxUndoManager::*doXDo )() =
1013 ( _nId == SID_UNDO(5000 + 701) ) ? &SfxUndoManager::Undo : &SfxUndoManager::Redo;
1014 SfxUndoManager& rUndoManager( getUndoManager() );
1015
1016 sal_Int16 nCount(1);
1017 if (aArgs.hasElements() && aArgs[0].Name != "KeyModifier")
1018 aArgs[0].Value >>= nCount;
1019 while (nCount--)
1020 (rUndoManager.*doXDo)();
1021 InvalidateAll();
1022 if (m_xGroupsFloater && m_xGroupsFloater->getDialog()->get_visible())
1023 m_xGroupsFloater->UpdateData();
1024 }
1025 break;
1026 case SID_CUT(5000 + 710):
1027 executeMethodWithUndo(RID_STR_UNDO_REMOVE_SELECTIONreinterpret_cast<char const *>("RID_STR_UNDO_REMOVE_SELECTION"
"\004" u8"Delete Selection")
,::std::mem_fn(&ODesignView::Cut));
1028 break;
1029 case SID_COPY(5000 + 711):
1030 getDesignView()->Copy();
1031 break;
1032 case SID_PASTE(5000 + 712):
1033 executeMethodWithUndo(RID_STR_UNDO_PASTEreinterpret_cast<char const *>("RID_STR_UNDO_PASTE" "\004"
u8"Paste")
,::std::mem_fn(&ODesignView::Paste));
1034 break;
1035
1036 case SID_FRAME_TO_TOP( 10000 + 286 ):
1037 case SID_FRAME_DOWN( 10000 + 1119 ):
1038 case SID_FRAME_UP( 10000 + 1118 ):
1039 case SID_FRAME_TO_BOTTOM( 10000 + 287 ):
1040 case SID_OBJECT_HEAVEN( 10000 + 283 ):
1041 case SID_OBJECT_HELL( 10000 + 282 ):
1042 changeZOrder(_nId);
1043 break;
1044 case SID_DISTRIBUTE_HLEFT(5000 + 686):
1045 case SID_DISTRIBUTE_HCENTER(5000 + 687):
1046 case SID_DISTRIBUTE_HDISTANCE(5000 + 688):
1047 case SID_DISTRIBUTE_HRIGHT(5000 + 689):
1048 case SID_DISTRIBUTE_VTOP(5000 + 690):
1049 case SID_DISTRIBUTE_VCENTER(5000 + 691):
1050 case SID_DISTRIBUTE_VDISTANCE(5000 + 692):
1051 case SID_DISTRIBUTE_VBOTTOM(5000 + 693):
1052 {
1053 OSectionView* pSectionView = getCurrentSectionView();
1054 if ( pSectionView )
1055 pSectionView->DistributeMarkedObjects(_nId);
1056 }
1057 break;
1058 case SID_OBJECT_SMALLESTWIDTH( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 143 )
:
1059 alignControlsWithUndo(RID_STR_UNDO_ALIGNMENTreinterpret_cast<char const *>("RID_STR_UNDO_ALIGNMENT"
"\004" u8"Change Alignment")
,ControlModification::WIDTH_SMALLEST);
1060 break;
1061 case SID_OBJECT_SMALLESTHEIGHT( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 144 )
:
1062 alignControlsWithUndo(RID_STR_UNDO_ALIGNMENTreinterpret_cast<char const *>("RID_STR_UNDO_ALIGNMENT"
"\004" u8"Change Alignment")
,ControlModification::HEIGHT_SMALLEST);
1063 break;
1064 case SID_OBJECT_GREATESTWIDTH( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 145 )
:
1065 alignControlsWithUndo(RID_STR_UNDO_ALIGNMENTreinterpret_cast<char const *>("RID_STR_UNDO_ALIGNMENT"
"\004" u8"Change Alignment")
,ControlModification::WIDTH_GREATEST);
1066 break;
1067 case SID_OBJECT_GREATESTHEIGHT( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 146 )
:
1068 alignControlsWithUndo(RID_STR_UNDO_ALIGNMENTreinterpret_cast<char const *>("RID_STR_UNDO_ALIGNMENT"
"\004" u8"Change Alignment")
,ControlModification::HEIGHT_GREATEST);
1069 break;
1070 case SID_SECTION_ALIGN_LEFT( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 153 )
:
1071 case SID_OBJECT_ALIGN_LEFT( 10000 + 131 ):
1072 alignControlsWithUndo(RID_STR_UNDO_ALIGNMENTreinterpret_cast<char const *>("RID_STR_UNDO_ALIGNMENT"
"\004" u8"Change Alignment")
,ControlModification::LEFT,SID_SECTION_ALIGN_LEFT( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 153 )
== _nId);
1073 break;
1074 case SID_SECTION_ALIGN_CENTER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 154 )
:
1075 case SID_OBJECT_ALIGN_CENTER( 10000 + 132 ):
1076 alignControlsWithUndo(RID_STR_UNDO_ALIGNMENTreinterpret_cast<char const *>("RID_STR_UNDO_ALIGNMENT"
"\004" u8"Change Alignment")
,ControlModification::CENTER_HORIZONTAL,SID_SECTION_ALIGN_CENTER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 154 )
== _nId);
1077 break;
1078 case SID_SECTION_ALIGN_RIGHT( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 155 )
:
1079 case SID_OBJECT_ALIGN_RIGHT( 10000 + 133 ):
1080 alignControlsWithUndo(RID_STR_UNDO_ALIGNMENTreinterpret_cast<char const *>("RID_STR_UNDO_ALIGNMENT"
"\004" u8"Change Alignment")
,ControlModification::RIGHT,SID_SECTION_ALIGN_RIGHT( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 155 )
== _nId);
1081 break;
1082 case SID_SECTION_ALIGN_UP( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 156 )
:
1083 case SID_OBJECT_ALIGN_UP( 10000 + 134 ):
1084 alignControlsWithUndo(RID_STR_UNDO_ALIGNMENTreinterpret_cast<char const *>("RID_STR_UNDO_ALIGNMENT"
"\004" u8"Change Alignment")
,ControlModification::TOP,SID_SECTION_ALIGN_UP( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 156 )
== _nId);
1085 break;
1086 case SID_SECTION_ALIGN_MIDDLE( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 157 )
:
1087 case SID_OBJECT_ALIGN_MIDDLE( 10000 + 135 ):
1088 alignControlsWithUndo(RID_STR_UNDO_ALIGNMENTreinterpret_cast<char const *>("RID_STR_UNDO_ALIGNMENT"
"\004" u8"Change Alignment")
,ControlModification::CENTER_VERTICAL,SID_SECTION_ALIGN_MIDDLE( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 157 )
== _nId);
1089 break;
1090 case SID_SECTION_ALIGN_DOWN( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 158 )
:
1091 case SID_OBJECT_ALIGN_DOWN( 10000 + 136 ):
1092 alignControlsWithUndo(RID_STR_UNDO_ALIGNMENTreinterpret_cast<char const *>("RID_STR_UNDO_ALIGNMENT"
"\004" u8"Change Alignment")
,ControlModification::BOTTOM,SID_SECTION_ALIGN_DOWN( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 158 )
== _nId);
1093 break;
1094
1095 case SID_SECTION_SHRINK_BOTTOM( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 165 )
:
1096 case SID_SECTION_SHRINK_TOP( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 164 )
:
1097 case SID_SECTION_SHRINK( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 163 )
:
1098 {
1099 uno::Reference<report::XSection> xSection = getDesignView()->getCurrentSection();
1100 shrinkSection(RID_STR_UNDO_SHRINKreinterpret_cast<char const *>("RID_STR_UNDO_SHRINK" "\004"
u8"Shrink Section")
, xSection, _nId);
1101 }
1102 break;
1103
1104 case SID_SELECTALL(5000 + 723):
1105 getDesignView()->SelectAll(OBJ_NONE);
1106 break;
1107 case SID_SELECTALL_IN_SECTION( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 149 )
:
1108 {
1109 OSectionView* pSectionView = getCurrentSectionView();
1110 if ( pSectionView )
1111 pSectionView->MarkAll();
1112 }
1113 break;
1114 case SID_ESCAPE( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 21 )
:
1115 getDesignView()->SetMode(DlgEdMode::Select);
1116 InvalidateFeature( SID_OBJECT_SELECT( 10000 + 128 ) );
1117 break;
1118 case SID_SELECT_ALL_EDITS( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 162 )
:
1119 getDesignView()->SelectAll(OBJ_DLG_FORMATTEDFIELD(sal_uInt16(OBJ_MAXI) + 3));
1120 break;
1121 case SID_SELECT_ALL_LABELS( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 161 )
:
1122 getDesignView()->SelectAll(OBJ_DLG_FIXEDTEXT(sal_uInt16(OBJ_MAXI) + 1));
1123 break;
1124 case SID_TERMINATE_INPLACEACTIVATION(5000 + 1702):
1125 {
1126 OSectionWindow* pSection = getDesignView()->getMarkedSection();
1127 if ( pSection )
1128 pSection->getReportSection().deactivateOle();
1129 }
1130 break;
1131 case SID_SELECT(5000 + 720):
1132 if ( aArgs.getLength() == 1 )
1133 select(aArgs[0].Value);
1134 break;
1135 case SID_SELECT_REPORT( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 12 )
:
1136 select(uno::makeAny(m_xReportDefinition));
1137 break;
1138 case SID_EXECUTE_REPORT( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 19 )
:
1139 getView()->PostUserEvent(LINK(this, OReportController,OnExecuteReport)::tools::detail::makeLink( ::tools::detail::castTo<OReportController
*>(this), &OReportController::LinkStubOnExecuteReport
)
);
1140 break;
1141 case SID_RPT_NEW_FUNCTION( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 142 )
:
1142 createNewFunction(aArgs[0].Value);
1143 break;
1144 case SID_COLLAPSE_SECTION( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 167 )
:
1145 collapseSection(true);
1146 break;
1147 case SID_EXPAND_SECTION( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 168 )
:
1148 collapseSection(false);
1149 break;
1150 case SID_NEXT_MARK( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 159 )
:
1151 markSection(true);
1152 break;
1153 case SID_PREV_MARK( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 160 )
:
1154 markSection(false);
1155 break;
1156 case SID_DELETE(5000 + 713):
1157 if ( aArgs.getLength() == 1 )
1158 {
1159 uno::Reference< report::XFunction> xFunction;
1160 aArgs[0].Value >>= xFunction;
1161 if ( xFunction.is() )
1162 {
1163 uno::Reference< report::XFunctions> xFunctions(xFunction->getParent(),uno::UNO_QUERY_THROW);
1164 sal_Int32 nIndex = getPositionInIndexAccess(xFunctions.get(),xFunction);
1165 const OUString sUndoAction = RptResId(RID_STR_UNDO_REMOVE_FUNCTIONreinterpret_cast<char const *>("RID_STR_UNDO_REMOVE_FUNCTION"
"\004" u8"Delete Function")
);
1166 UndoContext aUndoContext( getUndoManager(), sUndoAction );
1167 xFunctions->removeByIndex(nIndex);
1168 select(uno::makeAny(xFunctions->getParent()));
1169 InvalidateFeature( SID_UNDO(5000 + 701) );
1170 }
1171 }
1172 else
1173 executeMethodWithUndo(RID_STR_UNDO_REMOVE_SELECTIONreinterpret_cast<char const *>("RID_STR_UNDO_REMOVE_SELECTION"
"\004" u8"Delete Selection")
,::std::mem_fn(&ODesignView::Delete));
1174 break;
1175 case SID_GRID_USE(27000 +154):
1176 m_bGridUse = !m_bGridUse;
1177 getDesignView()->setGridSnap(m_bGridUse);
1178 break;
1179 case SID_HELPLINES_MOVE(27000 +153):
1180 m_bHelplinesMove = !m_bHelplinesMove;
1181 getDesignView()->setDragStripes(m_bHelplinesMove);
1182 break;
1183 case SID_GRID_VISIBLE(27000 +322):
1184 m_bGridVisible = !m_bGridVisible;
1185 getDesignView()->toggleGrid(m_bGridVisible);
1186 break;
1187 case SID_RULER(27000 +40):
1188 m_bShowRuler = !m_bShowRuler;
1189 getDesignView()->showRuler(m_bShowRuler);
1190 break;
1191 case SID_OBJECT_SELECT( 10000 + 128 ):
1192 getDesignView()->SetMode(DlgEdMode::Select);
1193 InvalidateAll();
1194 break;
1195 case SID_INSERT_DIAGRAM( 10000 + 140 ):
1196 getDesignView()->SetMode( DlgEdMode::Insert );
1197 getDesignView()->SetInsertObj( OBJ_OLE2);
1198 createDefaultControl(aArgs);
1199 InvalidateAll();
1200 break;
1201 case SID_FM_FIXEDTEXT( 10000 + 597 ):
1202 getDesignView()->SetMode( DlgEdMode::Insert );
1203 getDesignView()->SetInsertObj( OBJ_DLG_FIXEDTEXT(sal_uInt16(OBJ_MAXI) + 1) );
1204 createDefaultControl(aArgs);
1205 InvalidateAll();
1206 break;
1207 case SID_INSERT_HFIXEDLINE( 10000 + 928 ):
1208 getDesignView()->SetMode( DlgEdMode::Insert );
1209 getDesignView()->SetInsertObj( OBJ_DLG_HFIXEDLINE(sal_uInt16(OBJ_MAXI) + 4) );
1210 createDefaultControl(aArgs);
1211 InvalidateAll();
1212 break;
1213 case SID_INSERT_VFIXEDLINE( 10000 + 929 ):
1214 getDesignView()->SetMode( DlgEdMode::Insert );
1215 getDesignView()->SetInsertObj( OBJ_DLG_VFIXEDLINE(sal_uInt16(OBJ_MAXI) + 5) );
1216 createDefaultControl(aArgs);
1217 InvalidateAll();
1218 break;
1219 case SID_FM_EDIT( 10000 + 599 ):
1220 getDesignView()->SetMode( DlgEdMode::Insert );
1221 getDesignView()->SetInsertObj( OBJ_DLG_FORMATTEDFIELD(sal_uInt16(OBJ_MAXI) + 3) );
1222 createDefaultControl(aArgs);
1223 InvalidateAll();
1224 break;
1225 case SID_FM_IMAGECONTROL( 10000 + 710 ):
1226 getDesignView()->SetMode( DlgEdMode::Insert );
1227 getDesignView()->SetInsertObj( OBJ_DLG_IMAGECONTROLOBJ_FM_IMAGECONTROL );
1228 createDefaultControl(aArgs);
1229 InvalidateAll();
1230 break;
1231 case SID_DRAWTBX_CS_BASIC( 10000 + 1047 ):
1232 case SID_DRAWTBX_CS_BASIC1( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 26 )
:
1233 case SID_DRAWTBX_CS_BASIC2( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 27 )
:
1234 case SID_DRAWTBX_CS_BASIC3( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 28 )
:
1235 case SID_DRAWTBX_CS_BASIC4( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 29 )
:
1236 case SID_DRAWTBX_CS_BASIC5( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 30 )
:
1237 case SID_DRAWTBX_CS_BASIC6( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 31 )
:
1238 case SID_DRAWTBX_CS_BASIC7( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 32 )
:
1239 case SID_DRAWTBX_CS_BASIC8( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 33 )
:
1240 case SID_DRAWTBX_CS_BASIC9( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 34 )
:
1241 case SID_DRAWTBX_CS_BASIC10( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 35 )
:
1242 case SID_DRAWTBX_CS_BASIC11( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 36 )
:
1243 case SID_DRAWTBX_CS_BASIC12( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 37 )
:
1244 case SID_DRAWTBX_CS_BASIC13( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 38 )
:
1245 case SID_DRAWTBX_CS_BASIC14( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 39 )
:
1246 case SID_DRAWTBX_CS_BASIC15( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 40 )
:
1247 case SID_DRAWTBX_CS_BASIC16( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 41 )
:
1248 case SID_DRAWTBX_CS_BASIC17( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 42 )
:
1249 case SID_DRAWTBX_CS_BASIC18( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 43 )
:
1250 case SID_DRAWTBX_CS_BASIC19( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 44 )
:
1251 case SID_DRAWTBX_CS_BASIC20( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 45 )
:
1252 case SID_DRAWTBX_CS_BASIC21( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 46 )
:
1253 case SID_DRAWTBX_CS_BASIC22( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 47 )
:
1254 case SID_DRAWTBX_CS_SYMBOL1( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 48 )
:
1255 case SID_DRAWTBX_CS_SYMBOL2( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 49 )
:
1256 case SID_DRAWTBX_CS_SYMBOL3( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 50 )
:
1257 case SID_DRAWTBX_CS_SYMBOL4( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 51 )
:
1258 case SID_DRAWTBX_CS_SYMBOL5( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 52 )
:
1259 case SID_DRAWTBX_CS_SYMBOL6( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 53 )
:
1260 case SID_DRAWTBX_CS_SYMBOL7( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 54 )
:
1261 case SID_DRAWTBX_CS_SYMBOL8( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 55 )
:
1262 case SID_DRAWTBX_CS_SYMBOL9( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 56 )
:
1263 case SID_DRAWTBX_CS_SYMBOL10( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 57 )
:
1264 case SID_DRAWTBX_CS_SYMBOL11( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 58 )
:
1265 case SID_DRAWTBX_CS_SYMBOL12( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 59 )
:
1266 case SID_DRAWTBX_CS_SYMBOL13( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 60 )
:
1267 case SID_DRAWTBX_CS_SYMBOL14( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 61 )
:
1268 case SID_DRAWTBX_CS_SYMBOL15( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 62 )
:
1269 case SID_DRAWTBX_CS_SYMBOL16( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 63 )
:
1270 case SID_DRAWTBX_CS_SYMBOL17( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 64 )
:
1271 case SID_DRAWTBX_CS_SYMBOL18( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 65 )
:
1272 case SID_DRAWTBX_CS_ARROW1( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 66 )
:
1273 case SID_DRAWTBX_CS_ARROW2( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 67 )
:
1274 case SID_DRAWTBX_CS_ARROW3( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 68 )
:
1275 case SID_DRAWTBX_CS_ARROW4( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 69 )
:
1276 case SID_DRAWTBX_CS_ARROW5( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 70 )
:
1277 case SID_DRAWTBX_CS_ARROW6( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 71 )
:
1278 case SID_DRAWTBX_CS_ARROW7( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 72 )
:
1279 case SID_DRAWTBX_CS_ARROW8( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 73 )
:
1280 case SID_DRAWTBX_CS_ARROW9( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 74 )
:
1281 case SID_DRAWTBX_CS_ARROW10( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 75 )
:
1282 case SID_DRAWTBX_CS_ARROW11( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 76 )
:
1283 case SID_DRAWTBX_CS_ARROW12( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 77 )
:
1284 case SID_DRAWTBX_CS_ARROW13( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 78 )
:
1285 case SID_DRAWTBX_CS_ARROW14( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 79 )
:
1286 case SID_DRAWTBX_CS_ARROW15( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 80 )
:
1287 case SID_DRAWTBX_CS_ARROW16( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 81 )
:
1288 case SID_DRAWTBX_CS_ARROW17( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 82 )
:
1289 case SID_DRAWTBX_CS_ARROW18( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 83 )
:
1290 case SID_DRAWTBX_CS_ARROW19( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 84 )
:
1291 case SID_DRAWTBX_CS_ARROW20( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 85 )
:
1292 case SID_DRAWTBX_CS_ARROW21( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 86 )
:
1293 case SID_DRAWTBX_CS_ARROW22( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 87 )
:
1294 case SID_DRAWTBX_CS_ARROW23( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 88 )
:
1295 case SID_DRAWTBX_CS_ARROW24( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 89 )
:
1296 case SID_DRAWTBX_CS_ARROW25( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 90 )
:
1297 case SID_DRAWTBX_CS_ARROW26( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 91 )
:
1298 case SID_DRAWTBX_CS_STAR1( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 92 )
:
1299 case SID_DRAWTBX_CS_STAR2( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 93 )
:
1300 case SID_DRAWTBX_CS_STAR3( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 94 )
:
1301 case SID_DRAWTBX_CS_STAR4( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 95 )
:
1302 case SID_DRAWTBX_CS_STAR5( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 96 )
:
1303 case SID_DRAWTBX_CS_STAR6( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 97 )
:
1304 case SID_DRAWTBX_CS_STAR7( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 98 )
:
1305 case SID_DRAWTBX_CS_STAR8( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 99 )
:
1306 case SID_DRAWTBX_CS_STAR9( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 100 )
:
1307 case SID_DRAWTBX_CS_STAR10( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 101 )
:
1308 case SID_DRAWTBX_CS_STAR11( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 102 )
:
1309 case SID_DRAWTBX_CS_STAR12( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 103 )
:
1310 case SID_DRAWTBX_CS_FLOWCHART1( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 104 )
:
1311 case SID_DRAWTBX_CS_FLOWCHART2( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 105 )
:
1312 case SID_DRAWTBX_CS_FLOWCHART3( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 106 )
:
1313 case SID_DRAWTBX_CS_FLOWCHART4( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 107 )
:
1314 case SID_DRAWTBX_CS_FLOWCHART5( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 108 )
:
1315 case SID_DRAWTBX_CS_FLOWCHART6( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 109 )
:
1316 case SID_DRAWTBX_CS_FLOWCHART7( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 110 )
:
1317 case SID_DRAWTBX_CS_FLOWCHART8( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 111 )
:
1318 case SID_DRAWTBX_CS_FLOWCHART9( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 112 )
:
1319 case SID_DRAWTBX_CS_FLOWCHART10( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 113 )
:
1320 case SID_DRAWTBX_CS_FLOWCHART11( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 114 )
:
1321 case SID_DRAWTBX_CS_FLOWCHART12( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 115 )
:
1322 case SID_DRAWTBX_CS_FLOWCHART13( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 116 )
:
1323 case SID_DRAWTBX_CS_FLOWCHART14( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 117 )
:
1324 case SID_DRAWTBX_CS_FLOWCHART15( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 118 )
:
1325 case SID_DRAWTBX_CS_FLOWCHART16( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 119 )
:
1326 case SID_DRAWTBX_CS_FLOWCHART17( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 120 )
:
1327 case SID_DRAWTBX_CS_FLOWCHART18( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 121 )
:
1328 case SID_DRAWTBX_CS_FLOWCHART19( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 122 )
:
1329 case SID_DRAWTBX_CS_FLOWCHART20( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 123 )
:
1330 case SID_DRAWTBX_CS_FLOWCHART21( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 124 )
:
1331 case SID_DRAWTBX_CS_FLOWCHART22( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 125 )
:
1332 case SID_DRAWTBX_CS_FLOWCHART23( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 126 )
:
1333 case SID_DRAWTBX_CS_FLOWCHART24( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 127 )
:
1334 case SID_DRAWTBX_CS_FLOWCHART25( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 128 )
:
1335 case SID_DRAWTBX_CS_FLOWCHART26( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 129 )
:
1336 case SID_DRAWTBX_CS_FLOWCHART27( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 130 )
:
1337 case SID_DRAWTBX_CS_FLOWCHART28( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 131 )
:
1338 case SID_DRAWTBX_CS_CALLOUT1( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 132 )
:
1339 case SID_DRAWTBX_CS_CALLOUT2( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 133 )
:
1340 case SID_DRAWTBX_CS_CALLOUT3( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 134 )
:
1341 case SID_DRAWTBX_CS_CALLOUT4( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 135 )
:
1342 case SID_DRAWTBX_CS_CALLOUT5( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 136 )
:
1343 case SID_DRAWTBX_CS_CALLOUT6( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 137 )
:
1344 case SID_DRAWTBX_CS_CALLOUT7( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 138 )
:
1345 case SID_DRAWTBX_CS_SYMBOL( 10000 + 1048 ):
1346 case SID_DRAWTBX_CS_ARROW( 10000 + 1049 ):
1347 case SID_DRAWTBX_CS_FLOWCHART( 10000 + 1050 ):
1348 case SID_DRAWTBX_CS_CALLOUT( 10000 + 1051 ):
1349 case SID_DRAWTBX_CS_STAR( 10000 + 1052 ):
1350 getDesignView()->SetMode( DlgEdMode::Insert );
1351 {
1352 URL aUrl = getURLForId(_nId);
1353 sal_Int32 nIndex = 1;
1354 OUString sType = aUrl.Complete.getToken(0,'.',nIndex);
1355 if ( nIndex == -1 || sType.isEmpty() )
1356 {
1357 switch(_nId)
1358 {
1359 case SID_DRAWTBX_CS_SYMBOL( 10000 + 1048 ):
1360 sType = "smiley";
1361 break;
1362 case SID_DRAWTBX_CS_ARROW( 10000 + 1049 ):
1363 sType = "left-right-arrow";
1364 break;
1365 case SID_DRAWTBX_CS_FLOWCHART( 10000 + 1050 ):
1366 sType = "flowchart-internal-storage";
1367 break;
1368 case SID_DRAWTBX_CS_CALLOUT( 10000 + 1051 ):
1369 sType = "round-rectangular-callout";
1370 break;
1371 case SID_DRAWTBX_CS_STAR( 10000 + 1052 ):
1372 sType = "star5";
1373 break;
1374 default:
1375 sType = "diamond";
1376 }
1377 }
1378 else
1379 sType = aUrl.Complete.getToken(0,'.',nIndex);
1380
1381 getDesignView()->SetInsertObj( OBJ_CUSTOMSHAPE ,sType);
1382 createDefaultControl(aArgs);
1383 }
1384 InvalidateAll();
1385 break;
1386 case SID_RPT_SHOWREPORTEXPLORER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 141 )
:
1387 if ( isUiVisible() )
1388 getDesignView()->toggleReportExplorer();
1389 break;
1390 case SID_FM_ADD_FIELD( 10000 + 623 ):
1391 if ( isUiVisible() )
1392 getDesignView()->toggleAddField();
1393 break;
1394 case SID_SHOW_PROPERTYBROWSER( 10000 + 943 ):
1395 if ( m_bShowProperties )
1396 m_sLastActivePage = getDesignView()->getCurrentPage();
1397 else
1398 getDesignView()->setCurrentPage(m_sLastActivePage);
1399
1400 if ( isUiVisible() )
1401 {
1402 m_bShowProperties = !m_bShowProperties;
1403 if ( aArgs.getLength() == 1 )
1404 aArgs[0].Value >>= m_bShowProperties;
1405
1406 getDesignView()->togglePropertyBrowser(m_bShowProperties);
1407 }
1408 break;
1409 case SID_PROPERTYBROWSER_LAST_PAGE( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 24 )
: // nothing to do
1410 m_sLastActivePage = getDesignView()->getCurrentPage();
1411 break;
1412 case SID_SPLIT_POSITION( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 23 )
:
1413 getDesignView()->Resize();
1414 break;
1415 case SID_PAGEDIALOG( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 5 )
:
1416 case SID_ATTR_CHAR_COLOR_BACKGROUND(10000 + 489):
1417 {
1418 uno::Reference<report::XSection> xSection;
1419 if (aArgs.getLength() == 1 )
1420 aArgs[0].Value >>= xSection;
1421 else if (_nId == SID_ATTR_CHAR_COLOR_BACKGROUND(10000 + 489))
1422 xSection.set(getDesignView()->getMarkedSection()->getReportSection().getSection());
1423 openPageDialog(xSection);
1424 bForceBroadcast = true;
1425 }
1426 break;
1427 case SID_SORTINGANDGROUPING( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 2 )
:
1428 openSortingAndGroupingDialog();
1429 break;
1430 case SID_BACKGROUND_COLORTypedWhichId<SvxColorItem>( 10000 + 186 ):
1431 {
1432 const util::Color aColor( lcl_extractBackgroundColor( aArgs ) );
1433 if ( !impl_setPropertyAtControls_throw(RID_STR_UNDO_CHANGEFONTreinterpret_cast<char const *>("RID_STR_UNDO_CHANGEFONT"
"\004" u8"Change font")
,PROPERTY_CONTROLBACKGROUND"ControlBackground",uno::makeAny(aColor),aArgs) )
1434 {
1435 uno::Reference< report::XSection > xSection = getDesignView()->getCurrentSection();
1436 if ( xSection.is() )
1437 {
1438 xSection->setBackColor( aColor );
1439 }
1440 }
1441 bForceBroadcast = true;
1442 }
1443 break;
1444 case SID_ATTR_CHAR_WEIGHT( 10000 + 9 ):
1445 case SID_ATTR_CHAR_POSTURE( 10000 + 8 ):
1446 case SID_ATTR_CHAR_UNDERLINE( 10000 + 14 ):
1447 {
1448 uno::Reference< awt::XWindow> xWindow;
1449 ::std::vector< uno::Reference< uno::XInterface > > aControlsFormats;
1450 lcl_getReportControlFormat( aArgs, getDesignView(), xWindow, aControlsFormats );
1451
1452 const OUString sUndoAction(RptResId(RID_STR_UNDO_CHANGEFONTreinterpret_cast<char const *>("RID_STR_UNDO_CHANGEFONT"
"\004" u8"Change font")
));
1453 UndoContext aUndoContext( getUndoManager(), sUndoAction );
1454
1455 for (const auto& rxControlFormat : aControlsFormats)
1456 {
1457 uno::Reference< report::XReportControlFormat> xReportControlFormat(rxControlFormat,uno::UNO_QUERY);
1458 lcl_setFontWPU_nothrow(xReportControlFormat,_nId);
1459 }
1460 }
1461 break;
1462 case SID_ATTR_CHAR_COLOR( 10000 + 17 ):
1463 case SID_ATTR_CHAR_COLOR2(10000 + 537):
1464 case SID_ATTR_CHAR_COLOR_EXT(10000 + 488):
1465 {
1466 const SequenceAsHashMap aMap(aArgs);
1467 const util::Color aColor = aMap.getUnpackedValueOrDefault(PROPERTY_FONTCOLOR"FontColor",util::Color());
1468 impl_setPropertyAtControls_throw(RID_STR_UNDO_CHANGEFONTreinterpret_cast<char const *>("RID_STR_UNDO_CHANGEFONT"
"\004" u8"Change font")
,PROPERTY_CHARCOLOR"CharColor",uno::makeAny(aColor),aArgs);
1469 bForceBroadcast = true;
1470 }
1471 break;
1472 case SID_ATTR_CHAR_FONT( 10000 + 7 ):
1473 if ( aArgs.getLength() == 1 )
1474 {
1475 awt::FontDescriptor aFont;
1476 if ( aArgs[0].Value >>= aFont )
1477 {
1478 impl_setPropertyAtControls_throw(RID_STR_UNDO_CHANGEFONTreinterpret_cast<char const *>("RID_STR_UNDO_CHANGEFONT"
"\004" u8"Change font")
,PROPERTY_CHARFONTNAME"CharFontName",uno::makeAny(aFont.Name),aArgs);
1479 }
1480 }
1481 break;
1482 case SID_ATTR_CHAR_FONTHEIGHT( 10000 + 15 ):
1483 if ( aArgs.getLength() == 1 )
1484 {
1485 float fSelVal = 0.0;
1486 if ( aArgs[0].Value >>= fSelVal )
1487 impl_setPropertyAtControls_throw(RID_STR_UNDO_CHANGEFONTreinterpret_cast<char const *>("RID_STR_UNDO_CHANGEFONT"
"\004" u8"Change font")
,PROPERTY_CHARHEIGHT"CharHeight",aArgs[0].Value,aArgs);
1488 }
1489 break;
1490 case SID_ATTR_PARA_ADJUST_LEFT( 10000 + 28 ):
1491 case SID_ATTR_PARA_ADJUST_CENTER( 10000 + 30 ):
1492 case SID_ATTR_PARA_ADJUST_RIGHT( 10000 + 29 ):
1493 case SID_ATTR_PARA_ADJUST_BLOCK( 10000 + 31 ):
1494 {
1495 style::ParagraphAdjust eParagraphAdjust = style::ParagraphAdjust_LEFT;
1496 switch(_nId)
1497 {
1498 case SID_ATTR_PARA_ADJUST_LEFT( 10000 + 28 ):
1499 eParagraphAdjust = style::ParagraphAdjust_LEFT;
1500 break;
1501 case SID_ATTR_PARA_ADJUST_CENTER( 10000 + 30 ):
1502 eParagraphAdjust = style::ParagraphAdjust_CENTER;
1503 break;
1504 case SID_ATTR_PARA_ADJUST_RIGHT( 10000 + 29 ):
1505 eParagraphAdjust = style::ParagraphAdjust_RIGHT;
1506 break;
1507 case SID_ATTR_PARA_ADJUST_BLOCK( 10000 + 31 ):
1508 eParagraphAdjust = style::ParagraphAdjust_BLOCK;
1509 break;
1510 }
1511 impl_setPropertyAtControls_throw(RID_STR_UNDO_ALIGNMENTreinterpret_cast<char const *>("RID_STR_UNDO_ALIGNMENT"
"\004" u8"Change Alignment")
,PROPERTY_PARAADJUST"ParaAdjust",uno::makeAny(static_cast<sal_Int16>(eParagraphAdjust)),aArgs);
1512
1513 InvalidateFeature(SID_ATTR_PARA_ADJUST_LEFT( 10000 + 28 ));
1514 InvalidateFeature(SID_ATTR_PARA_ADJUST_CENTER( 10000 + 30 ));
1515 InvalidateFeature(SID_ATTR_PARA_ADJUST_RIGHT( 10000 + 29 ));
1516 InvalidateFeature(SID_ATTR_PARA_ADJUST_BLOCK( 10000 + 31 ));
1517 }
1518 break;
1519 case SID_CHAR_DLG( 10000 + 296 ):
1520 {
1521 uno::Sequence< beans::NamedValue > aSettings;
1522 uno::Reference< awt::XWindow> xWindow;
1523 ::std::vector< uno::Reference< uno::XInterface > > aControlsFormats;
1524 lcl_getReportControlFormat( aArgs, getDesignView(), xWindow, aControlsFormats );
1525
1526 if ( !aControlsFormats.empty() )
1527 {
1528 const OUString sUndoAction( RptResId( RID_STR_UNDO_CHANGEFONTreinterpret_cast<char const *>("RID_STR_UNDO_CHANGEFONT"
"\004" u8"Change font")
) );
1529 UndoContext aUndoContext( getUndoManager(), sUndoAction );
1530
1531 for (const auto& rxControlFormat : aControlsFormats)
1532 {
1533 uno::Reference< report::XReportControlFormat > xFormat( rxControlFormat, uno::UNO_QUERY );
1534 if ( !xFormat.is() )
1535 continue;
1536
1537 if ( !aSettings.hasElements() )
1538 {
1539 ::rptui::openCharDialog( xFormat, xWindow, aSettings );
1540 if ( !aSettings.hasElements() )
1541 break;
1542 }
1543
1544 applyCharacterSettings( xFormat, aSettings );
1545 }
1546
1547 InvalidateAll();
1548 }
1549 }
1550 break;
1551 case SID_INSERT_GRAPHICTypedWhichId<SfxStringItem>( 10000 + 241 ):
1552 insertGraphic();
1553 break;
1554 case SID_SETCONTROLDEFAULTS( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 6 )
:
1555 break;
1556 case SID_CONDITIONALFORMATTING( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 4 )
:
1557 {
1558 uno::Reference< report::XFormattedField> xFormattedField(getDesignView()->getCurrentControlModel(),uno::UNO_QUERY);
1559 if ( xFormattedField.is() )
1560 {
1561 ConditionalFormattingDialog aDlg(getFrameWeld(), xFormattedField.get(), *this);
1562 aDlg.run();
1563 }
1564 }
1565 break;
1566 case SID_DATETIME( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 20 )
:
1567 if ( m_xReportDefinition.is() )
1568 {
1569 if ( !aArgs.hasElements() )
1570 {
1571 ODateTimeDialog aDlg(getFrameWeld(), getDesignView()->getCurrentSection(), this);
1572 aDlg.run();
1573 }
1574 else
1575 createDateTime(aArgs);
1576 }
1577 break;
1578 case SID_INSERT_FLD_PGNUMBER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 3 )
:
1579 if ( m_xReportDefinition.is() )
1580 {
1581 if ( !aArgs.hasElements() )
1582 {
1583 OPageNumberDialog aDlg(getFrameWeld(), m_xReportDefinition, this);
1584 aDlg.run();
1585 }
1586 else
1587 createPageNumber(aArgs);
1588 }
1589 break;
1590 case SID_EXPORTDOC(5000 + 829):
1591 case SID_EXPORTDOCASPDF(5000 + 1673):
1592 case SID_PRINTPREVIEW(5000 + 325):
1593 break;
1594 case SID_EDITDOC(5000 + 1312):
1595 if(isEditable())
1596 { // the state should be changed to not editable
1597 setModified(false); // and we are not modified yet
1598 }
1599 setEditable(!isEditable());
1600 InvalidateAll();
1601 return;
1602 case SID_GROUP( 10000 + 454 ):
1603 break;
1604 case SID_ATTR_ZOOMTypedWhichId<SvxZoomItem>(10000 + 0):
1605 if ( !aArgs.hasElements() )
1606 {
1607 openZoomDialog();
1608 }
1609 else if ( aArgs.getLength() == 1 && aArgs[0].Name == "Zoom" )
1610 {
1611 SvxZoomItem aZoomItem;
1612 aZoomItem.PutValue(aArgs[0].Value, 0);
1613 m_nZoomValue = aZoomItem.GetValue();
1614 m_eZoomType = aZoomItem.GetType();
1615 impl_zoom_nothrow();
1616 }
1617 break;
1618 case SID_ATTR_ZOOMSLIDER( 10000 + 1065 ):
1619 if ( aArgs.getLength() == 1 && aArgs[0].Name == "ZoomSlider" )
1620 {
1621 SvxZoomSliderItem aZoomSlider;
1622 aZoomSlider.PutValue(aArgs[0].Value, 0);
1623 m_nZoomValue = aZoomSlider.GetValue();
1624 m_eZoomType = SvxZoomType::PERCENT;
1625 impl_zoom_nothrow();
1626 }
1627 break;
1628 default:
1629 OReportController_BASE::Execute(_nId,aArgs);
1630 }
1631 InvalidateFeature(_nId,Reference< XStatusListener >(),bForceBroadcast);
1632}
1633
1634void OReportController::impl_initialize( )
1635{
1636 OReportController_BASE::impl_initialize();
1637
1638 const ::comphelper::NamedValueCollection& rArguments( getInitParams() );
1639
1640 rArguments.get_ensureType( PROPERTY_REPORTNAME"ReportName", m_sName );
1641 if ( m_sName.isEmpty() )
1642 rArguments.get_ensureType( "DocumentTitle", m_sName );
1643
1644 try
1645 {
1646 if ( m_xReportDefinition.is() )
1647 {
1648 getView()->initialize(); // show the windows and fill with our information
1649
1650 m_aReportModel = reportdesign::OReportDefinition::getSdrModel(m_xReportDefinition);
1651 if ( !m_aReportModel )
1652 throw RuntimeException();
1653 m_aReportModel->attachController( *this );
1654
1655 clearUndoManager();
1656 UndoSuppressor aSuppressUndo( getUndoManager() );
1657
1658 ::comphelper::NamedValueCollection aArgs(getModel()->getArgs());
1659 setMode(aArgs.getOrDefault("Mode", OUString("normal")));
1660
1661 listen(true);
1662 setEditable( !m_aReportModel->IsReadOnly() );
1663 m_xFormatter.set(util::NumberFormatter::create(m_xContext), UNO_QUERY_THROW);
1664 m_xFormatter->attachNumberFormatsSupplier(Reference< XNumberFormatsSupplier>(m_xReportDefinition,uno::UNO_QUERY));
1665
1666 utl::MediaDescriptor aDescriptor( m_xReportDefinition->getArgs() );
1667 OUString sHierarchicalDocumentName = aDescriptor.getUnpackedValueOrDefault("HierarchicalDocumentName",OUString());
1668
1669 if ( sHierarchicalDocumentName.isEmpty() && getConnection().is() )
1670 {
1671 uno::Reference<sdbcx::XTablesSupplier> xTablesSup(getConnection(),uno::UNO_QUERY_THROW);
1672 uno::Reference<container::XNameAccess> xTables = xTablesSup->getTables();
1673 const uno::Sequence< OUString > aNames( xTables->getElementNames() );
1674
1675 if ( aNames.hasElements() )
1676 {
1677 m_xReportDefinition->setCommand(aNames[0]);
1678 m_xReportDefinition->setCommandType(sdb::CommandType::TABLE);
1679 }
1680 }
1681
1682 m_aVisualAreaSize = m_xReportDefinition->getVisualAreaSize(0);
1683
1684 }
1685
1686 // check if chart is supported by the engine
1687 checkChartEnabled();
1688 // restore the view data
1689 getDesignView()->toggleGrid(m_bGridVisible);
1690 getDesignView()->showRuler(m_bShowRuler);
1691 getDesignView()->togglePropertyBrowser(m_bShowProperties);
1692 getDesignView()->setCurrentPage(m_sLastActivePage);
1693 getDesignView()->unmarkAllObjects();
1694
1695 if ( m_nPageNum != -1 )
1696 {
1697 if ( m_nPageNum < m_aReportModel->GetPageCount() )
1698 {
1699 const OReportPage* pPage = dynamic_cast<OReportPage*>(m_aReportModel->GetPage(static_cast<sal_uInt16>(m_nPageNum)));
1700 if ( pPage )
1701 {
1702 uno::Sequence< beans::PropertyValue> aArgs(1);
1703 aArgs[0].Value <<= pPage->getSection();
1704 executeUnChecked(SID_SELECT(5000 + 720),aArgs);
1705 }
1706 }
1707 else
1708 m_nPageNum = -1;
1709 }
1710 getDesignView()->collapseSections(m_aCollapsedSections);
1711 impl_zoom_nothrow();
1712 getDesignView()->Resize();
1713 getDesignView()->Invalidate();
1714 InvalidateAll();
1715
1716 if ( m_bShowProperties && m_nPageNum == -1 )
1717 {
1718 m_sLastActivePage = "Data";
1719 getDesignView()->setCurrentPage(m_sLastActivePage);
1720 uno::Sequence< beans::PropertyValue> aArgs;
1721 executeUnChecked(SID_SELECT_REPORT( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 12 )
,aArgs);
1722 }
1723
1724 setModified(false); // and we are not modified yet
1725 }
1726 catch(const SQLException&)
1727 {
1728 DBG_UNHANDLED_EXCEPTION("reportdesign")DbgUnhandledException( DbgGetCaughtException(), __func__, "/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "1728" ": ", "reportdesign" );
;
1729 }
1730}
1731
1732IMPL_LINK( OReportController, OnCreateHdl, OAddFieldWindow& ,_rAddFieldDlg, void)void OReportController::LinkStubOnCreateHdl(void * instance, OAddFieldWindow
& data) { return static_cast<OReportController *>(instance
)->OnCreateHdl(data); } void OReportController::OnCreateHdl
(OAddFieldWindow& _rAddFieldDlg)
1733{
1734 weld::WaitObject aObj(getFrameWeld());
1735 uno::Sequence< beans::PropertyValue > aArgs = _rAddFieldDlg.getSelectedFieldDescriptors();
1736 // we use this way to create undo actions
1737 if ( aArgs.hasElements() )
1738 {
1739 executeChecked(SID_ADD_CONTROL_PAIR( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 22 )
,aArgs);
1740 }
1741}
1742
1743bool OReportController::Construct(vcl::Window* pParent)
1744{
1745 VclPtrInstance<ODesignView> pMyOwnView( pParent, m_xContext, *this );
1
Calling constructor for 'VclPtrInstance<rptui::ODesignView>'
3
Returning from constructor for 'VclPtrInstance<rptui::ODesignView>'
1746 StartListening( *pMyOwnView );
1747 setView( pMyOwnView );
4
Calling implicit destructor for 'VclPtr<dbaui::ODataView>'
5
Calling '~Reference'
12
Returning from '~Reference'
13
Returning from destructor for 'VclPtr<dbaui::ODataView>'
1748
1749 // now that we have a view we can create the clipboard listener
1750 m_aSystemClipboard = TransferableDataHelper::CreateFromSystemClipboard( getView() );
1751 m_aSystemClipboard.StartClipboardListening( );
1752 m_pClipboardNotifier = new TransferableClipboardListener( LINK( this, OReportController, OnClipboardChanged )::tools::detail::makeLink( ::tools::detail::castTo<OReportController
*>(this), &OReportController::LinkStubOnClipboardChanged
)
);
1753 m_pClipboardNotifier->AddListener( getView() );
1754
1755 OReportController_BASE::Construct(pParent);
1756 return true;
14
Calling implicit destructor for 'VclPtrInstance<rptui::ODesignView>'
15
Calling implicit destructor for 'VclPtr<rptui::ODesignView>'
16
Calling '~Reference'
1757}
1758
1759sal_Bool SAL_CALL OReportController::suspend(sal_Bool /*_bSuspend*/)
1760{
1761 if ( getBroadcastHelper().bInDispose || getBroadcastHelper().bDisposed )
1762 return true;
1763
1764 SolarMutexGuard aSolarGuard;
1765 ::osl::MutexGuard aGuard( getMutex() );
1766
1767 if ( getView() && getView()->IsInModalMode() )
1768 return false;
1769
1770 // this suspend will be handled in the DBAccess interceptor implementation
1771 return true;
1772}
1773
1774void OReportController::describeSupportedFeatures()
1775{
1776 DBSubComponentController::describeSupportedFeatures();
1777
1778 implDescribeSupportedFeature( ".uno:TextDocument", SID_RPT_TEXTDOCUMENT( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 139 )
, CommandGroup::APPLICATION );
1779 implDescribeSupportedFeature( ".uno:Spreadsheet", SID_RPT_SPREADSHEET( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 140 )
, CommandGroup::APPLICATION );
1780
1781 implDescribeSupportedFeature( ".uno:Redo", SID_REDO(5000 + 700), CommandGroup::EDIT );
1782 implDescribeSupportedFeature( ".uno:Undo", SID_UNDO(5000 + 701), CommandGroup::EDIT );
1783 implDescribeSupportedFeature( ".uno:SelectAll", SID_SELECTALL(5000 + 723), CommandGroup::EDIT );
1784 implDescribeSupportedFeature( ".uno:SelectAllInSection", SID_SELECTALL_IN_SECTION( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 149 )
, CommandGroup::EDIT );
1785 implDescribeSupportedFeature( ".uno:Delete", SID_DELETE(5000 + 713), CommandGroup::EDIT );
1786 implDescribeSupportedFeature( ".uno:SelectReport", SID_SELECT_REPORT( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 12 )
, CommandGroup::EDIT );
1787 implDescribeSupportedFeature( ".uno:ExecuteReport", SID_EXECUTE_REPORT( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 19 )
, CommandGroup::EDIT );
1788
1789 implDescribeSupportedFeature( ".uno:GridVisible", SID_GRID_VISIBLE(27000 +322), CommandGroup::VIEW );
1790 implDescribeSupportedFeature( ".uno:GridUse", SID_GRID_USE(27000 +154), CommandGroup::VIEW );
1791 implDescribeSupportedFeature( ".uno:HelplinesMove", SID_HELPLINES_MOVE(27000 +153), CommandGroup::VIEW );
1792 implDescribeSupportedFeature( ".uno:ShowRuler", SID_RULER(27000 +40), CommandGroup::VIEW );
1793 implDescribeSupportedFeature( ".uno:AddField", SID_FM_ADD_FIELD( 10000 + 623 ), CommandGroup::VIEW );
1794 implDescribeSupportedFeature( ".uno:ReportNavigator", SID_RPT_SHOWREPORTEXPLORER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 141 )
, CommandGroup::VIEW );
1795 implDescribeSupportedFeature( ".uno:ControlProperties", SID_SHOW_PROPERTYBROWSER( 10000 + 943 ), CommandGroup::VIEW );
1796 implDescribeSupportedFeature( ".uno:DbSortingAndGrouping", SID_SORTINGANDGROUPING( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 2 )
, CommandGroup::VIEW );
1797 implDescribeSupportedFeature( ".uno:PageHeaderFooter", SID_PAGEHEADERFOOTER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 0 )
, CommandGroup::VIEW );
1798 implDescribeSupportedFeature( ".uno:ReportHeaderFooter", SID_REPORTHEADERFOOTER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 1 )
, CommandGroup::VIEW );
1799 implDescribeSupportedFeature( ".uno:ZoomSlider", SID_ATTR_ZOOMSLIDER( 10000 + 1065 ) );
1800 implDescribeSupportedFeature( ".uno:Zoom", SID_ATTR_ZOOMTypedWhichId<SvxZoomItem>(10000 + 0), CommandGroup::VIEW );
1801
1802 implDescribeSupportedFeature( ".uno:ConditionalFormatting", SID_CONDITIONALFORMATTING( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 4 )
, CommandGroup::FORMAT );
1803 implDescribeSupportedFeature( ".uno:PageDialog", SID_PAGEDIALOG( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 5 )
, CommandGroup::FORMAT );
1804 implDescribeSupportedFeature( ".uno:ResetAttributes", SID_SETCONTROLDEFAULTS( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 6 )
, CommandGroup::FORMAT );
1805
1806 implDescribeSupportedFeature( ".uno:Bold", SID_ATTR_CHAR_WEIGHT( 10000 + 9 ), CommandGroup::FORMAT );
1807 implDescribeSupportedFeature( ".uno:Italic", SID_ATTR_CHAR_POSTURE( 10000 + 8 ), CommandGroup::FORMAT );
1808 implDescribeSupportedFeature( ".uno:Underline", SID_ATTR_CHAR_UNDERLINE( 10000 + 14 ), CommandGroup::FORMAT );
1809 implDescribeSupportedFeature( ".uno:DBBackgroundColor", SID_ATTR_CHAR_COLOR_BACKGROUND(10000 + 489), CommandGroup::FORMAT );
1810 implDescribeSupportedFeature( ".uno:BackgroundColor", SID_BACKGROUND_COLORTypedWhichId<SvxColorItem>( 10000 + 186 ), CommandGroup::FORMAT );
1811 implDescribeSupportedFeature( ".uno:CharColorExt", SID_ATTR_CHAR_COLOR_EXT(10000 + 488));
1812 implDescribeSupportedFeature( ".uno:Color", SID_ATTR_CHAR_COLOR( 10000 + 17 ));
1813 implDescribeSupportedFeature( ".uno:FontColor", SID_ATTR_CHAR_COLOR2(10000 + 537), CommandGroup::FORMAT );
1814 implDescribeSupportedFeature( ".uno:FontDialog", SID_CHAR_DLG( 10000 + 296 ), CommandGroup::FORMAT );
1815 implDescribeSupportedFeature( ".uno:LeftPara", SID_ATTR_PARA_ADJUST_LEFT( 10000 + 28 ), CommandGroup::FORMAT );
1816 implDescribeSupportedFeature( ".uno:CenterPara", SID_ATTR_PARA_ADJUST_CENTER( 10000 + 30 ), CommandGroup::FORMAT );
1817 implDescribeSupportedFeature( ".uno:RightPara", SID_ATTR_PARA_ADJUST_RIGHT( 10000 + 29 ), CommandGroup::FORMAT );
1818 implDescribeSupportedFeature( ".uno:JustifyPara", SID_ATTR_PARA_ADJUST_BLOCK( 10000 + 31 ), CommandGroup::FORMAT );
1819
1820 implDescribeSupportedFeature( ".uno:FontHeight", SID_ATTR_CHAR_FONTHEIGHT( 10000 + 15 ), CommandGroup::FORMAT );
1821 implDescribeSupportedFeature( ".uno:CharFontName", SID_ATTR_CHAR_FONT( 10000 + 7 ), CommandGroup::FORMAT );
1822
1823 implDescribeSupportedFeature( ".uno:ArrangeMenu", SID_ARRANGEMENU( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 148 )
, CommandGroup::FORMAT );
1824 implDescribeSupportedFeature( ".uno:BringToFront", SID_FRAME_TO_TOP( 10000 + 286 ), CommandGroup::FORMAT );
1825 implDescribeSupportedFeature( ".uno:ObjectBackOne", SID_FRAME_DOWN( 10000 + 1119 ), CommandGroup::FORMAT );
1826 implDescribeSupportedFeature( ".uno:ObjectForwardOne", SID_FRAME_UP( 10000 + 1118 ), CommandGroup::FORMAT );
1827 implDescribeSupportedFeature( ".uno:SendToBack", SID_FRAME_TO_BOTTOM( 10000 + 287 ), CommandGroup::FORMAT );
1828 implDescribeSupportedFeature( ".uno:SetObjectToForeground", SID_OBJECT_HEAVEN( 10000 + 283 ), CommandGroup::FORMAT );
1829 implDescribeSupportedFeature( ".uno:SetObjectToBackground", SID_OBJECT_HELL( 10000 + 282 ), CommandGroup::FORMAT );
1830
1831 implDescribeSupportedFeature( ".uno:ObjectAlign", SID_OBJECT_ALIGN( 10000 + 130 ), CommandGroup::FORMAT );
1832 implDescribeSupportedFeature( ".uno:ObjectAlignLeft", SID_OBJECT_ALIGN_LEFT( 10000 + 131 ), CommandGroup::FORMAT );
1833 implDescribeSupportedFeature( ".uno:AlignCenter", SID_OBJECT_ALIGN_CENTER( 10000 + 132 ), CommandGroup::FORMAT );
1834 implDescribeSupportedFeature( ".uno:ObjectAlignRight", SID_OBJECT_ALIGN_RIGHT( 10000 + 133 ), CommandGroup::FORMAT );
1835 implDescribeSupportedFeature( ".uno:AlignUp", SID_OBJECT_ALIGN_UP( 10000 + 134 ), CommandGroup::FORMAT );
1836 implDescribeSupportedFeature( ".uno:AlignMiddle", SID_OBJECT_ALIGN_MIDDLE( 10000 + 135 ), CommandGroup::FORMAT );
1837 implDescribeSupportedFeature( ".uno:AlignDown", SID_OBJECT_ALIGN_DOWN( 10000 + 136 ), CommandGroup::FORMAT );
1838
1839 implDescribeSupportedFeature( ".uno:SectionAlign", SID_SECTION_ALIGN( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 152 )
);
1840 implDescribeSupportedFeature( ".uno:SectionAlignLeft", SID_SECTION_ALIGN_LEFT( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 153 )
, CommandGroup::FORMAT );
1841 implDescribeSupportedFeature( ".uno:SectionAlignCenter", SID_SECTION_ALIGN_CENTER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 154 )
, CommandGroup::FORMAT );
1842 implDescribeSupportedFeature( ".uno:SectionAlignRight", SID_SECTION_ALIGN_RIGHT( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 155 )
, CommandGroup::FORMAT );
1843 implDescribeSupportedFeature( ".uno:SectionAlignTop", SID_SECTION_ALIGN_UP( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 156 )
, CommandGroup::FORMAT );
1844 implDescribeSupportedFeature( ".uno:SectionAlignMiddle", SID_SECTION_ALIGN_MIDDLE( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 157 )
, CommandGroup::FORMAT );
1845 implDescribeSupportedFeature( ".uno:SectionAlignBottom", SID_SECTION_ALIGN_DOWN( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 158 )
, CommandGroup::FORMAT );
1846 implDescribeSupportedFeature( ".uno:SectionShrink", SID_SECTION_SHRINK( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 163 )
, CommandGroup::FORMAT );
1847 implDescribeSupportedFeature( ".uno:SectionShrinkTop", SID_SECTION_SHRINK_TOP( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 164 )
, CommandGroup::FORMAT );
1848 implDescribeSupportedFeature( ".uno:SectionShrinkBottom", SID_SECTION_SHRINK_BOTTOM( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 165 )
, CommandGroup::FORMAT );
1849
1850 implDescribeSupportedFeature( ".uno:ObjectResize", SID_OBJECT_RESIZING( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 147 )
, CommandGroup::FORMAT );
1851 implDescribeSupportedFeature( ".uno:SmallestWidth", SID_OBJECT_SMALLESTWIDTH( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 143 )
, CommandGroup::FORMAT );
1852 implDescribeSupportedFeature( ".uno:SmallestHeight", SID_OBJECT_SMALLESTHEIGHT( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 144 )
, CommandGroup::FORMAT );
1853 implDescribeSupportedFeature( ".uno:GreatestWidth", SID_OBJECT_GREATESTWIDTH( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 145 )
, CommandGroup::FORMAT );
1854 implDescribeSupportedFeature( ".uno:GreatestHeight", SID_OBJECT_GREATESTHEIGHT( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 146 )
, CommandGroup::FORMAT );
1855
1856 implDescribeSupportedFeature( ".uno:DistributeSelection", SID_DISTRIBUTE_DLG(5000 + 683), CommandGroup::FORMAT );
1857 implDescribeSupportedFeature( ".uno:DistributeHorzLeft", SID_DISTRIBUTE_HLEFT(5000 + 686), CommandGroup::FORMAT );
1858 implDescribeSupportedFeature( ".uno:DistributeHorzCenter", SID_DISTRIBUTE_HCENTER(5000 + 687), CommandGroup::FORMAT );
1859 implDescribeSupportedFeature( ".uno:DistributeHorzDistance", SID_DISTRIBUTE_HDISTANCE(5000 + 688), CommandGroup::FORMAT );
1860 implDescribeSupportedFeature( ".uno:DistributeHorzRight", SID_DISTRIBUTE_HRIGHT(5000 + 689), CommandGroup::FORMAT );
1861 implDescribeSupportedFeature( ".uno:DistributeVertTop", SID_DISTRIBUTE_VTOP(5000 + 690), CommandGroup::FORMAT );
1862 implDescribeSupportedFeature( ".uno:DistributeVertCenter", SID_DISTRIBUTE_VCENTER(5000 + 691), CommandGroup::FORMAT );
1863 implDescribeSupportedFeature( ".uno:DistributeVertDistance", SID_DISTRIBUTE_VDISTANCE(5000 + 692), CommandGroup::FORMAT );
1864 implDescribeSupportedFeature( ".uno:DistributeVertBottom", SID_DISTRIBUTE_VBOTTOM(5000 + 693), CommandGroup::FORMAT );
1865
1866 implDescribeSupportedFeature( ".uno:ExportTo", SID_EXPORTDOC(5000 + 829), CommandGroup::APPLICATION );
1867 implDescribeSupportedFeature( ".uno:ExportToPDF", SID_EXPORTDOCASPDF(5000 + 1673), CommandGroup::APPLICATION );
1868 implDescribeSupportedFeature( ".uno:PrintPreview", SID_PRINTPREVIEW(5000 + 325), CommandGroup::APPLICATION );
1869
1870 implDescribeSupportedFeature( ".uno:NewDoc", SID_NEWDOC(5000 + 500), CommandGroup::DOCUMENT );
1871 implDescribeSupportedFeature( ".uno:Save", SID_SAVEDOC(5000 + 505), CommandGroup::DOCUMENT );
1872 implDescribeSupportedFeature( ".uno:SaveAs", SID_SAVEASDOC(5000 + 502), CommandGroup::DOCUMENT );
1873 implDescribeSupportedFeature( ".uno:SaveACopy", SID_SAVEACOPY(5000 + 999), CommandGroup::DOCUMENT );
1874
1875 implDescribeSupportedFeature( ".uno:InsertPageNumberField", SID_INSERT_FLD_PGNUMBER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 3 )
, CommandGroup::INSERT );
1876 implDescribeSupportedFeature( ".uno:InsertDateTimeField", SID_DATETIME( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 20 )
, CommandGroup::INSERT );
1877 implDescribeSupportedFeature( ".uno:InsertObjectChart", SID_INSERT_DIAGRAM( 10000 + 140 ), CommandGroup::INSERT );
1878 implDescribeSupportedFeature( ".uno:InsertGraphic", SID_INSERT_GRAPHICTypedWhichId<SfxStringItem>( 10000 + 241 ), CommandGroup::INSERT );
1879 // controls
1880 implDescribeSupportedFeature( ".uno:SelectObject", SID_OBJECT_SELECT( 10000 + 128 ), CommandGroup::INSERT );
1881 implDescribeSupportedFeature( ".uno:Label", SID_FM_FIXEDTEXT( 10000 + 597 ), CommandGroup::INSERT );
1882 implDescribeSupportedFeature( ".uno:Edit", SID_FM_EDIT( 10000 + 599 ), CommandGroup::INSERT );
1883 implDescribeSupportedFeature( ".uno:ImageControl", SID_FM_IMAGECONTROL( 10000 + 710 ), CommandGroup::INSERT );
1884 implDescribeSupportedFeature( ".uno:HFixedLine", SID_INSERT_HFIXEDLINE( 10000 + 928 ), CommandGroup::INSERT );
1885 implDescribeSupportedFeature( ".uno:VFixedLine", SID_INSERT_VFIXEDLINE( 10000 + 929 ), CommandGroup::INSERT );
1886
1887 // shapes
1888 implDescribeSupportedFeature( ".uno:BasicShapes", SID_DRAWTBX_CS_BASIC( 10000 + 1047 ), CommandGroup::INSERT );
1889 implDescribeSupportedFeature( ".uno:BasicShapes.rectangle", SID_DRAWTBX_CS_BASIC1( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 26 )
, CommandGroup::INSERT );
1890 implDescribeSupportedFeature( ".uno:BasicShapes.round-rectangle",SID_DRAWTBX_CS_BASIC2( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 27 )
, CommandGroup::INSERT );
1891 implDescribeSupportedFeature( ".uno:BasicShapes.quadrat", SID_DRAWTBX_CS_BASIC3( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 28 )
, CommandGroup::INSERT );
1892 implDescribeSupportedFeature( ".uno:BasicShapes.round-quadrat", SID_DRAWTBX_CS_BASIC4( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 29 )
, CommandGroup::INSERT );
1893 implDescribeSupportedFeature( ".uno:BasicShapes.circle", SID_DRAWTBX_CS_BASIC5( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 30 )
, CommandGroup::INSERT );
1894 implDescribeSupportedFeature( ".uno:BasicShapes.ellipse", SID_DRAWTBX_CS_BASIC6( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 31 )
, CommandGroup::INSERT );
1895 implDescribeSupportedFeature( ".uno:BasicShapes.circle-pie", SID_DRAWTBX_CS_BASIC7( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 32 )
, CommandGroup::INSERT );
1896 implDescribeSupportedFeature( ".uno:BasicShapes.isosceles-triangle",SID_DRAWTBX_CS_BASIC8( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 33 )
, CommandGroup::INSERT );
1897 implDescribeSupportedFeature( ".uno:BasicShapes.right-triangle",SID_DRAWTBX_CS_BASIC9( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 34 )
, CommandGroup::INSERT );
1898 implDescribeSupportedFeature( ".uno:BasicShapes.trapezoid", SID_DRAWTBX_CS_BASIC10( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 35 )
, CommandGroup::INSERT );
1899 implDescribeSupportedFeature( ".uno:BasicShapes.diamond", SID_DRAWTBX_CS_BASIC11( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 36 )
, CommandGroup::INSERT );
1900 implDescribeSupportedFeature( ".uno:BasicShapes.parallelogram", SID_DRAWTBX_CS_BASIC12( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 37 )
, CommandGroup::INSERT );
1901 implDescribeSupportedFeature( ".uno:BasicShapes.pentagon", SID_DRAWTBX_CS_BASIC13( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 38 )
, CommandGroup::INSERT );
1902 implDescribeSupportedFeature( ".uno:BasicShapes.hexagon", SID_DRAWTBX_CS_BASIC14( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 39 )
, CommandGroup::INSERT );
1903 implDescribeSupportedFeature( ".uno:BasicShapes.octagon", SID_DRAWTBX_CS_BASIC15( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 40 )
, CommandGroup::INSERT );
1904 implDescribeSupportedFeature( ".uno:BasicShapes.cross", SID_DRAWTBX_CS_BASIC16( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 41 )
, CommandGroup::INSERT );
1905 implDescribeSupportedFeature( ".uno:BasicShapes.ring", SID_DRAWTBX_CS_BASIC17( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 42 )
, CommandGroup::INSERT );
1906 implDescribeSupportedFeature( ".uno:BasicShapes.block-arc", SID_DRAWTBX_CS_BASIC18( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 43 )
, CommandGroup::INSERT );
1907 implDescribeSupportedFeature( ".uno:BasicShapes.can", SID_DRAWTBX_CS_BASIC19( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 44 )
, CommandGroup::INSERT );
1908 implDescribeSupportedFeature( ".uno:BasicShapes.cube", SID_DRAWTBX_CS_BASIC20( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 45 )
, CommandGroup::INSERT );
1909 implDescribeSupportedFeature( ".uno:BasicShapes.paper", SID_DRAWTBX_CS_BASIC21( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 46 )
, CommandGroup::INSERT );
1910 implDescribeSupportedFeature( ".uno:BasicShapes.frame", SID_DRAWTBX_CS_BASIC22( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 47 )
, CommandGroup::INSERT );
1911
1912 implDescribeSupportedFeature( ".uno:SymbolShapes", SID_DRAWTBX_CS_SYMBOL( 10000 + 1048 ), CommandGroup::INSERT );
1913
1914 implDescribeSupportedFeature( ".uno:SymbolShapes.smiley" , SID_DRAWTBX_CS_SYMBOL1( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 48 )
, CommandGroup::INSERT );
1915 implDescribeSupportedFeature( ".uno:SymbolShapes.sun" , SID_DRAWTBX_CS_SYMBOL2( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 49 )
, CommandGroup::INSERT );
1916 implDescribeSupportedFeature( ".uno:SymbolShapes.moon" , SID_DRAWTBX_CS_SYMBOL3( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 50 )
, CommandGroup::INSERT );
1917 implDescribeSupportedFeature( ".uno:SymbolShapes.lightning" , SID_DRAWTBX_CS_SYMBOL4( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 51 )
, CommandGroup::INSERT );
1918 implDescribeSupportedFeature( ".uno:SymbolShapes.heart" , SID_DRAWTBX_CS_SYMBOL5( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 52 )
, CommandGroup::INSERT );
1919 implDescribeSupportedFeature( ".uno:SymbolShapes.flower" , SID_DRAWTBX_CS_SYMBOL6( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 53 )
, CommandGroup::INSERT );
1920 implDescribeSupportedFeature( ".uno:SymbolShapes.cloud" , SID_DRAWTBX_CS_SYMBOL7( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 54 )
, CommandGroup::INSERT );
1921 implDescribeSupportedFeature( ".uno:SymbolShapes.forbidden" , SID_DRAWTBX_CS_SYMBOL8( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 55 )
, CommandGroup::INSERT );
1922 implDescribeSupportedFeature( ".uno:SymbolShapes.puzzle" , SID_DRAWTBX_CS_SYMBOL9( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 56 )
, CommandGroup::INSERT );
1923 implDescribeSupportedFeature( ".uno:SymbolShapes.bracket-pair" ,SID_DRAWTBX_CS_SYMBOL10( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 57 )
, CommandGroup::INSERT );
1924 implDescribeSupportedFeature( ".uno:SymbolShapes.left-bracket" ,SID_DRAWTBX_CS_SYMBOL11( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 58 )
, CommandGroup::INSERT );
1925 implDescribeSupportedFeature( ".uno:SymbolShapes.right-bracket",SID_DRAWTBX_CS_SYMBOL12( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 59 )
, CommandGroup::INSERT );
1926 implDescribeSupportedFeature( ".uno:SymbolShapes.brace-pair" , SID_DRAWTBX_CS_SYMBOL13( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 60 )
, CommandGroup::INSERT );
1927 implDescribeSupportedFeature( ".uno:SymbolShapes.left-brace" , SID_DRAWTBX_CS_SYMBOL14( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 61 )
, CommandGroup::INSERT );
1928 implDescribeSupportedFeature( ".uno:SymbolShapes.right-brace" , SID_DRAWTBX_CS_SYMBOL15( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 62 )
, CommandGroup::INSERT );
1929 implDescribeSupportedFeature( ".uno:SymbolShapes.quad-bevel" , SID_DRAWTBX_CS_SYMBOL16( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 63 )
, CommandGroup::INSERT );
1930 implDescribeSupportedFeature( ".uno:SymbolShapes.octagon-bevel",SID_DRAWTBX_CS_SYMBOL17( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 64 )
, CommandGroup::INSERT );
1931 implDescribeSupportedFeature( ".uno:SymbolShapes.diamond-bevel",SID_DRAWTBX_CS_SYMBOL18( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 65 )
, CommandGroup::INSERT );
1932
1933 implDescribeSupportedFeature( ".uno:ArrowShapes.left-arrow" , SID_DRAWTBX_CS_ARROW1( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 66 )
, CommandGroup::INSERT );
1934 implDescribeSupportedFeature( ".uno:ArrowShapes.right-arrow" , SID_DRAWTBX_CS_ARROW2( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 67 )
, CommandGroup::INSERT );
1935 implDescribeSupportedFeature( ".uno:ArrowShapes.up-arrow" , SID_DRAWTBX_CS_ARROW3( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 68 )
, CommandGroup::INSERT );
1936 implDescribeSupportedFeature( ".uno:ArrowShapes.down-arrow" , SID_DRAWTBX_CS_ARROW4( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 69 )
, CommandGroup::INSERT );
1937 implDescribeSupportedFeature( ".uno:ArrowShapes.left-right-arrow" , SID_DRAWTBX_CS_ARROW5( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 70 )
, CommandGroup::INSERT );
1938 implDescribeSupportedFeature( ".uno:ArrowShapes.up-down-arrow" , SID_DRAWTBX_CS_ARROW6( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 71 )
, CommandGroup::INSERT );
1939 implDescribeSupportedFeature( ".uno:ArrowShapes.up-right-arrow" , SID_DRAWTBX_CS_ARROW7( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 72 )
, CommandGroup::INSERT );
1940 implDescribeSupportedFeature( ".uno:ArrowShapes.up-right-down-arrow" , SID_DRAWTBX_CS_ARROW8( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 73 )
, CommandGroup::INSERT );
1941 implDescribeSupportedFeature( ".uno:ArrowShapes.quad-arrow" , SID_DRAWTBX_CS_ARROW9( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 74 )
, CommandGroup::INSERT );
1942 implDescribeSupportedFeature( ".uno:ArrowShapes.corner-right-arrow" , SID_DRAWTBX_CS_ARROW10( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 75 )
, CommandGroup::INSERT );
1943 implDescribeSupportedFeature( ".uno:ArrowShapes.split-arrow" , SID_DRAWTBX_CS_ARROW11( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 76 )
, CommandGroup::INSERT );
1944 implDescribeSupportedFeature( ".uno:ArrowShapes.striped-right-arrow" , SID_DRAWTBX_CS_ARROW12( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 77 )
, CommandGroup::INSERT );
1945 implDescribeSupportedFeature( ".uno:ArrowShapes.notched-right-arrow" , SID_DRAWTBX_CS_ARROW13( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 78 )
, CommandGroup::INSERT );
1946 implDescribeSupportedFeature( ".uno:ArrowShapes.pentagon-right" , SID_DRAWTBX_CS_ARROW14( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 79 )
, CommandGroup::INSERT );
1947 implDescribeSupportedFeature( ".uno:ArrowShapes.chevron" , SID_DRAWTBX_CS_ARROW15( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 80 )
, CommandGroup::INSERT );
1948 implDescribeSupportedFeature( ".uno:ArrowShapes.right-arrow-callout" , SID_DRAWTBX_CS_ARROW16( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 81 )
, CommandGroup::INSERT );
1949 implDescribeSupportedFeature( ".uno:ArrowShapes.left-arrow-callout" , SID_DRAWTBX_CS_ARROW17( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 82 )
, CommandGroup::INSERT );
1950 implDescribeSupportedFeature( ".uno:ArrowShapes.up-arrow-callout" , SID_DRAWTBX_CS_ARROW18( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 83 )
, CommandGroup::INSERT );
1951 implDescribeSupportedFeature( ".uno:ArrowShapes.down-arrow-callout" , SID_DRAWTBX_CS_ARROW19( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 84 )
, CommandGroup::INSERT );
1952 implDescribeSupportedFeature( ".uno:ArrowShapes.left-right-arrow-callout",SID_DRAWTBX_CS_ARROW20( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 85 )
, CommandGroup::INSERT );
1953 implDescribeSupportedFeature( ".uno:ArrowShapes.up-down-arrow-callout" ,SID_DRAWTBX_CS_ARROW21( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 86 )
, CommandGroup::INSERT );
1954 implDescribeSupportedFeature( ".uno:ArrowShapes.up-right-arrow-callout",SID_DRAWTBX_CS_ARROW22( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 87 )
, CommandGroup::INSERT );
1955 implDescribeSupportedFeature( ".uno:ArrowShapes.quad-arrow-callout" , SID_DRAWTBX_CS_ARROW23( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 88 )
, CommandGroup::INSERT );
1956 implDescribeSupportedFeature( ".uno:ArrowShapes.circular-arrow" , SID_DRAWTBX_CS_ARROW24( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 89 )
, CommandGroup::INSERT );
1957 implDescribeSupportedFeature( ".uno:ArrowShapes.split-round-arrow" , SID_DRAWTBX_CS_ARROW25( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 90 )
, CommandGroup::INSERT );
1958 implDescribeSupportedFeature( ".uno:ArrowShapes.s-sharped-arrow" , SID_DRAWTBX_CS_ARROW26( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 91 )
, CommandGroup::INSERT );
1959
1960 implDescribeSupportedFeature( ".uno:StarShapes.bang" , SID_DRAWTBX_CS_STAR1( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 92 )
, CommandGroup::INSERT );
1961 implDescribeSupportedFeature( ".uno:StarShapes.star4" , SID_DRAWTBX_CS_STAR2( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 93 )
, CommandGroup::INSERT );
1962 implDescribeSupportedFeature( ".uno:StarShapes.star5" , SID_DRAWTBX_CS_STAR3( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 94 )
, CommandGroup::INSERT );
1963 implDescribeSupportedFeature( ".uno:StarShapes.star6" , SID_DRAWTBX_CS_STAR4( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 95 )
, CommandGroup::INSERT );
1964 implDescribeSupportedFeature( ".uno:StarShapes.star8" , SID_DRAWTBX_CS_STAR5( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 96 )
, CommandGroup::INSERT );
1965 implDescribeSupportedFeature( ".uno:StarShapes.star12" , SID_DRAWTBX_CS_STAR6( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 97 )
, CommandGroup::INSERT );
1966 implDescribeSupportedFeature( ".uno:StarShapes.star24" , SID_DRAWTBX_CS_STAR7( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 98 )
, CommandGroup::INSERT );
1967 implDescribeSupportedFeature( ".uno:StarShapes.concave-star6" , SID_DRAWTBX_CS_STAR8( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 99 )
, CommandGroup::INSERT );
1968 implDescribeSupportedFeature( ".uno:StarShapes.vertical-scroll" , SID_DRAWTBX_CS_STAR9( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 100 )
, CommandGroup::INSERT );
1969 implDescribeSupportedFeature( ".uno:StarShapes.horizontal-scroll" , SID_DRAWTBX_CS_STAR10( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 101 )
, CommandGroup::INSERT );
1970 implDescribeSupportedFeature( ".uno:StarShapes.signet" , SID_DRAWTBX_CS_STAR11( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 102 )
, CommandGroup::INSERT );
1971 implDescribeSupportedFeature( ".uno:StarShapes.doorplate" , SID_DRAWTBX_CS_STAR12( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 103 )
, CommandGroup::INSERT );
1972
1973 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-process" , SID_DRAWTBX_CS_FLOWCHART1( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 104 )
, CommandGroup::INSERT );
1974 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-alternate-process" , SID_DRAWTBX_CS_FLOWCHART2( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 105 )
, CommandGroup::INSERT );
1975 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-decision" , SID_DRAWTBX_CS_FLOWCHART3( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 106 )
, CommandGroup::INSERT );
1976 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-data" , SID_DRAWTBX_CS_FLOWCHART4( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 107 )
, CommandGroup::INSERT );
1977 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-predefined-process" , SID_DRAWTBX_CS_FLOWCHART5( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 108 )
, CommandGroup::INSERT );
1978 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-internal-storage" , SID_DRAWTBX_CS_FLOWCHART6( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 109 )
, CommandGroup::INSERT );
1979 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-document" , SID_DRAWTBX_CS_FLOWCHART7( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 110 )
, CommandGroup::INSERT );
1980 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-multidocument" , SID_DRAWTBX_CS_FLOWCHART8( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 111 )
, CommandGroup::INSERT );
1981 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-terminator" , SID_DRAWTBX_CS_FLOWCHART9( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 112 )
, CommandGroup::INSERT );
1982 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-preparation" , SID_DRAWTBX_CS_FLOWCHART10( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 113 )
, CommandGroup::INSERT );
1983 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-manual-input" , SID_DRAWTBX_CS_FLOWCHART11( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 114 )
, CommandGroup::INSERT );
1984 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-manual-operation" , SID_DRAWTBX_CS_FLOWCHART12( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 115 )
, CommandGroup::INSERT );
1985 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-connector" , SID_DRAWTBX_CS_FLOWCHART13( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 116 )
, CommandGroup::INSERT );
1986 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-off-page-connector" , SID_DRAWTBX_CS_FLOWCHART14( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 117 )
, CommandGroup::INSERT );
1987 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-card" , SID_DRAWTBX_CS_FLOWCHART15( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 118 )
, CommandGroup::INSERT );
1988 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-punched-tape" , SID_DRAWTBX_CS_FLOWCHART16( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 119 )
, CommandGroup::INSERT );
1989 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-summing-junction" , SID_DRAWTBX_CS_FLOWCHART17( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 120 )
, CommandGroup::INSERT );
1990 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-or" , SID_DRAWTBX_CS_FLOWCHART18( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 121 )
, CommandGroup::INSERT );
1991 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-collate" , SID_DRAWTBX_CS_FLOWCHART19( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 122 )
, CommandGroup::INSERT );
1992 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-sort" , SID_DRAWTBX_CS_FLOWCHART20( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 123 )
, CommandGroup::INSERT );
1993 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-extract" , SID_DRAWTBX_CS_FLOWCHART21( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 124 )
, CommandGroup::INSERT );
1994 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-merge" , SID_DRAWTBX_CS_FLOWCHART22( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 125 )
, CommandGroup::INSERT );
1995 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-stored-data" , SID_DRAWTBX_CS_FLOWCHART23( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 126 )
, CommandGroup::INSERT );
1996 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-delay" , SID_DRAWTBX_CS_FLOWCHART24( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 127 )
, CommandGroup::INSERT );
1997 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-sequential-access" , SID_DRAWTBX_CS_FLOWCHART25( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 128 )
, CommandGroup::INSERT );
1998 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-magnetic-disk" , SID_DRAWTBX_CS_FLOWCHART26( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 129 )
, CommandGroup::INSERT );
1999 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-direct-access-storage",SID_DRAWTBX_CS_FLOWCHART27( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 130 )
, CommandGroup::INSERT );
2000 implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-display" , SID_DRAWTBX_CS_FLOWCHART28( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 131 )
, CommandGroup::INSERT );
2001
2002 implDescribeSupportedFeature( ".uno:CalloutShapes.rectangular-callout" , SID_DRAWTBX_CS_CALLOUT1( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 132 )
, CommandGroup::INSERT );
2003 implDescribeSupportedFeature( ".uno:CalloutShapes.round-rectangular-callout" , SID_DRAWTBX_CS_CALLOUT2( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 133 )
, CommandGroup::INSERT );
2004 implDescribeSupportedFeature( ".uno:CalloutShapes.round-callout" , SID_DRAWTBX_CS_CALLOUT3( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 134 )
, CommandGroup::INSERT );
2005 implDescribeSupportedFeature( ".uno:CalloutShapes.cloud-callout" , SID_DRAWTBX_CS_CALLOUT4( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 135 )
, CommandGroup::INSERT );
2006 implDescribeSupportedFeature( ".uno:CalloutShapes.line-callout-1" , SID_DRAWTBX_CS_CALLOUT5( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 136 )
, CommandGroup::INSERT );
2007 implDescribeSupportedFeature( ".uno:CalloutShapes.line-callout-2" , SID_DRAWTBX_CS_CALLOUT6( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 137 )
, CommandGroup::INSERT );
2008 implDescribeSupportedFeature( ".uno:CalloutShapes.line-callout-3" , SID_DRAWTBX_CS_CALLOUT7( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 138 )
, CommandGroup::INSERT );
2009
2010 implDescribeSupportedFeature( ".uno:ArrowShapes", SID_DRAWTBX_CS_ARROW( 10000 + 1049 ), CommandGroup::INSERT );
2011
2012 implDescribeSupportedFeature( ".uno:FlowChartShapes", SID_DRAWTBX_CS_FLOWCHART( 10000 + 1050 ), CommandGroup::INSERT );
2013 implDescribeSupportedFeature( ".uno:CalloutShapes", SID_DRAWTBX_CS_CALLOUT( 10000 + 1051 ), CommandGroup::INSERT );
2014 implDescribeSupportedFeature( ".uno:StarShapes", SID_DRAWTBX_CS_STAR( 10000 + 1052 ), CommandGroup::INSERT );
2015
2016
2017 // keys
2018 implDescribeSupportedFeature( ".uno:Escape", SID_ESCAPE( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 21 )
);
2019
2020 // internal one
2021 implDescribeSupportedFeature( ".uno:RPT_RPTHEADER_UNDO", SID_REPORTHEADER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 10 )
);
2022 implDescribeSupportedFeature( ".uno:RPT_RPTFOOTER_UNDO", SID_REPORTFOOTER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 11 )
);
2023 implDescribeSupportedFeature( ".uno:RPT_PGHEADER_UNDO", SID_PAGEHEADER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 8 )
);
2024 implDescribeSupportedFeature( ".uno:RPT_PGFOOTER_UNDO", SID_PAGEFOOTER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 9 )
);
2025 implDescribeSupportedFeature( ".uno:SID_GROUPHEADER", SID_GROUPHEADER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 14 )
);
2026 implDescribeSupportedFeature( ".uno:SID_GROUPHEADER_WITHOUT_UNDO", SID_GROUPHEADER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 13 )
);
2027 implDescribeSupportedFeature( ".uno:SID_GROUPFOOTER", SID_GROUPFOOTER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 16 )
);
2028 implDescribeSupportedFeature( ".uno:SID_GROUPFOOTER_WITHOUT_UNDO", SID_GROUPFOOTER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 15 )
);
2029 implDescribeSupportedFeature( ".uno:SID_GROUP_REMOVE", SID_GROUP_REMOVE( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 17 )
);
2030 implDescribeSupportedFeature( ".uno:SID_GROUP_APPEND", SID_GROUP_APPEND( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 18 )
);
2031 implDescribeSupportedFeature( ".uno:SID_ADD_CONTROL_PAIR", SID_ADD_CONTROL_PAIR( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 22 )
);
2032 implDescribeSupportedFeature( ".uno:SplitPosition", SID_SPLIT_POSITION( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 23 )
);
2033 implDescribeSupportedFeature( ".uno:LastPropertyBrowserPage", SID_PROPERTYBROWSER_LAST_PAGE( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 24 )
);
2034 implDescribeSupportedFeature( ".uno:Select", SID_SELECT(5000 + 720));
2035 implDescribeSupportedFeature( ".uno:InsertFunction", SID_RPT_NEW_FUNCTION( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 142 )
);
2036 implDescribeSupportedFeature( ".uno:NextMark", SID_NEXT_MARK( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 159 )
);
2037 implDescribeSupportedFeature( ".uno:PrevMark", SID_PREV_MARK( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 160 )
);
2038 implDescribeSupportedFeature( ".uno:TerminateInplaceActivation", SID_TERMINATE_INPLACEACTIVATION(5000 + 1702));
2039 implDescribeSupportedFeature( ".uno:SelectAllLabels", SID_SELECT_ALL_LABELS( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 161 )
);
2040 implDescribeSupportedFeature( ".uno:SelectAllEdits", SID_SELECT_ALL_EDITS( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 162 )
);
2041 implDescribeSupportedFeature( ".uno:CollapseSection", SID_COLLAPSE_SECTION( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 167 )
);
2042 implDescribeSupportedFeature( ".uno:ExpandSection", SID_EXPAND_SECTION( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 168 )
);
2043 implDescribeSupportedFeature( ".uno:GetUndoStrings", SID_GETUNDOSTRINGS( 10000 + 923 ));
2044 implDescribeSupportedFeature( ".uno:GetRedoStrings", SID_GETREDOSTRINGS( 10000 + 924 ));
2045}
2046
2047void OReportController::impl_onModifyChanged()
2048{
2049 try
2050 {
2051 if ( m_xReportDefinition.is() )
2052 m_xReportDefinition->setModified( impl_isModified() );
2053 DBSubComponentController::impl_onModifyChanged();
2054 }
2055 catch(const uno::Exception&)
2056 {
2057 DBG_UNHANDLED_EXCEPTION("reportdesign")DbgUnhandledException( DbgGetCaughtException(), __func__, "/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "2057" ": ", "reportdesign" );
;
2058 }
2059}
2060
2061void OReportController::onLoadedMenu(const Reference< frame::XLayoutManager >& _xLayoutManager)
2062{
2063 if ( !_xLayoutManager.is() )
2064 return;
2065
2066 static const std::u16string_view s_sMenu[] = {
2067 u"private:resource/statusbar/statusbar"
2068 ,u"private:resource/toolbar/reportcontrols"
2069 ,u"private:resource/toolbar/drawbar"
2070 ,u"private:resource/toolbar/Formatting"
2071 ,u"private:resource/toolbar/alignmentbar"
2072 ,u"private:resource/toolbar/sectionalignmentbar"
2073 ,u"private:resource/toolbar/resizebar"
2074 ,u"private:resource/toolbar/sectionshrinkbar"
2075 };
2076 for (const auto & i : s_sMenu)
2077 {
2078 _xLayoutManager->createElement( i );
2079 _xLayoutManager->requestElement( i );
2080 }
2081}
2082
2083void OReportController::notifyGroupSections(const ContainerEvent& _rEvent,bool _bShow)
2084{
2085 uno::Reference< report::XGroup> xGroup(_rEvent.Element,uno::UNO_QUERY);
2086 if ( !xGroup.is() )
2087 return;
2088
2089 SolarMutexGuard aSolarGuard;
2090 ::osl::MutexGuard aGuard( getMutex() );
2091 sal_Int32 nGroupPos = 0;
2092 _rEvent.Accessor >>= nGroupPos;
2093
2094 if ( _bShow )
2095 {
2096 xGroup->addPropertyChangeListener(PROPERTY_HEADERON"HeaderOn", static_cast<XPropertyChangeListener*>(this));
2097 xGroup->addPropertyChangeListener(PROPERTY_FOOTERON"FooterOn", static_cast<XPropertyChangeListener*>(this));
2098 }
2099 else
2100 {
2101 xGroup->removePropertyChangeListener(PROPERTY_HEADERON"HeaderOn", static_cast<XPropertyChangeListener*>(this));
2102 xGroup->removePropertyChangeListener(PROPERTY_FOOTERON"FooterOn", static_cast<XPropertyChangeListener*>(this));
2103 }
2104
2105 if ( xGroup->getHeaderOn() )
2106 {
2107 groupChange(xGroup,PROPERTY_HEADERON"HeaderOn",nGroupPos,_bShow);
2108 if (_bShow)
2109 {
2110 m_pReportControllerObserver->AddSection(xGroup->getHeader());
2111 }
2112 else
2113 {
2114 m_pReportControllerObserver->RemoveSection(xGroup->getHeader());
2115 }
2116 }
2117 if ( xGroup->getFooterOn() )
2118 {
2119 groupChange(xGroup,PROPERTY_FOOTERON"FooterOn",nGroupPos,_bShow);
2120 if (_bShow)
2121 {
2122 m_pReportControllerObserver->AddSection(xGroup->getFooter());
2123 }
2124 else
2125 {
2126 m_pReportControllerObserver->RemoveSection(xGroup->getFooter());
2127 }
2128 }
2129}
2130
2131// ::container::XContainerListener
2132void SAL_CALL OReportController::elementInserted( const ContainerEvent& _rEvent )
2133{
2134 notifyGroupSections(_rEvent,true);
2135}
2136
2137void SAL_CALL OReportController::elementRemoved( const ContainerEvent& _rEvent )
2138{
2139 notifyGroupSections(_rEvent,false);
2140}
2141
2142void SAL_CALL OReportController::elementReplaced( const ContainerEvent& /*_rEvent*/ )
2143{
2144 SolarMutexGuard aSolarGuard;
2145 ::osl::MutexGuard aGuard( getMutex() );
2146 OSL_FAIL("Not yet implemented!")do { if (true && (((sal_Bool)1))) { sal_detail_logFormat
((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "2146" ": "), "%s", "Not yet implemented!"); } } while (
false)
;
2147}
2148
2149void SAL_CALL OReportController::propertyChange( const beans::PropertyChangeEvent& evt )
2150{
2151 SolarMutexGuard aSolarGuard;
2152 ::osl::MutexGuard aGuard( getMutex() );
2153 try
2154 {
2155 bool bShow = false;
2156 evt.NewValue >>= bShow;
2157 if ( evt.Source == m_xReportDefinition )
2158 {
2159 if ( evt.PropertyName == PROPERTY_REPORTHEADERON"ReportHeaderOn" )
2160 {
2161 const sal_uInt16 nPosition = m_xReportDefinition->getPageHeaderOn() ? 1 : 0;
2162 if ( bShow )
2163 {
2164 getDesignView()->addSection(m_xReportDefinition->getReportHeader(),DBREPORTHEADER"ReportHeader",nPosition);
2165 m_pReportControllerObserver->AddSection(m_xReportDefinition->getReportHeader());
2166 }
2167 else
2168 {
2169 getDesignView()->removeSection(nPosition);
2170 }
2171 }
2172 else if ( evt.PropertyName == PROPERTY_REPORTFOOTERON"ReportFooterOn" )
2173 {
2174 sal_uInt16 nPosition = getDesignView()->getSectionCount();
2175 if ( m_xReportDefinition->getPageFooterOn() )
2176 --nPosition;
2177 if ( bShow )
2178 {
2179 getDesignView()->addSection(m_xReportDefinition->getReportFooter(),DBREPORTFOOTER"ReportFooter",nPosition);
2180 m_pReportControllerObserver->AddSection(m_xReportDefinition->getReportFooter());
2181 }
2182 else
2183 {
2184 getDesignView()->removeSection(nPosition - 1);
2185 }
2186 }
2187 else if ( evt.PropertyName == PROPERTY_PAGEHEADERON"PageHeaderOn" )
2188 {
2189 if ( bShow )
2190 {
2191 getDesignView()->addSection(m_xReportDefinition->getPageHeader(),DBPAGEHEADER"PageHeader",0);
2192 m_pReportControllerObserver->AddSection(m_xReportDefinition->getPageHeader());
2193 }
2194 else
2195 {
2196 getDesignView()->removeSection(sal_uInt16(0));
2197 }
2198 }
2199 else if ( evt.PropertyName == PROPERTY_PAGEFOOTERON"PageFooterOn" )
2200 {
2201 if ( bShow )
2202 {
2203 getDesignView()->addSection(m_xReportDefinition->getPageFooter(),DBPAGEFOOTER"PageFooter");
2204 m_pReportControllerObserver->AddSection(m_xReportDefinition->getPageFooter());
2205 }
2206 else
2207 {
2208 getDesignView()->removeSection(getDesignView()->getSectionCount() - 1);
2209 }
2210 }
2211 else if ( evt.PropertyName == PROPERTY_COMMAND"Command"
2212 || evt.PropertyName == PROPERTY_COMMANDTYPE"CommandType"
2213 || evt.PropertyName == PROPERTY_ESCAPEPROCESSING"EscapeProcessing"
2214 || evt.PropertyName == PROPERTY_FILTER"Filter"
2215 )
2216 {
2217 m_xColumns.clear();
2218 m_xHoldAlive.clear();
2219 InvalidateFeature(SID_FM_ADD_FIELD( 10000 + 623 ));
2220 if ( !getDesignView()->isAddFieldVisible() && isUiVisible() )
2221 getDesignView()->toggleAddField();
2222 }
2223 /// TODO: check what we need to notify here TitleHelper
2224 /*else if ( evt.PropertyName.equals( PROPERTY_CAPTION ) )
2225 updateTitle();*/
2226 }
2227 else
2228 {
2229 uno::Reference< report::XGroup> xGroup(evt.Source,uno::UNO_QUERY);
2230 if ( xGroup.is() )
2231 {
2232 sal_Int32 nGroupPos = getGroupPosition(xGroup);
2233
2234 groupChange(xGroup,evt.PropertyName,nGroupPos,bShow);
2235 }
2236 }
2237 }
2238 catch(const uno::Exception&)
2239 {
2240 DBG_UNHANDLED_EXCEPTION("reportdesign")DbgUnhandledException( DbgGetCaughtException(), __func__, "/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "2240" ": ", "reportdesign" );
;
2241 }
2242}
2243
2244
2245void SAL_CALL OReportController::disposing( const lang::EventObject& Source )
2246{
2247 // simply disambiguate
2248 OReportController_BASE::disposing(Source);
2249}
2250
2251
2252static sal_uInt16 lcl_getNonVisibleGroupsBefore( const uno::Reference< report::XGroups>& _xGroups
2253 ,sal_Int32 _nGroupPos
2254 ,::std::function<bool(OGroupHelper *)> const & _pGroupMemberFunction)
2255{
2256 uno::Reference< report::XGroup> xGroup;
2257 sal_uInt16 nNonVisibleGroups = 0;
2258 sal_Int32 nCount = _xGroups->getCount();
2259 for( sal_Int32 i = 0; i < _nGroupPos && i < nCount; ++i)
2260 {
2261 xGroup.set(_xGroups->getByIndex(i),uno::UNO_QUERY);
2262 OSL_ENSURE(xGroup.is(),"Group is NULL! -> GPF")do { if (true && (!(xGroup.is()))) { sal_detail_logFormat
((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "2262" ": "), "%s", "Group is NULL! -> GPF"); } } while
(false)
;
2263 OGroupHelper aGroupHelper(xGroup);
2264 if ( !_pGroupMemberFunction(&aGroupHelper) )
2265 ++nNonVisibleGroups;
2266 }
2267 return nNonVisibleGroups;
2268}
2269
2270void OReportController::groupChange( const uno::Reference< report::XGroup>& _xGroup,const OUString& _sPropName,sal_Int32 _nGroupPos,bool _bShow)
2271{
2272 ::std::function<bool(OGroupHelper *)> pMemFun = ::std::mem_fn(&OGroupHelper::getHeaderOn);
2273 ::std::function<uno::Reference<report::XSection>(OGroupHelper *)> pMemFunSection = ::std::mem_fn(&OGroupHelper::getHeader);
2274 OUString sColor(DBGROUPHEADER"GroupHeader");
2275 sal_uInt16 nPosition = 0;
2276 bool bHandle = false;
2277 if ( _sPropName == PROPERTY_HEADERON"HeaderOn" )
2278 {
2279 nPosition = m_xReportDefinition->getPageHeaderOn() ? (m_xReportDefinition->getReportHeaderOn() ? 2 : 1) : (m_xReportDefinition->getReportHeaderOn() ? 1 : 0);
2280 nPosition += (static_cast<sal_uInt16>(_nGroupPos) - lcl_getNonVisibleGroupsBefore(m_xReportDefinition->getGroups(),_nGroupPos,pMemFun));
2281 bHandle = true;
2282 }
2283 else if ( _sPropName == PROPERTY_FOOTERON"FooterOn" )
2284 {
2285 pMemFun = ::std::mem_fn(&OGroupHelper::getFooterOn);
2286 pMemFunSection = ::std::mem_fn(&OGroupHelper::getFooter);
2287 nPosition = getDesignView()->getSectionCount();
2288
2289 if ( m_xReportDefinition->getPageFooterOn() )
2290 --nPosition;
2291 if ( m_xReportDefinition->getReportFooterOn() )
2292 --nPosition;
2293 sColor = DBGROUPFOOTER"GroupFooter";
2294 nPosition -= (static_cast<sal_uInt16>(_nGroupPos) - lcl_getNonVisibleGroupsBefore(m_xReportDefinition->getGroups(),_nGroupPos,pMemFun));
2295 if ( !_bShow )
2296 --nPosition;
2297 bHandle = true;
2298 }
2299 if ( bHandle )
2300 {
2301 if ( _bShow )
2302 {
2303 OGroupHelper aGroupHelper(_xGroup);
2304 getDesignView()->addSection(pMemFunSection(&aGroupHelper),sColor,nPosition);
2305 }
2306 else
2307 {
2308 getDesignView()->removeSection(nPosition);
2309 }
2310 }
2311}
2312
2313IMPL_LINK_NOARG(OReportController, OnClipboardChanged, TransferableDataHelper*, void)void OReportController::LinkStubOnClipboardChanged(void * instance
, TransferableDataHelper* data) { return static_cast<OReportController
*>(instance)->OnClipboardChanged(data); } void OReportController
::OnClipboardChanged(__attribute__ ((unused)) TransferableDataHelper
*)
2314{
2315 OnInvalidateClipboard();
2316}
2317
2318void OReportController::OnInvalidateClipboard()
2319{
2320 InvalidateFeature(SID_CUT(5000 + 710));
2321 InvalidateFeature(SID_COPY(5000 + 711));
2322 InvalidateFeature(SID_PASTE(5000 + 712));
2323}
2324
2325void OReportController::openPageDialog(const uno::Reference<report::XSection>& _xSection)
2326{
2327 if ( !m_xReportDefinition.is() )
2328 return;
2329
2330 // UNO->ItemSet
2331 static SfxItemInfo aItemInfos[] =
2332 {
2333 { SID_ATTR_LRSPACE( 10000 + 48 ), true },
2334 { SID_ATTR_ULSPACE( 10000 + 49 ), true },
2335 { SID_ATTR_PAGETypedWhichId<SvxPageItem>( 10000 + 50 ), true },
2336 { SID_ATTR_PAGE_SIZETypedWhichId<SvxSizeItem>( 10000 + 51 ), true },
2337 { SID_ENUM_PAGE_MODETypedWhichId<SfxUInt16Item>( 10000 + 1038 ), true },
2338 { SID_PAPER_STARTTypedWhichId<SfxUInt16Item>( 10000 + 1039 ), true },
2339 { SID_PAPER_ENDTypedWhichId<SfxUInt16Item>( 10000 + 1040 ), true },
2340 { SID_ATTR_BRUSH( 10000 + 1 ), true },
2341 { XATTR_FILLSTYLE, true },
2342 { XATTR_FILLCOLOR, true },
2343 { XATTR_FILLGRADIENT, true },
2344 { XATTR_FILLHATCH, true },
2345 { XATTR_FILLBITMAP, true },
2346 { XATTR_FILLTRANSPARENCE, true },
2347 { XATTR_GRADIENTSTEPCOUNT, true },
2348 { XATTR_FILLBMP_TILE, true },
2349 { XATTR_FILLBMP_POS, true },
2350 { XATTR_FILLBMP_SIZEX, true },
2351 { XATTR_FILLBMP_SIZEY, true },
2352 { XATTR_FILLFLOATTRANSPARENCE, true },
2353 { XATTR_SECONDARYFILLCOLOR, true },
2354 { XATTR_FILLBMP_SIZELOG, true },
2355 { XATTR_FILLBMP_TILEOFFSETX, true },
2356 { XATTR_FILLBMP_TILEOFFSETY, true },
2357 { XATTR_FILLBMP_STRETCH, true },
2358 { XATTR_FILLBMP_POSOFFSETX, true },
2359 { XATTR_FILLBMP_POSOFFSETY, true },
2360 { XATTR_FILLBACKGROUND, true },
2361 { SID_ATTR_METRICTypedWhichId<SfxUInt16Item>(((((10000 + 1499) + 1) + 499
) + 1) + 8)
, true }
2362 };
2363
2364 MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum();
2365 FieldUnit eUserMetric = MeasurementSystem::Metric == eSystem ? FieldUnit::CM : FieldUnit::INCH;
2366 static const sal_uInt16 pRanges[] =
2367 {
2368 RPTUI_ID_LRSPACEXATTR_FILL_FIRST - 8, XATTR_FILL_LAST,
2369 SID_ATTR_METRICTypedWhichId<SfxUInt16Item>(((((10000 + 1499) + 1) + 499
) + 1) + 8)
,SID_ATTR_METRICTypedWhichId<SfxUInt16Item>(((((10000 + 1499) + 1) + 499
) + 1) + 8)
,
2370 0
2371 };
2372 SfxItemPool* pPool( new SfxItemPool("ReportPageProperties", RPTUI_ID_LRSPACEXATTR_FILL_FIRST - 8, RPTUI_ID_METRICXATTR_FILL_LAST + 1, aItemInfos ) );
2373
2374 const Graphic aNullGraphic;
2375 const ::Color aNullLineCol(COL_DEFAULT_SHAPE_STROKE::Color(0x3465a4)); // #i121448# Use defined default color
2376 const ::Color aNullFillCol(COL_DEFAULT_SHAPE_FILLING::Color(0x729fcf)); // #i121448# Use defined default color
2377 const XGradient aNullGrad(COL_BLACK, COL_WHITE);
2378 const XHatch aNullHatch(aNullLineCol);
2379
2380 std::vector<SfxPoolItem*> pDefaults
2381 {
2382 new SvxLRSpaceItem(RPTUI_ID_LRSPACEXATTR_FILL_FIRST - 8),
2383 new SvxULSpaceItem(RPTUI_ID_ULSPACEXATTR_FILL_FIRST - 7),
2384 new SvxPageItem(RPTUI_ID_PAGEXATTR_FILL_FIRST - 6),
2385 new SvxSizeItem(RPTUI_ID_SIZEXATTR_FILL_FIRST - 5),
2386 new SfxUInt16Item(RPTUI_ID_PAGE_MODEXATTR_FILL_FIRST - 4,SVX_PAGE_MODE_STANDARD),
2387 new SfxUInt16Item(RPTUI_ID_STARTXATTR_FILL_FIRST - 3,PAPER_A4),
2388 new SfxUInt16Item(RPTUI_ID_ENDXATTR_FILL_FIRST - 2,PAPER_E),
2389 new SvxBrushItem(RPTUI_ID_BRUSHXATTR_FILL_FIRST - 1),
2390 new XFillStyleItem,
2391 new XFillColorItem("", aNullFillCol),
2392 new XFillGradientItem(aNullGrad),
2393 new XFillHatchItem(aNullHatch),
2394 new XFillBitmapItem(aNullGraphic),
2395 new XFillTransparenceItem,
2396 new XGradientStepCountItem,
2397 new XFillBmpTileItem,
2398 new XFillBmpPosItem,
2399 new XFillBmpSizeXItem,
2400 new XFillBmpSizeYItem,
2401 new XFillFloatTransparenceItem(aNullGrad, false),
2402 new XSecondaryFillColorItem("", aNullFillCol),
2403 new XFillBmpSizeLogItem,
2404 new XFillBmpTileOffsetXItem,
2405 new XFillBmpTileOffsetYItem,
2406 new XFillBmpStretchItem,
2407 new XFillBmpPosOffsetXItem,
2408 new XFillBmpPosOffsetYItem,
2409 new XFillBackgroundItem,
2410 new SfxUInt16Item(RPTUI_ID_METRICXATTR_FILL_LAST + 1,static_cast<sal_uInt16>(eUserMetric))
2411 };
2412
2413 pPool->SetDefaults(&pDefaults);
2414
2415
2416 pPool->SetDefaultMetric( MapUnit::Map100thMM ); // ripped, don't understand why
2417 pPool->FreezeIdRanges(); // the same
2418
2419 try
2420 {
2421 ::std::unique_ptr<SfxItemSet> pDescriptor(new SfxItemSet(*pPool, pRanges));
2422 // fill it
2423 if ( _xSection.is() )
2424 pDescriptor->Put(SvxBrushItem(::Color(_xSection->getBackColor()),RPTUI_ID_BRUSHXATTR_FILL_FIRST - 1));
2425 else
2426 {
2427 pDescriptor->Put(SvxSizeItem(RPTUI_ID_SIZEXATTR_FILL_FIRST - 5,VCLSize(getStyleProperty<awt::Size>(m_xReportDefinition,PROPERTY_PAPERSIZE"Size"))));
2428 pDescriptor->Put(SvxLRSpaceItem(getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_LEFTMARGIN"LeftMargin")
2429 ,getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_RIGHTMARGIN"RightMargin"),0,0,RPTUI_ID_LRSPACEXATTR_FILL_FIRST - 8));
2430 pDescriptor->Put(SvxULSpaceItem(static_cast<sal_uInt16>(getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_TOPMARGIN"TopMargin"))
2431 ,static_cast<sal_uInt16>(getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_BOTTOMMARGIN"BottomMargin")),RPTUI_ID_ULSPACEXATTR_FILL_FIRST - 7));
2432 pDescriptor->Put(SfxUInt16Item(SID_ATTR_METRICTypedWhichId<SfxUInt16Item>(((((10000 + 1499) + 1) + 499
) + 1) + 8)
,static_cast<sal_uInt16>(eUserMetric)));
2433
2434 uno::Reference< style::XStyle> xPageStyle(getUsedStyle(m_xReportDefinition));
2435 if ( xPageStyle.is() )
2436 {
2437 SvxPageItem aPageItem(RPTUI_ID_PAGEXATTR_FILL_FIRST - 6);
2438 aPageItem.SetDescName(xPageStyle->getName());
2439 uno::Reference<beans::XPropertySet> xProp(xPageStyle,uno::UNO_QUERY_THROW);
2440 aPageItem.PutValue(xProp->getPropertyValue(PROPERTY_PAGESTYLELAYOUT"PageStyleLayout"),MID_PAGE_LAYOUT2);
2441 aPageItem.SetLandscape(getStyleProperty<bool>(m_xReportDefinition,PROPERTY_ISLANDSCAPE"IsLandscape"));
2442 aPageItem.SetNumType(static_cast<SvxNumType>(getStyleProperty<sal_Int16>(m_xReportDefinition,PROPERTY_NUMBERINGTYPE"NumberingType")));
2443 pDescriptor->Put(aPageItem);
2444 pDescriptor->Put(SvxBrushItem(::Color(getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_BACKCOLOR"BackColor")),RPTUI_ID_BRUSHXATTR_FILL_FIRST - 1));
2445 }
2446 }
2447
2448 { // want the dialog to be destroyed before our set
2449 ORptPageDialog aDlg(
2450 getFrameWeld(), pDescriptor.get(),_xSection.is()
2451 ? OUString("BackgroundDialog")
2452 : OUString("PageDialog"));
2453 if (aDlg.run() == RET_OK)
2454 {
2455
2456 // ItemSet->UNO
2457 // UNO-properties
2458 const SfxItemSet* pSet = aDlg.GetOutputItemSet();
2459 if ( _xSection.is() )
2460 {
2461 const SfxPoolItem* pItem;
2462 if ( SfxItemState::SET == pSet->GetItemState( RPTUI_ID_BRUSHXATTR_FILL_FIRST - 1,true,&pItem))
2463 _xSection->setBackColor(sal_Int32(static_cast<const SvxBrushItem*>(pItem)->GetColor()));
2464 }
2465 else
2466 {
2467 uno::Reference< beans::XPropertySet> xProp(getUsedStyle(m_xReportDefinition),uno::UNO_QUERY_THROW);
2468 const OUString sUndoAction(RptResId(RID_STR_UNDO_CHANGEPAGEreinterpret_cast<char const *>("RID_STR_UNDO_CHANGEPAGE"
"\004" u8"Change page attributes")
));
2469 UndoContext aUndoContext( getUndoManager(), sUndoAction );
2470 const SfxPoolItem* pItem = nullptr;
2471 if ( SfxItemState::SET == pSet->GetItemState( RPTUI_ID_SIZEXATTR_FILL_FIRST - 5,true,&pItem))
2472 {
2473 uno::Any aValue;
2474 static_cast<const SvxSizeItem*>(pItem)->QueryValue(aValue);
2475 xProp->setPropertyValue(PROPERTY_PAPERSIZE"Size",aValue);
2476 resetZoomType();
2477 }
2478
2479 if ( SfxItemState::SET == pSet->GetItemState( RPTUI_ID_LRSPACEXATTR_FILL_FIRST - 8,true,&pItem))
2480 {
2481 Any aValue;
2482 static_cast<const SvxLRSpaceItem*>(pItem)->QueryValue(aValue,MID_L_MARGIN4);
2483 xProp->setPropertyValue(PROPERTY_LEFTMARGIN"LeftMargin",aValue);
2484 static_cast<const SvxLRSpaceItem*>(pItem)->QueryValue(aValue,MID_R_MARGIN5);
2485 xProp->setPropertyValue(PROPERTY_RIGHTMARGIN"RightMargin",aValue);
2486 }
2487 if ( SfxItemState::SET == pSet->GetItemState( RPTUI_ID_ULSPACEXATTR_FILL_FIRST - 7,true,&pItem))
2488 {
2489 xProp->setPropertyValue(PROPERTY_TOPMARGIN"TopMargin",uno::makeAny(static_cast<const SvxULSpaceItem*>(pItem)->GetUpper()));
2490 xProp->setPropertyValue(PROPERTY_BOTTOMMARGIN"BottomMargin",uno::makeAny(static_cast<const SvxULSpaceItem*>(pItem)->GetLower()));
2491 }
2492 if ( SfxItemState::SET == pSet->GetItemState( RPTUI_ID_PAGEXATTR_FILL_FIRST - 6,true,&pItem))
2493 {
2494 const SvxPageItem* pPageItem = static_cast<const SvxPageItem*>(pItem);
2495 xProp->setPropertyValue(PROPERTY_ISLANDSCAPE"IsLandscape",uno::makeAny(pPageItem->IsLandscape()));
2496 xProp->setPropertyValue(PROPERTY_NUMBERINGTYPE"NumberingType",uno::makeAny(static_cast<sal_Int16>(pPageItem->GetNumType())));
2497 uno::Any aValue;
2498 pPageItem->QueryValue(aValue,MID_PAGE_LAYOUT2);
2499 xProp->setPropertyValue(PROPERTY_PAGESTYLELAYOUT"PageStyleLayout",aValue);
2500 resetZoomType();
2501 }
2502 if ( SfxItemState::SET == pSet->GetItemState( RPTUI_ID_BRUSHXATTR_FILL_FIRST - 1,true,&pItem))
2503 {
2504 ::Color aBackColor = static_cast<const SvxBrushItem*>(pItem)->GetColor();
2505 xProp->setPropertyValue(PROPERTY_BACKTRANSPARENT"BackTransparent",uno::makeAny(aBackColor == COL_TRANSPARENT));
2506 xProp->setPropertyValue(PROPERTY_BACKCOLOR"BackColor",uno::makeAny(aBackColor));
2507 }
2508 }
2509 }
2510 }
2511 }
2512 catch(const Exception&)
2513 {
2514 DBG_UNHANDLED_EXCEPTION("reportdesign")DbgUnhandledException( DbgGetCaughtException(), __func__, "/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "2514" ": ", "reportdesign" );
;
2515 }
2516 SfxItemPool::Free(pPool);
2517
2518 for (SfxPoolItem* pDefault : pDefaults)
2519 delete pDefault;
2520
2521}
2522
2523
2524sal_Bool SAL_CALL OReportController::attachModel(const uno::Reference< frame::XModel > & xModel)
2525{
2526 ::osl::MutexGuard aGuard( getMutex() );
2527
2528 uno::Reference< report::XReportDefinition > xReportDefinition( xModel, UNO_QUERY );
2529 if ( !xReportDefinition.is() )
2530 return false;
2531
2532 uno::Reference< document::XUndoManagerSupplier > xTestSuppUndo( xModel, UNO_QUERY );
2533 if ( !xTestSuppUndo.is() )
2534 return false;
2535
2536 m_xReportDefinition = xReportDefinition;
2537 return true;
2538}
2539
2540
2541void OReportController::openSortingAndGroupingDialog()
2542{
2543 if ( !m_xReportDefinition.is() )
2544 return;
2545 if (!m_xGroupsFloater)
2546 {
2547 m_xGroupsFloater = std::make_shared<OGroupsSortingDialog>(getFrameWeld(), !isEditable(), this);
2548 SvtViewOptions aDlgOpt(EViewType::Window, OStringToOUString(m_xGroupsFloater->get_help_id(), RTL_TEXTENCODING_UTF8(((rtl_TextEncoding) 76))));
2549 if ( aDlgOpt.Exists() )
2550 m_xGroupsFloater->getDialog()->set_window_state(OUStringToOString(aDlgOpt.GetWindowState(), RTL_TEXTENCODING_ASCII_US(((rtl_TextEncoding) 11))));
2551 }
2552 if (isUiVisible())
2553 {
2554 if (!m_xGroupsFloater->getDialog()->get_visible())
2555 weld::DialogController::runAsync(m_xGroupsFloater, [this](sal_Int32 /*nResult*/) { m_xGroupsFloater.reset(); });
2556 else
2557 m_xGroupsFloater->response(RET_CANCEL);
2558 }
2559}
2560
2561sal_Int32 OReportController::getGroupPosition(const uno::Reference< report::XGroup >& _xGroup)
2562{
2563 return rptui::getPositionInIndexAccess(m_xReportDefinition->getGroups().get(),_xGroup);
2564}
2565
2566
2567void OReportController::Notify(SfxBroadcaster & /* _rBc */, SfxHint const & _rHint)
2568{
2569 const DlgEdHint* pDlgEdHint = dynamic_cast<const DlgEdHint*>(&_rHint);
2570 if (!(pDlgEdHint && pDlgEdHint->GetKind() == RPTUI_HINT_SELECTIONCHANGED))
2571 return;
2572
2573 const sal_Int32 nSelectionCount = getDesignView()->getMarkedObjectCount();
2574 if ( m_nSelectionCount != nSelectionCount )
2575 {
2576 m_nSelectionCount = nSelectionCount;
2577 InvalidateAll();
2578 }
2579 lang::EventObject aEvent(*this);
2580 m_aSelectionListeners.forEach<view::XSelectionChangeListener>(
2581 [&aEvent] (uno::Reference<view::XSelectionChangeListener> const& xListener) {
2582 return xListener->selectionChanged(aEvent);
2583 });
2584}
2585
2586void OReportController::executeMethodWithUndo(const char* pUndoStrId,const ::std::function<void(ODesignView *)>& _pMemfun)
2587{
2588 const OUString sUndoAction = RptResId(pUndoStrId);
2589 UndoContext aUndoContext( getUndoManager(), sUndoAction );
2590 _pMemfun( getDesignView() );
2591 InvalidateFeature( SID_UNDO(5000 + 701) );
2592}
2593
2594void OReportController::alignControlsWithUndo(const char* pUndoStrId, ControlModification _nControlModification, bool _bAlignAtSection)
2595{
2596 const OUString sUndoAction = RptResId(pUndoStrId);
2597 UndoContext aUndoContext( getUndoManager(), sUndoAction );
2598 getDesignView()->alignMarkedObjects(_nControlModification,_bAlignAtSection);
2599 InvalidateFeature( SID_UNDO(5000 + 701) );
2600}
2601
2602void OReportController::shrinkSectionBottom(const uno::Reference<report::XSection>& _xSection)
2603{
2604 const sal_Int32 nElements = _xSection->getCount();
2605 if (nElements == 0)
2606 {
2607 // there are no elements
2608 return;
2609 }
2610 const sal_Int32 nSectionHeight = _xSection->getHeight();
2611 sal_Int32 nMaxPositionY = 0;
2612 uno::Reference< report::XReportComponent> xReportComponent;
2613
2614 // for every component get its Y-position and compare it to the current Y-position
2615 for (int i=0;i<nElements;i++)
2616 {
2617 xReportComponent.set(_xSection->getByIndex(i), uno::UNO_QUERY);
2618 const sal_Int32 nReportComponentPositionY = xReportComponent->getPositionY();
2619 const sal_Int32 nReportComponentHeight = xReportComponent->getHeight();
2620 const sal_Int32 nReportComponentPositionYAndHeight = nReportComponentPositionY + nReportComponentHeight;
2621 nMaxPositionY = std::max(nReportComponentPositionYAndHeight, nMaxPositionY);
2622 }
2623 // now we know the minimal Y-Position and maximal Y-Position
2624
2625 if (nMaxPositionY > (nSectionHeight - 7) ) // Magic Number, we use a little bit less heights for right positioning
2626 {
2627 // the lowest position is already 0
2628 return;
2629 }
2630 _xSection->setHeight(nMaxPositionY);
2631}
2632
2633void OReportController::shrinkSectionTop(const uno::Reference<report::XSection>& _xSection)
2634{
2635 const sal_Int32 nElements = _xSection->getCount();
2636 if (nElements == 0)
2637 {
2638 // there are no elements
2639 return;
2640 }
2641
2642 const sal_Int32 nSectionHeight = _xSection->getHeight();
2643 sal_Int32 nMinPositionY = nSectionHeight;
2644 uno::Reference< report::XReportComponent> xReportComponent;
2645
2646 // for every component get its Y-position and compare it to the current Y-position
2647 for (int i=0;i<nElements;i++)
2648 {
2649 xReportComponent.set(_xSection->getByIndex(i), uno::UNO_QUERY);
2650 const sal_Int32 nReportComponentPositionY = xReportComponent->getPositionY();
2651 nMinPositionY = std::min(nReportComponentPositionY, nMinPositionY);
2652 }
2653 // now we know the minimal Y-Position and maximal Y-Position
2654 if (nMinPositionY == 0)
2655 {
2656 // the lowest position is already 0
2657 return;
2658 }
2659 for (int i=0;i<nElements;i++)
2660 {
2661 xReportComponent.set(_xSection->getByIndex(i), uno::UNO_QUERY);
2662 const sal_Int32 nReportComponentPositionY = xReportComponent->getPositionY();
2663 const sal_Int32 nNewPositionY = nReportComponentPositionY - nMinPositionY;
2664 xReportComponent->setPositionY(nNewPositionY);
2665 }
2666 const sal_Int32 nNewSectionHeight = nSectionHeight - nMinPositionY;
2667 _xSection->setHeight(nNewSectionHeight);
2668}
2669
2670void OReportController::shrinkSection(const char* pUndoStrId, const uno::Reference<report::XSection>& _xSection, sal_Int32 _nSid)
2671{
2672 if ( _xSection.is() )
2673 {
2674 const OUString sUndoAction = RptResId(pUndoStrId);
2675 UndoContext aUndoContext( getUndoManager(), sUndoAction );
2676
2677 if (_nSid == SID_SECTION_SHRINK( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 163 )
)
2678 {
2679 shrinkSectionTop(_xSection);
2680 shrinkSectionBottom(_xSection);
2681 }
2682 else if (_nSid == SID_SECTION_SHRINK_TOP( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 164 )
)
2683 {
2684 shrinkSectionTop(_xSection);
2685 }
2686 else if (_nSid == SID_SECTION_SHRINK_BOTTOM( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 165 )
)
2687 {
2688 shrinkSectionBottom(_xSection);
2689 }
2690 }
2691
2692 InvalidateFeature( SID_UNDO(5000 + 701) );
2693}
2694
2695
2696uno::Any SAL_CALL OReportController::getViewData()
2697{
2698 ::osl::MutexGuard aGuard( getMutex() );
2699
2700 const sal_Int32 nCommandIDs[] =
2701 {
2702 SID_GRID_VISIBLE(27000 +322),
2703 SID_GRID_USE(27000 +154),
2704 SID_HELPLINES_MOVE(27000 +153),
2705 SID_RULER(27000 +40),
2706 SID_SHOW_PROPERTYBROWSER( 10000 + 943 ),
2707 SID_PROPERTYBROWSER_LAST_PAGE( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 24 )
,
2708 SID_SPLIT_POSITION( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 23 )
2709 };
2710
2711 ::comphelper::NamedValueCollection aCommandProperties;
2712 for (sal_Int32 nCommandID : nCommandIDs)
2713 {
2714 const FeatureState aFeatureState = GetState( nCommandID );
2715
2716 OUString sCommandURL( getURLForId( nCommandID ).Main );
2717 OSL_ENSURE( sCommandURL.startsWith( ".uno:" ), "OReportController::getViewData: illegal command URL!" )do { if (true && (!(sCommandURL.startsWith( ".uno:" )
))) { sal_detail_logFormat((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"
), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "2717" ": "), "%s", "OReportController::getViewData: illegal command URL!"
); } } while (false)
;
2718 sCommandURL = sCommandURL.copy( 5 );
2719
2720 Any aCommandState;
2721 if ( !!aFeatureState.bChecked )
2722 aCommandState <<= *aFeatureState.bChecked;
2723 else if ( aFeatureState.aValue.hasValue() )
2724 aCommandState = aFeatureState.aValue;
2725
2726 aCommandProperties.put( sCommandURL, aCommandState );
2727 }
2728
2729 ::comphelper::NamedValueCollection aViewData;
2730 aViewData.put( "CommandProperties", aCommandProperties.getPropertyValues() );
2731
2732 if ( getDesignView() )
2733 {
2734 ::std::vector<sal_uInt16> aCollapsedPositions;
2735 getDesignView()->fillCollapsedSections(aCollapsedPositions);
2736 if ( !aCollapsedPositions.empty() )
2737 {
2738 uno::Sequence<beans::PropertyValue> aCollapsedSections(aCollapsedPositions.size());
2739 beans::PropertyValue* pCollapsedIter = aCollapsedSections.getArray();
2740 sal_Int32 i = 1;
2741 for (const auto& rPos : aCollapsedPositions)
2742 {
2743 pCollapsedIter->Name = PROPERTY_SECTION"Section" + OUString::number(i);
2744 pCollapsedIter->Value <<= static_cast<sal_Int32>(rPos);
2745 ++pCollapsedIter;
2746 ++i;
2747 }
2748
2749 aViewData.put( "CollapsedSections", aCollapsedSections );
2750 }
2751
2752 OSectionWindow* pSectionWindow = getDesignView()->getMarkedSection();
2753 if ( pSectionWindow )
2754 {
2755 aViewData.put( "MarkedSection", static_cast<sal_Int32>(pSectionWindow->getReportSection().getPage()->GetPageNum()) );
2756 }
2757 }
2758
2759 aViewData.put( "ZoomFactor", m_nZoomValue );
2760 return uno::makeAny( aViewData.getPropertyValues() );
2761}
2762
2763void SAL_CALL OReportController::restoreViewData(const uno::Any& i_data)
2764{
2765 ::osl::MutexGuard aGuard( getMutex() );
2766
2767 try
2768 {
2769 const ::comphelper::NamedValueCollection aViewData( i_data );
2770
2771 m_aCollapsedSections = aViewData.getOrDefault( "CollapsedSections", m_aCollapsedSections );
2772 m_nPageNum = aViewData.getOrDefault( "MarkedSection", m_nPageNum );
2773 m_nZoomValue = aViewData.getOrDefault( "ZoomFactor", m_nZoomValue );
2774 // TODO: setting those 3 members is not enough - in theory, restoreViewData can be called when the
2775 // view is fully alive, so we need to reflect those 3 values in the view.
2776 // (At the moment, the method is called only during construction phase)
2777
2778
2779 ::comphelper::NamedValueCollection aCommandProperties( aViewData.get( "CommandProperties" ) );
2780 const ::std::vector< OUString > aCommandNames( aCommandProperties.getNames() );
2781
2782 for ( const auto& rCommandName : aCommandNames )
2783 {
2784 const Any& rCommandValue = aCommandProperties.get( rCommandName );
2785 if ( !rCommandValue.hasValue() )
2786 continue;
2787
2788 if ( getView() )
2789 {
2790 util::URL aCommand;
2791 aCommand.Complete = ".uno:" + rCommandName;
2792
2793 Sequence< PropertyValue > aCommandArgs(1);
2794 aCommandArgs[0].Name = "Value";
2795 aCommandArgs[0].Value = rCommandValue;
2796
2797 executeUnChecked( aCommand, aCommandArgs );
2798 }
2799 else
2800 {
2801 if ( rCommandName == "ShowRuler" )
2802 OSL_VERIFY( rCommandValue >>= m_bShowRuler )do { if (!(rCommandValue >>= m_bShowRuler)) do { if (true
&& (!(0))) { sal_detail_logFormat((SAL_DETAIL_LOG_LEVEL_WARN
), ("legacy.osl"), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "2802" ": "), "OSL_ASSERT: %s", "0"); } } while (false);
} while (0)
;
2803 else if ( rCommandName == "HelplinesMove" )
2804 OSL_VERIFY( rCommandValue >>= m_bHelplinesMove )do { if (!(rCommandValue >>= m_bHelplinesMove)) do { if
(true && (!(0))) { sal_detail_logFormat((SAL_DETAIL_LOG_LEVEL_WARN
), ("legacy.osl"), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "2804" ": "), "OSL_ASSERT: %s", "0"); } } while (false);
} while (0)
;
2805 else if ( rCommandName == "GridVisible" )
2806 OSL_VERIFY( rCommandValue >>= m_bGridVisible )do { if (!(rCommandValue >>= m_bGridVisible)) do { if (
true && (!(0))) { sal_detail_logFormat((SAL_DETAIL_LOG_LEVEL_WARN
), ("legacy.osl"), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "2806" ": "), "OSL_ASSERT: %s", "0"); } } while (false);
} while (0)
;
2807 else if ( rCommandName == "GridUse" )
2808 OSL_VERIFY( rCommandValue >>= m_bGridUse )do { if (!(rCommandValue >>= m_bGridUse)) do { if (true
&& (!(0))) { sal_detail_logFormat((SAL_DETAIL_LOG_LEVEL_WARN
), ("legacy.osl"), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "2808" ": "), "OSL_ASSERT: %s", "0"); } } while (false);
} while (0)
;
2809 else if ( rCommandName == "ControlProperties" )
2810 OSL_VERIFY( rCommandValue >>= m_bShowProperties )do { if (!(rCommandValue >>= m_bShowProperties)) do { if
(true && (!(0))) { sal_detail_logFormat((SAL_DETAIL_LOG_LEVEL_WARN
), ("legacy.osl"), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "2810" ": "), "OSL_ASSERT: %s", "0"); } } while (false);
} while (0)
;
2811 else if ( rCommandName == "LastPropertyBrowserPage" )
2812 OSL_VERIFY( rCommandValue >>= m_sLastActivePage )do { if (!(rCommandValue >>= m_sLastActivePage)) do { if
(true && (!(0))) { sal_detail_logFormat((SAL_DETAIL_LOG_LEVEL_WARN
), ("legacy.osl"), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "2812" ": "), "OSL_ASSERT: %s", "0"); } } while (false);
} while (0)
;
2813 else if ( rCommandName == "SplitPosition" )
2814 OSL_VERIFY( rCommandValue >>= m_nSplitPos )do { if (!(rCommandValue >>= m_nSplitPos)) do { if (true
&& (!(0))) { sal_detail_logFormat((SAL_DETAIL_LOG_LEVEL_WARN
), ("legacy.osl"), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "2814" ": "), "OSL_ASSERT: %s", "0"); } } while (false);
} while (0)
;
2815 }
2816 }
2817 }
2818 catch(const IllegalArgumentException&)
2819 {
2820 DBG_UNHANDLED_EXCEPTION("reportdesign")DbgUnhandledException( DbgGetCaughtException(), __func__, "/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "2820" ": ", "reportdesign" );
;
2821 }
2822}
2823
2824Reference<XFrame> OReportController::getXFrame()
2825{
2826 if ( !m_xFrameLoader.is() )
2827 {
2828 m_xFrameLoader.set( frame::Desktop::create(m_xContext) );
2829 }
2830 const sal_Int32 nFrameSearchFlag = frame::FrameSearchFlag::TASKS | frame::FrameSearchFlag::CREATE;
2831 Reference<XFrame> xFrame = m_xFrameLoader->findFrame("_blank",nFrameSearchFlag);
2832 return xFrame;
2833}
2834
2835
2836uno::Reference<frame::XModel> OReportController::executeReport()
2837{
2838 OSL_ENSURE(m_xReportDefinition.is(),"Where is my report?")do { if (true && (!(m_xReportDefinition.is()))) { sal_detail_logFormat
((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "2838" ": "), "%s", "Where is my report?"); } } while (false
)
;
2839
2840 uno::Reference<frame::XModel> xModel;
2841 if ( m_xReportDefinition.is() )
2842 {
2843 const char* pErrorId = RID_ERR_NO_COMMANDreinterpret_cast<char const *>("RID_ERR_NO_COMMAND" "\004"
u8"The report can not be executed unless it is bound to content."
)
;
2844 bool bEnabled = !m_xReportDefinition->getCommand().isEmpty();
2845 if ( bEnabled )
2846 {
2847 bEnabled = false;
2848 const sal_uInt16 nCount = m_aReportModel->GetPageCount();
2849 sal_uInt16 i = 0;
2850 for (; i < nCount && !bEnabled ; ++i)
2851 {
2852 const SdrPage* pPage = m_aReportModel->GetPage(i);
2853 bEnabled = pPage->GetObjCount() != 0;
2854 }
2855 if ( !bEnabled )
2856 pErrorId = RID_ERR_NO_OBJECTSreinterpret_cast<char const *>("RID_ERR_NO_OBJECTS" "\004"
u8"The report can not be executed unless at least one object has been inserted."
)
;
2857 }
2858
2859 dbtools::SQLExceptionInfo aInfo;
2860 if ( !bEnabled )
2861 {
2862 sdb::SQLContext aFirstMessage;
2863 OUString sInfo = RptResId( pErrorId );
2864 aFirstMessage.Message = sInfo;
2865 aInfo = aFirstMessage;
2866 if ( isEditable() )
2867 {
2868 sal_uInt16 nCommand = 0;
2869 if (!strcmp(pErrorId, RID_ERR_NO_COMMANDreinterpret_cast<char const *>("RID_ERR_NO_COMMAND" "\004"
u8"The report can not be executed unless it is bound to content."
)
))
2870 {
2871 if ( !m_bShowProperties )
2872 executeUnChecked(SID_SHOW_PROPERTYBROWSER( 10000 + 943 ),uno::Sequence< beans::PropertyValue>());
2873
2874 m_sLastActivePage = "Data";
2875 getDesignView()->setCurrentPage(m_sLastActivePage);
2876 nCommand = SID_SELECT_REPORT( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 12 )
;
2877 }
2878 else if ( getDesignView() && !getDesignView()->isAddFieldVisible() )
2879 {
2880 nCommand = SID_FM_ADD_FIELD( 10000 + 623 );
2881 }
2882 if ( nCommand )
2883 {
2884 uno::Sequence< beans::PropertyValue> aArgs;
2885 executeUnChecked(nCommand,aArgs);
2886 }
2887 }
2888 }
2889 else
2890 {
2891 m_bInGeneratePreview = true;
2892 try
2893 {
2894 weld::WaitObject aWait(getFrameWeld()); // cursor
2895 if ( !m_xReportEngine.is() )
2896 m_xReportEngine.set( report::ReportEngine::create(m_xContext) );
2897 m_xReportEngine->setReportDefinition(m_xReportDefinition);
2898 m_xReportEngine->setActiveConnection(getConnection());
2899 Reference<XFrame> xFrame = getXFrame();
2900 xModel = m_xReportEngine->createDocumentAlive(xFrame);
2901 }
2902 catch(const sdbc::SQLException&)
2903 { // SQLExceptions and derived exceptions must not be translated
2904 aInfo = ::cppu::getCaughtException();
2905 }
2906 catch(const uno::Exception& e)
2907 {
2908 uno::Any aCaughtException( ::cppu::getCaughtException() );
2909
2910 // our first message says: we caught an exception
2911 sdb::SQLContext aFirstMessage;
2912 OUString sInfo(RptResId(RID_STR_CAUGHT_FOREIGN_EXCEPTIONreinterpret_cast<char const *>("RID_STR_CAUGHT_FOREIGN_EXCEPTION"
"\004" u8"An exception of type $type$ was caught.")
));
2913 sInfo = sInfo.replaceAll("$type$", aCaughtException.getValueTypeName());
2914 aFirstMessage.Message = sInfo;
2915
2916 // our second message: the message of the exception we caught
2917 sdbc::SQLException aSecondMessage;
2918 aSecondMessage.Message = e.Message;
2919 aSecondMessage.Context = e.Context;
2920
2921 // maybe our third message: the message which is wrapped in the exception we caught
2922 sdbc::SQLException aThirdMessage;
2923 lang::WrappedTargetException aWrapped;
2924 if ( aCaughtException >>= aWrapped )
2925 {
2926 aThirdMessage.Message = aWrapped.Message;
2927 aThirdMessage.Context = aWrapped.Context;
2928 }
2929
2930 if ( !aThirdMessage.Message.isEmpty() )
2931 aSecondMessage.NextException <<= aThirdMessage;
2932 aFirstMessage.NextException <<= aSecondMessage;
2933
2934 aInfo = aFirstMessage;
2935 }
2936 if (aInfo.isValid())
2937 {
2938 const OUString suSQLContext = RptResId( RID_STR_COULD_NOT_CREATE_REPORTreinterpret_cast<char const *>("RID_STR_COULD_NOT_CREATE_REPORT"
"\004" u8"An error occurred while creating the report.")
);
2939 aInfo.prepend(suSQLContext);
2940 }
2941 m_bInGeneratePreview = false;
2942 }
2943
2944 if (aInfo.isValid())
2945 {
2946 showError(aInfo);
2947 }
2948 }
2949 return xModel;
2950}
2951
2952uno::Reference< frame::XModel > SAL_CALL OReportController::getModel()
2953{
2954 return m_xReportDefinition.get();
2955}
2956
2957uno::Reference< sdbc::XRowSet > const & OReportController::getRowSet()
2958{
2959 OSL_PRECOND( m_xReportDefinition.is(), "OReportController::getRowSet: no report definition?!" )do { if (true && (!(m_xReportDefinition.is()))) { sal_detail_logFormat
((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "2959" ": "), "%s", "OReportController::getRowSet: no report definition?!"
); } } while (false)
;
2960
2961 if ( m_xRowSet.is() || !m_xReportDefinition.is() )
2962 return m_xRowSet;
2963
2964 try
2965 {
2966 uno::Reference< sdbc::XRowSet > xRowSet(
2967 getORB()->getServiceManager()->createInstanceWithContext("com.sun.star.sdb.RowSet", getORB()),
2968 uno::UNO_QUERY );
2969 uno::Reference< beans::XPropertySet> xRowSetProp( xRowSet, uno::UNO_QUERY_THROW );
2970
2971 xRowSetProp->setPropertyValue( PROPERTY_ACTIVECONNECTION"ActiveConnection", uno::makeAny( getConnection() ) );
2972 xRowSetProp->setPropertyValue( PROPERTY_APPLYFILTER"ApplyFilter", uno::makeAny( true ) );
2973
2974 auto aNoConverter = std::make_shared<AnyConverter>();
2975 TPropertyNamePair aPropertyMediation;
2976 aPropertyMediation.emplace( PROPERTY_COMMAND"Command", TPropertyConverter(PROPERTY_COMMAND"Command",aNoConverter) );
2977 aPropertyMediation.emplace( PROPERTY_COMMANDTYPE"CommandType", TPropertyConverter(PROPERTY_COMMANDTYPE"CommandType",aNoConverter) );
2978 aPropertyMediation.emplace( PROPERTY_ESCAPEPROCESSING"EscapeProcessing", TPropertyConverter(PROPERTY_ESCAPEPROCESSING"EscapeProcessing",aNoConverter) );
2979 aPropertyMediation.emplace( PROPERTY_FILTER"Filter", TPropertyConverter(PROPERTY_FILTER"Filter",aNoConverter) );
2980
2981 m_xRowSetMediator = new OPropertyMediator( m_xReportDefinition.get(), xRowSetProp, aPropertyMediation );
2982 m_xRowSet = xRowSet;
2983 }
2984 catch(const uno::Exception&)
2985 {
2986 DBG_UNHANDLED_EXCEPTION("reportdesign")DbgUnhandledException( DbgGetCaughtException(), __func__, "/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "2986" ": ", "reportdesign" );
;
2987 }
2988
2989 return m_xRowSet;
2990}
2991
2992void OReportController::insertGraphic()
2993{
2994 const OUString sTitle(RptResId(RID_STR_IMPORT_GRAPHICreinterpret_cast<char const *>("RID_STR_IMPORT_GRAPHIC"
"\004" u8"Insert graphics")
));
2995 // build some arguments for the upcoming dialog
2996 try
2997 {
2998 uno::Reference< report::XSection> xSection = getDesignView()->getCurrentSection();
2999 ::sfx2::FileDialogHelper aDialog(ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW, FileDialogFlags::Graphic, getFrameWeld());
3000 aDialog.SetTitle( sTitle );
3001
3002 uno::Reference< ui::dialogs::XFilePickerControlAccess > xController(aDialog.GetFilePicker(), UNO_QUERY_THROW);
3003 xController->setValue(ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_PREVIEW, 0, css::uno::Any(true));
3004 xController->enableControl(ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_LINK, false/*sal_True*/);
3005 xController->setValue( ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_LINK, 0, css::uno::Any(true) );
3006
3007 if ( ERRCODE_NONEErrCode(0) == aDialog.Execute() )
3008 {
3009 bool bLink = true;
3010 xController->getValue( ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_LINK, 0) >>= bLink;
3011 uno::Sequence<beans::PropertyValue> aArgs( comphelper::InitPropertySequence({
3012 { PROPERTY_IMAGEURL"ImageURL", Any(aDialog.GetPath()) },
3013 { PROPERTY_PRESERVEIRI"PreserveIRI", Any(bLink) }
3014 }));
3015 createControl(aArgs,xSection,OUString(),OBJ_DLG_IMAGECONTROLOBJ_FM_IMAGECONTROL);
3016 }
3017 }
3018 catch(const Exception&)
3019 {
3020 DBG_UNHANDLED_EXCEPTION("reportdesign")DbgUnhandledException( DbgGetCaughtException(), __func__, "/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "3020" ": ", "reportdesign" );
;
3021 }
3022}
3023
3024
3025sal_Bool SAL_CALL OReportController::select( const Any& aSelection )
3026{
3027 ::osl::MutexGuard aGuard( getMutex() );
3028 if ( getDesignView() )
3029 {
3030 getDesignView()->unmarkAllObjects();
3031 getDesignView()->SetMode(DlgEdMode::Select);
3032
3033 uno::Sequence< uno::Reference<report::XReportComponent> > aElements;
3034 if ( aSelection >>= aElements )
3035 {
3036 if ( aElements.hasElements() )
3037 getDesignView()->showProperties(uno::Reference<uno::XInterface>(aElements[0],uno::UNO_QUERY));
3038 getDesignView()->setMarked(aElements, true);
3039 }
3040 else
3041 {
3042 uno::Reference<uno::XInterface> xObject(aSelection,uno::UNO_QUERY);
3043 uno::Reference<report::XReportComponent> xProp(xObject,uno::UNO_QUERY);
3044 if ( xProp.is() )
3045 {
3046 getDesignView()->showProperties(xObject);
3047 aElements.realloc(1);
3048 aElements[0] = xProp;
3049 getDesignView()->setMarked(aElements, true);
3050 }
3051 else
3052 {
3053 uno::Reference<report::XSection> xSection(aSelection,uno::UNO_QUERY);
3054 if ( !xSection.is() && xObject.is() )
3055 getDesignView()->showProperties(xObject);
3056 getDesignView()->setMarked(xSection,xSection.is());
3057 }
3058 }
3059 InvalidateAll();
3060 }
3061 return true;
3062}
3063
3064Any SAL_CALL OReportController::getSelection( )
3065{
3066 ::osl::MutexGuard aGuard( getMutex() );
3067 Any aRet;
3068 if ( getDesignView() )
3069 {
3070 aRet = getDesignView()->getCurrentlyShownProperty();
3071 if ( !aRet.hasValue() )
3072 aRet <<= getDesignView()->getCurrentSection();
3073 }
3074 return aRet;
3075}
3076
3077void SAL_CALL OReportController::addSelectionChangeListener( const Reference< view::XSelectionChangeListener >& Listener )
3078{
3079 m_aSelectionListeners.addInterface( Listener );
3080}
3081
3082void SAL_CALL OReportController::removeSelectionChangeListener( const Reference< view::XSelectionChangeListener >& Listener )
3083{
3084 m_aSelectionListeners.removeInterface( Listener );
3085}
3086
3087void OReportController::createNewFunction(const uno::Any& _aValue)
3088{
3089 uno::Reference< container::XIndexContainer> xFunctions(_aValue,uno::UNO_QUERY_THROW);
3090 const OUString sNewName = RptResId(RID_STR_FUNCTIONreinterpret_cast<char const *>("RID_STR_FUNCTION" "\004"
u8"Function")
);
3091 uno::Reference< report::XFunction> xFunction(report::Function::create(m_xContext));
3092 xFunction->setName(sNewName);
3093 // the call below will also create an undo action -> listener
3094 xFunctions->insertByIndex(xFunctions->getCount(),uno::makeAny(xFunction));
3095}
3096
3097IMPL_LINK_NOARG( OReportController, OnExecuteReport, void*, void )void OReportController::LinkStubOnExecuteReport(void * instance
, void* data) { return static_cast<OReportController *>
(instance)->OnExecuteReport(data); } void OReportController
::OnExecuteReport(__attribute__ ((unused)) void*)
3098{
3099 executeReport();
3100}
3101
3102void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,const uno::Reference< report::XSection>& _xSection,const OUString& _sFunction,sal_uInt16 _nObjectId)
3103{
3104 SequenceAsHashMap aMap(_aArgs);
3105 getDesignView()->setMarked(_xSection, true);
3106 OSectionWindow* pSectionWindow = getDesignView()->getMarkedSection();
3107 if ( !pSectionWindow )
3108 return;
3109
3110 OSL_ENSURE(pSectionWindow->getReportSection().getSection() == _xSection,"Invalid section after marking the correct one.")do { if (true && (!(pSectionWindow->getReportSection
().getSection() == _xSection))) { sal_detail_logFormat((SAL_DETAIL_LOG_LEVEL_WARN
), ("legacy.osl"), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "3110" ": "), "%s", "Invalid section after marking the correct one."
); } } while (false)
;
3111
3112 sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_LEFTMARGIN"LeftMargin");
3113 const sal_Int32 nRightMargin = getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_RIGHTMARGIN"RightMargin");
3114 const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(m_xReportDefinition,PROPERTY_PAPERSIZE"Size").Width - nRightMargin;
3115 awt::Point aPos = aMap.getUnpackedValueOrDefault(PROPERTY_POSITION"Position",awt::Point(nLeftMargin,0));
3116 if ( aPos.X < nLeftMargin )
3117 aPos.X = nLeftMargin;
3118
3119 SdrObject* pNewControl = nullptr;
3120 uno::Reference< report::XReportComponent> xShapeProp;
3121 if ( _nObjectId == OBJ_CUSTOMSHAPE )
3122 {
3123 pNewControl = SdrObjFactory::MakeNewObject(
3124 *m_aReportModel,
3125 SdrInventor::ReportDesign,
3126 _nObjectId);
3127 xShapeProp.set(pNewControl->getUnoShape(),uno::UNO_QUERY);
3128 OUString sCustomShapeType = getDesignView()->GetInsertObjString();
3129 if ( sCustomShapeType.isEmpty() )
3130 sCustomShapeType = "diamond";
3131 OReportSection::createDefault(sCustomShapeType,pNewControl);
3132 pNewControl->SetLogicRect(tools::Rectangle(3000,500,6000,3500)); // switch height and width
3133 }
3134 else if ( _nObjectId == OBJ_OLE2 || OBJ_DLG_SUBREPORT(sal_uInt16(OBJ_MAXI) + 6) == _nObjectId )
3135 {
3136 pNewControl = SdrObjFactory::MakeNewObject(
3137 *m_aReportModel,
3138 SdrInventor::ReportDesign,
3139 _nObjectId);
3140
3141 pNewControl->SetLogicRect(tools::Rectangle(3000,500,8000,5500)); // switch height and width
3142 xShapeProp.set(pNewControl->getUnoShape(),uno::UNO_QUERY_THROW);
3143 OOle2Obj* pObj = dynamic_cast<OOle2Obj*>(pNewControl);
3144 if ( pObj && !pObj->IsEmpty() )
3145 {
3146 pObj->initializeChart(getModel());
3147 }
3148 }
3149 else
3150 {
3151 std::unique_ptr<SdrUnoObj, SdrObjectFreeOp> pLabel;
3152 std::unique_ptr<SdrUnoObj, SdrObjectFreeOp> pControl;
3153
3154 FmFormView::createControlLabelPair(
3155 getDesignView(),
3156 nLeftMargin,
3157 0,
3158 nullptr,
3159 nullptr,
3160 _nObjectId,
3161 SdrInventor::ReportDesign,
3162 OBJ_DLG_FIXEDTEXT(sal_uInt16(OBJ_MAXI) + 1),
3163
3164 // tdf#118963 Need a SdrModel for SdrObject creation. Dereferencing
3165 // m_aReportModel seems pretty safe, it's done in other places, initialized
3166 // in impl_initialize and throws a RuntimeException if not existing.
3167 *m_aReportModel,
3168
3169 pLabel,
3170 pControl);
3171
3172 pLabel.reset();
3173
3174 pNewControl = pControl.release();
3175 OUnoObject* pObj = dynamic_cast<OUnoObject*>(pNewControl);
3176 assert(pObj)(static_cast <bool> (pObj) ? void (0) : __assert_fail (
"pObj", "/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
, 3176, __extension__ __PRETTY_FUNCTION__))
;
3177 if(pObj)
3178 {
3179 uno::Reference<beans::XPropertySet> xUnoProp(pObj->GetUnoControlModel(),uno::UNO_QUERY);
3180 xShapeProp.set(pObj->getUnoShape(),uno::UNO_QUERY);
3181 uno::Reference<beans::XPropertySetInfo> xShapeInfo = xShapeProp->getPropertySetInfo();
3182 uno::Reference<beans::XPropertySetInfo> xInfo = xUnoProp->getPropertySetInfo();
3183
3184 const OUString sProps[] = { OUString(PROPERTY_NAME"Name")
3185 ,OUString(PROPERTY_FONTDESCRIPTOR"FontDescriptor")
3186 ,OUString(PROPERTY_FONTDESCRIPTORASIAN"FontDescriptorAsian")
3187 ,OUString(PROPERTY_FONTDESCRIPTORCOMPLEX"FontDescriptorComplex")
3188 ,OUString(PROPERTY_ORIENTATION"Orientation")
3189 ,OUString(PROPERTY_BORDER"Border")
3190 ,OUString(PROPERTY_FORMATSSUPPLIER"FormatsSupplier")
3191 ,OUString(PROPERTY_BACKGROUNDCOLOR"BackgroundColor")
3192 };
3193 for(const auto & sProp : sProps)
3194 {
3195 if ( xInfo->hasPropertyByName(sProp) && xShapeInfo->hasPropertyByName(sProp) )
3196 xUnoProp->setPropertyValue(sProp,xShapeProp->getPropertyValue(sProp));
3197 }
3198
3199 if ( xInfo->hasPropertyByName(PROPERTY_BORDER"Border") && xShapeInfo->hasPropertyByName(PROPERTY_CONTROLBORDER"ControlBorder") )
3200 xUnoProp->setPropertyValue(PROPERTY_BORDER"Border",xShapeProp->getPropertyValue(PROPERTY_CONTROLBORDER"ControlBorder"));
3201
3202
3203 if ( xInfo->hasPropertyByName(PROPERTY_DATAFIELD"DataField") && !_sFunction.isEmpty() )
3204 {
3205 ReportFormula aFunctionFormula( ReportFormula::Expression, _sFunction );
3206 xUnoProp->setPropertyValue( PROPERTY_DATAFIELD"DataField", uno::makeAny( aFunctionFormula.getCompleteFormula() ) );
3207 }
3208
3209 sal_Int32 nFormatKey = aMap.getUnpackedValueOrDefault(PROPERTY_FORMATKEY"FormatKey",sal_Int32(0));
3210 if ( nFormatKey && xInfo->hasPropertyByName(PROPERTY_FORMATKEY"FormatKey") )
3211 xUnoProp->setPropertyValue( PROPERTY_FORMATKEY"FormatKey", uno::makeAny( nFormatKey ) );
3212
3213 OUString sUrl = aMap.getUnpackedValueOrDefault(PROPERTY_IMAGEURL"ImageURL",OUString());
3214 if ( !sUrl.isEmpty() && xInfo->hasPropertyByName(PROPERTY_IMAGEURL"ImageURL") )
3215 xUnoProp->setPropertyValue( PROPERTY_IMAGEURL"ImageURL", uno::makeAny( sUrl ) );
3216
3217 pObj->CreateMediator(true);
3218
3219 if ( _nObjectId == OBJ_DLG_FIXEDTEXT(sal_uInt16(OBJ_MAXI) + 1) ) // special case for fixed text
3220 xUnoProp->setPropertyValue(PROPERTY_LABEL"Label",uno::makeAny(OUnoObject::GetDefaultName(pObj)));
3221 else if ( _nObjectId == OBJ_DLG_VFIXEDLINE(sal_uInt16(OBJ_MAXI) + 5) )
3222 {
3223 awt::Size aOlSize = xShapeProp->getSize();
3224 xShapeProp->setSize(awt::Size(aOlSize.Height,aOlSize.Width)); // switch height and width
3225 }
3226 }
3227 }
3228
3229 const sal_Int32 nShapeWidth = aMap.getUnpackedValueOrDefault(PROPERTY_WIDTH"Width",xShapeProp->getWidth());
3230 if ( nShapeWidth != xShapeProp->getWidth() )
3231 xShapeProp->setWidth( nShapeWidth );
3232
3233 const bool bChangedPos = (aPos.X + nShapeWidth) > nPaperWidth;
3234 if ( bChangedPos )
3235 aPos.X = nPaperWidth - nShapeWidth;
3236 xShapeProp->setPosition(aPos);
3237
3238 correctOverlapping(pNewControl,pSectionWindow->getReportSection());
3239}
3240
3241void OReportController::createDateTime(const Sequence< PropertyValue >& _aArgs)
3242{
3243 getDesignView()->unmarkAllObjects();
3244
3245 const OUString sUndoAction(RptResId(RID_STR_UNDO_INSERT_CONTROLreinterpret_cast<char const *>("RID_STR_UNDO_INSERT_CONTROL"
"\004" u8"Insert Control")
));
3246 UndoContext aUndoContext( getUndoManager(), sUndoAction );
3247
3248 SequenceAsHashMap aMap(_aArgs);
3249 aMap.createItemIfMissing(PROPERTY_FORMATKEY"FormatKey",aMap.getUnpackedValueOrDefault(PROPERTY_FORMATKEYDATE"FormatKeyDate",sal_Int32(0)));
3250
3251 uno::Reference< report::XSection> xSection = aMap.getUnpackedValueOrDefault(PROPERTY_SECTION"Section",uno::Reference< report::XSection>());
3252 OUString sFunction;
3253
3254 bool bDate = aMap.getUnpackedValueOrDefault(PROPERTY_DATE_STATE"DateState", false);
3255 if ( bDate )
3256 {
3257 sFunction = "TODAY()";
3258 createControl(aMap.getAsConstPropertyValueList(),xSection,sFunction);
3259 }
3260 bool bTime = aMap.getUnpackedValueOrDefault(PROPERTY_TIME_STATE"TimeState", false);
3261 if ( bTime )
3262 {
3263 sFunction = "TIMEVALUE(NOW())";
3264 aMap[PROPERTY_FORMATKEY"FormatKey"] <<= aMap.getUnpackedValueOrDefault(PROPERTY_FORMATKEYTIME"FormatKeyTime",sal_Int32(0));
3265 createControl(aMap.getAsConstPropertyValueList(),xSection,sFunction);
3266 }
3267}
3268
3269void OReportController::createPageNumber(const Sequence< PropertyValue >& _aArgs)
3270{
3271 getDesignView()->unmarkAllObjects();
3272
3273 const OUString sUndoAction(RptResId(RID_STR_UNDO_INSERT_CONTROLreinterpret_cast<char const *>("RID_STR_UNDO_INSERT_CONTROL"
"\004" u8"Insert Control")
));
3274 UndoContext aUndoContext( getUndoManager(), sUndoAction );
3275
3276 if ( !m_xReportDefinition->getPageHeaderOn() )
3277 {
3278 uno::Sequence< beans::PropertyValue > aArgs;
3279 executeChecked(SID_PAGEHEADERFOOTER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 0 )
,aArgs);
3280 }
3281
3282 SequenceAsHashMap aMap(_aArgs);
3283 bool bStateOfPage = aMap.getUnpackedValueOrDefault(PROPERTY_STATE"State", false);
3284
3285 OUString sFunction( RptResId(STR_RPT_PN_PAGEreinterpret_cast<char const *>("STR_RPT_PN_PAGE" "\004"
u8"\"Page \" & #PAGENUMBER#")
) );
3286 sFunction = sFunction.replaceFirst("#PAGENUMBER#", "PageNumber()");
3287
3288 if ( bStateOfPage )
3289 {
3290 sFunction += RptResId(STR_RPT_PN_PAGE_OFreinterpret_cast<char const *>("STR_RPT_PN_PAGE_OF" "\004"
u8" & \" of \" & #PAGECOUNT#")
);
3291 sFunction = sFunction.replaceFirst("#PAGECOUNT#", "PageCount()");
3292 }
3293
3294 bool bInPageHeader = aMap.getUnpackedValueOrDefault(PROPERTY_PAGEHEADERON"PageHeaderOn", true);
3295 createControl(_aArgs,bInPageHeader ? m_xReportDefinition->getPageHeader() : m_xReportDefinition->getPageFooter(),sFunction);
3296}
3297
3298
3299void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
3300{
3301 getDesignView()->unmarkAllObjects();
3302
3303 // the FormatKey determines which field is required
3304 OSectionWindow* pSectionWindow[2];
3305 pSectionWindow[0] = getDesignView()->getMarkedSection();
3306
3307 if ( !pSectionWindow[0] )
3308 {
3309 select(uno::makeAny(m_xReportDefinition->getDetail()));
3310 pSectionWindow[0] = getDesignView()->getMarkedSection();
3311 if ( !pSectionWindow[0] )
3312 return;
3313 }
3314
3315 uno::Reference<report::XSection> xCurrentSection = getDesignView()->getCurrentSection();
3316 UndoContext aUndoContext(getUndoManager(), RptResId(RID_STR_UNDO_INSERT_CONTROLreinterpret_cast<char const *>("RID_STR_UNDO_INSERT_CONTROL"
"\004" u8"Insert Control")
));
3317
3318 try
3319 {
3320 bool bHandleOnlyOne = false;
3321 for(const PropertyValue& rArg : aArgs)
3322 {
3323 if (bHandleOnlyOne)
3324 break;
3325 Sequence< PropertyValue > aValue;
3326 if ( !(rArg.Value >>= aValue) )
3327 { // the sequence has only one element which already contains the descriptor
3328 bHandleOnlyOne = true;
3329 aValue = aArgs;
3330 }
3331 svx::ODataAccessDescriptor aDescriptor(aValue);
3332 SequenceAsHashMap aMap(aValue);
3333 uno::Reference<report::XSection> xSection = aMap.getUnpackedValueOrDefault("Section",xCurrentSection);
3334 uno::Reference<report::XReportDefinition> xReportDefinition = xSection->getReportDefinition();
3335
3336 getDesignView()->setMarked(xSection, true);
3337 pSectionWindow[0] = getDesignView()->getMarkedSection();
3338
3339 sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_LEFTMARGIN"LeftMargin");
3340 awt::Point aPos = aMap.getUnpackedValueOrDefault(PROPERTY_POSITION"Position",awt::Point(nLeftMargin,0));
3341 if ( aPos.X < nLeftMargin )
3342 aPos.X = nLeftMargin;
3343
3344 // LLA: new feature, add the Label in dependency of the given DND_ACTION one section up, normal or one section down
3345 sal_Int8 nDNDAction = aMap.getUnpackedValueOrDefault("DNDAction", sal_Int8(0));
3346 pSectionWindow[1] = pSectionWindow[0];
3347 bool bLabelAboveTextField = nDNDAction == DND_ACTION_COPYcss::datatransfer::dnd::DNDConstants::ACTION_COPY;
3348 if ( bLabelAboveTextField || nDNDAction == DND_ACTION_LINKcss::datatransfer::dnd::DNDConstants::ACTION_LINK )
3349 {
3350 // Add the Label one Section up
3351 pSectionWindow[1] = getDesignView()->getMarkedSection(bLabelAboveTextField ? PREVIOUS : POST);
3352 if (!pSectionWindow[1])
3353 {
3354 // maybe out of bounds
3355 pSectionWindow[1] = pSectionWindow[0];
3356 }
3357 }
3358 // clear all selections
3359 getDesignView()->unmarkAllObjects();
3360
3361 uno::Reference< beans::XPropertySet > xField( aDescriptor[ svx::DataAccessDescriptorProperty::ColumnObject ], uno::UNO_QUERY );
3362 uno::Reference< lang::XComponent > xHoldAlive;
3363 if ( !xField.is() )
3364 {
3365 OUString sCommand;
3366 OUString sColumnName;
3367 sal_Int32 nCommandType( -1 );
3368 OSL_VERIFY( aDescriptor[ svx::DataAccessDescriptorProperty::Command ] >>= sCommand )do { if (!(aDescriptor[ svx::DataAccessDescriptorProperty::Command
] >>= sCommand)) do { if (true && (!(0))) { sal_detail_logFormat
((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "3368" ": "), "OSL_ASSERT: %s", "0"); } } while (false);
} while (0)
;
3369 OSL_VERIFY( aDescriptor[ svx::DataAccessDescriptorProperty::ColumnName ] >>= sColumnName )do { if (!(aDescriptor[ svx::DataAccessDescriptorProperty::ColumnName
] >>= sColumnName)) do { if (true && (!(0))) {
sal_detail_logFormat((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"
), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "3369" ": "), "OSL_ASSERT: %s", "0"); } } while (false);
} while (0)
;
3370 OSL_VERIFY( aDescriptor[ svx::DataAccessDescriptorProperty::CommandType ] >>= nCommandType )do { if (!(aDescriptor[ svx::DataAccessDescriptorProperty::CommandType
] >>= nCommandType)) do { if (true && (!(0))) {
sal_detail_logFormat((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"
), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "3370" ": "), "OSL_ASSERT: %s", "0"); } } while (false);
} while (0)
;
3371
3372 uno::Reference< container::XNameAccess > xColumns;
3373 uno::Reference< sdbc::XConnection > xConnection( getConnection() );
3374 if ( !sCommand.isEmpty() && nCommandType != -1 && !sColumnName.isEmpty() && xConnection.is() )
3375 {
3376 if ( xReportDefinition->getCommand().isEmpty() )
3377 {
3378 xReportDefinition->setCommand(sCommand);
3379 xReportDefinition->setCommandType(nCommandType);
3380 }
3381
3382 xColumns = dbtools::getFieldsByCommandDescriptor(xConnection,nCommandType,sCommand,xHoldAlive);
3383 if ( xColumns.is() && xColumns->hasByName(sColumnName) )
3384 xField.set( xColumns->getByName( sColumnName ), uno::UNO_QUERY );
3385 }
3386
3387 if ( !xField.is() )
3388 {
3389 #if OSL_DEBUG_LEVEL1 > 0
3390 try
3391 {
3392 uno::Reference< beans::XPropertySet > xRowSetProps( getRowSet(), UNO_QUERY_THROW );
3393 OUString sRowSetCommand;
3394 sal_Int32 nRowSetCommandType( -1 );
3395 OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_COMMAND ) >>= sRowSetCommand )do { if (!(xRowSetProps->getPropertyValue( "Command" ) >>=
sRowSetCommand)) do { if (true && (!(0))) { sal_detail_logFormat
((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "3395" ": "), "OSL_ASSERT: %s", "0"); } } while (false);
} while (0)
;
3396 OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_COMMANDTYPE ) >>= nRowSetCommandType )do { if (!(xRowSetProps->getPropertyValue( "CommandType" )
>>= nRowSetCommandType)) do { if (true && (!(0
))) { sal_detail_logFormat((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"
), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "3396" ": "), "OSL_ASSERT: %s", "0"); } } while (false);
} while (0)
;
3397 OSL_ENSURE( ( sRowSetCommand == sCommand ) && ( nCommandType == nRowSetCommandType ),do { if (true && (!(( sRowSetCommand == sCommand ) &&
( nCommandType == nRowSetCommandType )))) { sal_detail_logFormat
((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "3398" ": "), "%s", "OReportController::addPairControls: this only works for a data source which equals our current settings!"
); } } while (false)
3398 "OReportController::addPairControls: this only works for a data source which equals our current settings!" )do { if (true && (!(( sRowSetCommand == sCommand ) &&
( nCommandType == nRowSetCommandType )))) { sal_detail_logFormat
((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "3398" ": "), "%s", "OReportController::addPairControls: this only works for a data source which equals our current settings!"
); } } while (false)
;
3399 // if this asserts, then either our row set and our report definition are not in sync, or somebody
3400 // requested the creation of a control/pair for another data source than what our report
3401 // definition is bound to - which is not supported for the parameters case, since we
3402 // can retrieve parameters from the RowSet only.
3403 }
3404 catch(const Exception&)
3405 {
3406 DBG_UNHANDLED_EXCEPTION("reportdesign")DbgUnhandledException( DbgGetCaughtException(), __func__, "/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "3406" ": ", "reportdesign" );
;
3407 }
3408 #endif
3409
3410 // no column name - perhaps a parameter name?
3411 uno::Reference< sdb::XParametersSupplier > xSuppParam( getRowSet(), uno::UNO_QUERY_THROW );
3412 uno::Reference< container::XIndexAccess > xParams( xSuppParam->getParameters(), uno::UNO_SET_THROW );
3413 sal_Int32 nParamCount( xParams->getCount() );
3414 for ( sal_Int32 i=0; i<nParamCount; ++i)
3415 {
3416 uno::Reference< beans::XPropertySet > xParamCol( xParams->getByIndex(i), uno::UNO_QUERY_THROW );
3417 OUString sParamName;
3418 OSL_VERIFY( xParamCol->getPropertyValue("Name") >>= sParamName )do { if (!(xParamCol->getPropertyValue("Name") >>= sParamName
)) do { if (true && (!(0))) { sal_detail_logFormat((SAL_DETAIL_LOG_LEVEL_WARN
), ("legacy.osl"), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "3418" ": "), "OSL_ASSERT: %s", "0"); } } while (false);
} while (0)
;
3419 if ( sParamName == sColumnName )
3420 {
3421 xField = xParamCol;
3422 break;
3423 }
3424 }
3425 }
3426 }
3427 if ( !xField.is() )
3428 continue;
3429
3430 sal_uInt16 nOBJID = 0;
3431 sal_Int32 nDataType = sdbc::DataType::BINARY;
3432 xField->getPropertyValue(PROPERTY_TYPE"Type") >>= nDataType;
3433 switch ( nDataType )
3434 {
3435 case sdbc::DataType::BINARY:
3436 case sdbc::DataType::VARBINARY:
3437 case sdbc::DataType::LONGVARBINARY:
3438 nOBJID = OBJ_DLG_IMAGECONTROLOBJ_FM_IMAGECONTROL;
3439 break;
3440 default:
3441 nOBJID = OBJ_DLG_FORMATTEDFIELD(sal_uInt16(OBJ_MAXI) + 3);
3442 break;
3443 }
3444
3445 if ( !nOBJID )
3446 continue;
3447
3448 Reference< util::XNumberFormatsSupplier > xSupplier = getReportNumberFormatter()->getNumberFormatsSupplier();
3449 if ( !xSupplier.is() )
3450 continue;
3451
3452 Reference< XNumberFormats > xNumberFormats(xSupplier->getNumberFormats());
3453 std::unique_ptr<SdrUnoObj, SdrObjectFreeOp> pControl[2];
3454 const sal_Int32 nRightMargin = getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_RIGHTMARGIN"RightMargin");
3455 const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(m_xReportDefinition,PROPERTY_PAPERSIZE"Size").Width - nRightMargin;
3456 OSectionView* pSectionViews[2];
3457 pSectionViews[0] = &pSectionWindow[1]->getReportSection().getSectionView();
3458 pSectionViews[1] = &pSectionWindow[0]->getReportSection().getSectionView();
3459
3460 // find this in svx
3461 FmFormView::createControlLabelPair(
3462 getDesignView(),
3463 nLeftMargin,
3464 0,
3465 xField,
3466 xNumberFormats,
3467 nOBJID,
3468 SdrInventor::ReportDesign,
3469 OBJ_DLG_FIXEDTEXT(sal_uInt16(OBJ_MAXI) + 1),
3470
3471 // tdf#118963 Need a SdrModel for SdrObject creation. Dereferencing
3472 // m_aReportModel seems pretty safe, it's done in other places, initialized
3473 // in impl_initialize and throws a RuntimeException if not existing.
3474 *m_aReportModel,
3475
3476 pControl[0],
3477 pControl[1]);
3478
3479 if ( pControl[0] && pControl[1] )
3480 {
3481 SdrPageView* pPgViews[2];
3482 pPgViews[0] = pSectionViews[0]->GetSdrPageView();
3483 pPgViews[1] = pSectionViews[1]->GetSdrPageView();
3484 if ( pPgViews[0] && pPgViews[1] )
3485 {
3486 OUString sDefaultName;
3487 size_t i = 0;
3488 OUnoObject* pObjs[2];
3489 for(i = 0; i < SAL_N_ELEMENTS(pControl)(sizeof(sal_n_array_size(pControl))); ++i)
3490 {
3491 pObjs[i] = dynamic_cast<OUnoObject*>(pControl[i].get());
3492 assert(pObjs[i])(static_cast <bool> (pObjs[i]) ? void (0) : __assert_fail
("pObjs[i]", "/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
, 3492, __extension__ __PRETTY_FUNCTION__))
;
3493 uno::Reference<beans::XPropertySet> xUnoProp(pObjs[i]->GetUnoControlModel(),uno::UNO_QUERY_THROW);
3494 uno::Reference< report::XReportComponent> xShapeProp(pObjs[i]->getUnoShape(),uno::UNO_QUERY_THROW);
3495 xUnoProp->setPropertyValue(PROPERTY_NAME"Name",xShapeProp->getPropertyValue(PROPERTY_NAME"Name"));
3496
3497 uno::Reference<beans::XPropertySetInfo> xShapeInfo = xShapeProp->getPropertySetInfo();
3498 uno::Reference<beans::XPropertySetInfo> xInfo = xUnoProp->getPropertySetInfo();
3499 const OUString sProps[] = { OUString(PROPERTY_FONTDESCRIPTOR"FontDescriptor")
3500 ,OUString(PROPERTY_FONTDESCRIPTORASIAN"FontDescriptorAsian")
3501 ,OUString(PROPERTY_FONTDESCRIPTORCOMPLEX"FontDescriptorComplex")
3502 ,OUString(PROPERTY_BORDER"Border")
3503 ,OUString(PROPERTY_BACKGROUNDCOLOR"BackgroundColor")
3504 };
3505 for(const auto & sProp : sProps)
3506 {
3507 if ( xInfo->hasPropertyByName(sProp) && xShapeInfo->hasPropertyByName(sProp) )
3508 xUnoProp->setPropertyValue(sProp,xShapeProp->getPropertyValue(sProp));
3509 }
3510 if ( xInfo->hasPropertyByName(PROPERTY_DATAFIELD"DataField") )
3511 {
3512 OUString sName;
3513 xUnoProp->getPropertyValue(PROPERTY_DATAFIELD"DataField") >>= sName;
3514 sDefaultName = sName;
3515 xUnoProp->setPropertyValue(PROPERTY_NAME"Name",uno::makeAny(sDefaultName));
3516
3517 ReportFormula aFormula( ReportFormula::Field, sName );
3518 xUnoProp->setPropertyValue( PROPERTY_DATAFIELD"DataField", uno::makeAny( aFormula.getCompleteFormula() ) );
3519 }
3520
3521 if ( xInfo->hasPropertyByName(PROPERTY_BORDER"Border") && xShapeInfo->hasPropertyByName(PROPERTY_CONTROLBORDER"ControlBorder") )
3522 xUnoProp->setPropertyValue(PROPERTY_BORDER"Border",xShapeProp->getPropertyValue(PROPERTY_CONTROLBORDER"ControlBorder"));
3523
3524 pObjs[i]->CreateMediator(true);
3525
3526 const sal_Int32 nShapeWidth = xShapeProp->getWidth();
3527 const bool bChangedPos = (aPos.X + nShapeWidth) > nPaperWidth;
3528 if ( bChangedPos )
3529 aPos.X = nPaperWidth - nShapeWidth;
3530 xShapeProp->setPosition(aPos);
3531 if ( bChangedPos )
3532 aPos.Y += xShapeProp->getHeight();
3533 aPos.X += nShapeWidth;
3534 }
3535 OUString sLabel;
3536 if ( xField->getPropertySetInfo()->hasPropertyByName(PROPERTY_LABEL"Label") )
3537 xField->getPropertyValue(PROPERTY_LABEL"Label") >>= sLabel;
3538
3539 if (pSectionViews[0] != pSectionViews[1] &&
3540 nOBJID == OBJ_DLG_FORMATTEDFIELD(sal_uInt16(OBJ_MAXI) + 3)) // we want this nice feature only at FORMATTEDFIELD
3541 {
3542 uno::Reference< report::XReportComponent> xShapePropLabel(pObjs[0]->getUnoShape(),uno::UNO_QUERY_THROW);
3543 uno::Reference< report::XReportComponent> xShapePropTextField(pObjs[1]->getUnoShape(),uno::UNO_QUERY_THROW);
3544 if ( !sLabel.isEmpty() )
3545 xShapePropTextField->setName(sLabel);
3546 awt::Point aPosLabel = xShapePropLabel->getPosition();
3547 awt::Point aPosTextField = xShapePropTextField->getPosition();
3548 aPosTextField.X = aPosLabel.X;
3549 xShapePropTextField->setPosition(aPosTextField);
3550 if (bLabelAboveTextField)
3551 {
3552 // move the label down near the splitter
3553 const uno::Reference<report::XSection> xLabelSection = pSectionWindow[1]->getReportSection().getSection();
3554 aPosLabel.Y = xLabelSection->getHeight() - xShapePropLabel->getHeight();
3555 }
3556 else
3557 {
3558 // move the label up to the splitter
3559 aPosLabel.Y = 0;
3560 }
3561 xShapePropLabel->setPosition(aPosLabel);
3562 }
3563 OUnoObject* pObj = dynamic_cast<OUnoObject*>(pControl[0].get());
3564 assert(pObj)(static_cast <bool> (pObj) ? void (0) : __assert_fail (
"pObj", "/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
, 3564, __extension__ __PRETTY_FUNCTION__))
;
3565 uno::Reference< report::XFixedText> xShapeProp(pObj->getUnoShape(),uno::UNO_QUERY_THROW);
3566 xShapeProp->setName(xShapeProp->getName() + sDefaultName );
3567
3568 for(i = 0; i < SAL_N_ELEMENTS(pControl)(sizeof(sal_n_array_size(pControl))); ++i) // insert controls
3569 {
3570 correctOverlapping(pControl[i].get(), pSectionWindow[1-i]->getReportSection());
3571 }
3572
3573 if (!bLabelAboveTextField )
3574 {
3575 if ( pSectionViews[0] == pSectionViews[1] )
3576 {
3577 tools::Rectangle aLabel = getRectangleFromControl(pControl[0].get());
3578 tools::Rectangle aTextfield = getRectangleFromControl(pControl[1].get());
3579
3580 // create a Union of the given Label and Textfield
3581 tools::Rectangle aLabelAndTextfield( aLabel );
3582 aLabelAndTextfield.Union(aTextfield);
3583
3584 // check if there exists other fields and if yes, move down
3585 bool bOverlapping = true;
3586 bool bHasToMove = false;
3587 while ( bOverlapping )
3588 {
3589 const SdrObject* pOverlappedObj = isOver(aLabelAndTextfield, *pSectionWindow[0]->getReportSection().getPage(), *pSectionViews[0], true, pControl, 2);
3590 bOverlapping = pOverlappedObj != nullptr;
3591 if ( bOverlapping )
3592 {
3593 const tools::Rectangle& aLogicRect = pOverlappedObj->GetLogicRect();
3594 aLabelAndTextfield.Move(0,aLogicRect.Top() + aLogicRect.getHeight() - aLabelAndTextfield.Top());
3595 bHasToMove = true;
3596 }
3597 }
3598
3599 if (bHasToMove)
3600 {
3601 // There was a move down, we need to move the Label and the Textfield down
3602 aLabel.Move(0, aLabelAndTextfield.Top() - aLabel.Top());
3603 aTextfield.Move(0, aLabelAndTextfield.Top() - aTextfield.Top());
3604
3605 uno::Reference< report::XReportComponent> xLabel(pControl[0]->getUnoShape(),uno::UNO_QUERY_THROW);
3606 xLabel->setPositionY(aLabel.Top());
3607
3608 uno::Reference< report::XReportComponent> xTextfield(pControl[1]->getUnoShape(),uno::UNO_QUERY_THROW);
3609 xTextfield->setPositionY(aTextfield.Top());
3610 }
3611 }
3612 }
3613 }
3614 // not sure where the ownership of these passes too...
3615 pControl[0].release();
3616 pControl[1].release();
3617 }
3618 }
3619 }
3620 catch(const Exception&)
3621 {
3622 DBG_UNHANDLED_EXCEPTION("reportdesign")DbgUnhandledException( DbgGetCaughtException(), __func__, "/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "3622" ": ", "reportdesign" );
;
3623 }
3624}
3625
3626
3627OSectionView* OReportController::getCurrentSectionView() const
3628{
3629 OSectionView* pSectionView = nullptr;
3630 OSectionWindow* pSectionWindow = getDesignView()->getMarkedSection();
3631 if ( pSectionWindow )
3632 pSectionView = &pSectionWindow->getReportSection().getSectionView();
3633 return pSectionView;
3634}
3635
3636void OReportController::changeZOrder(sal_Int32 _nId)
3637{
3638 OSectionView* pSectionView = getCurrentSectionView();
3639 if ( !pSectionView )
3640 return;
3641
3642 switch(_nId)
3643 {
3644 case SID_FRAME_TO_BOTTOM( 10000 + 287 ):
3645 pSectionView->PutMarkedToBtm();
3646 break;
3647 case SID_FRAME_TO_TOP( 10000 + 286 ):
3648 pSectionView->PutMarkedToTop();
3649 break;
3650 case SID_FRAME_DOWN( 10000 + 1119 ):
3651 pSectionView->MovMarkedToBtm();
3652 break;
3653 case SID_FRAME_UP( 10000 + 1118 ):
3654 pSectionView->MovMarkedToTop();
3655 break;
3656
3657 case SID_OBJECT_HEAVEN( 10000 + 283 ):
3658 pSectionView->SetMarkedToLayer( RPT_LAYER_FRONT );
3659 break;
3660 case SID_OBJECT_HELL( 10000 + 282 ):
3661 pSectionView->SetMarkedToLayer( RPT_LAYER_BACK );
3662 break;
3663 }
3664}
3665
3666void OReportController::listen(const bool _bAdd)
3667{
3668 const OUString aProps [] = { OUString(PROPERTY_REPORTHEADERON"ReportHeaderOn"),OUString(PROPERTY_REPORTFOOTERON"ReportFooterOn")
3669 ,OUString(PROPERTY_PAGEHEADERON"PageHeaderOn"),OUString(PROPERTY_PAGEFOOTERON"PageFooterOn")
3670 ,OUString(PROPERTY_COMMAND"Command"), OUString(PROPERTY_COMMANDTYPE"CommandType"),OUString(PROPERTY_CAPTION"Caption")
3671 };
3672
3673 void (SAL_CALL XPropertySet::*pPropertyListenerAction)( const OUString&, const uno::Reference< XPropertyChangeListener >& ) =
3674 _bAdd ? &XPropertySet::addPropertyChangeListener : &XPropertySet::removePropertyChangeListener;
3675
3676 for (const auto & aProp : aProps)
3677 (m_xReportDefinition.get()->*pPropertyListenerAction)( aProp, static_cast< XPropertyChangeListener* >( this ) );
3678
3679 OXUndoEnvironment& rUndoEnv = m_aReportModel->GetUndoEnv();
3680 uno::Reference< XPropertyChangeListener > xUndo = &rUndoEnv;
3681 const uno::Sequence< beans::Property> aSeq = m_xReportDefinition->getPropertySetInfo()->getProperties();
3682 const OUString* pPropsBegin = &aProps[0];
3683 const OUString* pPropsEnd = pPropsBegin + SAL_N_ELEMENTS(aProps)(sizeof(sal_n_array_size(aProps))) - 3;
3684 for(const beans::Property& rProp : aSeq)
3685 {
3686 if ( ::std::find(pPropsBegin,pPropsEnd,rProp.Name) == pPropsEnd )
3687 (m_xReportDefinition.get()->*pPropertyListenerAction)( rProp.Name, xUndo );
3688 }
3689
3690 // Add Listeners to UndoEnvironment
3691 void (OXUndoEnvironment::*pElementUndoFunction)( const uno::Reference< uno::XInterface >& ) =
3692 _bAdd ? &OXUndoEnvironment::AddElement : &OXUndoEnvironment::RemoveElement;
3693
3694 (rUndoEnv.*pElementUndoFunction)( m_xReportDefinition->getStyleFamilies() );
3695 (rUndoEnv.*pElementUndoFunction)( m_xReportDefinition->getFunctions() );
3696
3697 // Add Listeners to ReportControllerObserver
3698 OXReportControllerObserver& rObserver = *m_pReportControllerObserver;
3699
3700 if ( m_xReportDefinition->getPageHeaderOn() && _bAdd )
3701 {
3702 getDesignView()->addSection(m_xReportDefinition->getPageHeader(),DBPAGEHEADER"PageHeader");
3703 rObserver.AddSection(m_xReportDefinition->getPageHeader());
3704 }
3705 if ( m_xReportDefinition->getReportHeaderOn() && _bAdd )
3706 {
3707 getDesignView()->addSection(m_xReportDefinition->getReportHeader(),DBREPORTHEADER"ReportHeader");
3708 rObserver.AddSection(m_xReportDefinition->getReportHeader());
3709 }
3710
3711 uno::Reference< report::XGroups > xGroups = m_xReportDefinition->getGroups();
3712 const sal_Int32 nCount = xGroups->getCount();
3713 _bAdd ? xGroups->addContainerListener(&rUndoEnv) : xGroups->removeContainerListener(&rUndoEnv);
3714 _bAdd ? xGroups->addContainerListener(&rObserver) : xGroups->removeContainerListener(&rObserver);
3715
3716 for (sal_Int32 i=0;i<nCount ; ++i)
3717 {
3718 uno::Reference< report::XGroup > xGroup(xGroups->getByIndex(i),uno::UNO_QUERY);
3719 (xGroup.get()->*pPropertyListenerAction)( OUString(PROPERTY_HEADERON"HeaderOn"), static_cast< XPropertyChangeListener* >( this ) );
3720 (xGroup.get()->*pPropertyListenerAction)( OUString(PROPERTY_FOOTERON"FooterOn"), static_cast< XPropertyChangeListener* >( this ) );
3721
3722 (rUndoEnv.*pElementUndoFunction)( xGroup );
3723 (rUndoEnv.*pElementUndoFunction)( xGroup->getFunctions() );
3724 if ( xGroup->getHeaderOn() && _bAdd )
3725 {
3726 getDesignView()->addSection(xGroup->getHeader(),DBGROUPHEADER"GroupHeader");
3727 rObserver.AddSection(xGroup->getHeader());
3728 }
3729 }
3730
3731 if ( _bAdd )
3732 {
3733 getDesignView()->addSection(m_xReportDefinition->getDetail(),DBDETAIL"Detail");
3734 rObserver.AddSection(m_xReportDefinition->getDetail());
3735
3736 for (sal_Int32 i=nCount;i > 0 ; --i)
3737 {
3738 uno::Reference< report::XGroup > xGroup(xGroups->getByIndex(i-1),uno::UNO_QUERY);
3739 if ( xGroup->getFooterOn() )
3740 {
3741 getDesignView()->addSection(xGroup->getFooter(),DBGROUPFOOTER"GroupFooter");
3742 rObserver.AddSection(xGroup->getFooter());
3743 }
3744 }
3745 if ( m_xReportDefinition->getReportFooterOn() )
3746 {
3747 getDesignView()->addSection(m_xReportDefinition->getReportFooter(),DBREPORTFOOTER"ReportFooter");
3748 rObserver.AddSection(m_xReportDefinition->getReportFooter());
3749 }
3750 if ( m_xReportDefinition->getPageFooterOn())
3751 {
3752 getDesignView()->addSection(m_xReportDefinition->getPageFooter(),DBPAGEFOOTER"PageFooter");
3753 rObserver.AddSection(m_xReportDefinition->getPageFooter());
3754 }
3755
3756 xGroups->addContainerListener(static_cast<XContainerListener*>(this));
3757 m_xReportDefinition->addModifyListener(static_cast<XModifyListener*>(this));
3758 }
3759 else /* ! _bAdd */
3760 {
3761 rObserver.RemoveSection(m_xReportDefinition->getDetail());
3762 xGroups->removeContainerListener(static_cast<XContainerListener*>(this));
3763 m_xReportDefinition->removeModifyListener(static_cast<XModifyListener*>(this));
3764 m_aReportModel->detachController();
3765 }
3766}
3767
3768void OReportController::switchReportSection(const sal_Int16 _nId)
3769{
3770 OSL_ENSURE(_nId == SID_REPORTHEADER_WITHOUT_UNDO || _nId == SID_REPORTFOOTER_WITHOUT_UNDO || _nId == SID_REPORTHEADERFOOTER ,"Illegal id given!")do { if (true && (!(_nId == ( ((((((((((10000 + 1499)
+ 1) + 499) + 1) + 100) + 1) + 149) + 1) + 200) + 1) + 10 ) ||
_nId == ( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1
) + 149) + 1) + 200) + 1) + 11 ) || _nId == ( ((((((((((10000
+ 1499) + 1) + 499) + 1) + 100) + 1) + 149) + 1) + 200) + 1)
+ 1 )))) { sal_detail_logFormat((SAL_DETAIL_LOG_LEVEL_WARN),
("legacy.osl"), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "3770" ": "), "%s", "Illegal id given!"); } } while (false
)
;
3771
3772 if ( !m_xReportDefinition.is() )
3773 return;
3774
3775 const OXUndoEnvironment::OUndoEnvLock aLock( m_aReportModel->GetUndoEnv() );
3776 const bool bSwitchOn = !m_xReportDefinition->getReportHeaderOn();
3777
3778 std::unique_ptr< UndoContext > pUndoContext;
3779 if ( SID_REPORTHEADERFOOTER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 1 )
== _nId )
3780 {
3781 const OUString sUndoAction(RptResId(bSwitchOn ? RID_STR_UNDO_ADD_REPORTHEADERFOOTERreinterpret_cast<char const *>("RID_STR_UNDO_ADD_REPORTHEADERFOOTER"
"\004" u8"Add report header / report footer")
: RID_STR_UNDO_REMOVE_REPORTHEADERFOOTERreinterpret_cast<char const *>("RID_STR_UNDO_REMOVE_REPORTHEADERFOOTER"
"\004" u8"Remove report header / report footer")
));
3782 pUndoContext.reset( new UndoContext( getUndoManager(), sUndoAction ) );
3783
3784 addUndoAction(std::make_unique<OReportSectionUndo>(*m_aReportModel,SID_REPORTHEADER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 10 )
3785 ,::std::mem_fn(&OReportHelper::getReportHeader)
3786 ,m_xReportDefinition
3787 ,bSwitchOn ? Inserted : Removed
3788 ));
3789
3790 addUndoAction(std::make_unique<OReportSectionUndo>(*m_aReportModel,SID_REPORTFOOTER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 11 )
3791 ,::std::mem_fn(&OReportHelper::getReportFooter)
3792 ,m_xReportDefinition
3793 ,bSwitchOn ? Inserted : Removed
3794 ));
3795 }
3796
3797 switch( _nId )
3798 {
3799 case SID_REPORTHEADER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 10 )
:
3800 m_xReportDefinition->setReportHeaderOn( bSwitchOn );
3801 break;
3802 case SID_REPORTFOOTER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 11 )
:
3803 m_xReportDefinition->setReportFooterOn( !m_xReportDefinition->getReportFooterOn() );
3804 break;
3805 case SID_REPORTHEADERFOOTER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 1 )
:
3806 m_xReportDefinition->setReportHeaderOn( bSwitchOn );
3807 m_xReportDefinition->setReportFooterOn( bSwitchOn );
3808 break;
3809 }
3810
3811 if ( SID_REPORTHEADERFOOTER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 1 )
== _nId )
3812 pUndoContext.reset();
3813 getView()->Resize();
3814}
3815
3816void OReportController::switchPageSection(const sal_Int16 _nId)
3817{
3818 OSL_ENSURE(_nId == SID_PAGEHEADERFOOTER || _nId == SID_PAGEHEADER_WITHOUT_UNDO || _nId == SID_PAGEFOOTER_WITHOUT_UNDO ,"Illegal id given!")do { if (true && (!(_nId == ( ((((((((((10000 + 1499)
+ 1) + 499) + 1) + 100) + 1) + 149) + 1) + 200) + 1) + 0 ) ||
_nId == ( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1
) + 149) + 1) + 200) + 1) + 8 ) || _nId == ( ((((((((((10000 +
1499) + 1) + 499) + 1) + 100) + 1) + 149) + 1) + 200) + 1) +
9 )))) { sal_detail_logFormat((SAL_DETAIL_LOG_LEVEL_WARN), (
"legacy.osl"), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "3818" ": "), "%s", "Illegal id given!"); } } while (false
)
;
3819 if ( !m_xReportDefinition.is() )
3820 return;
3821
3822 const OXUndoEnvironment::OUndoEnvLock aLock( m_aReportModel->GetUndoEnv() );
3823 const bool bSwitchOn = !m_xReportDefinition->getPageHeaderOn();
3824
3825 std::unique_ptr< UndoContext > pUndoContext;
3826 if ( SID_PAGEHEADERFOOTER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 0 )
== _nId )
3827 {
3828 const OUString sUndoAction(RptResId(bSwitchOn ? RID_STR_UNDO_ADD_REPORTHEADERFOOTERreinterpret_cast<char const *>("RID_STR_UNDO_ADD_REPORTHEADERFOOTER"
"\004" u8"Add report header / report footer")
: RID_STR_UNDO_REMOVE_REPORTHEADERFOOTERreinterpret_cast<char const *>("RID_STR_UNDO_REMOVE_REPORTHEADERFOOTER"
"\004" u8"Remove report header / report footer")
));
3829 pUndoContext.reset( new UndoContext( getUndoManager(), sUndoAction ) );
3830
3831 addUndoAction(std::make_unique<OReportSectionUndo>(*m_aReportModel
3832 ,SID_PAGEHEADER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 8 )
3833 ,::std::mem_fn(&OReportHelper::getPageHeader)
3834 ,m_xReportDefinition
3835 ,bSwitchOn ? Inserted : Removed
3836 ));
3837
3838 addUndoAction(std::make_unique<OReportSectionUndo>(*m_aReportModel
3839 ,SID_PAGEFOOTER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 9 )
3840 ,::std::mem_fn(&OReportHelper::getPageFooter)
3841 ,m_xReportDefinition
3842 ,bSwitchOn ? Inserted : Removed
3843 ));
3844 }
3845 switch( _nId )
3846 {
3847 case SID_PAGEHEADER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 8 )
:
3848 m_xReportDefinition->setPageHeaderOn( bSwitchOn );
3849 break;
3850 case SID_PAGEFOOTER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 9 )
:
3851 m_xReportDefinition->setPageFooterOn( !m_xReportDefinition->getPageFooterOn() );
3852 break;
3853 case SID_PAGEHEADERFOOTER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 0 )
:
3854 m_xReportDefinition->setPageHeaderOn( bSwitchOn );
3855 m_xReportDefinition->setPageFooterOn( bSwitchOn );
3856 break;
3857 }
3858 if ( SID_PAGEHEADERFOOTER( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 0 )
== _nId )
3859 pUndoContext.reset();
3860 getView()->Resize();
3861}
3862
3863void OReportController::modifyGroup(const bool _bAppend, const Sequence< PropertyValue >& _aArgs)
3864{
3865 if ( !m_xReportDefinition.is() )
3866 return;
3867
3868 try
3869 {
3870 const SequenceAsHashMap aMap( _aArgs );
3871 uno::Reference< report::XGroup > xGroup = aMap.getUnpackedValueOrDefault( PROPERTY_GROUP"Group", uno::Reference< report::XGroup >() );
3872 if ( !xGroup.is() )
3873 return;
3874
3875 OXUndoEnvironment& rUndoEnv = m_aReportModel->GetUndoEnv();
3876 uno::Reference< report::XGroups > xGroups = m_xReportDefinition->getGroups();
3877 if ( _bAppend )
3878 {
3879 const sal_Int32 nPos = aMap.getUnpackedValueOrDefault( PROPERTY_POSITIONY"PositionY", xGroups->getCount() );
3880 xGroups->insertByIndex( nPos, uno::makeAny( xGroup ) );
3881 rUndoEnv.AddElement( xGroup->getFunctions() );
3882 }
3883
3884 addUndoAction( std::make_unique<OGroupUndo>(
3885 *m_aReportModel,
3886 _bAppend ? RID_STR_UNDO_APPEND_GROUPreinterpret_cast<char const *>("RID_STR_UNDO_APPEND_GROUP"
"\004" u8"Add Group")
: RID_STR_UNDO_REMOVE_GROUPreinterpret_cast<char const *>("RID_STR_UNDO_REMOVE_GROUP"
"\004" u8"Delete Group")
,
3887 _bAppend ? Inserted : Removed,
3888 xGroup,
3889 m_xReportDefinition
3890 ) );
3891
3892 if ( !_bAppend )
3893 {
3894 rUndoEnv.RemoveElement( xGroup->getFunctions() );
3895 const sal_Int32 nPos = getGroupPosition( xGroup );
3896 const OXUndoEnvironment::OUndoEnvLock aLock( m_aReportModel->GetUndoEnv() );
3897 xGroups->removeByIndex( nPos );
3898 }
3899 }
3900 catch(const Exception&)
3901 {
3902 DBG_UNHANDLED_EXCEPTION("reportdesign")DbgUnhandledException( DbgGetCaughtException(), __func__, "/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "3902" ": ", "reportdesign" );
;
3903 }
3904}
3905
3906
3907void OReportController::createGroupSection(const bool _bUndo,const bool _bHeader, const Sequence< PropertyValue >& _aArgs)
3908{
3909 if ( !m_xReportDefinition.is() )
3910 return;
3911
3912 const SequenceAsHashMap aMap(_aArgs);
3913 const bool bSwitchOn = aMap.getUnpackedValueOrDefault(_bHeader ? OUString(PROPERTY_HEADERON"HeaderOn") : OUString(PROPERTY_FOOTERON"FooterOn"), false);
3914 uno::Reference< report::XGroup> xGroup = aMap.getUnpackedValueOrDefault(PROPERTY_GROUP"Group",uno::Reference< report::XGroup>());
3915 if ( !xGroup.is() )
3916 return;
3917
3918 const OXUndoEnvironment::OUndoEnvLock aLock(m_aReportModel->GetUndoEnv());
3919 if ( _bUndo )
3920 addUndoAction(std::make_unique<OGroupSectionUndo>(*m_aReportModel
3921 ,_bHeader ? SID_GROUPHEADER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 13 )
: SID_GROUPFOOTER_WITHOUT_UNDO( ((((((((((10000 + 1499) + 1) + 499) + 1) + 100) + 1) + 149)
+ 1) + 200) + 1) + 15 )
3922 ,_bHeader ? ::std::mem_fn(&OGroupHelper::getHeader) : ::std::mem_fn(&OGroupHelper::getFooter)
3923 ,xGroup
3924 ,bSwitchOn ? Inserted : Removed
3925 , ( _bHeader ?
3926 (bSwitchOn ? RID_STR_UNDO_ADD_GROUP_HEADERreinterpret_cast<char const *>("RID_STR_UNDO_ADD_GROUP_HEADER"
"\004" u8"Add group header ")
: RID_STR_UNDO_REMOVE_GROUP_HEADERreinterpret_cast<char const *>("RID_STR_UNDO_REMOVE_GROUP_HEADER"
"\004" u8"Remove group header ")
)
3927 :(bSwitchOn ? RID_STR_UNDO_ADD_GROUP_FOOTERreinterpret_cast<char const *>("RID_STR_UNDO_ADD_GROUP_FOOTER"
"\004" u8"Add group footer ")
: RID_STR_UNDO_REMOVE_GROUP_FOOTERreinterpret_cast<char const *>("RID_STR_UNDO_REMOVE_GROUP_FOOTER"
"\004" u8"Remove group footer ")
)
3928 )
3929 ));
3930
3931 if ( _bHeader )
3932 xGroup->setHeaderOn( bSwitchOn );
3933 else
3934 xGroup->setFooterOn( bSwitchOn );
3935}
3936
3937void OReportController::collapseSection(const bool _bCollapse)
3938{
3939 OSectionWindow *pSection = getDesignView()->getMarkedSection();
3940 if ( pSection )
3941 {
3942 pSection->setCollapsed(_bCollapse);
3943 }
3944}
3945
3946void OReportController::markSection(const bool _bNext)
3947{
3948 OSectionWindow *pSection = getDesignView()->getMarkedSection();
3949 if ( pSection )
3950 {
3951 OSectionWindow *pPrevSection = getDesignView()->getMarkedSection(_bNext ? POST : PREVIOUS);
3952 if ( pPrevSection != pSection && pPrevSection )
3953 select(uno::makeAny(pPrevSection->getReportSection().getSection()));
3954 else
3955 select(uno::makeAny(m_xReportDefinition));
3956 }
3957 else
3958 {
3959 getDesignView()->markSection(_bNext ? 0 : getDesignView()->getSectionCount() - 1);
3960 pSection = getDesignView()->getMarkedSection();
3961 if ( pSection )
3962 select(uno::makeAny(pSection->getReportSection().getSection()));
3963 }
3964}
3965
3966void OReportController::createDefaultControl(const uno::Sequence< beans::PropertyValue>& _aArgs)
3967{
3968 uno::Reference< report::XSection > xSection = getDesignView()->getCurrentSection();
3969 if ( !xSection.is() )
3970 xSection = m_xReportDefinition->getDetail();
3971
3972 if ( !xSection.is() )
3973 return;
3974
3975 const OUString sKeyModifier("KeyModifier");
3976 const beans::PropertyValue* pIter = _aArgs.getConstArray();
3977 const beans::PropertyValue* pEnd = pIter + _aArgs.getLength();
3978 const beans::PropertyValue* pKeyModifier = ::std::find_if(pIter, pEnd,
3979 [&sKeyModifier] (const beans::PropertyValue& x) -> bool {
3980 return x.Name == sKeyModifier;
3981 });
3982 sal_Int16 nKeyModifier = 0;
3983 if ( pKeyModifier == pEnd || ((pKeyModifier->Value >>= nKeyModifier) && nKeyModifier == KEY_MOD1) )
3984 {
3985 Sequence< PropertyValue > aCreateArgs;
3986 getDesignView()->unmarkAllObjects();
3987 createControl(aCreateArgs,xSection,OUString(),getDesignView()->GetInsertObj());
3988 }
3989}
3990
3991
3992void OReportController::checkChartEnabled()
3993{
3994 if ( m_bChartEnabledAsked )
3995 return;
3996
3997 m_bChartEnabledAsked = true;
3998
3999 try
4000 {
4001 ::utl::OConfigurationTreeRoot aConfiguration(
4002 ::utl::OConfigurationTreeRoot::createWithComponentContext( m_xContext, "/org.openoffice.Office.ReportDesign" ) );
4003
4004 bool bChartEnabled = false;
4005 const OUString sPropertyName( "UserData/Chart" );
4006 if ( aConfiguration.hasByHierarchicalName(sPropertyName) )
4007 aConfiguration.getNodeValue( sPropertyName ) >>= bChartEnabled;
4008 m_bChartEnabled = bChartEnabled;
4009 }
4010 catch(const Exception&)
4011 {
4012 }
4013}
4014
4015
4016// css.frame.XTitle
4017OUString SAL_CALL OReportController::getTitle()
4018{
4019 SolarMutexGuard aSolarGuard;
4020 ::osl::MutexGuard aGuard( getMutex() );
4021
4022 uno::Reference< frame::XTitle> xTitle(m_xReportDefinition,uno::UNO_QUERY_THROW);
4023
4024 return xTitle->getTitle ();
4025}
4026
4027void OReportController::getPropertyDefaultByHandle( sal_Int32 /*_nHandle*/, Any& _rDefault ) const
4028{
4029 _rDefault <<= sal_Int16(100);
4030}
4031
4032// comphelper::OPropertyArrayUsageHelper
4033::cppu::IPropertyArrayHelper* OReportController::createArrayHelper( ) const
4034{
4035 Sequence< Property > aProps;
4036 describeProperties(aProps);
4037 return new ::cppu::OPropertyArrayHelper(aProps);
4038}
4039
4040
4041// cppu::OPropertySetHelper
4042::cppu::IPropertyArrayHelper& SAL_CALL OReportController::getInfoHelper()
4043{
4044 return *::comphelper::OPropertyArrayUsageHelper<OReportController_BASE>::getArrayHelper();
4045}
4046
4047void SAL_CALL OReportController::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle,const Any& _aValue)
4048{
4049 if ( _nHandle == PROPERTY_ID_ZOOMVALUE1 )
4050 {
4051 _aValue >>= m_nZoomValue;
4052 impl_zoom_nothrow();
4053 }
4054}
4055void SAL_CALL OReportController::setMode( const OUString& aMode )
4056{
4057 ::osl::MutexGuard aGuard( getMutex() );
4058 m_sMode = aMode;
4059}
4060OUString SAL_CALL OReportController::getMode( )
4061{
4062 ::osl::MutexGuard aGuard( getMutex() );
4063 return m_sMode;
4064}
4065css::uno::Sequence< OUString > SAL_CALL OReportController::getSupportedModes( )
4066{
4067 return uno::Sequence< OUString> { OUString("remote"), OUString("normal") };
4068}
4069sal_Bool SAL_CALL OReportController::supportsMode( const OUString& aMode )
4070{
4071 uno::Sequence< OUString> aModes = getSupportedModes();
4072 return comphelper::findValue(aModes, aMode) != -1;
4073}
4074
4075bool OReportController::isUiVisible() const
4076{
4077 return m_sMode != "remote";
4078}
4079
4080void OReportController::impl_fillState_nothrow(const OUString& _sProperty,dbaui::FeatureState& _rState) const
4081{
4082 _rState.bEnabled = isEditable();
4083 if ( !_rState.bEnabled )
4084 return;
4085
4086 ::std::vector< uno::Reference< uno::XInterface > > aSelection;
4087 getDesignView()->fillControlModelSelection(aSelection);
4088 _rState.bEnabled = !aSelection.empty();
4089 if ( !_rState.bEnabled )
4090 return;
4091
4092 uno::Any aTemp;
4093 ::std::vector< uno::Reference< uno::XInterface > >::const_iterator aIter = aSelection.begin();
4094 for(; aIter != aSelection.end() && _rState.bEnabled ;++aIter)
4095 {
4096 uno::Reference< beans::XPropertySet> xProp(*aIter,uno::UNO_QUERY);
4097 try
4098 {
4099 uno::Any aTemp2 = xProp->getPropertyValue(_sProperty);
4100 if ( aIter == aSelection.begin() )
4101 {
4102 aTemp = aTemp2;
4103 }
4104 else if ( aTemp != aTemp2 )
4105 break;
4106 }
4107 catch(const beans::UnknownPropertyException&)
4108 {
4109 _rState.bEnabled = false;
4110 }
4111 }
4112 if ( aIter == aSelection.end() )
4113 _rState.aValue = aTemp;
4114}
4115
4116void OReportController::impl_zoom_nothrow()
4117{
4118 Fraction aZoom(m_nZoomValue,100);
4119 setZoomFactor( aZoom,*getDesignView() );
4120 getDesignView()->zoom(aZoom);
4121 InvalidateFeature(SID_ATTR_ZOOMTypedWhichId<SvxZoomItem>(10000 + 0),Reference< XStatusListener >(), true);
4122 InvalidateFeature(SID_ATTR_ZOOMSLIDER( 10000 + 1065 ),Reference< XStatusListener >(), true);
4123}
4124
4125bool OReportController::isFormatCommandEnabled(sal_uInt16 _nCommand,const uno::Reference< report::XReportControlFormat>& _xReportControlFormat)
4126{
4127 bool bRet = false;
4128 if ( _xReportControlFormat.is() && !uno::Reference< report::XFixedLine>(_xReportControlFormat,uno::UNO_QUERY).is() ) // this command is really often called so we need a short cut here
4129 {
4130 try
4131 {
4132 const awt::FontDescriptor aFontDescriptor = _xReportControlFormat->getFontDescriptor();
4133
4134 switch(_nCommand)
4135 {
4136 case SID_ATTR_CHAR_WEIGHT( 10000 + 9 ):
4137 bRet = awt::FontWeight::BOLD == aFontDescriptor.Weight;
4138 break;
4139 case SID_ATTR_CHAR_POSTURE( 10000 + 8 ):
4140 bRet = awt::FontSlant_ITALIC == aFontDescriptor.Slant;
4141 break;
4142 case SID_ATTR_CHAR_UNDERLINE( 10000 + 14 ):
4143 bRet = awt::FontUnderline::SINGLE == aFontDescriptor.Underline;
4144 break;
4145 default:
4146 ;
4147 }
4148 }
4149 catch(const uno::Exception&)
4150 {
4151 }
4152 }
4153 return bRet;
4154}
4155
4156bool OReportController::impl_setPropertyAtControls_throw(const char* pUndoResId,const OUString& _sProperty,const uno::Any& _aValue,const Sequence< PropertyValue >& _aArgs)
4157{
4158 ::std::vector< uno::Reference< uno::XInterface > > aSelection;
4159 uno::Reference< awt::XWindow> xWindow;
4160 lcl_getReportControlFormat( _aArgs, getDesignView(), xWindow, aSelection );
4161
4162 const OUString sUndoAction = RptResId( pUndoResId );
4163 UndoContext aUndoContext( getUndoManager(), sUndoAction );
4164
4165 for (const auto& rxInterface : aSelection)
4166 {
4167 const uno::Reference< beans::XPropertySet > xControlModel(rxInterface,uno::UNO_QUERY);
4168 if ( xControlModel.is() )
4169 // tdf#117795: some elements may have not some property
4170 // eg class "OFixedLine" doesn't have property "CharFontName"
4171 // so in this case, instead of crashing when selecting all and changing font
4172 // just display a warning
4173 try
4174 {
4175 xControlModel->setPropertyValue(_sProperty,_aValue);
4176 }
4177 catch(const UnknownPropertyException&)
4178 {
4179 TOOLS_WARN_EXCEPTION("reportdesign", "")do { css::uno::Any tools_warn_exception( DbgGetCaughtException
() ); do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_WARN
, "reportdesign")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break
; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult
( ::sal::detail::StreamStart() << "" << " " <<
exceptionToString(tools_warn_exception)) == 1) { ::sal_detail_log
( (::SAL_DETAIL_LOG_LEVEL_WARN), ("reportdesign"), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "4179" ": "), ::sal::detail::unwrapStream( ::sal::detail
::StreamStart() << "" << " " << exceptionToString
(tools_warn_exception)), 0); } else { ::std::ostringstream sal_detail_stream
; sal_detail_stream << "" << " " << exceptionToString
(tools_warn_exception); ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_WARN
), ("reportdesign"), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "4179" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL
: if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart
() << "" << " " << exceptionToString(tools_warn_exception
)) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_WARN), (
"reportdesign"), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "4179" ": "), ::sal::detail::unwrapStream( ::sal::detail
::StreamStart() << "" << " " << exceptionToString
(tools_warn_exception)), 0); } else { ::std::ostringstream sal_detail_stream
; sal_detail_stream << "" << " " << exceptionToString
(tools_warn_exception); ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_WARN
), ("reportdesign"), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "4179" ": "), sal_detail_stream, 0); }; std::abort(); break
; } } } while (false); } while (false)
;
4180 }
4181 }
4182
4183 return !aSelection.empty();
4184}
4185
4186void OReportController::impl_fillCustomShapeState_nothrow(const char* _pCustomShapeType,dbaui::FeatureState& _rState) const
4187{
4188 _rState.bEnabled = isEditable();
4189 _rState.bChecked = getDesignView()->GetInsertObj() == OBJ_CUSTOMSHAPE && getDesignView()->GetInsertObjString().equalsAscii(_pCustomShapeType);
4190}
4191
4192
4193OSectionWindow* OReportController::getSectionWindow(const css::uno::Reference< css::report::XSection>& _xSection) const
4194{
4195 if ( getDesignView() )
4196 {
4197 return getDesignView()->getSectionWindow(_xSection);
4198 }
4199
4200 // throw NullPointerException?
4201 return nullptr;
4202}
4203
4204
4205void OReportController::openZoomDialog()
4206{
4207 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
4208
4209 static SfxItemInfo aItemInfos[] =
4210 {
4211 { SID_ATTR_ZOOMTypedWhichId<SvxZoomItem>(10000 + 0), true }
4212 };
4213 std::vector<SfxPoolItem*> pDefaults
4214 {
4215 new SvxZoomItem()
4216 };
4217 static const sal_uInt16 pRanges[] =
4218 {
4219 SID_ATTR_ZOOMTypedWhichId<SvxZoomItem>(10000 + 0),SID_ATTR_ZOOMTypedWhichId<SvxZoomItem>(10000 + 0),
4220 0
4221 };
4222 SfxItemPool* pPool( new SfxItemPool("ZoomProperties", SID_ATTR_ZOOMTypedWhichId<SvxZoomItem>(10000 + 0),SID_ATTR_ZOOMTypedWhichId<SvxZoomItem>(10000 + 0), aItemInfos, &pDefaults) );
4223 pPool->SetDefaultMetric( MapUnit::Map100thMM ); // ripped, don't understand why
4224 pPool->FreezeIdRanges(); // the same
4225 try
4226 {
4227 ::std::unique_ptr<SfxItemSet> pDescriptor(new SfxItemSet(*pPool, pRanges));
4228 // fill it
4229 SvxZoomItem aZoomItem( m_eZoomType, m_nZoomValue, SID_ATTR_ZOOMTypedWhichId<SvxZoomItem>(10000 + 0) );
4230 aZoomItem.SetValueSet(SvxZoomEnableFlags::N100|SvxZoomEnableFlags::WHOLEPAGE|SvxZoomEnableFlags::PAGEWIDTH);
4231 pDescriptor->Put(aZoomItem);
4232
4233 ScopedVclPtr<AbstractSvxZoomDialog> pDlg(pFact->CreateSvxZoomDialog(nullptr, *pDescriptor));
4234 pDlg->SetLimits( 20, 400 );
4235 bool bCancel = ( RET_CANCEL == pDlg->Execute() );
4236
4237 if ( !bCancel )
4238 {
4239 const SvxZoomItem& rZoomItem = pDlg->GetOutputItemSet()->Get( SID_ATTR_ZOOMTypedWhichId<SvxZoomItem>(10000 + 0) );
4240 m_eZoomType = rZoomItem.GetType();
4241 m_nZoomValue = rZoomItem.GetValue();
4242 if ( m_eZoomType != SvxZoomType::PERCENT )
4243 m_nZoomValue = getDesignView()->getZoomFactor( m_eZoomType );
4244
4245 impl_zoom_nothrow();
4246 }
4247 }
4248 catch(const uno::Exception&)
4249 {
4250 DBG_UNHANDLED_EXCEPTION("reportdesign")DbgUnhandledException( DbgGetCaughtException(), __func__, "/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "4250" ": ", "reportdesign" );
;
4251 }
4252 SfxItemPool::Free(pPool);
4253
4254 for (SfxPoolItem* pDefault : pDefaults)
4255 delete pDefault;
4256}
4257
4258
4259// XVisualObject
4260void SAL_CALL OReportController::setVisualAreaSize( ::sal_Int64 _nAspect, const awt::Size& _aSize )
4261{
4262 ::osl::MutexGuard aGuard( getMutex() );
4263 bool bChanged =
4264 (m_aVisualAreaSize.Width != _aSize.Width ||
4265 m_aVisualAreaSize.Height != _aSize.Height);
4266 m_aVisualAreaSize = _aSize;
4267 if( bChanged )
4268 setModified( true );
4269 m_nAspect = _nAspect;
4270}
4271
4272awt::Size SAL_CALL OReportController::getVisualAreaSize( ::sal_Int64 /*nAspect*/ )
4273{
4274 ::osl::MutexGuard aGuard( getMutex() );
4275 return m_aVisualAreaSize;
4276}
4277
4278embed::VisualRepresentation SAL_CALL OReportController::getPreferredVisualRepresentation( ::sal_Int64 _nAspect )
4279{
4280 SolarMutexGuard aSolarGuard;
4281 ::osl::MutexGuard aGuard( getMutex() );
4282 embed::VisualRepresentation aResult;
4283 if ( !m_bInGeneratePreview )
4284 {
4285 m_bInGeneratePreview = true;
4286 try
4287 {
4288 if ( !m_xReportEngine.is() )
4289 m_xReportEngine.set( report::ReportEngine::create(m_xContext) );
4290 const sal_Int32 nOldMaxRows = m_xReportEngine->getMaxRows();
4291 m_xReportEngine->setMaxRows(MAX_ROWS_FOR_PREVIEW20);
4292 m_xReportEngine->setReportDefinition(m_xReportDefinition);
4293 m_xReportEngine->setActiveConnection(getConnection());
4294 try
4295 {
4296 Reference<embed::XVisualObject> xTransfer(m_xReportEngine->createDocumentModel(),UNO_QUERY);
4297 if ( xTransfer.is() )
4298 {
4299 xTransfer->setVisualAreaSize(m_nAspect,m_aVisualAreaSize);
4300 aResult = xTransfer->getPreferredVisualRepresentation( _nAspect );
4301 }
4302 }
4303 catch(const uno::Exception&)
4304 {
4305 }
4306 m_xReportEngine->setMaxRows(nOldMaxRows);
4307 }
4308 catch(const uno::Exception&)
4309 {
4310 }
4311 m_bInGeneratePreview = false;
4312 }
4313 return aResult;
4314}
4315
4316::sal_Int32 SAL_CALL OReportController::getMapUnit( ::sal_Int64 /*nAspect*/ )
4317{
4318 return embed::EmbedMapUnits::ONE_100TH_MM;
4319}
4320
4321uno::Reference< container::XNameAccess > const & OReportController::getColumns() const
4322{
4323 if ( !m_xColumns.is() && m_xReportDefinition.is() && !m_xReportDefinition->getCommand().isEmpty() )
4324 {
4325 m_xColumns = dbtools::getFieldsByCommandDescriptor(getConnection(),m_xReportDefinition->getCommandType(),m_xReportDefinition->getCommand(),m_xHoldAlive);
4326 }
4327 return m_xColumns;
4328}
4329
4330OUString OReportController::getColumnLabel_throw(const OUString& i_sColumnName) const
4331{
4332 OUString sLabel;
4333 uno::Reference< container::XNameAccess > xColumns = getColumns();
4334 if ( xColumns.is() && xColumns->hasByName(i_sColumnName) )
4335 {
4336 uno::Reference< beans::XPropertySet> xColumn(xColumns->getByName(i_sColumnName),uno::UNO_QUERY_THROW);
4337 if ( xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_LABEL"Label") )
4338 xColumn->getPropertyValue(PROPERTY_LABEL"Label") >>= sLabel;
4339 }
4340 return sLabel;
4341}
4342
4343
4344SfxUndoManager& OReportController::getUndoManager() const
4345{
4346 DBG_TESTSOLARMUTEX()do { DbgTestSolarMutex(); } while(false);
4347 // this is expected to be called during UI actions, so the SM is assumed to be locked
4348
4349 std::shared_ptr< OReportModel > pReportModel( getSdrModel() );
4350 ENSURE_OR_THROW( !!pReportModel, "no access to our model" )if( !(!!pReportModel) ){ do { if (true && (!(!!pReportModel
))) { sal_detail_logFormat((SAL_DETAIL_LOG_LEVEL_WARN), ("legacy.osl"
), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "4350" ": "), "%s", "no access to our model"); } } while
(false); throw css::uno::RuntimeException( __func__ + OUStringLiteral
(u",\n" "no access to our model"), css::uno::Reference< css
::uno::XInterface >() ); }
;
4351
4352 SfxUndoManager* pUndoManager( pReportModel->GetSdrUndoManager() );
4353 ENSURE_OR_THROW( pUndoManager != nullptr, "no access to our model's UndoManager" )if( !(pUndoManager != nullptr) ){ do { if (true && (!
(pUndoManager != nullptr))) { sal_detail_logFormat((SAL_DETAIL_LOG_LEVEL_WARN
), ("legacy.osl"), ("/home/maarten/src/libreoffice/core/reportdesign/source/ui/report/ReportController.cxx"
":" "4353" ": "), "%s", "no access to our model's UndoManager"
); } } while (false); throw css::uno::RuntimeException( __func__
+ OUStringLiteral(u",\n" "no access to our model's UndoManager"
), css::uno::Reference< css::uno::XInterface >() ); }
;
4354
4355 return *pUndoManager;
4356}
4357
4358
4359void OReportController::clearUndoManager() const
4360{
4361 getUndoManager().Clear();
4362}
4363
4364
4365void OReportController::addUndoAction( std::unique_ptr<SfxUndoAction> i_pAction )
4366{
4367 getUndoManager().AddUndoAction( std::move(i_pAction) );
4368
4369 InvalidateFeature( SID_UNDO(5000 + 701) );
4370 InvalidateFeature( SID_REDO(5000 + 700) );
4371}
4372
4373extern "C" SAL_DLLPUBLIC_EXPORT__attribute__ ((visibility("default"))) css::uno::XInterface*
4374reportdesign_OReportController_get_implementation(
4375 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
4376{
4377 return cppu::acquire(new OReportController(context));
4378}
4379
4380
4381/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

/home/maarten/src/libreoffice/core/include/vcl/vclptr.hxx

1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_VCL_PTR_HXX
21#define INCLUDED_VCL_PTR_HXX
22
23#include <sal/config.h>
24
25#include <rtl/ref.hxx>
26
27#include <utility>
28#include <type_traits>
29
30#ifdef DBG_UTIL
31#ifndef _WIN32
32#include <vcl/vclmain.hxx>
33#endif
34#endif
35
36class VclReferenceBase;
37
38namespace vcl::detail {
39
40template<typename>
41constexpr bool isIncompleteOrDerivedFromVclReferenceBase(...) { return true; }
42
43template<typename T> constexpr bool isIncompleteOrDerivedFromVclReferenceBase(
44 int (*)[sizeof(T)])
45{ return std::is_base_of<VclReferenceBase, T>::value; }
46
47} // namespace vcl::detail
48
49/**
50 * A thin wrapper around rtl::Reference to implement the acquire and dispose semantics we want for references to vcl::Window subclasses.
51 *
52 * For more details on the design please see vcl/README.lifecycle
53 *
54 * @param reference_type must be a subclass of vcl::Window
55 */
56template <class reference_type>
57class VclPtr
58{
59 static_assert(
60 vcl::detail::isIncompleteOrDerivedFromVclReferenceBase<reference_type>(
61 nullptr),
62 "template argument type must be derived from VclReferenceBase");
63
64 ::rtl::Reference<reference_type> m_rInnerRef;
65
66public:
67 /** Constructor...
68 */
69 VclPtr()
70 : m_rInnerRef()
71 {}
72
73 /** Constructor...
74 */
75 VclPtr (reference_type * pBody)
76 : m_rInnerRef(pBody)
77 {}
78
79 /** Constructor... that doesn't take a ref.
80 */
81 VclPtr (reference_type * pBody, __sal_NoAcquire)
82 : m_rInnerRef(pBody, SAL_NO_ACQUIRE)
83 {}
84
85 /** Up-casting conversion constructor: Copies interface reference.
86
87 Does not work for up-casts to ambiguous bases. For the special case of
88 up-casting to Reference< XInterface >, see the corresponding conversion
89 operator.
90
91 @param rRef another reference
92 */
93 template< class derived_type >
94 VclPtr(
95 const VclPtr< derived_type > & rRef,
96 typename std::enable_if<
97 std::is_base_of<reference_type, derived_type>::value, int>::type
98 = 0 )
99 : m_rInnerRef( static_cast<reference_type*>(rRef) )
100 {
101 }
102
103#if defined(DBG_UTIL) && !defined(_WIN32)
104 virtual ~VclPtr()
105 {
106 assert(m_rInnerRef.get() == nullptr || vclmain::isAlive())(static_cast <bool> (m_rInnerRef.get() == nullptr || vclmain
::isAlive()) ? void (0) : __assert_fail ("m_rInnerRef.get() == nullptr || vclmain::isAlive()"
, "/home/maarten/src/libreoffice/core/include/vcl/vclptr.hxx"
, 106, __extension__ __PRETTY_FUNCTION__))
;
107 // We can be one of the intermediate counts, but if we are the last
108 // VclPtr keeping this object alive, then something forgot to call dispose().
109 assert((!m_rInnerRef.get() || m_rInnerRef->isDisposed() || m_rInnerRef->getRefCount() > 1)(static_cast <bool> ((!m_rInnerRef.get() || m_rInnerRef
->isDisposed() || m_rInnerRef->getRefCount() > 1) &&
"someone forgot to call dispose()") ? void (0) : __assert_fail
("(!m_rInnerRef.get() || m_rInnerRef->isDisposed() || m_rInnerRef->getRefCount() > 1) && \"someone forgot to call dispose()\""
, "/home/maarten/src/libreoffice/core/include/vcl/vclptr.hxx"
, 110, __extension__ __PRETTY_FUNCTION__))
110 && "someone forgot to call dispose()")(static_cast <bool> ((!m_rInnerRef.get() || m_rInnerRef
->isDisposed() || m_rInnerRef->getRefCount() > 1) &&
"someone forgot to call dispose()") ? void (0) : __assert_fail
("(!m_rInnerRef.get() || m_rInnerRef->isDisposed() || m_rInnerRef->getRefCount() > 1) && \"someone forgot to call dispose()\""
, "/home/maarten/src/libreoffice/core/include/vcl/vclptr.hxx"
, 110, __extension__ __PRETTY_FUNCTION__))
;
111 }
112 VclPtr(VclPtr const &) = default;
113 VclPtr(VclPtr &&) = default;
114 VclPtr & operator =(VclPtr const &) = default;
115 VclPtr & operator =(VclPtr &&) = default;
116#endif
117
118 /**
119 * A construction helper for VclPtr. Since VclPtr types are created
120 * with a reference-count of one - to help fit into the existing
121 * code-flow; this helps us to construct them easily.
122 *
123 * For more details on the design please see vcl/README.lifecycle
124 *
125 * @tparam reference_type must be a subclass of vcl::Window
126 */
127 template<typename... Arg> [[nodiscard]] static VclPtr< reference_type > Create(Arg &&... arg)
128 {
129 return VclPtr< reference_type >( new reference_type(std::forward<Arg>(arg)...), SAL_NO_ACQUIRE );
130 }
131
132 /** Probably most common used: handle->someBodyOp().
133 */
134 reference_type * operator->() const
135 {
136 return m_rInnerRef.get();
137 }
138
139 /** Get the body. Can be used instead of operator->().
140 I.e. handle->someBodyOp() and handle.get()->someBodyOp()
141 are the same.
142 */
143 reference_type * get() const
144 {
145 return m_rInnerRef.get();
146 }
147
148 void set(reference_type *pBody)
149 {
150 m_rInnerRef.set(pBody);
151 }
152
153 void reset(reference_type *pBody)
154 {
155 m_rInnerRef.set(pBody);
156 }
157
158 /** Up-casting copy assignment operator.
159
160 Does not work for up-casts to ambiguous bases.
161
162 @param rRef another reference
163 */
164 template<typename derived_type>
165 typename std::enable_if<
166 std::is_base_of<reference_type, derived_type>::value,
167 VclPtr &>::type
168 operator =(VclPtr<derived_type> const & rRef)
169 {
170 m_rInnerRef.set(rRef.get());
171 return *this;
172 }
173
174 VclPtr & operator =(reference_type * pBody)
175 {
176 m_rInnerRef.set(pBody);
177 return *this;
178 }
179
180 operator reference_type * () const
181 {
182 return m_rInnerRef.get();
183 }
184
185 explicit operator bool () const
186 {
187 return m_rInnerRef.get() != nullptr;
188 }
189
190 void clear()
191 {
192 m_rInnerRef.clear();
193 }
194
195 void reset()
196 {
197 m_rInnerRef.clear();
198 }
199
200 void disposeAndClear()
201 {
202 // hold it alive for the lifetime of this method
203 ::rtl::Reference<reference_type> aTmp(m_rInnerRef);
204 m_rInnerRef.clear(); // we should use some 'swap' method ideally ;-)
205 if (aTmp.get()) {
206 aTmp->disposeOnce();
207 }
208 }
209
210 /** Needed to place VclPtr's into STL collection.
211 */
212 bool operator< (const VclPtr<reference_type> & handle) const
213 {
214 return (m_rInnerRef < handle.m_rInnerRef);
215 }
216}; // class VclPtr
217
218template<typename T1, typename T2>
219inline bool operator ==(VclPtr<T1> const & p1, VclPtr<T2> const & p2) {
220 return p1.get() == p2.get();
221}
222
223template<typename T> inline bool operator ==(VclPtr<T> const & p1, T const * p2)
224{
225 return p1.get() == p2;
226}
227
228template<typename T> inline bool operator ==(VclPtr<T> const & p1, T * p2) {
229 return p1.get() == p2;
230}
231
232template<typename T> inline bool operator ==(T const * p1, VclPtr<T> const & p2)
233{
234 return p1 == p2.get();
235}
236
237template<typename T> inline bool operator ==(T * p1, VclPtr<T> const & p2) {
238 return p1 == p2.get();
239}
240
241template<typename T1, typename T2>
242inline bool operator !=(VclPtr<T1> const & p1, VclPtr<T2> const & p2) {
243 return !(p1 == p2);
244}
245
246template<typename T> inline bool operator !=(VclPtr<T> const & p1, T const * p2)
247{
248 return !(p1 == p2);
249}
250
251template<typename T> inline bool operator !=(VclPtr<T> const & p1, T * p2) {
252 return !(p1 == p2);
253}
254
255template<typename T> inline bool operator !=(T const * p1, VclPtr<T> const & p2)
256{
257 return !(p1 == p2);
258}
259
260template<typename T> inline bool operator !=(T * p1, VclPtr<T> const & p2) {
261 return !(p1 == p2);
262}
263
264/**
265 * A construction helper for a temporary VclPtr. Since VclPtr types
266 * are created with a reference-count of one - to help fit into
267 * the existing code-flow; this helps us to construct them easily.
268 * see also VclPtr::Create and ScopedVclPtr
269 *
270 * For more details on the design please see vcl/README.lifecycle
271 *
272 * @param reference_type must be a subclass of vcl::Window
273 */
274template <class reference_type>
275class SAL_WARN_UNUSED__attribute__((warn_unused)) VclPtrInstance final : public VclPtr<reference_type>
276{
277public:
278 template<typename... Arg> VclPtrInstance(Arg &&... arg)
279 : VclPtr<reference_type>( new reference_type(std::forward<Arg>(arg)...), SAL_NO_ACQUIRE )
2
Memory is allocated
280 {
281 }
282
283 /**
284 * Override and disallow this, to prevent people accidentally calling it and actually
285 * getting VclPtr::Create and getting a naked VclPtr<> instance
286 */
287 template<typename... Arg> static VclPtrInstance< reference_type > Create(Arg &&... ) = delete;
288};
289
290template <class reference_type>
291class ScopedVclPtr : public VclPtr<reference_type>
292{
293public:
294 /** Constructor...
295 */
296 ScopedVclPtr()
297 : VclPtr<reference_type>()
298 {}
299
300 /** Constructor
301 */
302 ScopedVclPtr (reference_type * pBody)
303 : VclPtr<reference_type>(pBody)
304 {}
305
306 /** Copy constructor...
307 */
308 ScopedVclPtr (const VclPtr<reference_type> & handle)
309 : VclPtr<reference_type>(handle)
310 {}
311
312 /**
313 Assignment that releases the last reference.
314 */
315 void disposeAndReset(reference_type *pBody)
316 {
317 if (pBody != this->get()) {
318 VclPtr<reference_type>::disposeAndClear();
319 VclPtr<reference_type>::set(pBody);
320 }
321 }
322
323 /**
324 Assignment that releases the last reference.
325 */
326 ScopedVclPtr<reference_type>& operator = (reference_type * pBody)
327 {
328 disposeAndReset(pBody);
329 return *this;
330 }
331
332 /** Up-casting conversion constructor: Copies interface reference.
333
334 Does not work for up-casts to ambiguous bases. For the special case of
335 up-casting to Reference< XInterface >, see the corresponding conversion
336 operator.
337
338 @param rRef another reference
339 */
340 template< class derived_type >
341 ScopedVclPtr(
342 const VclPtr< derived_type > & rRef,
343 typename std::enable_if<
344 std::is_base_of<reference_type, derived_type>::value, int>::type
345 = 0 )
346 : VclPtr<reference_type>( rRef )
347 {
348 }
349
350 /** Up-casting assignment operator.
351
352 Does not work for up-casts to ambiguous bases.
353
354 @param rRef another VclPtr
355 */
356 template<typename derived_type>
357 typename std::enable_if<
358 std::is_base_of<reference_type, derived_type>::value,
359 ScopedVclPtr &>::type
360 operator =(VclPtr<derived_type> const & rRef)
361 {
362 disposeAndReset(rRef.get());
363 return *this;
364 }
365
366 /**
367 * Override and disallow this, to prevent people accidentally calling it and actually
368 * getting VclPtr::Create and getting a naked VclPtr<> instance
369 */
370 template<typename... Arg> static ScopedVclPtr< reference_type > Create(Arg &&... ) = delete;
371
372 ~ScopedVclPtr()
373 {
374 VclPtr<reference_type>::disposeAndClear();
375 assert(VclPtr<reference_type>::get() == nullptr)(static_cast <bool> (VclPtr<reference_type>::get(
) == nullptr) ? void (0) : __assert_fail ("VclPtr<reference_type>::get() == nullptr"
, "/home/maarten/src/libreoffice/core/include/vcl/vclptr.hxx"
, 375, __extension__ __PRETTY_FUNCTION__))
; // make sure there are no lingering references
376 }
377
378private:
379 // Most likely we don't want this default copy-constructor.
380 ScopedVclPtr (const ScopedVclPtr<reference_type> &) = delete;
381 // And certainly we don't want a default assignment operator.
382 ScopedVclPtr<reference_type>& operator = (const ScopedVclPtr<reference_type> &) = delete;
383 // And disallow reset as that doesn't call disposeAndClear on the original reference
384 void reset() = delete;
385 void reset(reference_type *pBody) = delete;
386
387protected:
388 ScopedVclPtr (reference_type * pBody, __sal_NoAcquire)
389 : VclPtr<reference_type>(pBody, SAL_NO_ACQUIRE)
390 {}
391};
392
393/**
394 * A construction helper for ScopedVclPtr. Since VclPtr types are created
395 * with a reference-count of one - to help fit into the existing
396 * code-flow; this helps us to construct them easily.
397 *
398 * For more details on the design please see vcl/README.lifecycle
399 *
400 * @param reference_type must be a subclass of vcl::Window
401 */
402#if defined _MSC_VER
403#pragma warning(push)
404#pragma warning(disable: 4521) // " multiple copy constructors specified"
405#endif
406template <class reference_type>
407class SAL_WARN_UNUSED__attribute__((warn_unused)) ScopedVclPtrInstance final : public ScopedVclPtr<reference_type>
408{
409public:
410 template<typename... Arg> ScopedVclPtrInstance(Arg &&... arg)
411 : ScopedVclPtr<reference_type>( new reference_type(std::forward<Arg>(arg)...), SAL_NO_ACQUIRE )
412 {
413 }
414
415 /**
416 * Override and disallow this, to prevent people accidentally calling it and actually
417 * getting VclPtr::Create and getting a naked VclPtr<> instance
418 */
419 template<typename... Arg> static ScopedVclPtrInstance< reference_type > Create(Arg &&...) = delete;
420
421private:
422 // Prevent the above perfect forwarding ctor from hijacking (accidental)
423 // attempts at ScopedVclPtrInstance copy construction (where the hijacking
424 // would typically lead to somewhat obscure error messages); both non-const
425 // and const variants are needed here, as the ScopedVclPtr base class has a
426 // const--variant copy ctor, so the implicitly declared copy ctor for
427 // ScopedVclPtrInstance would also be the const variant, so non-const copy
428 // construction attempts would be hijacked by the perfect forwarding ctor;
429 // but if we only declared a non-const variant here, the const variant would
430 // no longer be implicitly declared (as there would already be an explicitly
431 // declared copy ctor), so const copy construction attempts would then be
432 // hijacked by the perfect forwarding ctor:
433 ScopedVclPtrInstance(ScopedVclPtrInstance &) = delete;
434 ScopedVclPtrInstance(ScopedVclPtrInstance const &) = delete;
435};
436#if defined _MSC_VER
437#pragma warning(pop)
438#endif
439
440#endif // INCLUDED_VCL_PTR_HXX
441
442/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

/home/maarten/src/libreoffice/core/include/rtl/ref.hxx

1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_RTL_REF_HXX
21#define INCLUDED_RTL_REF_HXX
22
23#include "sal/config.h"
24
25#include <cassert>
26#include <cstddef>
27#include <functional>
28#ifdef LIBO_INTERNAL_ONLY1
29#include <type_traits>
30#endif
31
32#include "sal/types.h"
33
34namespace rtl
35{
36
37/** Template reference class for reference type.
38*/
39template <class reference_type>
40class Reference
41{
42 /** The <b>reference_type</b> body pointer.
43 */
44 reference_type * m_pBody;
45
46
47public:
48 /** Constructor...
49 */
50 Reference()
51 : m_pBody (NULL__null)
52 {}
53
54
55 /** Constructor...
56 */
57 Reference (reference_type * pBody, __sal_NoAcquire)
58 : m_pBody (pBody)
59 {
60 }
61
62 /** Constructor...
63 */
64 Reference (reference_type * pBody)
65 : m_pBody (pBody)
66 {
67 if (m_pBody)
68 m_pBody->acquire();
69 }
70
71 /** Copy constructor...
72 */
73 Reference (const Reference<reference_type> & handle)
74 : m_pBody (handle.m_pBody)
75 {
76 if (m_pBody)
77 m_pBody->acquire();
78 }
79
80#ifdef LIBO_INTERNAL_ONLY1
81 /** Move constructor...
82 */
83 Reference (Reference<reference_type> && handle) noexcept
84 : m_pBody (handle.m_pBody)
85 {
86 handle.m_pBody = nullptr;
87 }
88#endif
89
90#if defined LIBO_INTERNAL_ONLY1
91 /** Up-casting conversion constructor: Copies interface reference.
92
93 Does not work for up-casts to ambiguous bases.
94
95 @param rRef another reference
96 */
97 template< class derived_type >
98 inline Reference(
99 const Reference< derived_type > & rRef,
100 std::enable_if_t<std::is_base_of_v<reference_type, derived_type>, int> = 0 )
101 : m_pBody (rRef.get())
102 {
103 if (m_pBody)
104 m_pBody->acquire();
105 }
106#endif
107
108 /** Destructor...
109 */
110 ~Reference() COVERITY_NOEXCEPT_FALSE
111 {
112 if (m_pBody
5.1
Field 'm_pBody' is non-null
16.1
Field 'm_pBody' is non-null
5.1
Field 'm_pBody' is non-null
16.1
Field 'm_pBody' is non-null
5.1
Field 'm_pBody' is non-null
16.1
Field 'm_pBody' is non-null
5.1
Field 'm_pBody' is non-null
16.1
Field 'm_pBody' is non-null
)
6
Taking true branch
17
Taking true branch
113 m_pBody->release();
7
Calling 'VclReferenceBase::release'
11
Returning; memory was released
18
Use of memory after it is freed
114 }
115
116 /** Set...
117 Similar to assignment.
118 */
119 Reference<reference_type> &
120 SAL_CALL set (reference_type * pBody)
121 {
122 if (pBody)
123 pBody->acquire();
124 reference_type * const pOld = m_pBody;
125 m_pBody = pBody;
126 if (pOld)
127 pOld->release();
128 return *this;
129 }
130
131 /** Assignment.
132 Unbinds this instance from its body (if bound) and
133 bind it to the body represented by the handle.
134 */
135 Reference<reference_type> &
136 SAL_CALL operator= (const Reference<reference_type> & handle)
137 {
138 return set( handle.m_pBody );
139 }
140
141#ifdef LIBO_INTERNAL_ONLY1
142 /** Assignment.
143 * Unbinds this instance from its body (if bound),
144 * bind it to the body represented by the handle, and
145 * set the body represented by the handle to nullptr.
146 */
147 Reference<reference_type> &
148 operator= (Reference<reference_type> && handle)
149 {
150 // self-movement guts ourself
151 if (m_pBody)
152 m_pBody->release();
153 m_pBody = handle.m_pBody;
154 handle.m_pBody = nullptr;
155 return *this;
156 }
157#endif
158
159 /** Assignment...
160 */
161 Reference<reference_type> &
162 SAL_CALL operator= (reference_type * pBody)
163 {
164 return set( pBody );
165 }
166
167 /** Unbind the body from this handle.
168 Note that for a handle representing a large body,
169 "handle.clear().set(new body());" _might_
170 perform a little bit better than "handle.set(new body());",
171 since in the second case two large objects exist in memory
172 (the old body and the new body).
173 */
174 Reference<reference_type> & SAL_CALL clear()
175 {
176 if (m_pBody)
177 {
178 reference_type * const pOld = m_pBody;
179 m_pBody = NULL__null;
180 pOld->release();
181 }
182 return *this;
183 }
184
185
186 /** Get the body. Can be used instead of operator->().
187 I.e. handle->someBodyOp() and handle.get()->someBodyOp()
188 are the same.
189 */
190 reference_type * SAL_CALL get() const
191 {
192 return m_pBody;
193 }
194
195
196 /** Probably most common used: handle->someBodyOp().
197 */
198 reference_type * SAL_CALL operator->() const
199 {
200 assert(m_pBody != NULL)(static_cast <bool> (m_pBody != __null) ? void (0) : __assert_fail
("m_pBody != NULL", "/home/maarten/src/libreoffice/core/include/rtl/ref.hxx"
, 200, __extension__ __PRETTY_FUNCTION__))
;
201 return m_pBody;
202 }
203
204
205 /** Allows (*handle).someBodyOp().
206 */
207 reference_type & SAL_CALL operator*() const
208 {
209 assert(m_pBody != NULL)(static_cast <bool> (m_pBody != __null) ? void (0) : __assert_fail
("m_pBody != NULL", "/home/maarten/src/libreoffice/core/include/rtl/ref.hxx"
, 209, __extension__ __PRETTY_FUNCTION__))
;
210 return *m_pBody;
211 }
212
213
214 /** Returns True if the handle does point to a valid body.
215 */
216 bool SAL_CALL is() const
217 {
218 return (m_pBody != NULL__null);
219 }
220
221#if defined LIBO_INTERNAL_ONLY1
222 /** Returns True if the handle does point to a valid body.
223 */
224 explicit operator bool() const
225 {
226 return is();
227 }
228#endif
229
230 /** Returns True if this points to pBody.
231 */
232 bool SAL_CALL operator== (const reference_type * pBody) const
233 {
234 return (m_pBody == pBody);
235 }
236
237
238 /** Returns True if handle points to the same body.
239 */
240 bool
241 SAL_CALL operator== (const Reference<reference_type> & handle) const
242 {
243 return (m_pBody == handle.m_pBody);
244 }
245
246
247 /** Needed to place References into STL collection.
248 */
249 bool
250 SAL_CALL operator!= (const Reference<reference_type> & handle) const
251 {
252 return (m_pBody != handle.m_pBody);
253 }
254
255
256 /** Needed to place References into STL collection.
257 */
258 bool
259 SAL_CALL operator< (const Reference<reference_type> & handle) const
260 {
261 return (m_pBody < handle.m_pBody);
262 }
263
264
265 /** Needed to place References into STL collection.
266 */
267 bool
268 SAL_CALL operator> (const Reference<reference_type> & handle) const
269 {
270 return (m_pBody > handle.m_pBody);
271 }
272};
273
274} // namespace rtl
275
276#if defined LIBO_INTERNAL_ONLY1
277namespace std
278{
279
280/// @cond INTERNAL
281/**
282 Make rtl::Reference hashable by default for use in STL containers.
283
284 @since LibreOffice 6.3
285*/
286template<typename T>
287struct hash<::rtl::Reference<T>>
288{
289 std::size_t operator()(::rtl::Reference<T> const & s) const
290 { return std::size_t(s.get()); }
291};
292/// @endcond
293
294}
295
296#endif
297
298#endif /* ! INCLUDED_RTL_REF_HXX */
299
300/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

/home/maarten/src/libreoffice/core/include/vcl/vclreferencebase.hxx

1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#ifndef INCLUDED_VCL_Reference_HXX
20#define INCLUDED_VCL_Reference_HXX
21
22#include <vcl/dllapi.h>
23#include <osl/interlck.h>
24
25class VCL_DLLPUBLIC__attribute__ ((visibility("default"))) VclReferenceBase
26{
27 mutable oslInterlockedCount mnRefCnt;
28
29 template<typename T> friend class VclPtr;
30
31public:
32 void acquire() const
33 {
34 osl_atomic_increment(&mnRefCnt)__sync_add_and_fetch((&mnRefCnt), 1);
35 }
36
37 void release() const
38 {
39 if (osl_atomic_decrement(&mnRefCnt)__sync_sub_and_fetch((&mnRefCnt), 1) == 0)
8
Assuming the condition is true
9
Taking true branch
40 delete this;
10
Memory is released
41 }
42#ifdef DBG_UTIL
43#ifndef _WIN32
44 sal_Int32 getRefCount() const { return mnRefCnt; }
45#endif
46#endif
47
48
49private:
50 VclReferenceBase(const VclReferenceBase&) = delete;
51 VclReferenceBase& operator=(const VclReferenceBase&) = delete;
52
53 bool mbDisposed : 1;
54
55protected:
56 VclReferenceBase();
57protected:
58 virtual ~VclReferenceBase();
59
60protected:
61 virtual void dispose();
62
63public:
64 void disposeOnce();
65 bool isDisposed() const { return mbDisposed; }
66
67};
68#endif