30#include <rptui_slotid.hrc>
41#include <com/sun/star/style/XStyle.hpp>
42#include <com/sun/star/style/ParagraphAdjust.hpp>
43#include <com/sun/star/util/NumberFormatter.hpp>
44#include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
45#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
46#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
47#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
48#include <com/sun/star/frame/FrameSearchFlag.hpp>
49#include <com/sun/star/container/XChild.hpp>
50#include <com/sun/star/report/XImageControl.hpp>
51#include <com/sun/star/report/XFixedLine.hpp>
52#include <com/sun/star/report/Function.hpp>
53#include <com/sun/star/awt/FontDescriptor.hpp>
54#include <com/sun/star/sdb/XParametersSupplier.hpp>
55#include <com/sun/star/sdb/CommandType.hpp>
56#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
57#include <com/sun/star/embed/EmbedMapUnits.hpp>
58#include <com/sun/star/awt/FontWeight.hpp>
59#include <com/sun/star/awt/FontUnderline.hpp>
60#include <com/sun/star/awt/FontSlant.hpp>
61#include <com/sun/star/frame/Desktop.hpp>
62#include <com/sun/star/frame/status/FontHeight.hpp>
63#include <com/sun/star/report/ReportEngine.hpp>
64#include <com/sun/star/report/XFormattedField.hpp>
65#include <com/sun/star/sdb/SQLContext.hpp>
66#include <com/sun/star/beans/PropertyAttribute.hpp>
67#include <com/sun/star/document/XUndoManagerSupplier.hpp>
74#include <svx/svxids.hrc>
107#include <core_resource.hxx>
111#include <strings.hxx>
115#include <UndoActions.hxx>
116#include <dlgpage.hxx>
117#include <strings.hrc>
126#include <osl/mutex.hxx>
127#include <PropertyForward.hxx>
136#include <string_view>
143#define MAX_ROWS_FOR_PREVIEW 20
145#define RPTUI_ID_LRSPACE TypedWhichId<SvxLRSpaceItem>(XATTR_FILL_FIRST - 8)
146#define RPTUI_ID_ULSPACE TypedWhichId<SvxULSpaceItem>(XATTR_FILL_FIRST - 7)
147#define RPTUI_ID_PAGE TypedWhichId<SvxPageItem>(XATTR_FILL_FIRST - 6)
148#define RPTUI_ID_SIZE TypedWhichId<SvxSizeItem>(XATTR_FILL_FIRST - 5)
149#define RPTUI_ID_PAGE_MODE TypedWhichId<SfxUInt16Item>(XATTR_FILL_FIRST - 4)
150#define RPTUI_ID_START TypedWhichId<SfxUInt16Item>(XATTR_FILL_FIRST - 3)
151#define RPTUI_ID_END TypedWhichId<SfxUInt16Item>(XATTR_FILL_FIRST - 2)
152#define RPTUI_ID_BRUSH TypedWhichId<SvxBrushItem>(XATTR_FILL_FIRST - 1)
155#define RPTUI_ID_METRIC TypedWhichId<SfxUInt16Item>(XATTR_FILL_LAST)
162using namespace beans;
163using namespace frame;
166using namespace container;
167using namespace sdbcx;
171using namespace ui::dialogs;
173using namespace ::
rptui;
174using namespace ::
dbaui;
176using namespace ::
cppu;
181 void lcl_setFontWPU_nothrow(
const uno::Reference< report::XReportControlFormat>& _xReportControlFormat,
const sal_Int32 _nId)
183 if ( !_xReportControlFormat.is() )
188 awt::FontDescriptor aFontDescriptor = _xReportControlFormat->getFontDescriptor();
191 case SID_ATTR_CHAR_WEIGHT:
192 aFontDescriptor.Weight = (awt::FontWeight::NORMAL + awt::FontWeight::BOLD) - aFontDescriptor.Weight;
194 case SID_ATTR_CHAR_POSTURE:
195 aFontDescriptor.Slant =
static_cast<awt::FontSlant
>(
static_cast<sal_Int16
>(awt::FontSlant_ITALIC) -
static_cast<sal_Int16
>(aFontDescriptor.Slant));
197 case SID_ATTR_CHAR_UNDERLINE:
198 aFontDescriptor.Underline = awt::FontUnderline::SINGLE - aFontDescriptor.Underline;
201 OSL_FAIL(
"Illegal value in default!");
205 _xReportControlFormat->setFontDescriptor(aFontDescriptor);
207 catch(
const beans::UnknownPropertyException&)
216 uno::Reference< awt::XWindow>& _xWindow,
217 ::std::vector< uno::Reference< uno::XInterface > >& _rControlsFormats)
219 uno::Reference< report::XReportControlFormat> xReportControlFormat;
220 if ( aArgs.hasElements() )
222 SequenceAsHashMap
aMap(aArgs);
223 xReportControlFormat =
aMap.getUnpackedValueOrDefault(
REPORTCONTROLFORMAT,uno::Reference< report::XReportControlFormat>());
224 _xWindow =
aMap.getUnpackedValueOrDefault(
CURRENT_WINDOW,uno::Reference< awt::XWindow>());
227 if ( !xReportControlFormat.is() )
229 _pView->fillControlModelSelection(_rControlsFormats);
233 uno::Reference<uno::XInterface> xInterface(xReportControlFormat);
234 _rControlsFormats.push_back(xInterface);
237 if ( !_xWindow.is() )
241OUString SAL_CALL OReportController::getImplementationName()
243 return "com.sun.star.report.comp.ReportDesign";
248 return {
"com.sun.star.sdb.ReportDesign" };
251#define PROPERTY_ID_ZOOMVALUE 1
254OReportController::OReportController(Reference< XComponentContext >
const & xContext)
257 ,m_aSelectionListeners(
getMutex() )
261 ,m_nSelectionCount(0)
266 ,m_bGridVisible(true)
268 ,m_bShowProperties(true)
269 ,m_bHelplinesMove(true)
270 ,m_bChartEnabled(false)
271 ,m_bChartEnabledAsked(false)
272 ,m_bInGeneratePreview(false)
275 m_pReportControllerObserver =
new OXReportControllerObserver(*
this);
277 beans::PropertyAttribute::BOUND | beans::PropertyAttribute::TRANSIENT,
282OReportController::~OReportController()
289void OReportController::disposing()
292 if ( m_pClipboardNotifier.is() )
294 m_pClipboardNotifier->ClearCallbackLink();
295 m_pClipboardNotifier->RemoveListener(
getView() );
296 m_pClipboardNotifier.clear();
298 if ( m_xGroupsFloater )
300 SvtViewOptions aDlgOpt(EViewType::Window, m_xGroupsFloater->get_help_id());
302 if (m_xGroupsFloater->getDialog()->get_visible())
303 m_xGroupsFloater->response(RET_CANCEL);
304 m_xGroupsFloater.reset();
309 m_xHoldAlive.clear();
311 ::comphelper::disposeComponent( m_xRowSet );
312 ::comphelper::disposeComponent( m_xRowSetMediator );
313 ::comphelper::disposeComponent( m_xFormatter );
315 catch(
const uno::Exception&)
320 m_xRowSetMediator.clear();
322 if ( m_xReportDefinition.is() )
326 OSectionWindow* pSectionWindow =
nullptr;
327 if ( getDesignView() )
328 pSectionWindow = getDesignView()->getMarkedSection();
329 if ( pSectionWindow )
330 pSectionWindow->getReportSection().deactivateOle();
332 if ( m_aReportModel )
334 m_pReportControllerObserver->Clear();
335 m_pReportControllerObserver.clear();
337 catch(
const uno::Exception&)
344 EventObject aDisposingEvent( *
this );
345 m_aSelectionListeners.disposeAndClear( aDisposingEvent );
348 OReportController_BASE::disposing();
353 m_xReportDefinition.clear();
354 m_aReportModel.reset();
356 m_xReportEngine.clear();
358 catch(
const uno::Exception&)
361 if ( getDesignView() )
362 EndListening( *getDesignView() );
366FeatureState OReportController::GetState(sal_uInt16 _nId)
const
368 FeatureState aReturn;
370 aReturn.bEnabled =
false;
377 case SID_RPT_TEXTDOCUMENT:
378 aReturn.bEnabled = isEditable();
381 case SID_RPT_SPREADSHEET:
382 aReturn.bEnabled = isEditable();
385 case SID_REPORTHEADER_WITHOUT_UNDO:
386 case SID_REPORTFOOTER_WITHOUT_UNDO:
387 case SID_REPORTHEADERFOOTER:
389 aReturn.bEnabled = isEditable();
390 OUString sText =
RptResId((m_xReportDefinition.is() && m_xReportDefinition->getReportHeaderOn()) ? RID_STR_REPORTHEADERFOOTER_DELETE : RID_STR_REPORTHEADERFOOTER_INSERT);
391 aReturn.sTitle = sText;
394 case SID_PAGEHEADER_WITHOUT_UNDO:
395 case SID_PAGEFOOTER_WITHOUT_UNDO:
396 case SID_PAGEHEADERFOOTER:
398 aReturn.bEnabled = isEditable();
399 OUString sText =
RptResId((m_xReportDefinition.is() && m_xReportDefinition->getPageHeaderOn()) ? RID_STR_PAGEHEADERFOOTER_DELETE : RID_STR_PAGEHEADERFOOTER_INSERT);
400 aReturn.sTitle = sText;
403 case SID_GROUP_APPEND:
404 case SID_GROUP_REMOVE:
405 case SID_GROUPHEADER_WITHOUT_UNDO:
406 case SID_GROUPHEADER:
407 case SID_GROUPFOOTER_WITHOUT_UNDO:
408 case SID_GROUPFOOTER:
409 aReturn.bEnabled = isEditable();
411 case SID_ADD_CONTROL_PAIR:
412 aReturn.bEnabled = isEditable();
422 if ( aReturn.bEnabled )
425 OUString (
SfxUndoManager::*retrieveComment )( size_t,
bool const )
const =
431 case SID_GETUNDOSTRINGS:
432 case SID_GETREDOSTRINGS:
437 OUString (
SfxUndoManager::*retrieveComment )( size_t,
bool const )
const =
443 auto aSeqRange = asNonConstRange(
aSeq);
446 aReturn.aValue <<=
aSeq;
447 aReturn.bEnabled =
true;
450 case SID_OBJECT_RESIZING:
451 case SID_OBJECT_SMALLESTWIDTH:
452 case SID_OBJECT_SMALLESTHEIGHT:
453 case SID_OBJECT_GREATESTWIDTH:
454 case SID_OBJECT_GREATESTHEIGHT:
455 aReturn.bEnabled = isEditable() && getDesignView()->HasSelection();
456 if ( aReturn.bEnabled )
457 aReturn.bEnabled = m_nSelectionCount > 1;
460 case SID_DISTRIBUTE_HLEFT:
461 case SID_DISTRIBUTE_HCENTER:
462 case SID_DISTRIBUTE_HDISTANCE:
463 case SID_DISTRIBUTE_HRIGHT:
464 case SID_DISTRIBUTE_VTOP:
465 case SID_DISTRIBUTE_VCENTER:
466 case SID_DISTRIBUTE_VDISTANCE:
467 case SID_DISTRIBUTE_VBOTTOM:
468 aReturn.bEnabled = isEditable() && getDesignView()->HasSelection();
469 if ( aReturn.bEnabled )
475 case SID_ARRANGEMENU:
478 case SID_FRAME_TO_TOP:
479 case SID_FRAME_TO_BOTTOM:
480 case SID_OBJECT_HEAVEN:
481 case SID_OBJECT_HELL:
482 aReturn.bEnabled = isEditable() && getDesignView()->HasSelection();
483 if ( aReturn.bEnabled )
487 if ( aReturn.bEnabled )
489 if ( SID_OBJECT_HEAVEN == _nId )
491 else if ( SID_OBJECT_HELL == _nId )
497 case SID_SECTION_SHRINK:
498 case SID_SECTION_SHRINK_TOP:
499 case SID_SECTION_SHRINK_BOTTOM:
502 uno::Reference<report::XSection> xSection = getDesignView()->getCurrentSection();
505 nCount = xSection->getCount();
507 aReturn.bEnabled = isEditable() &&
nCount > 0;
510 case SID_OBJECT_ALIGN:
511 case SID_OBJECT_ALIGN_LEFT:
512 case SID_OBJECT_ALIGN_CENTER:
513 case SID_OBJECT_ALIGN_RIGHT:
514 case SID_OBJECT_ALIGN_UP:
515 case SID_OBJECT_ALIGN_MIDDLE:
516 case SID_OBJECT_ALIGN_DOWN:
517 case SID_SECTION_ALIGN:
518 case SID_SECTION_ALIGN_LEFT:
519 case SID_SECTION_ALIGN_CENTER:
520 case SID_SECTION_ALIGN_RIGHT:
521 case SID_SECTION_ALIGN_UP:
522 case SID_SECTION_ALIGN_MIDDLE:
523 case SID_SECTION_ALIGN_DOWN:
524 aReturn.bEnabled = isEditable() && getDesignView()->HasSelection();
527 aReturn.bEnabled = isEditable() && getDesignView()->HasSelection() && !getDesignView()->isHandleEvent();
530 aReturn.bEnabled = getDesignView()->HasSelection() && !getDesignView()->isHandleEvent();
533 aReturn.bEnabled = isEditable() && !getDesignView()->isHandleEvent() && getDesignView()->IsPasteAllowed();
536 aReturn.bEnabled = !getDesignView()->isHandleEvent();
538 case SID_SELECTALL_IN_SECTION:
539 aReturn.bEnabled = !getDesignView()->isHandleEvent();
540 if ( aReturn.bEnabled )
541 aReturn.bEnabled = getCurrentSectionView() !=
nullptr;
544 aReturn.bEnabled = getDesignView()->GetMode() == DlgEdMode::Insert;
546 case SID_TERMINATE_INPLACEACTIVATION:
547 aReturn.bEnabled =
true;
549 case SID_SELECT_ALL_EDITS:
550 case SID_SELECT_ALL_LABELS:
551 aReturn.bEnabled =
true;
553 case SID_RPT_NEW_FUNCTION:
554 aReturn.bEnabled = isEditable();
556 case SID_COLLAPSE_SECTION:
557 case SID_EXPAND_SECTION:
560 aReturn.bEnabled = isEditable() && !getDesignView()->isHandleEvent();
563 case SID_SELECT_REPORT:
564 aReturn.bEnabled =
true;
566 case SID_EXECUTE_REPORT:
567 aReturn.bEnabled = isConnected() && m_xReportDefinition.is();
570 aReturn.bEnabled = isEditable() && getDesignView()->HasSelection() && !getDesignView()->isHandleEvent();
571 if ( aReturn.bEnabled )
573 OSectionWindow* pSectionWindow = getDesignView()->getMarkedSection();
574 if ( pSectionWindow )
578 OUString sText =
RptResId(RID_STR_DELETE);
579 aReturn.sTitle = sText;
582 case SID_GRID_VISIBLE:
583 aReturn.bEnabled = isEditable();
584 aReturn.bChecked = m_bGridVisible;
587 aReturn.bEnabled = isEditable();
588 aReturn.bChecked = m_bGridUse;
590 case SID_HELPLINES_MOVE:
591 aReturn.bEnabled = isEditable();
592 aReturn.bChecked = m_bHelplinesMove;
595 aReturn.bEnabled = isEditable();
596 aReturn.bChecked = m_bShowRuler;
598 case SID_OBJECT_SELECT:
599 aReturn.bEnabled =
true;
600 aReturn.bChecked = getDesignView()->GetMode() == DlgEdMode::Select;
602 case SID_INSERT_DIAGRAM:
603 aReturn.bEnabled = isEditable();
604 aReturn.bInvisible = !m_bChartEnabled;
605 aReturn.bChecked = getDesignView()->GetInsertObj() == SdrObjKind::OLE2;
607 case SID_FM_FIXEDTEXT:
608 aReturn.bEnabled = isEditable();
609 aReturn.bChecked = getDesignView()->GetInsertObj() == SdrObjKind::ReportDesignFixedText;
611 case SID_INSERT_HFIXEDLINE:
612 aReturn.bEnabled = isEditable();
613 aReturn.bChecked = getDesignView()->GetInsertObj() == SdrObjKind::ReportDesignHorizontalFixedLine;
615 case SID_INSERT_VFIXEDLINE:
616 aReturn.bEnabled = isEditable();
617 aReturn.bChecked = getDesignView()->GetInsertObj() == SdrObjKind::ReportDesignVerticalFixedLine;
620 aReturn.bEnabled = isEditable();
621 aReturn.bChecked = getDesignView()->GetInsertObj() == SdrObjKind::ReportDesignFormattedField;
623 case SID_FM_IMAGECONTROL:
624 aReturn.bEnabled = isEditable();
625 aReturn.bChecked = getDesignView()->GetInsertObj() == SdrObjKind::ReportDesignImageControl;
627 case SID_DRAWTBX_CS_BASIC:
628 case SID_DRAWTBX_CS_BASIC1:
629 case SID_DRAWTBX_CS_BASIC2:
630 case SID_DRAWTBX_CS_BASIC3:
631 case SID_DRAWTBX_CS_BASIC4:
632 case SID_DRAWTBX_CS_BASIC5:
633 case SID_DRAWTBX_CS_BASIC6:
634 case SID_DRAWTBX_CS_BASIC7:
635 case SID_DRAWTBX_CS_BASIC8:
636 case SID_DRAWTBX_CS_BASIC9:
637 case SID_DRAWTBX_CS_BASIC10:
638 case SID_DRAWTBX_CS_BASIC11:
639 case SID_DRAWTBX_CS_BASIC12:
640 case SID_DRAWTBX_CS_BASIC13:
641 case SID_DRAWTBX_CS_BASIC14:
642 case SID_DRAWTBX_CS_BASIC15:
643 case SID_DRAWTBX_CS_BASIC16:
644 case SID_DRAWTBX_CS_BASIC17:
645 case SID_DRAWTBX_CS_BASIC18:
646 case SID_DRAWTBX_CS_BASIC19:
647 case SID_DRAWTBX_CS_BASIC20:
648 case SID_DRAWTBX_CS_BASIC21:
649 case SID_DRAWTBX_CS_BASIC22:
650 impl_fillCustomShapeState_nothrow(
"diamond",aReturn);
652 case SID_DRAWTBX_CS_SYMBOL:
653 case SID_DRAWTBX_CS_SYMBOL1:
654 case SID_DRAWTBX_CS_SYMBOL2:
655 case SID_DRAWTBX_CS_SYMBOL3:
656 case SID_DRAWTBX_CS_SYMBOL4:
657 case SID_DRAWTBX_CS_SYMBOL5:
658 case SID_DRAWTBX_CS_SYMBOL6:
659 case SID_DRAWTBX_CS_SYMBOL7:
660 case SID_DRAWTBX_CS_SYMBOL8:
661 case SID_DRAWTBX_CS_SYMBOL9:
662 case SID_DRAWTBX_CS_SYMBOL10:
663 case SID_DRAWTBX_CS_SYMBOL11:
664 case SID_DRAWTBX_CS_SYMBOL12:
665 case SID_DRAWTBX_CS_SYMBOL13:
666 case SID_DRAWTBX_CS_SYMBOL14:
667 case SID_DRAWTBX_CS_SYMBOL15:
668 case SID_DRAWTBX_CS_SYMBOL16:
669 case SID_DRAWTBX_CS_SYMBOL17:
670 case SID_DRAWTBX_CS_SYMBOL18:
671 impl_fillCustomShapeState_nothrow(
"smiley",aReturn);
673 case SID_DRAWTBX_CS_ARROW:
674 case SID_DRAWTBX_CS_ARROW1:
675 case SID_DRAWTBX_CS_ARROW2:
676 case SID_DRAWTBX_CS_ARROW3:
677 case SID_DRAWTBX_CS_ARROW4:
678 case SID_DRAWTBX_CS_ARROW5:
679 case SID_DRAWTBX_CS_ARROW6:
680 case SID_DRAWTBX_CS_ARROW7:
681 case SID_DRAWTBX_CS_ARROW8:
682 case SID_DRAWTBX_CS_ARROW9:
683 case SID_DRAWTBX_CS_ARROW10:
684 case SID_DRAWTBX_CS_ARROW11:
685 case SID_DRAWTBX_CS_ARROW12:
686 case SID_DRAWTBX_CS_ARROW13:
687 case SID_DRAWTBX_CS_ARROW14:
688 case SID_DRAWTBX_CS_ARROW15:
689 case SID_DRAWTBX_CS_ARROW16:
690 case SID_DRAWTBX_CS_ARROW17:
691 case SID_DRAWTBX_CS_ARROW18:
692 case SID_DRAWTBX_CS_ARROW19:
693 case SID_DRAWTBX_CS_ARROW20:
694 case SID_DRAWTBX_CS_ARROW21:
695 case SID_DRAWTBX_CS_ARROW22:
696 case SID_DRAWTBX_CS_ARROW23:
697 case SID_DRAWTBX_CS_ARROW24:
698 case SID_DRAWTBX_CS_ARROW25:
699 case SID_DRAWTBX_CS_ARROW26:
700 impl_fillCustomShapeState_nothrow(
"left-right-arrow",aReturn);
702 case SID_DRAWTBX_CS_STAR:
703 case SID_DRAWTBX_CS_STAR1:
704 case SID_DRAWTBX_CS_STAR2:
705 case SID_DRAWTBX_CS_STAR3:
706 case SID_DRAWTBX_CS_STAR4:
707 case SID_DRAWTBX_CS_STAR5:
708 case SID_DRAWTBX_CS_STAR6:
709 case SID_DRAWTBX_CS_STAR7:
710 case SID_DRAWTBX_CS_STAR8:
711 case SID_DRAWTBX_CS_STAR9:
712 case SID_DRAWTBX_CS_STAR10:
713 case SID_DRAWTBX_CS_STAR11:
714 case SID_DRAWTBX_CS_STAR12:
715 impl_fillCustomShapeState_nothrow(
"star5",aReturn);
717 case SID_DRAWTBX_CS_FLOWCHART:
718 case SID_DRAWTBX_CS_FLOWCHART1:
719 case SID_DRAWTBX_CS_FLOWCHART2:
720 case SID_DRAWTBX_CS_FLOWCHART3:
721 case SID_DRAWTBX_CS_FLOWCHART4:
722 case SID_DRAWTBX_CS_FLOWCHART5:
723 case SID_DRAWTBX_CS_FLOWCHART6:
724 case SID_DRAWTBX_CS_FLOWCHART7:
725 case SID_DRAWTBX_CS_FLOWCHART8:
726 case SID_DRAWTBX_CS_FLOWCHART9:
727 case SID_DRAWTBX_CS_FLOWCHART10:
728 case SID_DRAWTBX_CS_FLOWCHART11:
729 case SID_DRAWTBX_CS_FLOWCHART12:
730 case SID_DRAWTBX_CS_FLOWCHART13:
731 case SID_DRAWTBX_CS_FLOWCHART14:
732 case SID_DRAWTBX_CS_FLOWCHART15:
733 case SID_DRAWTBX_CS_FLOWCHART16:
734 case SID_DRAWTBX_CS_FLOWCHART17:
735 case SID_DRAWTBX_CS_FLOWCHART18:
736 case SID_DRAWTBX_CS_FLOWCHART19:
737 case SID_DRAWTBX_CS_FLOWCHART20:
738 case SID_DRAWTBX_CS_FLOWCHART21:
739 case SID_DRAWTBX_CS_FLOWCHART22:
740 case SID_DRAWTBX_CS_FLOWCHART23:
741 case SID_DRAWTBX_CS_FLOWCHART24:
742 case SID_DRAWTBX_CS_FLOWCHART25:
743 case SID_DRAWTBX_CS_FLOWCHART26:
744 case SID_DRAWTBX_CS_FLOWCHART27:
745 case SID_DRAWTBX_CS_FLOWCHART28:
746 impl_fillCustomShapeState_nothrow(
"flowchart-internal-storage",aReturn);
748 case SID_DRAWTBX_CS_CALLOUT:
749 case SID_DRAWTBX_CS_CALLOUT1:
750 case SID_DRAWTBX_CS_CALLOUT2:
751 case SID_DRAWTBX_CS_CALLOUT3:
752 case SID_DRAWTBX_CS_CALLOUT4:
753 case SID_DRAWTBX_CS_CALLOUT5:
754 case SID_DRAWTBX_CS_CALLOUT6:
755 case SID_DRAWTBX_CS_CALLOUT7:
756 impl_fillCustomShapeState_nothrow(
"round-rectangular-callout",aReturn);
758 case SID_RPT_SHOWREPORTEXPLORER:
759 aReturn.bEnabled = m_xReportDefinition.is();
760 aReturn.bChecked = getDesignView() && getDesignView()->isReportExplorerVisible();
762 case SID_FM_ADD_FIELD:
763 aReturn.bEnabled = isConnected() && isEditable() && m_xReportDefinition.is()
764 && !m_xReportDefinition->getCommand().isEmpty();
765 aReturn.bChecked = getDesignView() && getDesignView()->isAddFieldVisible();
767 case SID_SHOW_PROPERTYBROWSER:
768 aReturn.bEnabled =
true;
769 aReturn.bChecked = m_bShowProperties;
771 case SID_PROPERTYBROWSER_LAST_PAGE:
772 aReturn.bEnabled =
true;
773 aReturn.aValue <<= m_sLastActivePage;
775 case SID_SPLIT_POSITION:
776 aReturn.bEnabled =
true;
777 aReturn.aValue <<= getSplitPos();
782 aReturn.bEnabled = isConnected() && isEditable();
785 aReturn.bChecked = isEditable();
788 aReturn.bEnabled = isEditable();
790 case SID_BACKGROUND_COLOR:
793 case SID_ATTR_CHAR_COLOR_BACKGROUND:
794 aReturn.bEnabled = isEditable();
796 uno::Reference<report::XSection> xSection = getDesignView()->getCurrentSection();
800 aReturn.aValue <<= xSection->getBackColor();
801 const uno::Reference< report::XReportControlModel> xControlModel(getDesignView()->getCurrentControlModel(),uno::UNO_QUERY);
802 aReturn.bEnabled = !xControlModel.is();
804 catch(
const beans::UnknownPropertyException&)
808 aReturn.bEnabled =
false;
811 case SID_SORTINGANDGROUPING:
812 aReturn.bEnabled =
true;
813 aReturn.bChecked = m_xGroupsFloater && m_xGroupsFloater->getDialog()->get_visible();
815 case SID_ATTR_CHAR_WEIGHT:
816 case SID_ATTR_CHAR_POSTURE:
817 case SID_ATTR_CHAR_UNDERLINE:
819 if ( aReturn.bEnabled )
821 awt::FontDescriptor aFontDescriptor;
822 aReturn.aValue >>= aFontDescriptor;
823 aReturn.aValue.clear();
827 case SID_ATTR_CHAR_WEIGHT:
828 aReturn.bChecked = awt::FontWeight::BOLD == aFontDescriptor.Weight;
830 case SID_ATTR_CHAR_POSTURE:
831 aReturn.bChecked = awt::FontSlant_ITALIC == aFontDescriptor.Slant;
833 case SID_ATTR_CHAR_UNDERLINE:
834 aReturn.bChecked = awt::FontUnderline::SINGLE == aFontDescriptor.Underline;
841 case SID_ATTR_CHAR_COLOR:
842 case SID_ATTR_CHAR_COLOR2:
845 case SID_ATTR_CHAR_FONT:
848 case SID_ATTR_CHAR_FONTHEIGHT:
850 if ( aReturn.aValue.hasValue() )
852 frame::status::FontHeight aFontHeight;
853 aReturn.aValue >>= aFontHeight.Height;
854 aReturn.aValue <<= aFontHeight;
857 case SID_ATTR_PARA_ADJUST_LEFT:
858 case SID_ATTR_PARA_ADJUST_CENTER:
859 case SID_ATTR_PARA_ADJUST_RIGHT:
860 case SID_ATTR_PARA_ADJUST_BLOCK:
862 if ( aReturn.bEnabled )
864 ::sal_Int16 nParaAdjust = 0;
865 if ( aReturn.aValue >>= nParaAdjust )
867 switch(
static_cast<style::ParagraphAdjust
>(nParaAdjust))
869 case style::ParagraphAdjust_LEFT:
870 aReturn.bChecked = _nId == SID_ATTR_PARA_ADJUST_LEFT;
872 case style::ParagraphAdjust_RIGHT:
873 aReturn.bChecked = _nId == SID_ATTR_PARA_ADJUST_RIGHT;
875 case style::ParagraphAdjust_BLOCK:
876 case style::ParagraphAdjust_STRETCH:
877 aReturn.bChecked = _nId == SID_ATTR_PARA_ADJUST_BLOCK;
879 case style::ParagraphAdjust_CENTER:
880 aReturn.bChecked = _nId == SID_ATTR_PARA_ADJUST_CENTER;
885 aReturn.aValue.clear();
889 case SID_INSERT_GRAPHIC:
890 aReturn.bEnabled = m_xReportDefinition.is() && isEditable() && getDesignView()->getCurrentSection().is();
893 case SID_SETCONTROLDEFAULTS:
894 aReturn.bEnabled = m_xReportDefinition.is() && isEditable();
895 if ( aReturn.bEnabled )
897 ::std::vector< uno::Reference< uno::XInterface > > aSelection;
898 getDesignView()->fillControlModelSelection(aSelection);
899 aReturn.bEnabled = !aSelection.empty()
900 && std::all_of(aSelection.begin(), aSelection.end(), [](
const uno::Reference<uno::XInterface>& rxInterface) {
901 return !uno::Reference<report::XFixedLine>(rxInterface, uno::UNO_QUERY).is()
902 && !uno::Reference<report::XImageControl>(rxInterface, uno::UNO_QUERY).is()
903 && uno::Reference<report::XReportControlFormat>(rxInterface, uno::UNO_QUERY).is(); });
906 case SID_CONDITIONALFORMATTING:
908 const uno::Reference< report::XFormattedField> xFormattedField(getDesignView()->getCurrentControlModel(),uno::UNO_QUERY);
909 aReturn.bEnabled = xFormattedField.is();
912 case SID_INSERT_FLD_PGNUMBER:
914 aReturn.bEnabled = m_xReportDefinition.is() && isEditable() && getDesignView()->getCurrentSection().is();
917 case SID_EXPORTDOCASPDF:
918 aReturn.bEnabled = m_xReportDefinition.is();
920 case SID_PRINTPREVIEW:
921 aReturn.bEnabled =
false;
924 aReturn.bEnabled =
true;
927 aZoom.
SetValueSet(SvxZoomEnableFlags::N50|SvxZoomEnableFlags::N75|SvxZoomEnableFlags::N100|SvxZoomEnableFlags::N200);
931 case SID_ATTR_ZOOMSLIDER:
932 aReturn.bEnabled =
true;
943 aReturn = OReportController_BASE::GetState(_nId);
958 util::Color aColor( COL_TRANSPARENT );
959 if ( _rDispatchArgs.getLength() == 1 )
961 OSL_VERIFY( _rDispatchArgs[0].Value >>= aColor );
965 SequenceAsHashMap
aMap( _rDispatchArgs );
976 ::osl::MutexGuard aGuard(
getMutex() );
978 bool bForceBroadcast =
false;
981 case SID_RPT_TEXTDOCUMENT:
982 if ( m_xReportDefinition.is() )
985 case SID_RPT_SPREADSHEET:
986 if (m_xReportDefinition.is() )
989 case SID_REPORTHEADER_WITHOUT_UNDO:
990 case SID_REPORTFOOTER_WITHOUT_UNDO:
991 case SID_REPORTHEADERFOOTER:
992 switchReportSection(_nId);
994 case SID_PAGEHEADER_WITHOUT_UNDO:
995 case SID_PAGEFOOTER_WITHOUT_UNDO:
996 case SID_PAGEHEADERFOOTER:
997 switchPageSection(_nId);
999 case SID_GROUP_APPEND:
1000 case SID_GROUP_REMOVE:
1001 modifyGroup(_nId == SID_GROUP_APPEND,aArgs);
1003 case SID_GROUPHEADER_WITHOUT_UNDO:
1004 case SID_GROUPHEADER:
1005 createGroupSection(SID_GROUPHEADER == _nId,
true,aArgs);
1007 case SID_GROUPFOOTER_WITHOUT_UNDO:
1008 case SID_GROUPFOOTER:
1009 createGroupSection(SID_GROUPFOOTER == _nId,
false,aArgs);
1011 case SID_ADD_CONTROL_PAIR:
1012 addPairControls(aArgs);
1023 if (aArgs.hasElements() && aArgs[0].Name !=
"KeyModifier")
1024 aArgs[0].Value >>=
nCount;
1026 (rUndoManager.*doXDo)();
1028 if (m_xGroupsFloater && m_xGroupsFloater->getDialog()->get_visible())
1029 m_xGroupsFloater->UpdateData();
1033 executeMethodWithUndo(RID_STR_UNDO_REMOVE_SELECTION,::std::mem_fn(&ODesignView::Cut));
1036 getDesignView()->Copy();
1039 executeMethodWithUndo(RID_STR_UNDO_PASTE,::std::mem_fn(&ODesignView::Paste));
1042 case SID_FRAME_TO_TOP:
1043 case SID_FRAME_DOWN:
1045 case SID_FRAME_TO_BOTTOM:
1046 case SID_OBJECT_HEAVEN:
1047 case SID_OBJECT_HELL:
1050 case SID_DISTRIBUTE_HLEFT:
1051 case SID_DISTRIBUTE_HCENTER:
1052 case SID_DISTRIBUTE_HDISTANCE:
1053 case SID_DISTRIBUTE_HRIGHT:
1054 case SID_DISTRIBUTE_VTOP:
1055 case SID_DISTRIBUTE_VCENTER:
1056 case SID_DISTRIBUTE_VDISTANCE:
1057 case SID_DISTRIBUTE_VBOTTOM:
1064 case SID_OBJECT_SMALLESTWIDTH:
1065 alignControlsWithUndo(RID_STR_UNDO_ALIGNMENT,ControlModification::WIDTH_SMALLEST);
1067 case SID_OBJECT_SMALLESTHEIGHT:
1068 alignControlsWithUndo(RID_STR_UNDO_ALIGNMENT,ControlModification::HEIGHT_SMALLEST);
1070 case SID_OBJECT_GREATESTWIDTH:
1071 alignControlsWithUndo(RID_STR_UNDO_ALIGNMENT,ControlModification::WIDTH_GREATEST);
1073 case SID_OBJECT_GREATESTHEIGHT:
1074 alignControlsWithUndo(RID_STR_UNDO_ALIGNMENT,ControlModification::HEIGHT_GREATEST);
1076 case SID_SECTION_ALIGN_LEFT:
1077 case SID_OBJECT_ALIGN_LEFT:
1078 alignControlsWithUndo(RID_STR_UNDO_ALIGNMENT,ControlModification::LEFT,SID_SECTION_ALIGN_LEFT == _nId);
1080 case SID_SECTION_ALIGN_CENTER:
1081 case SID_OBJECT_ALIGN_CENTER:
1082 alignControlsWithUndo(RID_STR_UNDO_ALIGNMENT,ControlModification::CENTER_HORIZONTAL,SID_SECTION_ALIGN_CENTER == _nId);
1084 case SID_SECTION_ALIGN_RIGHT:
1085 case SID_OBJECT_ALIGN_RIGHT:
1086 alignControlsWithUndo(RID_STR_UNDO_ALIGNMENT,ControlModification::RIGHT,SID_SECTION_ALIGN_RIGHT == _nId);
1088 case SID_SECTION_ALIGN_UP:
1089 case SID_OBJECT_ALIGN_UP:
1090 alignControlsWithUndo(RID_STR_UNDO_ALIGNMENT,ControlModification::TOP,SID_SECTION_ALIGN_UP == _nId);
1092 case SID_SECTION_ALIGN_MIDDLE:
1093 case SID_OBJECT_ALIGN_MIDDLE:
1094 alignControlsWithUndo(RID_STR_UNDO_ALIGNMENT,ControlModification::CENTER_VERTICAL,SID_SECTION_ALIGN_MIDDLE == _nId);
1096 case SID_SECTION_ALIGN_DOWN:
1097 case SID_OBJECT_ALIGN_DOWN:
1098 alignControlsWithUndo(RID_STR_UNDO_ALIGNMENT,ControlModification::BOTTOM,SID_SECTION_ALIGN_DOWN == _nId);
1101 case SID_SECTION_SHRINK_BOTTOM:
1102 case SID_SECTION_SHRINK_TOP:
1103 case SID_SECTION_SHRINK:
1105 uno::Reference<report::XSection> xSection = getDesignView()->getCurrentSection();
1106 shrinkSection(RID_STR_UNDO_SHRINK, xSection, _nId);
1111 getDesignView()->SelectAll(SdrObjKind::NONE);
1113 case SID_SELECTALL_IN_SECTION:
1121 getDesignView()->SetMode(DlgEdMode::Select);
1122 InvalidateFeature( SID_OBJECT_SELECT );
1124 case SID_SELECT_ALL_EDITS:
1125 getDesignView()->SelectAll(SdrObjKind::ReportDesignFormattedField);
1127 case SID_SELECT_ALL_LABELS:
1128 getDesignView()->SelectAll(SdrObjKind::ReportDesignFixedText);
1130 case SID_TERMINATE_INPLACEACTIVATION:
1138 if ( aArgs.getLength() == 1 )
1139 select(aArgs[0].
Value);
1141 case SID_SELECT_REPORT:
1142 select(
uno::Any(m_xReportDefinition));
1144 case SID_EXECUTE_REPORT:
1147 case SID_RPT_NEW_FUNCTION:
1148 createNewFunction(aArgs[0].
Value);
1150 case SID_COLLAPSE_SECTION:
1151 collapseSection(
true);
1153 case SID_EXPAND_SECTION:
1154 collapseSection(
false);
1163 if ( aArgs.getLength() == 1 )
1165 uno::Reference< report::XFunction> xFunction;
1166 aArgs[0].Value >>= xFunction;
1167 if ( xFunction.is() )
1169 uno::Reference< report::XFunctions> xFunctions(xFunction->getParent(),uno::UNO_QUERY_THROW);
1171 const OUString sUndoAction =
RptResId(RID_STR_UNDO_REMOVE_FUNCTION);
1172 UndoContext aUndoContext( getUndoManager(), sUndoAction );
1173 xFunctions->removeByIndex(
nIndex);
1174 select(
uno::Any(xFunctions->getParent()));
1175 InvalidateFeature( SID_UNDO );
1179 executeMethodWithUndo(RID_STR_UNDO_REMOVE_SELECTION,::std::mem_fn(&ODesignView::Delete));
1182 m_bGridUse = !m_bGridUse;
1183 getDesignView()->setGridSnap(m_bGridUse);
1185 case SID_HELPLINES_MOVE:
1186 m_bHelplinesMove = !m_bHelplinesMove;
1187 getDesignView()->setDragStripes(m_bHelplinesMove);
1189 case SID_GRID_VISIBLE:
1190 m_bGridVisible = !m_bGridVisible;
1191 getDesignView()->toggleGrid(m_bGridVisible);
1194 m_bShowRuler = !m_bShowRuler;
1195 getDesignView()->showRuler(m_bShowRuler);
1197 case SID_OBJECT_SELECT:
1198 getDesignView()->SetMode(DlgEdMode::Select);
1201 case SID_INSERT_DIAGRAM:
1202 getDesignView()->SetMode( DlgEdMode::Insert );
1203 getDesignView()->SetInsertObj( SdrObjKind::OLE2);
1204 createDefaultControl(aArgs);
1207 case SID_FM_FIXEDTEXT:
1208 getDesignView()->SetMode( DlgEdMode::Insert );
1209 getDesignView()->SetInsertObj( SdrObjKind::ReportDesignFixedText );
1210 createDefaultControl(aArgs);
1213 case SID_INSERT_HFIXEDLINE:
1214 getDesignView()->SetMode( DlgEdMode::Insert );
1215 getDesignView()->SetInsertObj( SdrObjKind::ReportDesignHorizontalFixedLine );
1216 createDefaultControl(aArgs);
1219 case SID_INSERT_VFIXEDLINE:
1220 getDesignView()->SetMode( DlgEdMode::Insert );
1221 getDesignView()->SetInsertObj( SdrObjKind::ReportDesignVerticalFixedLine );
1222 createDefaultControl(aArgs);
1226 getDesignView()->SetMode( DlgEdMode::Insert );
1227 getDesignView()->SetInsertObj( SdrObjKind::ReportDesignFormattedField );
1228 createDefaultControl(aArgs);
1231 case SID_FM_IMAGECONTROL:
1232 getDesignView()->SetMode( DlgEdMode::Insert );
1233 getDesignView()->SetInsertObj( SdrObjKind::ReportDesignImageControl );
1234 createDefaultControl(aArgs);
1237 case SID_DRAWTBX_CS_BASIC:
1238 case SID_DRAWTBX_CS_BASIC1:
1239 case SID_DRAWTBX_CS_BASIC2:
1240 case SID_DRAWTBX_CS_BASIC3:
1241 case SID_DRAWTBX_CS_BASIC4:
1242 case SID_DRAWTBX_CS_BASIC5:
1243 case SID_DRAWTBX_CS_BASIC6:
1244 case SID_DRAWTBX_CS_BASIC7:
1245 case SID_DRAWTBX_CS_BASIC8:
1246 case SID_DRAWTBX_CS_BASIC9:
1247 case SID_DRAWTBX_CS_BASIC10:
1248 case SID_DRAWTBX_CS_BASIC11:
1249 case SID_DRAWTBX_CS_BASIC12:
1250 case SID_DRAWTBX_CS_BASIC13:
1251 case SID_DRAWTBX_CS_BASIC14:
1252 case SID_DRAWTBX_CS_BASIC15:
1253 case SID_DRAWTBX_CS_BASIC16:
1254 case SID_DRAWTBX_CS_BASIC17:
1255 case SID_DRAWTBX_CS_BASIC18:
1256 case SID_DRAWTBX_CS_BASIC19:
1257 case SID_DRAWTBX_CS_BASIC20:
1258 case SID_DRAWTBX_CS_BASIC21:
1259 case SID_DRAWTBX_CS_BASIC22:
1260 case SID_DRAWTBX_CS_SYMBOL1:
1261 case SID_DRAWTBX_CS_SYMBOL2:
1262 case SID_DRAWTBX_CS_SYMBOL3:
1263 case SID_DRAWTBX_CS_SYMBOL4:
1264 case SID_DRAWTBX_CS_SYMBOL5:
1265 case SID_DRAWTBX_CS_SYMBOL6:
1266 case SID_DRAWTBX_CS_SYMBOL7:
1267 case SID_DRAWTBX_CS_SYMBOL8:
1268 case SID_DRAWTBX_CS_SYMBOL9:
1269 case SID_DRAWTBX_CS_SYMBOL10:
1270 case SID_DRAWTBX_CS_SYMBOL11:
1271 case SID_DRAWTBX_CS_SYMBOL12:
1272 case SID_DRAWTBX_CS_SYMBOL13:
1273 case SID_DRAWTBX_CS_SYMBOL14:
1274 case SID_DRAWTBX_CS_SYMBOL15:
1275 case SID_DRAWTBX_CS_SYMBOL16:
1276 case SID_DRAWTBX_CS_SYMBOL17:
1277 case SID_DRAWTBX_CS_SYMBOL18:
1278 case SID_DRAWTBX_CS_ARROW1:
1279 case SID_DRAWTBX_CS_ARROW2:
1280 case SID_DRAWTBX_CS_ARROW3:
1281 case SID_DRAWTBX_CS_ARROW4:
1282 case SID_DRAWTBX_CS_ARROW5:
1283 case SID_DRAWTBX_CS_ARROW6:
1284 case SID_DRAWTBX_CS_ARROW7:
1285 case SID_DRAWTBX_CS_ARROW8:
1286 case SID_DRAWTBX_CS_ARROW9:
1287 case SID_DRAWTBX_CS_ARROW10:
1288 case SID_DRAWTBX_CS_ARROW11:
1289 case SID_DRAWTBX_CS_ARROW12:
1290 case SID_DRAWTBX_CS_ARROW13:
1291 case SID_DRAWTBX_CS_ARROW14:
1292 case SID_DRAWTBX_CS_ARROW15:
1293 case SID_DRAWTBX_CS_ARROW16:
1294 case SID_DRAWTBX_CS_ARROW17:
1295 case SID_DRAWTBX_CS_ARROW18:
1296 case SID_DRAWTBX_CS_ARROW19:
1297 case SID_DRAWTBX_CS_ARROW20:
1298 case SID_DRAWTBX_CS_ARROW21:
1299 case SID_DRAWTBX_CS_ARROW22:
1300 case SID_DRAWTBX_CS_ARROW23:
1301 case SID_DRAWTBX_CS_ARROW24:
1302 case SID_DRAWTBX_CS_ARROW25:
1303 case SID_DRAWTBX_CS_ARROW26:
1304 case SID_DRAWTBX_CS_STAR1:
1305 case SID_DRAWTBX_CS_STAR2:
1306 case SID_DRAWTBX_CS_STAR3:
1307 case SID_DRAWTBX_CS_STAR4:
1308 case SID_DRAWTBX_CS_STAR5:
1309 case SID_DRAWTBX_CS_STAR6:
1310 case SID_DRAWTBX_CS_STAR7:
1311 case SID_DRAWTBX_CS_STAR8:
1312 case SID_DRAWTBX_CS_STAR9:
1313 case SID_DRAWTBX_CS_STAR10:
1314 case SID_DRAWTBX_CS_STAR11:
1315 case SID_DRAWTBX_CS_STAR12:
1316 case SID_DRAWTBX_CS_FLOWCHART1:
1317 case SID_DRAWTBX_CS_FLOWCHART2:
1318 case SID_DRAWTBX_CS_FLOWCHART3:
1319 case SID_DRAWTBX_CS_FLOWCHART4:
1320 case SID_DRAWTBX_CS_FLOWCHART5:
1321 case SID_DRAWTBX_CS_FLOWCHART6:
1322 case SID_DRAWTBX_CS_FLOWCHART7:
1323 case SID_DRAWTBX_CS_FLOWCHART8:
1324 case SID_DRAWTBX_CS_FLOWCHART9:
1325 case SID_DRAWTBX_CS_FLOWCHART10:
1326 case SID_DRAWTBX_CS_FLOWCHART11:
1327 case SID_DRAWTBX_CS_FLOWCHART12:
1328 case SID_DRAWTBX_CS_FLOWCHART13:
1329 case SID_DRAWTBX_CS_FLOWCHART14:
1330 case SID_DRAWTBX_CS_FLOWCHART15:
1331 case SID_DRAWTBX_CS_FLOWCHART16:
1332 case SID_DRAWTBX_CS_FLOWCHART17:
1333 case SID_DRAWTBX_CS_FLOWCHART18:
1334 case SID_DRAWTBX_CS_FLOWCHART19:
1335 case SID_DRAWTBX_CS_FLOWCHART20:
1336 case SID_DRAWTBX_CS_FLOWCHART21:
1337 case SID_DRAWTBX_CS_FLOWCHART22:
1338 case SID_DRAWTBX_CS_FLOWCHART23:
1339 case SID_DRAWTBX_CS_FLOWCHART24:
1340 case SID_DRAWTBX_CS_FLOWCHART25:
1341 case SID_DRAWTBX_CS_FLOWCHART26:
1342 case SID_DRAWTBX_CS_FLOWCHART27:
1343 case SID_DRAWTBX_CS_FLOWCHART28:
1344 case SID_DRAWTBX_CS_CALLOUT1:
1345 case SID_DRAWTBX_CS_CALLOUT2:
1346 case SID_DRAWTBX_CS_CALLOUT3:
1347 case SID_DRAWTBX_CS_CALLOUT4:
1348 case SID_DRAWTBX_CS_CALLOUT5:
1349 case SID_DRAWTBX_CS_CALLOUT6:
1350 case SID_DRAWTBX_CS_CALLOUT7:
1351 case SID_DRAWTBX_CS_SYMBOL:
1352 case SID_DRAWTBX_CS_ARROW:
1353 case SID_DRAWTBX_CS_FLOWCHART:
1354 case SID_DRAWTBX_CS_CALLOUT:
1355 case SID_DRAWTBX_CS_STAR:
1356 getDesignView()->SetMode( DlgEdMode::Insert );
1358 URL aUrl = getURLForId(_nId);
1365 case SID_DRAWTBX_CS_SYMBOL:
1368 case SID_DRAWTBX_CS_ARROW:
1369 sType =
u"left-right-arrow";
1371 case SID_DRAWTBX_CS_FLOWCHART:
1372 sType =
u"flowchart-internal-storage";
1374 case SID_DRAWTBX_CS_CALLOUT:
1375 sType =
u"round-rectangular-callout";
1377 case SID_DRAWTBX_CS_STAR:
1387 getDesignView()->SetInsertObj( SdrObjKind::CustomShape, OUString(
sType));
1388 createDefaultControl(aArgs);
1392 case SID_RPT_SHOWREPORTEXPLORER:
1393 if ( isUiVisible() )
1394 getDesignView()->toggleReportExplorer();
1396 case SID_FM_ADD_FIELD:
1397 if ( isUiVisible() )
1398 getDesignView()->toggleAddField();
1400 case SID_SHOW_PROPERTYBROWSER:
1401 if ( m_bShowProperties )
1402 m_sLastActivePage = getDesignView()->getCurrentPage();
1404 getDesignView()->setCurrentPage(m_sLastActivePage);
1406 if ( isUiVisible() )
1408 m_bShowProperties = !m_bShowProperties;
1409 if ( aArgs.getLength() == 1 )
1410 aArgs[0].Value >>= m_bShowProperties;
1412 getDesignView()->togglePropertyBrowser(m_bShowProperties);
1415 case SID_PROPERTYBROWSER_LAST_PAGE:
1416 m_sLastActivePage = getDesignView()->getCurrentPage();
1418 case SID_SPLIT_POSITION:
1419 getDesignView()->Resize();
1421 case SID_PAGEDIALOG:
1422 case SID_ATTR_CHAR_COLOR_BACKGROUND:
1424 uno::Reference<report::XSection> xSection;
1425 if (aArgs.getLength() == 1 )
1426 aArgs[0].Value >>= xSection;
1427 else if (_nId == SID_ATTR_CHAR_COLOR_BACKGROUND)
1428 xSection.set(getDesignView()->getMarkedSection()->getReportSection().getSection());
1429 openPageDialog(xSection);
1430 bForceBroadcast =
true;
1433 case SID_SORTINGANDGROUPING:
1434 openSortingAndGroupingDialog();
1436 case SID_BACKGROUND_COLOR:
1438 const util::Color aColor( lcl_extractBackgroundColor( aArgs ) );
1441 uno::Reference< report::XSection > xSection = getDesignView()->getCurrentSection();
1442 if ( xSection.is() )
1444 xSection->setBackColor( aColor );
1447 bForceBroadcast =
true;
1450 case SID_ATTR_CHAR_WEIGHT:
1451 case SID_ATTR_CHAR_POSTURE:
1452 case SID_ATTR_CHAR_UNDERLINE:
1454 uno::Reference< awt::XWindow> xWindow;
1455 ::std::vector< uno::Reference< uno::XInterface > > aControlsFormats;
1458 const OUString sUndoAction(
RptResId(RID_STR_UNDO_CHANGEFONT));
1459 UndoContext aUndoContext( getUndoManager(), sUndoAction );
1461 for (
const auto& rxControlFormat : aControlsFormats)
1463 uno::Reference< report::XReportControlFormat> xReportControlFormat(rxControlFormat,uno::UNO_QUERY);
1464 lcl_setFontWPU_nothrow(xReportControlFormat,_nId);
1468 case SID_ATTR_CHAR_COLOR:
1469 case SID_ATTR_CHAR_COLOR2:
1470 case SID_ATTR_CHAR_COLOR_EXT:
1472 const util::Color aColor( lcl_extractBackgroundColor( aArgs ) );
1474 bForceBroadcast =
true;
1477 case SID_ATTR_CHAR_FONT:
1478 if ( aArgs.getLength() == 1 )
1480 awt::FontDescriptor aFont;
1481 if ( aArgs[0].
Value >>= aFont )
1487 case SID_ATTR_CHAR_FONTHEIGHT:
1488 if ( aArgs.getLength() == 1 )
1490 float fSelVal = 0.0;
1491 if ( aArgs[0].
Value >>= fSelVal )
1495 case SID_ATTR_PARA_ADJUST_LEFT:
1496 case SID_ATTR_PARA_ADJUST_CENTER:
1497 case SID_ATTR_PARA_ADJUST_RIGHT:
1498 case SID_ATTR_PARA_ADJUST_BLOCK:
1500 style::ParagraphAdjust eParagraphAdjust = style::ParagraphAdjust_LEFT;
1503 case SID_ATTR_PARA_ADJUST_LEFT:
1504 eParagraphAdjust = style::ParagraphAdjust_LEFT;
1506 case SID_ATTR_PARA_ADJUST_CENTER:
1507 eParagraphAdjust = style::ParagraphAdjust_CENTER;
1509 case SID_ATTR_PARA_ADJUST_RIGHT:
1510 eParagraphAdjust = style::ParagraphAdjust_RIGHT;
1512 case SID_ATTR_PARA_ADJUST_BLOCK:
1513 eParagraphAdjust = style::ParagraphAdjust_BLOCK;
1516 impl_setPropertyAtControls_throw(RID_STR_UNDO_ALIGNMENT,
PROPERTY_PARAADJUST,
uno::Any(
static_cast<sal_Int16
>(eParagraphAdjust)),aArgs);
1518 InvalidateFeature(SID_ATTR_PARA_ADJUST_LEFT);
1519 InvalidateFeature(SID_ATTR_PARA_ADJUST_CENTER);
1520 InvalidateFeature(SID_ATTR_PARA_ADJUST_RIGHT);
1521 InvalidateFeature(SID_ATTR_PARA_ADJUST_BLOCK);
1526 uno::Sequence< beans::NamedValue > aSettings;
1527 uno::Reference< awt::XWindow> xWindow;
1528 ::std::vector< uno::Reference< uno::XInterface > > aControlsFormats;
1531 if ( !aControlsFormats.empty() )
1533 const OUString sUndoAction(
RptResId( RID_STR_UNDO_CHANGEFONT ) );
1534 UndoContext aUndoContext( getUndoManager(), sUndoAction );
1536 for (
const auto& rxControlFormat : aControlsFormats)
1538 uno::Reference< report::XReportControlFormat > xFormat( rxControlFormat, uno::UNO_QUERY );
1539 if ( !xFormat.is() )
1542 if ( !aSettings.hasElements() )
1545 if ( !aSettings.hasElements() )
1556 case SID_INSERT_GRAPHIC:
1559 case SID_SETCONTROLDEFAULTS:
1561 case SID_CONDITIONALFORMATTING:
1563 uno::Reference< report::XFormattedField> xFormattedField(getDesignView()->getCurrentControlModel(),uno::UNO_QUERY);
1564 if ( xFormattedField.is() )
1572 if ( m_xReportDefinition.is() )
1574 if ( !aArgs.hasElements() )
1576 ODateTimeDialog aDlg(getFrameWeld(), getDesignView()->getCurrentSection(),
this);
1580 createDateTime(aArgs);
1583 case SID_INSERT_FLD_PGNUMBER:
1584 if ( m_xReportDefinition.is() )
1586 if ( !aArgs.hasElements() )
1592 createPageNumber(aArgs);
1596 case SID_EXPORTDOCASPDF:
1597 case SID_PRINTPREVIEW:
1604 setEditable(!isEditable());
1610 if ( !aArgs.hasElements() )
1614 else if ( aArgs.getLength() == 1 && aArgs[0].Name ==
"Zoom" )
1618 m_nZoomValue = aZoomItem.GetValue();
1619 m_eZoomType = aZoomItem.
GetType();
1620 impl_zoom_nothrow();
1623 case SID_ATTR_ZOOMSLIDER:
1624 if ( aArgs.getLength() == 1 && aArgs[0].Name ==
"ZoomSlider" )
1628 m_nZoomValue = aZoomSlider.GetValue();
1629 m_eZoomType = SvxZoomType::PERCENT;
1630 impl_zoom_nothrow();
1634 OReportController_BASE::Execute(_nId,aArgs);
1639void OReportController::impl_initialize( )
1641 OReportController_BASE::impl_initialize();
1643 const ::comphelper::NamedValueCollection& rArguments( getInitParams() );
1647 rArguments.get_ensureType(
"DocumentTitle",
m_sName );
1651 if ( m_xReportDefinition.is() )
1656 if ( !m_aReportModel )
1658 m_aReportModel->attachController( *
this );
1666 setEditable( !m_aReportModel->IsReadOnly() );
1667 m_xFormatter.set(util::NumberFormatter::create(
m_xContext), UNO_QUERY_THROW);
1675 uno::Reference<sdbcx::XTablesSupplier> xTablesSup(
getConnection(),uno::UNO_QUERY_THROW);
1676 uno::Reference<container::XNameAccess> xTables = xTablesSup->getTables();
1677 const uno::Sequence< OUString > aNames( xTables->getElementNames() );
1679 if ( aNames.hasElements() )
1681 m_xReportDefinition->setCommand(aNames[0]);
1682 m_xReportDefinition->setCommandType(sdb::CommandType::TABLE);
1686 m_aVisualAreaSize = m_xReportDefinition->getVisualAreaSize(0);
1691 checkChartEnabled();
1693 getDesignView()->toggleGrid(m_bGridVisible);
1694 getDesignView()->showRuler(m_bShowRuler);
1695 getDesignView()->togglePropertyBrowser(m_bShowProperties);
1696 getDesignView()->setCurrentPage(m_sLastActivePage);
1697 getDesignView()->unmarkAllObjects();
1699 if ( m_nPageNum != -1 )
1701 if ( m_nPageNum < m_aReportModel->GetPageCount() )
1703 const OReportPage* pPage =
dynamic_cast<OReportPage*
>(m_aReportModel->GetPage(
static_cast<sal_uInt16
>(m_nPageNum)));
1712 getDesignView()->collapseSections(m_aCollapsedSections);
1713 impl_zoom_nothrow();
1714 getDesignView()->Resize();
1715 getDesignView()->Invalidate();
1718 if ( m_bShowProperties && m_nPageNum == -1 )
1720 m_sLastActivePage =
"Data";
1721 getDesignView()->setCurrentPage(m_sLastActivePage);
1722 executeUnChecked(SID_SELECT_REPORT,{});
1727 catch(
const SQLException&)
1733IMPL_LINK( OReportController, OnCreateHdl, OAddFieldWindow& ,_rAddFieldDlg,
void)
1736 uno::Sequence< beans::PropertyValue > aArgs = _rAddFieldDlg.getSelectedFieldDescriptors();
1738 if ( aArgs.hasElements() )
1740 executeChecked(SID_ADD_CONTROL_PAIR,aArgs);
1748 setView( pMyOwnView );
1752 m_aSystemClipboard.StartClipboardListening( );
1754 m_pClipboardNotifier->AddListener(
getView() );
1756 OReportController_BASE::Construct(pParent);
1762 if ( getBroadcastHelper().bInDispose || getBroadcastHelper().bDisposed )
1766 ::osl::MutexGuard aGuard(
getMutex() );
1775void OReportController::describeSupportedFeatures()
1777 DBSubComponentController::describeSupportedFeatures();
1779 implDescribeSupportedFeature(
".uno:TextDocument", SID_RPT_TEXTDOCUMENT, CommandGroup::APPLICATION );
1780 implDescribeSupportedFeature(
".uno:Spreadsheet", SID_RPT_SPREADSHEET, CommandGroup::APPLICATION );
1782 implDescribeSupportedFeature(
".uno:Redo", SID_REDO, CommandGroup::EDIT );
1783 implDescribeSupportedFeature(
".uno:Undo", SID_UNDO, CommandGroup::EDIT );
1784 implDescribeSupportedFeature(
".uno:SelectAll", SID_SELECTALL, CommandGroup::EDIT );
1785 implDescribeSupportedFeature(
".uno:SelectAllInSection", SID_SELECTALL_IN_SECTION, CommandGroup::EDIT );
1786 implDescribeSupportedFeature(
".uno:Delete", SID_DELETE, CommandGroup::EDIT );
1787 implDescribeSupportedFeature(
".uno:SelectReport", SID_SELECT_REPORT, CommandGroup::EDIT );
1788 implDescribeSupportedFeature(
".uno:ExecuteReport", SID_EXECUTE_REPORT, CommandGroup::EDIT );
1790 implDescribeSupportedFeature(
".uno:GridVisible", SID_GRID_VISIBLE, CommandGroup::VIEW );
1791 implDescribeSupportedFeature(
".uno:GridUse", SID_GRID_USE, CommandGroup::VIEW );
1792 implDescribeSupportedFeature(
".uno:HelplinesMove", SID_HELPLINES_MOVE, CommandGroup::VIEW );
1793 implDescribeSupportedFeature(
".uno:ShowRuler", SID_RULER, CommandGroup::VIEW );
1794 implDescribeSupportedFeature(
".uno:AddField", SID_FM_ADD_FIELD, CommandGroup::VIEW );
1795 implDescribeSupportedFeature(
".uno:ReportNavigator", SID_RPT_SHOWREPORTEXPLORER, CommandGroup::VIEW );
1796 implDescribeSupportedFeature(
".uno:ControlProperties", SID_SHOW_PROPERTYBROWSER, CommandGroup::VIEW );
1797 implDescribeSupportedFeature(
".uno:DbSortingAndGrouping", SID_SORTINGANDGROUPING, CommandGroup::VIEW );
1798 implDescribeSupportedFeature(
".uno:PageHeaderFooter", SID_PAGEHEADERFOOTER, CommandGroup::VIEW );
1799 implDescribeSupportedFeature(
".uno:ReportHeaderFooter", SID_REPORTHEADERFOOTER, CommandGroup::VIEW );
1800 implDescribeSupportedFeature(
".uno:ZoomSlider", SID_ATTR_ZOOMSLIDER );
1801 implDescribeSupportedFeature(
".uno:Zoom", SID_ATTR_ZOOM, CommandGroup::VIEW );
1803 implDescribeSupportedFeature(
".uno:ConditionalFormatting", SID_CONDITIONALFORMATTING, CommandGroup::FORMAT );
1804 implDescribeSupportedFeature(
".uno:PageDialog", SID_PAGEDIALOG, CommandGroup::FORMAT );
1805 implDescribeSupportedFeature(
".uno:ResetAttributes", SID_SETCONTROLDEFAULTS, CommandGroup::FORMAT );
1807 implDescribeSupportedFeature(
".uno:Bold", SID_ATTR_CHAR_WEIGHT, CommandGroup::FORMAT );
1808 implDescribeSupportedFeature(
".uno:Italic", SID_ATTR_CHAR_POSTURE, CommandGroup::FORMAT );
1809 implDescribeSupportedFeature(
".uno:Underline", SID_ATTR_CHAR_UNDERLINE, CommandGroup::FORMAT );
1810 implDescribeSupportedFeature(
".uno:DBBackgroundColor", SID_ATTR_CHAR_COLOR_BACKGROUND, CommandGroup::FORMAT );
1811 implDescribeSupportedFeature(
".uno:BackgroundColor", SID_BACKGROUND_COLOR, CommandGroup::FORMAT );
1812 implDescribeSupportedFeature(
".uno:CharColorExt", SID_ATTR_CHAR_COLOR_EXT);
1813 implDescribeSupportedFeature(
".uno:Color", SID_ATTR_CHAR_COLOR);
1814 implDescribeSupportedFeature(
".uno:FontColor", SID_ATTR_CHAR_COLOR2, CommandGroup::FORMAT );
1815 implDescribeSupportedFeature(
".uno:FontDialog", SID_CHAR_DLG, CommandGroup::FORMAT );
1816 implDescribeSupportedFeature(
".uno:LeftPara", SID_ATTR_PARA_ADJUST_LEFT, CommandGroup::FORMAT );
1817 implDescribeSupportedFeature(
".uno:CenterPara", SID_ATTR_PARA_ADJUST_CENTER, CommandGroup::FORMAT );
1818 implDescribeSupportedFeature(
".uno:RightPara", SID_ATTR_PARA_ADJUST_RIGHT, CommandGroup::FORMAT );
1819 implDescribeSupportedFeature(
".uno:JustifyPara", SID_ATTR_PARA_ADJUST_BLOCK, CommandGroup::FORMAT );
1821 implDescribeSupportedFeature(
".uno:FontHeight", SID_ATTR_CHAR_FONTHEIGHT, CommandGroup::FORMAT );
1822 implDescribeSupportedFeature(
".uno:CharFontName", SID_ATTR_CHAR_FONT, CommandGroup::FORMAT );
1824 implDescribeSupportedFeature(
".uno:ArrangeMenu", SID_ARRANGEMENU, CommandGroup::FORMAT );
1825 implDescribeSupportedFeature(
".uno:BringToFront", SID_FRAME_TO_TOP, CommandGroup::FORMAT );
1826 implDescribeSupportedFeature(
".uno:ObjectBackOne", SID_FRAME_DOWN, CommandGroup::FORMAT );
1827 implDescribeSupportedFeature(
".uno:ObjectForwardOne", SID_FRAME_UP, CommandGroup::FORMAT );
1828 implDescribeSupportedFeature(
".uno:SendToBack", SID_FRAME_TO_BOTTOM, CommandGroup::FORMAT );
1829 implDescribeSupportedFeature(
".uno:SetObjectToForeground", SID_OBJECT_HEAVEN, CommandGroup::FORMAT );
1830 implDescribeSupportedFeature(
".uno:SetObjectToBackground", SID_OBJECT_HELL, CommandGroup::FORMAT );
1832 implDescribeSupportedFeature(
".uno:ObjectAlign", SID_OBJECT_ALIGN, CommandGroup::FORMAT );
1833 implDescribeSupportedFeature(
".uno:ObjectAlignLeft", SID_OBJECT_ALIGN_LEFT, CommandGroup::FORMAT );
1834 implDescribeSupportedFeature(
".uno:AlignCenter", SID_OBJECT_ALIGN_CENTER, CommandGroup::FORMAT );
1835 implDescribeSupportedFeature(
".uno:ObjectAlignRight", SID_OBJECT_ALIGN_RIGHT, CommandGroup::FORMAT );
1836 implDescribeSupportedFeature(
".uno:AlignUp", SID_OBJECT_ALIGN_UP, CommandGroup::FORMAT );
1837 implDescribeSupportedFeature(
".uno:AlignMiddle", SID_OBJECT_ALIGN_MIDDLE, CommandGroup::FORMAT );
1838 implDescribeSupportedFeature(
".uno:AlignDown", SID_OBJECT_ALIGN_DOWN, CommandGroup::FORMAT );
1840 implDescribeSupportedFeature(
".uno:SectionAlign", SID_SECTION_ALIGN );
1841 implDescribeSupportedFeature(
".uno:SectionAlignLeft", SID_SECTION_ALIGN_LEFT, CommandGroup::FORMAT );
1842 implDescribeSupportedFeature(
".uno:SectionAlignCenter", SID_SECTION_ALIGN_CENTER, CommandGroup::FORMAT );
1843 implDescribeSupportedFeature(
".uno:SectionAlignRight", SID_SECTION_ALIGN_RIGHT, CommandGroup::FORMAT );
1844 implDescribeSupportedFeature(
".uno:SectionAlignTop", SID_SECTION_ALIGN_UP, CommandGroup::FORMAT );
1845 implDescribeSupportedFeature(
".uno:SectionAlignMiddle", SID_SECTION_ALIGN_MIDDLE, CommandGroup::FORMAT );
1846 implDescribeSupportedFeature(
".uno:SectionAlignBottom", SID_SECTION_ALIGN_DOWN, CommandGroup::FORMAT );
1847 implDescribeSupportedFeature(
".uno:SectionShrink", SID_SECTION_SHRINK, CommandGroup::FORMAT );
1848 implDescribeSupportedFeature(
".uno:SectionShrinkTop", SID_SECTION_SHRINK_TOP, CommandGroup::FORMAT );
1849 implDescribeSupportedFeature(
".uno:SectionShrinkBottom", SID_SECTION_SHRINK_BOTTOM, CommandGroup::FORMAT );
1851 implDescribeSupportedFeature(
".uno:ObjectResize", SID_OBJECT_RESIZING, CommandGroup::FORMAT );
1852 implDescribeSupportedFeature(
".uno:SmallestWidth", SID_OBJECT_SMALLESTWIDTH, CommandGroup::FORMAT );
1853 implDescribeSupportedFeature(
".uno:SmallestHeight", SID_OBJECT_SMALLESTHEIGHT, CommandGroup::FORMAT );
1854 implDescribeSupportedFeature(
".uno:GreatestWidth", SID_OBJECT_GREATESTWIDTH, CommandGroup::FORMAT );
1855 implDescribeSupportedFeature(
".uno:GreatestHeight", SID_OBJECT_GREATESTHEIGHT, CommandGroup::FORMAT );
1857 implDescribeSupportedFeature(
".uno:DistributeSelection", SID_DISTRIBUTE_DLG, CommandGroup::FORMAT );
1858 implDescribeSupportedFeature(
".uno:DistributeHorzLeft", SID_DISTRIBUTE_HLEFT, CommandGroup::FORMAT );
1859 implDescribeSupportedFeature(
".uno:DistributeHorzCenter", SID_DISTRIBUTE_HCENTER, CommandGroup::FORMAT );
1860 implDescribeSupportedFeature(
".uno:DistributeHorzDistance", SID_DISTRIBUTE_HDISTANCE, CommandGroup::FORMAT );
1861 implDescribeSupportedFeature(
".uno:DistributeHorzRight", SID_DISTRIBUTE_HRIGHT, CommandGroup::FORMAT );
1862 implDescribeSupportedFeature(
".uno:DistributeVertTop", SID_DISTRIBUTE_VTOP, CommandGroup::FORMAT );
1863 implDescribeSupportedFeature(
".uno:DistributeVertCenter", SID_DISTRIBUTE_VCENTER, CommandGroup::FORMAT );
1864 implDescribeSupportedFeature(
".uno:DistributeVertDistance", SID_DISTRIBUTE_VDISTANCE, CommandGroup::FORMAT );
1865 implDescribeSupportedFeature(
".uno:DistributeVertBottom", SID_DISTRIBUTE_VBOTTOM, CommandGroup::FORMAT );
1867 implDescribeSupportedFeature(
".uno:ExportTo", SID_EXPORTDOC, CommandGroup::APPLICATION );
1868 implDescribeSupportedFeature(
".uno:ExportToPDF", SID_EXPORTDOCASPDF, CommandGroup::APPLICATION );
1869 implDescribeSupportedFeature(
".uno:PrintPreview", SID_PRINTPREVIEW, CommandGroup::APPLICATION );
1871 implDescribeSupportedFeature(
".uno:NewDoc", SID_NEWDOC, CommandGroup::DOCUMENT );
1872 implDescribeSupportedFeature(
".uno:Save", SID_SAVEDOC, CommandGroup::DOCUMENT );
1873 implDescribeSupportedFeature(
".uno:SaveAs", SID_SAVEASDOC, CommandGroup::DOCUMENT );
1874 implDescribeSupportedFeature(
".uno:SaveACopy", SID_SAVEACOPY, CommandGroup::DOCUMENT );
1876 implDescribeSupportedFeature(
".uno:InsertPageNumberField", SID_INSERT_FLD_PGNUMBER, CommandGroup::INSERT );
1877 implDescribeSupportedFeature(
".uno:InsertDateTimeField", SID_DATETIME, CommandGroup::INSERT );
1878 implDescribeSupportedFeature(
".uno:InsertObjectChart", SID_INSERT_DIAGRAM, CommandGroup::INSERT );
1879 implDescribeSupportedFeature(
".uno:InsertGraphic", SID_INSERT_GRAPHIC, CommandGroup::INSERT );
1881 implDescribeSupportedFeature(
".uno:SelectObject", SID_OBJECT_SELECT, CommandGroup::INSERT );
1882 implDescribeSupportedFeature(
".uno:Label", SID_FM_FIXEDTEXT, CommandGroup::INSERT );
1883 implDescribeSupportedFeature(
".uno:Edit", SID_FM_EDIT, CommandGroup::INSERT );
1884 implDescribeSupportedFeature(
".uno:ImageControl", SID_FM_IMAGECONTROL, CommandGroup::INSERT );
1885 implDescribeSupportedFeature(
".uno:HFixedLine", SID_INSERT_HFIXEDLINE, CommandGroup::INSERT );
1886 implDescribeSupportedFeature(
".uno:VFixedLine", SID_INSERT_VFIXEDLINE, CommandGroup::INSERT );
1889 implDescribeSupportedFeature(
".uno:BasicShapes", SID_DRAWTBX_CS_BASIC, CommandGroup::INSERT );
1890 implDescribeSupportedFeature(
".uno:BasicShapes.rectangle", SID_DRAWTBX_CS_BASIC1, CommandGroup::INSERT );
1891 implDescribeSupportedFeature(
".uno:BasicShapes.round-rectangle",SID_DRAWTBX_CS_BASIC2, CommandGroup::INSERT );
1892 implDescribeSupportedFeature(
".uno:BasicShapes.quadrat", SID_DRAWTBX_CS_BASIC3, CommandGroup::INSERT );
1893 implDescribeSupportedFeature(
".uno:BasicShapes.round-quadrat", SID_DRAWTBX_CS_BASIC4, CommandGroup::INSERT );
1894 implDescribeSupportedFeature(
".uno:BasicShapes.circle", SID_DRAWTBX_CS_BASIC5, CommandGroup::INSERT );
1895 implDescribeSupportedFeature(
".uno:BasicShapes.ellipse", SID_DRAWTBX_CS_BASIC6, CommandGroup::INSERT );
1896 implDescribeSupportedFeature(
".uno:BasicShapes.circle-pie", SID_DRAWTBX_CS_BASIC7, CommandGroup::INSERT );
1897 implDescribeSupportedFeature(
".uno:BasicShapes.isosceles-triangle",SID_DRAWTBX_CS_BASIC8, CommandGroup::INSERT );
1898 implDescribeSupportedFeature(
".uno:BasicShapes.right-triangle",SID_DRAWTBX_CS_BASIC9, CommandGroup::INSERT );
1899 implDescribeSupportedFeature(
".uno:BasicShapes.trapezoid", SID_DRAWTBX_CS_BASIC10, CommandGroup::INSERT );
1900 implDescribeSupportedFeature(
".uno:BasicShapes.diamond", SID_DRAWTBX_CS_BASIC11, CommandGroup::INSERT );
1901 implDescribeSupportedFeature(
".uno:BasicShapes.parallelogram", SID_DRAWTBX_CS_BASIC12, CommandGroup::INSERT );
1902 implDescribeSupportedFeature(
".uno:BasicShapes.pentagon", SID_DRAWTBX_CS_BASIC13, CommandGroup::INSERT );
1903 implDescribeSupportedFeature(
".uno:BasicShapes.hexagon", SID_DRAWTBX_CS_BASIC14, CommandGroup::INSERT );
1904 implDescribeSupportedFeature(
".uno:BasicShapes.octagon", SID_DRAWTBX_CS_BASIC15, CommandGroup::INSERT );
1905 implDescribeSupportedFeature(
".uno:BasicShapes.cross", SID_DRAWTBX_CS_BASIC16, CommandGroup::INSERT );
1906 implDescribeSupportedFeature(
".uno:BasicShapes.ring", SID_DRAWTBX_CS_BASIC17, CommandGroup::INSERT );
1907 implDescribeSupportedFeature(
".uno:BasicShapes.block-arc", SID_DRAWTBX_CS_BASIC18, CommandGroup::INSERT );
1908 implDescribeSupportedFeature(
".uno:BasicShapes.can", SID_DRAWTBX_CS_BASIC19, CommandGroup::INSERT );
1909 implDescribeSupportedFeature(
".uno:BasicShapes.cube", SID_DRAWTBX_CS_BASIC20, CommandGroup::INSERT );
1910 implDescribeSupportedFeature(
".uno:BasicShapes.paper", SID_DRAWTBX_CS_BASIC21, CommandGroup::INSERT );
1911 implDescribeSupportedFeature(
".uno:BasicShapes.frame", SID_DRAWTBX_CS_BASIC22, CommandGroup::INSERT );
1913 implDescribeSupportedFeature(
".uno:SymbolShapes", SID_DRAWTBX_CS_SYMBOL, CommandGroup::INSERT );
1915 implDescribeSupportedFeature(
".uno:SymbolShapes.smiley" , SID_DRAWTBX_CS_SYMBOL1, CommandGroup::INSERT );
1916 implDescribeSupportedFeature(
".uno:SymbolShapes.sun" , SID_DRAWTBX_CS_SYMBOL2, CommandGroup::INSERT );
1917 implDescribeSupportedFeature(
".uno:SymbolShapes.moon" , SID_DRAWTBX_CS_SYMBOL3, CommandGroup::INSERT );
1918 implDescribeSupportedFeature(
".uno:SymbolShapes.lightning" , SID_DRAWTBX_CS_SYMBOL4, CommandGroup::INSERT );
1919 implDescribeSupportedFeature(
".uno:SymbolShapes.heart" , SID_DRAWTBX_CS_SYMBOL5, CommandGroup::INSERT );
1920 implDescribeSupportedFeature(
".uno:SymbolShapes.flower" , SID_DRAWTBX_CS_SYMBOL6, CommandGroup::INSERT );
1921 implDescribeSupportedFeature(
".uno:SymbolShapes.cloud" , SID_DRAWTBX_CS_SYMBOL7, CommandGroup::INSERT );
1922 implDescribeSupportedFeature(
".uno:SymbolShapes.forbidden" , SID_DRAWTBX_CS_SYMBOL8, CommandGroup::INSERT );
1923 implDescribeSupportedFeature(
".uno:SymbolShapes.puzzle" , SID_DRAWTBX_CS_SYMBOL9, CommandGroup::INSERT );
1924 implDescribeSupportedFeature(
".uno:SymbolShapes.bracket-pair" ,SID_DRAWTBX_CS_SYMBOL10, CommandGroup::INSERT );
1925 implDescribeSupportedFeature(
".uno:SymbolShapes.left-bracket" ,SID_DRAWTBX_CS_SYMBOL11, CommandGroup::INSERT );
1926 implDescribeSupportedFeature(
".uno:SymbolShapes.right-bracket",SID_DRAWTBX_CS_SYMBOL12, CommandGroup::INSERT );
1927 implDescribeSupportedFeature(
".uno:SymbolShapes.brace-pair" , SID_DRAWTBX_CS_SYMBOL13, CommandGroup::INSERT );
1928 implDescribeSupportedFeature(
".uno:SymbolShapes.left-brace" , SID_DRAWTBX_CS_SYMBOL14, CommandGroup::INSERT );
1929 implDescribeSupportedFeature(
".uno:SymbolShapes.right-brace" , SID_DRAWTBX_CS_SYMBOL15, CommandGroup::INSERT );
1930 implDescribeSupportedFeature(
".uno:SymbolShapes.quad-bevel" , SID_DRAWTBX_CS_SYMBOL16, CommandGroup::INSERT );
1931 implDescribeSupportedFeature(
".uno:SymbolShapes.octagon-bevel",SID_DRAWTBX_CS_SYMBOL17, CommandGroup::INSERT );
1932 implDescribeSupportedFeature(
".uno:SymbolShapes.diamond-bevel",SID_DRAWTBX_CS_SYMBOL18, CommandGroup::INSERT );
1934 implDescribeSupportedFeature(
".uno:ArrowShapes.left-arrow" , SID_DRAWTBX_CS_ARROW1, CommandGroup::INSERT );
1935 implDescribeSupportedFeature(
".uno:ArrowShapes.right-arrow" , SID_DRAWTBX_CS_ARROW2, CommandGroup::INSERT );
1936 implDescribeSupportedFeature(
".uno:ArrowShapes.up-arrow" , SID_DRAWTBX_CS_ARROW3, CommandGroup::INSERT );
1937 implDescribeSupportedFeature(
".uno:ArrowShapes.down-arrow" , SID_DRAWTBX_CS_ARROW4, CommandGroup::INSERT );
1938 implDescribeSupportedFeature(
".uno:ArrowShapes.left-right-arrow" , SID_DRAWTBX_CS_ARROW5, CommandGroup::INSERT );
1939 implDescribeSupportedFeature(
".uno:ArrowShapes.up-down-arrow" , SID_DRAWTBX_CS_ARROW6, CommandGroup::INSERT );
1940 implDescribeSupportedFeature(
".uno:ArrowShapes.up-right-arrow" , SID_DRAWTBX_CS_ARROW7, CommandGroup::INSERT );
1941 implDescribeSupportedFeature(
".uno:ArrowShapes.up-right-down-arrow" , SID_DRAWTBX_CS_ARROW8, CommandGroup::INSERT );
1942 implDescribeSupportedFeature(
".uno:ArrowShapes.quad-arrow" , SID_DRAWTBX_CS_ARROW9, CommandGroup::INSERT );
1943 implDescribeSupportedFeature(
".uno:ArrowShapes.corner-right-arrow" , SID_DRAWTBX_CS_ARROW10, CommandGroup::INSERT );
1944 implDescribeSupportedFeature(
".uno:ArrowShapes.split-arrow" , SID_DRAWTBX_CS_ARROW11, CommandGroup::INSERT );
1945 implDescribeSupportedFeature(
".uno:ArrowShapes.striped-right-arrow" , SID_DRAWTBX_CS_ARROW12, CommandGroup::INSERT );
1946 implDescribeSupportedFeature(
".uno:ArrowShapes.notched-right-arrow" , SID_DRAWTBX_CS_ARROW13, CommandGroup::INSERT );
1947 implDescribeSupportedFeature(
".uno:ArrowShapes.pentagon-right" , SID_DRAWTBX_CS_ARROW14, CommandGroup::INSERT );
1948 implDescribeSupportedFeature(
".uno:ArrowShapes.chevron" , SID_DRAWTBX_CS_ARROW15, CommandGroup::INSERT );
1949 implDescribeSupportedFeature(
".uno:ArrowShapes.right-arrow-callout" , SID_DRAWTBX_CS_ARROW16, CommandGroup::INSERT );
1950 implDescribeSupportedFeature(
".uno:ArrowShapes.left-arrow-callout" , SID_DRAWTBX_CS_ARROW17, CommandGroup::INSERT );
1951 implDescribeSupportedFeature(
".uno:ArrowShapes.up-arrow-callout" , SID_DRAWTBX_CS_ARROW18, CommandGroup::INSERT );
1952 implDescribeSupportedFeature(
".uno:ArrowShapes.down-arrow-callout" , SID_DRAWTBX_CS_ARROW19, CommandGroup::INSERT );
1953 implDescribeSupportedFeature(
".uno:ArrowShapes.left-right-arrow-callout",SID_DRAWTBX_CS_ARROW20, CommandGroup::INSERT );
1954 implDescribeSupportedFeature(
".uno:ArrowShapes.up-down-arrow-callout" ,SID_DRAWTBX_CS_ARROW21, CommandGroup::INSERT );
1955 implDescribeSupportedFeature(
".uno:ArrowShapes.up-right-arrow-callout",SID_DRAWTBX_CS_ARROW22, CommandGroup::INSERT );
1956 implDescribeSupportedFeature(
".uno:ArrowShapes.quad-arrow-callout" , SID_DRAWTBX_CS_ARROW23, CommandGroup::INSERT );
1957 implDescribeSupportedFeature(
".uno:ArrowShapes.circular-arrow" , SID_DRAWTBX_CS_ARROW24, CommandGroup::INSERT );
1958 implDescribeSupportedFeature(
".uno:ArrowShapes.split-round-arrow" , SID_DRAWTBX_CS_ARROW25, CommandGroup::INSERT );
1959 implDescribeSupportedFeature(
".uno:ArrowShapes.s-sharped-arrow" , SID_DRAWTBX_CS_ARROW26, CommandGroup::INSERT );
1961 implDescribeSupportedFeature(
".uno:StarShapes.bang" , SID_DRAWTBX_CS_STAR1, CommandGroup::INSERT );
1962 implDescribeSupportedFeature(
".uno:StarShapes.star4" , SID_DRAWTBX_CS_STAR2, CommandGroup::INSERT );
1963 implDescribeSupportedFeature(
".uno:StarShapes.star5" , SID_DRAWTBX_CS_STAR3, CommandGroup::INSERT );
1964 implDescribeSupportedFeature(
".uno:StarShapes.star6" , SID_DRAWTBX_CS_STAR4, CommandGroup::INSERT );
1965 implDescribeSupportedFeature(
".uno:StarShapes.star8" , SID_DRAWTBX_CS_STAR5, CommandGroup::INSERT );
1966 implDescribeSupportedFeature(
".uno:StarShapes.star12" , SID_DRAWTBX_CS_STAR6, CommandGroup::INSERT );
1967 implDescribeSupportedFeature(
".uno:StarShapes.star24" , SID_DRAWTBX_CS_STAR7, CommandGroup::INSERT );
1968 implDescribeSupportedFeature(
".uno:StarShapes.concave-star6" , SID_DRAWTBX_CS_STAR8, CommandGroup::INSERT );
1969 implDescribeSupportedFeature(
".uno:StarShapes.vertical-scroll" , SID_DRAWTBX_CS_STAR9, CommandGroup::INSERT );
1970 implDescribeSupportedFeature(
".uno:StarShapes.horizontal-scroll" , SID_DRAWTBX_CS_STAR10, CommandGroup::INSERT );
1971 implDescribeSupportedFeature(
".uno:StarShapes.signet" , SID_DRAWTBX_CS_STAR11, CommandGroup::INSERT );
1972 implDescribeSupportedFeature(
".uno:StarShapes.doorplate" , SID_DRAWTBX_CS_STAR12, CommandGroup::INSERT );
1974 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-process" , SID_DRAWTBX_CS_FLOWCHART1, CommandGroup::INSERT );
1975 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-alternate-process" , SID_DRAWTBX_CS_FLOWCHART2, CommandGroup::INSERT );
1976 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-decision" , SID_DRAWTBX_CS_FLOWCHART3, CommandGroup::INSERT );
1977 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-data" , SID_DRAWTBX_CS_FLOWCHART4, CommandGroup::INSERT );
1978 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-predefined-process" , SID_DRAWTBX_CS_FLOWCHART5, CommandGroup::INSERT );
1979 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-internal-storage" , SID_DRAWTBX_CS_FLOWCHART6, CommandGroup::INSERT );
1980 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-document" , SID_DRAWTBX_CS_FLOWCHART7, CommandGroup::INSERT );
1981 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-multidocument" , SID_DRAWTBX_CS_FLOWCHART8, CommandGroup::INSERT );
1982 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-terminator" , SID_DRAWTBX_CS_FLOWCHART9, CommandGroup::INSERT );
1983 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-preparation" , SID_DRAWTBX_CS_FLOWCHART10, CommandGroup::INSERT );
1984 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-manual-input" , SID_DRAWTBX_CS_FLOWCHART11, CommandGroup::INSERT );
1985 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-manual-operation" , SID_DRAWTBX_CS_FLOWCHART12, CommandGroup::INSERT );
1986 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-connector" , SID_DRAWTBX_CS_FLOWCHART13, CommandGroup::INSERT );
1987 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-off-page-connector" , SID_DRAWTBX_CS_FLOWCHART14, CommandGroup::INSERT );
1988 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-card" , SID_DRAWTBX_CS_FLOWCHART15, CommandGroup::INSERT );
1989 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-punched-tape" , SID_DRAWTBX_CS_FLOWCHART16, CommandGroup::INSERT );
1990 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-summing-junction" , SID_DRAWTBX_CS_FLOWCHART17, CommandGroup::INSERT );
1991 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-or" , SID_DRAWTBX_CS_FLOWCHART18, CommandGroup::INSERT );
1992 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-collate" , SID_DRAWTBX_CS_FLOWCHART19, CommandGroup::INSERT );
1993 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-sort" , SID_DRAWTBX_CS_FLOWCHART20, CommandGroup::INSERT );
1994 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-extract" , SID_DRAWTBX_CS_FLOWCHART21, CommandGroup::INSERT );
1995 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-merge" , SID_DRAWTBX_CS_FLOWCHART22, CommandGroup::INSERT );
1996 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-stored-data" , SID_DRAWTBX_CS_FLOWCHART23, CommandGroup::INSERT );
1997 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-delay" , SID_DRAWTBX_CS_FLOWCHART24, CommandGroup::INSERT );
1998 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-sequential-access" , SID_DRAWTBX_CS_FLOWCHART25, CommandGroup::INSERT );
1999 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-magnetic-disk" , SID_DRAWTBX_CS_FLOWCHART26, CommandGroup::INSERT );
2000 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-direct-access-storage",SID_DRAWTBX_CS_FLOWCHART27, CommandGroup::INSERT );
2001 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-display" , SID_DRAWTBX_CS_FLOWCHART28, CommandGroup::INSERT );
2003 implDescribeSupportedFeature(
".uno:CalloutShapes.rectangular-callout" , SID_DRAWTBX_CS_CALLOUT1, CommandGroup::INSERT );
2004 implDescribeSupportedFeature(
".uno:CalloutShapes.round-rectangular-callout" , SID_DRAWTBX_CS_CALLOUT2, CommandGroup::INSERT );
2005 implDescribeSupportedFeature(
".uno:CalloutShapes.round-callout" , SID_DRAWTBX_CS_CALLOUT3, CommandGroup::INSERT );
2006 implDescribeSupportedFeature(
".uno:CalloutShapes.cloud-callout" , SID_DRAWTBX_CS_CALLOUT4, CommandGroup::INSERT );
2007 implDescribeSupportedFeature(
".uno:CalloutShapes.line-callout-1" , SID_DRAWTBX_CS_CALLOUT5, CommandGroup::INSERT );
2008 implDescribeSupportedFeature(
".uno:CalloutShapes.line-callout-2" , SID_DRAWTBX_CS_CALLOUT6, CommandGroup::INSERT );
2009 implDescribeSupportedFeature(
".uno:CalloutShapes.line-callout-3" , SID_DRAWTBX_CS_CALLOUT7, CommandGroup::INSERT );
2011 implDescribeSupportedFeature(
".uno:ArrowShapes", SID_DRAWTBX_CS_ARROW, CommandGroup::INSERT );
2013 implDescribeSupportedFeature(
".uno:FlowChartShapes", SID_DRAWTBX_CS_FLOWCHART, CommandGroup::INSERT );
2014 implDescribeSupportedFeature(
".uno:CalloutShapes", SID_DRAWTBX_CS_CALLOUT, CommandGroup::INSERT );
2015 implDescribeSupportedFeature(
".uno:StarShapes", SID_DRAWTBX_CS_STAR, CommandGroup::INSERT );
2019 implDescribeSupportedFeature(
".uno:Escape", SID_ESCAPE);
2022 implDescribeSupportedFeature(
".uno:RPT_RPTHEADER_UNDO", SID_REPORTHEADER_WITHOUT_UNDO);
2023 implDescribeSupportedFeature(
".uno:RPT_RPTFOOTER_UNDO", SID_REPORTFOOTER_WITHOUT_UNDO);
2024 implDescribeSupportedFeature(
".uno:RPT_PGHEADER_UNDO", SID_PAGEHEADER_WITHOUT_UNDO);
2025 implDescribeSupportedFeature(
".uno:RPT_PGFOOTER_UNDO", SID_PAGEFOOTER_WITHOUT_UNDO);
2026 implDescribeSupportedFeature(
".uno:SID_GROUPHEADER", SID_GROUPHEADER);
2027 implDescribeSupportedFeature(
".uno:SID_GROUPHEADER_WITHOUT_UNDO", SID_GROUPHEADER_WITHOUT_UNDO);
2028 implDescribeSupportedFeature(
".uno:SID_GROUPFOOTER", SID_GROUPFOOTER);
2029 implDescribeSupportedFeature(
".uno:SID_GROUPFOOTER_WITHOUT_UNDO", SID_GROUPFOOTER_WITHOUT_UNDO);
2030 implDescribeSupportedFeature(
".uno:SID_GROUP_REMOVE", SID_GROUP_REMOVE);
2031 implDescribeSupportedFeature(
".uno:SID_GROUP_APPEND", SID_GROUP_APPEND);
2032 implDescribeSupportedFeature(
".uno:SID_ADD_CONTROL_PAIR", SID_ADD_CONTROL_PAIR);
2033 implDescribeSupportedFeature(
".uno:SplitPosition", SID_SPLIT_POSITION);
2034 implDescribeSupportedFeature(
".uno:LastPropertyBrowserPage", SID_PROPERTYBROWSER_LAST_PAGE);
2035 implDescribeSupportedFeature(
".uno:Select", SID_SELECT);
2036 implDescribeSupportedFeature(
".uno:InsertFunction", SID_RPT_NEW_FUNCTION);
2037 implDescribeSupportedFeature(
".uno:NextMark", SID_NEXT_MARK);
2038 implDescribeSupportedFeature(
".uno:PrevMark", SID_PREV_MARK);
2039 implDescribeSupportedFeature(
".uno:TerminateInplaceActivation", SID_TERMINATE_INPLACEACTIVATION);
2040 implDescribeSupportedFeature(
".uno:SelectAllLabels", SID_SELECT_ALL_LABELS);
2041 implDescribeSupportedFeature(
".uno:SelectAllEdits", SID_SELECT_ALL_EDITS);
2042 implDescribeSupportedFeature(
".uno:CollapseSection", SID_COLLAPSE_SECTION);
2043 implDescribeSupportedFeature(
".uno:ExpandSection", SID_EXPAND_SECTION);
2044 implDescribeSupportedFeature(
".uno:GetUndoStrings", SID_GETUNDOSTRINGS);
2045 implDescribeSupportedFeature(
".uno:GetRedoStrings", SID_GETREDOSTRINGS);
2048void OReportController::impl_onModifyChanged()
2052 if ( m_xReportDefinition.is() )
2053 m_xReportDefinition->setModified( impl_isModified() );
2054 DBSubComponentController::impl_onModifyChanged();
2056 catch(
const uno::Exception&)
2064 if ( !_xLayoutManager.is() )
2067 static const std::u16string_view s_sMenu[] = {
2068 u"private:resource/statusbar/statusbar"
2069 ,
u"private:resource/toolbar/reportcontrols"
2070 ,
u"private:resource/toolbar/drawbar"
2071 ,
u"private:resource/toolbar/Formatting"
2072 ,
u"private:resource/toolbar/alignmentbar"
2073 ,
u"private:resource/toolbar/sectionalignmentbar"
2074 ,
u"private:resource/toolbar/resizebar"
2075 ,
u"private:resource/toolbar/sectionshrinkbar"
2077 for (
const auto &
i : s_sMenu)
2079 _xLayoutManager->createElement( OUString(
i) );
2080 _xLayoutManager->requestElement( OUString(
i) );
2084void OReportController::notifyGroupSections(
const ContainerEvent& _rEvent,
bool _bShow)
2086 uno::Reference< report::XGroup> xGroup(_rEvent.Element,uno::UNO_QUERY);
2091 ::osl::MutexGuard aGuard(
getMutex() );
2092 sal_Int32 nGroupPos = 0;
2093 _rEvent.Accessor >>= nGroupPos;
2097 xGroup->addPropertyChangeListener(
PROPERTY_HEADERON,
static_cast<XPropertyChangeListener*
>(
this));
2098 xGroup->addPropertyChangeListener(
PROPERTY_FOOTERON,
static_cast<XPropertyChangeListener*
>(
this));
2102 xGroup->removePropertyChangeListener(
PROPERTY_HEADERON,
static_cast<XPropertyChangeListener*
>(
this));
2103 xGroup->removePropertyChangeListener(
PROPERTY_FOOTERON,
static_cast<XPropertyChangeListener*
>(
this));
2106 if ( xGroup->getHeaderOn() )
2111 m_pReportControllerObserver->AddSection(xGroup->getHeader());
2115 m_pReportControllerObserver->RemoveSection(xGroup->getHeader());
2118 if ( xGroup->getFooterOn() )
2123 m_pReportControllerObserver->AddSection(xGroup->getFooter());
2127 m_pReportControllerObserver->RemoveSection(xGroup->getFooter());
2133void SAL_CALL OReportController::elementInserted(
const ContainerEvent& _rEvent )
2135 notifyGroupSections(_rEvent,
true);
2138void SAL_CALL OReportController::elementRemoved(
const ContainerEvent& _rEvent )
2140 notifyGroupSections(_rEvent,
false);
2143void SAL_CALL OReportController::elementReplaced(
const ContainerEvent& )
2146 ::osl::MutexGuard aGuard(
getMutex() );
2147 OSL_FAIL(
"Not yet implemented!");
2150void SAL_CALL OReportController::propertyChange(
const beans::PropertyChangeEvent& evt )
2153 ::osl::MutexGuard aGuard(
getMutex() );
2157 evt.NewValue >>= bShow;
2158 if ( evt.Source == m_xReportDefinition )
2162 const sal_uInt16 nPosition = m_xReportDefinition->getPageHeaderOn() ? 1 : 0;
2165 getDesignView()->addSection(m_xReportDefinition->getReportHeader(),
DBREPORTHEADER,nPosition);
2166 m_pReportControllerObserver->AddSection(m_xReportDefinition->getReportHeader());
2170 getDesignView()->removeSection(nPosition);
2175 sal_uInt16 nPosition = getDesignView()->getSectionCount();
2176 if ( m_xReportDefinition->getPageFooterOn() )
2180 getDesignView()->addSection(m_xReportDefinition->getReportFooter(),
DBREPORTFOOTER,nPosition);
2181 m_pReportControllerObserver->AddSection(m_xReportDefinition->getReportFooter());
2185 getDesignView()->removeSection(nPosition - 1);
2192 getDesignView()->addSection(m_xReportDefinition->getPageHeader(),
DBPAGEHEADER,0);
2193 m_pReportControllerObserver->AddSection(m_xReportDefinition->getPageHeader());
2197 getDesignView()->removeSection(sal_uInt16(0));
2204 getDesignView()->addSection(m_xReportDefinition->getPageFooter(),
DBPAGEFOOTER);
2205 m_pReportControllerObserver->AddSection(m_xReportDefinition->getPageFooter());
2209 getDesignView()->removeSection(getDesignView()->getSectionCount() - 1);
2219 m_xHoldAlive.clear();
2220 InvalidateFeature(SID_FM_ADD_FIELD);
2221 if ( !getDesignView()->isAddFieldVisible() && isUiVisible() )
2222 getDesignView()->toggleAddField();
2230 uno::Reference< report::XGroup> xGroup(evt.Source,uno::UNO_QUERY);
2233 sal_Int32 nGroupPos = getGroupPosition(xGroup);
2235 groupChange(xGroup,evt.PropertyName,nGroupPos,bShow);
2239 catch(
const uno::Exception&)
2246void SAL_CALL OReportController::disposing(
const lang::EventObject& Source )
2249 OReportController_BASE::disposing(Source);
2254 ,sal_Int32 _nGroupPos
2255 ,::std::function<
bool(OGroupHelper *)>
const & _pGroupMemberFunction)
2257 uno::Reference< report::XGroup> xGroup;
2258 sal_uInt16 nNonVisibleGroups = 0;
2259 sal_Int32
nCount = _xGroups->getCount();
2260 for( sal_Int32
i = 0;
i < _nGroupPos &&
i <
nCount; ++
i)
2262 xGroup.set(_xGroups->getByIndex(
i),uno::UNO_QUERY);
2263 OSL_ENSURE(xGroup.is(),
"Group is NULL! -> GPF");
2264 OGroupHelper aGroupHelper(xGroup);
2265 if ( !_pGroupMemberFunction(&aGroupHelper) )
2266 ++nNonVisibleGroups;
2268 return nNonVisibleGroups;
2271void OReportController::groupChange(
const uno::Reference< report::XGroup>& _xGroup,std::u16string_view _sPropName,sal_Int32 _nGroupPos,
bool _bShow)
2273 ::std::function<bool(
OGroupHelper *)> pMemFun = ::std::mem_fn(&OGroupHelper::getHeaderOn);
2274 ::std::function<uno::Reference<report::XSection>(
OGroupHelper *)> pMemFunSection = ::std::mem_fn(&OGroupHelper::getHeader);
2276 sal_uInt16 nPosition = 0;
2277 bool bHandle =
false;
2280 nPosition = m_xReportDefinition->getPageHeaderOn() ? (m_xReportDefinition->getReportHeaderOn() ? 2 : 1) : (m_xReportDefinition->getReportHeaderOn() ? 1 : 0);
2286 pMemFun = ::std::mem_fn(&OGroupHelper::getFooterOn);
2287 pMemFunSection = ::std::mem_fn(&OGroupHelper::getFooter);
2288 nPosition = getDesignView()->getSectionCount();
2290 if ( m_xReportDefinition->getPageFooterOn() )
2292 if ( m_xReportDefinition->getReportFooterOn() )
2305 getDesignView()->addSection(pMemFunSection(&aGroupHelper),
sColor,nPosition);
2309 getDesignView()->removeSection(nPosition);
2316 OnInvalidateClipboard();
2319void OReportController::OnInvalidateClipboard()
2321 InvalidateFeature(SID_CUT);
2322 InvalidateFeature(SID_COPY);
2323 InvalidateFeature(SID_PASTE);
2326void OReportController::openPageDialog(
const uno::Reference<report::XSection>& _xSection)
2328 if ( !m_xReportDefinition.is() )
2334 { SID_ATTR_LRSPACE,
true },
2335 { SID_ATTR_ULSPACE,
true },
2336 { SID_ATTR_PAGE,
true },
2337 { SID_ATTR_PAGE_SIZE,
true },
2338 { SID_ENUM_PAGE_MODE,
true },
2339 { SID_PAPER_START,
true },
2340 { SID_PAPER_END,
true },
2341 { SID_ATTR_BRUSH,
true },
2362 { SID_ATTR_METRIC,
true }
2366 FieldUnit eUserMetric = MeasurementSystem::Metric == eSystem ? FieldUnit::CM : FieldUnit::INCH;
2369 SID_ATTR_METRIC,SID_ATTR_METRIC
2377 const XHatch aNullHatch(aNullLineCol);
2379 std::vector<SfxPoolItem*> pDefaults
2412 pPool->SetDefaults(&pDefaults);
2415 pPool->SetDefaultMetric( MapUnit::Map100thMM );
2416 pPool->FreezeIdRanges();
2422 if ( _xSection.is() )
2431 aDescriptor.
Put(
SfxUInt16Item(SID_ATTR_METRIC,
static_cast<sal_uInt16
>(eUserMetric)));
2433 uno::Reference< style::XStyle> xPageStyle(
getUsedStyle(m_xReportDefinition));
2434 if ( xPageStyle.is() )
2438 uno::Reference<beans::XPropertySet> xProp(xPageStyle,uno::UNO_QUERY_THROW);
2442 aDescriptor.
Put(aPageItem);
2449 getFrameWeld(), &aDescriptor,_xSection.is()
2450 ? OUString(
"BackgroundDialog")
2451 : OUString(
"PageDialog"));
2458 if ( _xSection.is() )
2461 _xSection->setBackColor(sal_Int32(pBrushItem->GetColor()));
2465 uno::Reference< beans::XPropertySet> xProp(
getUsedStyle(m_xReportDefinition),uno::UNO_QUERY_THROW);
2466 const OUString sUndoAction(
RptResId(RID_STR_UNDO_CHANGEPAGE));
2467 UndoContext aUndoContext( getUndoManager(), sUndoAction );
2471 pSizeItem->QueryValue(aValue);
2500 ::Color aBackColor = pBrushItem->GetColor();
2520sal_Bool SAL_CALL OReportController::attachModel(
const uno::Reference< frame::XModel > & xModel)
2522 ::osl::MutexGuard aGuard(
getMutex() );
2524 uno::Reference< report::XReportDefinition > xReportDefinition(
xModel, UNO_QUERY );
2525 if ( !xReportDefinition.is() )
2528 uno::Reference< document::XUndoManagerSupplier > xTestSuppUndo(
xModel, UNO_QUERY );
2529 if ( !xTestSuppUndo.is() )
2532 m_xReportDefinition = xReportDefinition;
2537void OReportController::openSortingAndGroupingDialog()
2539 if ( !m_xReportDefinition.is() )
2541 if (!m_xGroupsFloater)
2543 m_xGroupsFloater = std::make_shared<OGroupsSortingDialog>(getFrameWeld(), !isEditable(),
this);
2544 SvtViewOptions aDlgOpt(EViewType::Window, m_xGroupsFloater->get_help_id());
2546 m_xGroupsFloater->getDialog()->set_window_state(aDlgOpt.
GetWindowState());
2550 if (!m_xGroupsFloater->getDialog()->get_visible())
2557sal_Int32 OReportController::getGroupPosition(
const uno::Reference< report::XGroup >& _xGroup)
2569 const sal_Int32 nSelectionCount = getDesignView()->getMarkedObjectCount();
2570 if ( m_nSelectionCount != nSelectionCount )
2572 m_nSelectionCount = nSelectionCount;
2575 lang::EventObject
aEvent(*
this);
2576 m_aSelectionListeners.forEach(
2577 [&
aEvent] (uno::Reference<view::XSelectionChangeListener>
const& xListener) {
2578 return xListener->selectionChanged(
aEvent);
2584 const OUString sUndoAction =
RptResId(pUndoStrId);
2585 UndoContext aUndoContext( getUndoManager(), sUndoAction );
2586 _pMemfun( getDesignView() );
2587 InvalidateFeature( SID_UNDO );
2592 const OUString sUndoAction =
RptResId(pUndoStrId);
2593 UndoContext aUndoContext( getUndoManager(), sUndoAction );
2594 getDesignView()->alignMarkedObjects(_nControlModification,_bAlignAtSection);
2595 InvalidateFeature( SID_UNDO );
2598void OReportController::shrinkSectionBottom(
const uno::Reference<report::XSection>& _xSection)
2600 const sal_Int32
nElements = _xSection->getCount();
2606 const sal_Int32 nSectionHeight = _xSection->getHeight();
2607 sal_Int32 nMaxPositionY = 0;
2608 uno::Reference< report::XReportComponent> xReportComponent;
2613 xReportComponent.set(_xSection->getByIndex(
i), uno::UNO_QUERY);
2614 const sal_Int32 nReportComponentPositionY = xReportComponent->getPositionY();
2615 const sal_Int32 nReportComponentHeight = xReportComponent->getHeight();
2616 const sal_Int32 nReportComponentPositionYAndHeight = nReportComponentPositionY + nReportComponentHeight;
2617 nMaxPositionY = std::max(nReportComponentPositionYAndHeight, nMaxPositionY);
2621 if (nMaxPositionY > (nSectionHeight - 7) )
2626 _xSection->setHeight(nMaxPositionY);
2629void OReportController::shrinkSectionTop(
const uno::Reference<report::XSection>& _xSection)
2631 const sal_Int32
nElements = _xSection->getCount();
2638 const sal_Int32 nSectionHeight = _xSection->getHeight();
2639 sal_Int32 nMinPositionY = nSectionHeight;
2640 uno::Reference< report::XReportComponent> xReportComponent;
2645 xReportComponent.set(_xSection->getByIndex(
i), uno::UNO_QUERY);
2646 const sal_Int32 nReportComponentPositionY = xReportComponent->getPositionY();
2647 nMinPositionY = std::min(nReportComponentPositionY, nMinPositionY);
2650 if (nMinPositionY == 0)
2657 xReportComponent.set(_xSection->getByIndex(
i), uno::UNO_QUERY);
2658 const sal_Int32 nReportComponentPositionY = xReportComponent->getPositionY();
2659 const sal_Int32 nNewPositionY = nReportComponentPositionY - nMinPositionY;
2660 xReportComponent->setPositionY(nNewPositionY);
2662 const sal_Int32 nNewSectionHeight = nSectionHeight - nMinPositionY;
2663 _xSection->setHeight(nNewSectionHeight);
2666void OReportController::shrinkSection(
TranslateId pUndoStrId,
const uno::Reference<report::XSection>& _xSection, sal_Int32 _nSid)
2668 if ( _xSection.is() )
2670 const OUString sUndoAction =
RptResId(pUndoStrId);
2671 UndoContext aUndoContext( getUndoManager(), sUndoAction );
2673 if (_nSid == SID_SECTION_SHRINK)
2675 shrinkSectionTop(_xSection);
2676 shrinkSectionBottom(_xSection);
2678 else if (_nSid == SID_SECTION_SHRINK_TOP)
2680 shrinkSectionTop(_xSection);
2682 else if (_nSid == SID_SECTION_SHRINK_BOTTOM)
2684 shrinkSectionBottom(_xSection);
2688 InvalidateFeature( SID_UNDO );
2694 ::osl::MutexGuard aGuard(
getMutex() );
2696 const sal_Int32 nCommandIDs[] =
2702 SID_SHOW_PROPERTYBROWSER,
2703 SID_PROPERTYBROWSER_LAST_PAGE,
2708 for (sal_Int32 nCommandID : nCommandIDs)
2710 const FeatureState aFeatureState =
GetState( nCommandID );
2712 OUString sCommandURL( getURLForId( nCommandID ).Main );
2713 OSL_ENSURE( sCommandURL.startsWith(
".uno:" ),
"OReportController::getViewData: illegal command URL!" );
2714 sCommandURL = sCommandURL.copy( 5 );
2717 if ( !!aFeatureState.bChecked )
2718 aCommandState <<= *aFeatureState.bChecked;
2719 else if ( aFeatureState.aValue.hasValue() )
2720 aCommandState = aFeatureState.aValue;
2722 aCommandProperties.
put( sCommandURL, aCommandState );
2728 if ( getDesignView() )
2730 ::std::vector<sal_uInt16> aCollapsedPositions;
2731 getDesignView()->fillCollapsedSections(aCollapsedPositions);
2732 if ( !aCollapsedPositions.empty() )
2734 uno::Sequence<beans::PropertyValue> aCollapsedSections(aCollapsedPositions.size());
2735 beans::PropertyValue* pCollapsedIter = aCollapsedSections.getArray();
2737 for (
const auto& rPos : aCollapsedPositions)
2740 pCollapsedIter->Value <<=
static_cast<sal_Int32
>(rPos);
2745 aViewData.
put(
"CollapsedSections", aCollapsedSections );
2748 OSectionWindow* pSectionWindow = getDesignView()->getMarkedSection();
2749 if ( pSectionWindow )
2755 aViewData.
put(
"ZoomFactor", m_nZoomValue );
2759void SAL_CALL OReportController::restoreViewData(
const uno::Any& i_data)
2761 ::osl::MutexGuard aGuard(
getMutex() );
2765 const ::comphelper::NamedValueCollection aViewData( i_data );
2767 m_aCollapsedSections = aViewData.getOrDefault(
"CollapsedSections", m_aCollapsedSections );
2768 m_nPageNum = aViewData.getOrDefault(
"MarkedSection", m_nPageNum );
2769 m_nZoomValue = aViewData.getOrDefault(
"ZoomFactor", m_nZoomValue );
2776 const ::std::vector< OUString > aCommandNames( aCommandProperties.
getNames() );
2778 for (
const auto& rCommandName : aCommandNames )
2780 const Any& rCommandValue = aCommandProperties.
get( rCommandName );
2787 aCommand.Complete =
".uno:" + rCommandName;
2793 if ( rCommandName ==
"ShowRuler" )
2794 OSL_VERIFY( rCommandValue >>= m_bShowRuler );
2795 else if ( rCommandName ==
"HelplinesMove" )
2796 OSL_VERIFY( rCommandValue >>= m_bHelplinesMove );
2797 else if ( rCommandName ==
"GridVisible" )
2798 OSL_VERIFY( rCommandValue >>= m_bGridVisible );
2799 else if ( rCommandName ==
"GridUse" )
2800 OSL_VERIFY( rCommandValue >>= m_bGridUse );
2801 else if ( rCommandName ==
"ControlProperties" )
2802 OSL_VERIFY( rCommandValue >>= m_bShowProperties );
2803 else if ( rCommandName ==
"LastPropertyBrowserPage" )
2804 OSL_VERIFY( rCommandValue >>= m_sLastActivePage );
2805 else if ( rCommandName ==
"SplitPosition" )
2806 OSL_VERIFY( rCommandValue >>= m_nSplitPos );
2810 catch(
const IllegalArgumentException&)
2822 const sal_Int32 nFrameSearchFlag = frame::FrameSearchFlag::TASKS | frame::FrameSearchFlag::CREATE;
2828uno::Reference<frame::XModel> OReportController::executeReport()
2830 OSL_ENSURE(m_xReportDefinition.is(),
"Where is my report?");
2832 uno::Reference<frame::XModel>
xModel;
2833 if ( m_xReportDefinition.is() )
2836 bool bEnabled = !m_xReportDefinition->getCommand().isEmpty();
2840 const sal_uInt16
nCount = m_aReportModel->GetPageCount();
2842 for (;
i <
nCount && !bEnabled ; ++
i)
2844 const SdrPage* pPage = m_aReportModel->GetPage(
i);
2848 pErrorId = RID_ERR_NO_OBJECTS;
2854 sdb::SQLContext aFirstMessage;
2855 OUString sInfo =
RptResId( pErrorId );
2856 aFirstMessage.Message = sInfo;
2857 aInfo = aFirstMessage;
2860 sal_uInt16 nCommand = 0;
2861 if (pErrorId != RID_ERR_NO_COMMAND)
2863 if ( !m_bShowProperties )
2864 executeUnChecked(SID_SHOW_PROPERTYBROWSER, {});
2866 m_sLastActivePage =
"Data";
2867 getDesignView()->setCurrentPage(m_sLastActivePage);
2868 nCommand = SID_SELECT_REPORT;
2870 else if ( getDesignView() && !getDesignView()->isAddFieldVisible() )
2872 nCommand = SID_FM_ADD_FIELD;
2876 executeUnChecked(nCommand, {});
2882 m_bInGeneratePreview =
true;
2886 if ( !m_xReportEngine.is() )
2887 m_xReportEngine.set( report::ReportEngine::create(
m_xContext) );
2888 m_xReportEngine->setReportDefinition(m_xReportDefinition);
2893 catch(
const sdbc::SQLException&)
2895 aInfo = ::cppu::getCaughtException();
2897 catch(
const uno::Exception& e)
2899 uno::Any aCaughtException( ::cppu::getCaughtException() );
2902 sdb::SQLContext aFirstMessage;
2903 OUString sInfo(
RptResId(RID_STR_CAUGHT_FOREIGN_EXCEPTION));
2904 sInfo = sInfo.replaceAll(
"$type$", aCaughtException.getValueTypeName());
2905 aFirstMessage.Message = sInfo;
2908 sdbc::SQLException aSecondMessage;
2909 aSecondMessage.Message = e.Message;
2910 aSecondMessage.Context = e.Context;
2913 sdbc::SQLException aThirdMessage;
2914 lang::WrappedTargetException aWrapped;
2915 if ( aCaughtException >>= aWrapped )
2917 aThirdMessage.Message = aWrapped.Message;
2918 aThirdMessage.Context = aWrapped.Context;
2921 if ( !aThirdMessage.Message.isEmpty() )
2922 aSecondMessage.NextException <<= aThirdMessage;
2923 aFirstMessage.NextException <<= aSecondMessage;
2925 aInfo = aFirstMessage;
2929 const OUString suSQLContext =
RptResId( RID_STR_COULD_NOT_CREATE_REPORT );
2932 m_bInGeneratePreview =
false;
2943uno::Reference< frame::XModel > SAL_CALL OReportController::getModel()
2945 return m_xReportDefinition;
2948uno::Reference< sdbc::XRowSet >
const & OReportController::getRowSet()
2950 OSL_PRECOND( m_xReportDefinition.is(),
"OReportController::getRowSet: no report definition?!" );
2952 if ( m_xRowSet.is() || !m_xReportDefinition.is() )
2957 uno::Reference< sdbc::XRowSet > xRowSet(
2958 getORB()->getServiceManager()->createInstanceWithContext(
"com.sun.star.sdb.RowSet", getORB()),
2960 uno::Reference< beans::XPropertySet> xRowSetProp( xRowSet, uno::UNO_QUERY_THROW );
2965 auto aNoConverter = std::make_shared<AnyConverter>();
2972 m_xRowSetMediator =
new OPropertyMediator( m_xReportDefinition, xRowSetProp, std::move(aPropertyMediation) );
2973 m_xRowSet = xRowSet;
2975 catch(
const uno::Exception&)
2983void OReportController::insertGraphic()
2985 const OUString sTitle(
RptResId(RID_STR_IMPORT_GRAPHIC));
2989 uno::Reference< report::XSection> xSection = getDesignView()->getCurrentSection();
2990 ::sfx2::FileDialogHelper aDialog(ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW, FileDialogFlags::Graphic, getFrameWeld());
2995 xController->setValue(ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_PREVIEW, 0, css::uno::Any(
true));
2996 xController->enableControl(ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_LINK,
false);
2997 xController->setValue( ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_LINK, 0, css::uno::Any(
true) );
3002 xController->getValue( ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_LINK, 0) >>= bLink;
3007 createControl(aArgs,xSection,OUString(),SdrObjKind::ReportDesignImageControl);
3019 ::osl::MutexGuard aGuard(
getMutex() );
3020 if ( !getDesignView() )
3023 getDesignView()->unmarkAllObjects();
3024 getDesignView()->SetMode(DlgEdMode::Select);
3026 uno::Sequence< uno::Reference<report::XReportComponent> > aElements;
3027 if ( aSelection >>= aElements )
3029 if ( aElements.hasElements() )
3030 getDesignView()->showProperties(uno::Reference<uno::XInterface>(aElements[0],uno::UNO_QUERY));
3031 getDesignView()->setMarked(aElements,
true);
3035 uno::Reference<uno::XInterface> xObject(aSelection,uno::UNO_QUERY);
3036 uno::Reference<report::XReportComponent> xProp(xObject,uno::UNO_QUERY);
3039 getDesignView()->showProperties(xObject);
3040 aElements = { xProp };
3041 getDesignView()->setMarked(aElements,
true);
3045 uno::Reference<report::XSection> xSection(aSelection,uno::UNO_QUERY);
3046 if ( !xSection.is() && xObject.is() )
3047 getDesignView()->showProperties(xObject);
3048 getDesignView()->setMarked(xSection,xSection.is());
3055Any SAL_CALL OReportController::getSelection( )
3057 ::osl::MutexGuard aGuard(
getMutex() );
3059 if ( getDesignView() )
3061 aRet = getDesignView()->getCurrentlyShownProperty();
3063 aRet <<= getDesignView()->getCurrentSection();
3070 m_aSelectionListeners.addInterface( Listener );
3075 m_aSelectionListeners.removeInterface( Listener );
3078void OReportController::createNewFunction(
const uno::Any& _aValue)
3080 uno::Reference< container::XIndexContainer> xFunctions(_aValue,uno::UNO_QUERY_THROW);
3081 const OUString sNewName =
RptResId(RID_STR_FUNCTION);
3082 uno::Reference< report::XFunction> xFunction(report::Function::create(
m_xContext));
3083 xFunction->setName(sNewName);
3085 xFunctions->insertByIndex(xFunctions->getCount(),
uno::Any(xFunction));
3096 getDesignView()->setMarked(_xSection,
true);
3097 OSectionWindow* pSectionWindow = getDesignView()->getMarkedSection();
3098 if ( !pSectionWindow )
3111 uno::Reference< report::XReportComponent> xShapeProp;
3112 if ( _nObjectId == SdrObjKind::CustomShape )
3116 SdrInventor::ReportDesign,
3118 xShapeProp.set(pNewControl->getUnoShape(),uno::UNO_QUERY);
3119 OUString sCustomShapeType = getDesignView()->GetInsertObjString();
3120 if ( sCustomShapeType.isEmpty() )
3121 sCustomShapeType =
"diamond";
3122 OReportSection::createDefault(sCustomShapeType,pNewControl.get());
3125 else if ( _nObjectId == SdrObjKind::OLE2 || SdrObjKind::ReportDesignSubReport == _nObjectId )
3129 SdrInventor::ReportDesign,
3133 xShapeProp.set(pNewControl->getUnoShape(),uno::UNO_QUERY_THROW);
3135 if ( pObj && !pObj->
IsEmpty() )
3146 getDesignView()->GetOutDev(),
3152 SdrInventor::ReportDesign,
3153 SdrObjKind::ReportDesignFixedText,
3165 pNewControl = pControl;
3170 uno::Reference<beans::XPropertySet> xUnoProp(pObj->
GetUnoControlModel(),uno::UNO_QUERY);
3171 xShapeProp.set(pObj->
getUnoShape(),uno::UNO_QUERY);
3172 uno::Reference<beans::XPropertySetInfo> xShapeInfo = xShapeProp->getPropertySetInfo();
3173 uno::Reference<beans::XPropertySetInfo> xInfo = xUnoProp->getPropertySetInfo();
3184 for(
const auto & sProp : sProps)
3186 if ( xInfo->hasPropertyByName(sProp) && xShapeInfo->hasPropertyByName(sProp) )
3187 xUnoProp->setPropertyValue(sProp,xShapeProp->getPropertyValue(sProp));
3196 ReportFormula aFunctionFormula( ReportFormula::Expression, _sFunction );
3210 if ( _nObjectId == SdrObjKind::ReportDesignFixedText )
3212 else if ( _nObjectId == SdrObjKind::ReportDesignVerticalFixedLine )
3214 awt::Size aOlSize = xShapeProp->getSize();
3215 xShapeProp->setSize(awt::Size(aOlSize.Height,aOlSize.Width));
3220 const sal_Int32 nShapeWidth =
aMap.getUnpackedValueOrDefault(
PROPERTY_WIDTH,xShapeProp->getWidth());
3221 if ( nShapeWidth != xShapeProp->getWidth() )
3222 xShapeProp->setWidth( nShapeWidth );
3224 const bool bChangedPos = (aPos.X + nShapeWidth) > nPaperWidth;
3226 aPos.X = nPaperWidth - nShapeWidth;
3227 xShapeProp->setPosition(aPos);
3234 getDesignView()->unmarkAllObjects();
3236 const OUString sUndoAction(
RptResId(RID_STR_UNDO_INSERT_CONTROL));
3237 UndoContext aUndoContext( getUndoManager(), sUndoAction );
3242 uno::Reference< report::XSection> xSection =
aMap.getUnpackedValueOrDefault(
PROPERTY_SECTION,uno::Reference< report::XSection>());
3248 sFunction =
"TODAY()";
3249 createControl(
aMap.getAsConstPropertyValueList(),xSection,sFunction);
3254 sFunction =
"TIMEVALUE(NOW())";
3256 createControl(
aMap.getAsConstPropertyValueList(),xSection,sFunction);
3262 getDesignView()->unmarkAllObjects();
3264 const OUString sUndoAction(
RptResId(RID_STR_UNDO_INSERT_CONTROL));
3265 UndoContext aUndoContext( getUndoManager(), sUndoAction );
3267 if ( !m_xReportDefinition->getPageHeaderOn() )
3269 uno::Sequence< beans::PropertyValue > aArgs;
3270 executeChecked(SID_PAGEHEADERFOOTER,aArgs);
3276 OUString sFunction(
RptResId(STR_RPT_PN_PAGE) );
3277 sFunction = sFunction.replaceFirst(
"#PAGENUMBER#",
"PageNumber()");
3281 sFunction +=
RptResId(STR_RPT_PN_PAGE_OF);
3282 sFunction = sFunction.replaceFirst(
"#PAGECOUNT#",
"PageCount()");
3286 createControl(_aArgs,bInPageHeader ? m_xReportDefinition->getPageHeader() : m_xReportDefinition->getPageFooter(),sFunction);
3292 getDesignView()->unmarkAllObjects();
3296 pSectionWindow[0] = getDesignView()->getMarkedSection();
3298 if ( !pSectionWindow[0] )
3300 select(
uno::Any(m_xReportDefinition->getDetail()));
3301 pSectionWindow[0] = getDesignView()->getMarkedSection();
3302 if ( !pSectionWindow[0] )
3306 uno::Reference<report::XSection> xCurrentSection = getDesignView()->getCurrentSection();
3311 bool bHandleOnlyOne =
false;
3312 for(
const PropertyValue& rArg : aArgs)
3317 if ( !(rArg.Value >>= aValue) )
3319 bHandleOnlyOne =
true;
3324 uno::Reference<report::XSection> xSection =
aMap.getUnpackedValueOrDefault(
"Section",xCurrentSection);
3325 uno::Reference<report::XReportDefinition> xReportDefinition = xSection->getReportDefinition();
3327 getDesignView()->setMarked(xSection,
true);
3328 pSectionWindow[0] = getDesignView()->getMarkedSection();
3337 pSectionWindow[1] = pSectionWindow[0];
3342 pSectionWindow[1] = getDesignView()->getMarkedSection(bLabelAboveTextField ?
PREVIOUS :
POST);
3343 if (!pSectionWindow[1])
3346 pSectionWindow[1] = pSectionWindow[0];
3350 getDesignView()->unmarkAllObjects();
3353 uno::Reference< lang::XComponent > xHoldAlive;
3357 OUString sColumnName;
3358 sal_Int32 nCommandType( -1 );
3363 uno::Reference< container::XNameAccess > xColumns;
3364 uno::Reference< sdbc::XConnection > xConnection(
getConnection() );
3365 if ( !sCommand.isEmpty() && nCommandType != -1 && !sColumnName.isEmpty() && xConnection.is() )
3367 if ( xReportDefinition->getCommand().isEmpty() )
3369 xReportDefinition->setCommand(sCommand);
3370 xReportDefinition->setCommandType(nCommandType);
3374 if ( xColumns.is() && xColumns->hasByName(sColumnName) )
3375 xField.set( xColumns->getByName( sColumnName ), uno::UNO_QUERY );
3380 #if OSL_DEBUG_LEVEL > 0
3383 uno::Reference< beans::XPropertySet > xRowSetProps( getRowSet(), UNO_QUERY_THROW );
3384 OUString sRowSetCommand;
3385 sal_Int32 nRowSetCommandType( -1 );
3386 OSL_VERIFY( xRowSetProps->getPropertyValue(
PROPERTY_COMMAND ) >>= sRowSetCommand );
3388 OSL_ENSURE( ( sRowSetCommand == sCommand ) && ( nCommandType == nRowSetCommandType ),
3389 "OReportController::addPairControls: this only works for a data source which equals our current settings!" );
3402 uno::Reference< sdb::XParametersSupplier > xSuppParam( getRowSet(), uno::UNO_QUERY_THROW );
3403 uno::Reference< container::XIndexAccess > xParams( xSuppParam->getParameters(), uno::UNO_SET_THROW );
3404 sal_Int32 nParamCount( xParams->getCount() );
3405 for ( sal_Int32
i=0;
i<nParamCount; ++
i)
3407 uno::Reference< beans::XPropertySet > xParamCol( xParams->getByIndex(
i), uno::UNO_QUERY_THROW );
3408 OUString sParamName;
3409 OSL_VERIFY( xParamCol->getPropertyValue(
"Name") >>= sParamName );
3410 if ( sParamName == sColumnName )
3422 sal_Int32
nDataType = sdbc::DataType::BINARY;
3426 case sdbc::DataType::BINARY:
3427 case sdbc::DataType::VARBINARY:
3428 case sdbc::DataType::LONGVARBINARY:
3429 nOBJID = SdrObjKind::ReportDesignImageControl;
3432 nOBJID = SdrObjKind::ReportDesignFormattedField;
3436 if ( nOBJID == SdrObjKind::NONE )
3440 if ( !xSupplier.is() )
3453 getDesignView()->GetOutDev(),
3459 SdrInventor::ReportDesign,
3460 SdrObjKind::ReportDesignFixedText,
3470 if ( pControl[0] && pControl[1] )
3475 if ( pPgViews[0] && pPgViews[1] )
3477 OUString sDefaultName;
3482 pObjs[
i] =
dynamic_cast<OUnoObject*
>(pControl[
i].get());
3484 uno::Reference<beans::XPropertySet> xUnoProp(pObjs[
i]->GetUnoControlModel(),uno::UNO_QUERY_THROW);
3485 uno::Reference< report::XReportComponent> xShapeProp(pObjs[
i]->getUnoShape(),uno::UNO_QUERY_THROW);
3488 uno::Reference<beans::XPropertySetInfo> xShapeInfo = xShapeProp->getPropertySetInfo();
3489 uno::Reference<beans::XPropertySetInfo> xInfo = xUnoProp->getPropertySetInfo();
3496 for(
const auto & sProp : sProps)
3498 if ( xInfo->hasPropertyByName(sProp) && xShapeInfo->hasPropertyByName(sProp) )
3499 xUnoProp->setPropertyValue(sProp,xShapeProp->getPropertyValue(sProp));
3505 sDefaultName =
sName;
3515 pObjs[
i]->CreateMediator(
true);
3517 const sal_Int32 nShapeWidth = xShapeProp->getWidth();
3518 const bool bChangedPos = (aPos.X + nShapeWidth) > nPaperWidth;
3520 aPos.X = nPaperWidth - nShapeWidth;
3521 xShapeProp->setPosition(aPos);
3523 aPos.Y += xShapeProp->getHeight();
3524 aPos.X += nShapeWidth;
3527 if ( xField->getPropertySetInfo()->hasPropertyByName(
PROPERTY_LABEL) )
3530 if (pSectionViews[0] != pSectionViews[1] &&
3531 nOBJID == SdrObjKind::ReportDesignFormattedField)
3533 uno::Reference< report::XReportComponent> xShapePropLabel(pObjs[0]->getUnoShape(),uno::UNO_QUERY_THROW);
3534 uno::Reference< report::XReportComponent> xShapePropTextField(pObjs[1]->getUnoShape(),uno::UNO_QUERY_THROW);
3535 if ( !sLabel.isEmpty() )
3536 xShapePropTextField->setName(sLabel);
3537 awt::Point aPosLabel = xShapePropLabel->getPosition();
3538 awt::Point aPosTextField = xShapePropTextField->getPosition();
3539 aPosTextField.X = aPosLabel.X;
3540 xShapePropTextField->setPosition(aPosTextField);
3541 if (bLabelAboveTextField)
3545 aPosLabel.Y = xLabelSection->getHeight() - xShapePropLabel->getHeight();
3552 xShapePropLabel->setPosition(aPosLabel);
3556 uno::Reference< report::XFixedText> xShapeProp(pObj->getUnoShape(),uno::UNO_QUERY_THROW);
3557 xShapeProp->setName(xShapeProp->getName() + sDefaultName );
3564 if (!bLabelAboveTextField )
3566 if ( pSectionViews[0] == pSectionViews[1] )
3573 aLabelAndTextfield.
Union(aTextfield);
3576 bool bOverlapping =
true;
3577 bool bHasToMove =
false;
3578 while ( bOverlapping )
3580 const SdrObject* pOverlappedObj =
isOver(aLabelAndTextfield, *pSectionWindow[0]->getReportSection().getPage(), *pSectionViews[0],
true, pControl, 2);
3581 bOverlapping = pOverlappedObj !=
nullptr;
3594 aTextfield.
Move(0, aLabelAndTextfield.
Top() - aTextfield.
Top());
3596 uno::Reference< report::XReportComponent> xLabel(pControl[0]->getUnoShape(),uno::UNO_QUERY_THROW);
3597 xLabel->setPositionY(
aLabel.Top());
3599 uno::Reference< report::XReportComponent> xTextfield(pControl[1]->getUnoShape(),uno::UNO_QUERY_THROW);
3600 xTextfield->setPositionY(aTextfield.
Top());
3618 OSectionWindow* pSectionWindow = getDesignView()->getMarkedSection();
3619 if ( pSectionWindow )
3621 return pSectionView;
3624void OReportController::changeZOrder(sal_Int32 _nId)
3627 if ( !pSectionView )
3632 case SID_FRAME_TO_BOTTOM:
3635 case SID_FRAME_TO_TOP:
3638 case SID_FRAME_DOWN:
3645 case SID_OBJECT_HEAVEN:
3648 case SID_OBJECT_HELL:
3654void OReportController::listen(
const bool _bAdd)
3661 void (SAL_CALL
XPropertySet::*pPropertyListenerAction)(
const OUString&,
const uno::Reference< XPropertyChangeListener >& ) =
3662 _bAdd ? &XPropertySet::addPropertyChangeListener : &XPropertySet::removePropertyChangeListener;
3664 for (
const auto & aProp : aProps)
3665 (m_xReportDefinition.get()->*pPropertyListenerAction)( aProp,
static_cast< XPropertyChangeListener*
>(
this ) );
3668 uno::Reference< XPropertyChangeListener > xUndo = &rUndoEnv;
3669 const uno::Sequence< beans::Property>
aSeq = m_xReportDefinition->getPropertySetInfo()->getProperties();
3670 const OUString* pPropsBegin = &aProps[0];
3671 const OUString* pPropsEnd = pPropsBegin +
SAL_N_ELEMENTS(aProps) - 3;
3672 for(
const beans::Property& rProp :
aSeq)
3674 if ( ::std::find(pPropsBegin,pPropsEnd,rProp.Name) == pPropsEnd )
3675 (m_xReportDefinition.get()->*pPropertyListenerAction)( rProp.Name, xUndo );
3679 void (
OXUndoEnvironment::*pElementUndoFunction)(
const uno::Reference< uno::XInterface >& ) =
3680 _bAdd ? &OXUndoEnvironment::AddElement : &OXUndoEnvironment::RemoveElement;
3682 (rUndoEnv.*pElementUndoFunction)( m_xReportDefinition->getStyleFamilies() );
3683 (rUndoEnv.*pElementUndoFunction)( m_xReportDefinition->getFunctions() );
3688 if ( m_xReportDefinition->getPageHeaderOn() && _bAdd )
3690 getDesignView()->addSection(m_xReportDefinition->getPageHeader(),
DBPAGEHEADER);
3691 rObserver.
AddSection(m_xReportDefinition->getPageHeader());
3693 if ( m_xReportDefinition->getReportHeaderOn() && _bAdd )
3695 getDesignView()->addSection(m_xReportDefinition->getReportHeader(),
DBREPORTHEADER);
3696 rObserver.
AddSection(m_xReportDefinition->getReportHeader());
3699 uno::Reference< report::XGroups > xGroups = m_xReportDefinition->getGroups();
3700 const sal_Int32
nCount = xGroups->getCount();
3701 _bAdd ? xGroups->addContainerListener(&rUndoEnv) : xGroups->removeContainerListener(&rUndoEnv);
3702 _bAdd ? xGroups->addContainerListener(&rObserver) : xGroups->removeContainerListener(&rObserver);
3706 uno::Reference< report::XGroup > xGroup(xGroups->getByIndex(
i),uno::UNO_QUERY);
3707 (xGroup.get()->*pPropertyListenerAction)( OUString(
PROPERTY_HEADERON),
static_cast< XPropertyChangeListener*
>( this ) );
3708 (xGroup.get()->*pPropertyListenerAction)( OUString(
PROPERTY_FOOTERON),
static_cast< XPropertyChangeListener*
>( this ) );
3710 (rUndoEnv.*pElementUndoFunction)( xGroup );
3711 (rUndoEnv.*pElementUndoFunction)( xGroup->getFunctions() );
3712 if ( xGroup->getHeaderOn() && _bAdd )
3714 getDesignView()->addSection(xGroup->getHeader(),
DBGROUPHEADER);
3721 getDesignView()->addSection(m_xReportDefinition->getDetail(),
DBDETAIL);
3722 rObserver.
AddSection(m_xReportDefinition->getDetail());
3726 uno::Reference< report::XGroup > xGroup(xGroups->getByIndex(
i-1),uno::UNO_QUERY);
3727 if ( xGroup->getFooterOn() )
3729 getDesignView()->addSection(xGroup->getFooter(),
DBGROUPFOOTER);
3733 if ( m_xReportDefinition->getReportFooterOn() )
3735 getDesignView()->addSection(m_xReportDefinition->getReportFooter(),
DBREPORTFOOTER);
3736 rObserver.
AddSection(m_xReportDefinition->getReportFooter());
3738 if ( m_xReportDefinition->getPageFooterOn())
3740 getDesignView()->addSection(m_xReportDefinition->getPageFooter(),
DBPAGEFOOTER);
3741 rObserver.
AddSection(m_xReportDefinition->getPageFooter());
3744 xGroups->addContainerListener(
static_cast<XContainerListener*
>(
this));
3745 m_xReportDefinition->addModifyListener(
static_cast<XModifyListener*
>(
this));
3750 xGroups->removeContainerListener(
static_cast<XContainerListener*
>(
this));
3751 m_xReportDefinition->removeModifyListener(
static_cast<XModifyListener*
>(
this));
3752 m_aReportModel->detachController();
3756void OReportController::switchReportSection(
const sal_Int16 _nId)
3758 OSL_ENSURE(_nId == SID_REPORTHEADER_WITHOUT_UNDO || _nId == SID_REPORTFOOTER_WITHOUT_UNDO || _nId == SID_REPORTHEADERFOOTER ,
"Illegal id given!");
3760 if ( !m_xReportDefinition.is() )
3764 const bool bSwitchOn = !m_xReportDefinition->getReportHeaderOn();
3766 std::unique_ptr< UndoContext > pUndoContext;
3767 if ( SID_REPORTHEADERFOOTER == _nId )
3769 const OUString sUndoAction(
RptResId(bSwitchOn ? RID_STR_UNDO_ADD_REPORTHEADERFOOTER : RID_STR_UNDO_REMOVE_REPORTHEADERFOOTER));
3770 pUndoContext.reset(
new UndoContext( getUndoManager(), sUndoAction ) );
3772 addUndoAction(std::make_unique<OReportSectionUndo>(*m_aReportModel,SID_REPORTHEADER_WITHOUT_UNDO
3773 ,::std::mem_fn(&OReportHelper::getReportHeader)
3774 ,m_xReportDefinition
3778 addUndoAction(std::make_unique<OReportSectionUndo>(*m_aReportModel,SID_REPORTFOOTER_WITHOUT_UNDO
3779 ,::std::mem_fn(&OReportHelper::getReportFooter)
3780 ,m_xReportDefinition
3787 case SID_REPORTHEADER_WITHOUT_UNDO:
3788 m_xReportDefinition->setReportHeaderOn( bSwitchOn );
3790 case SID_REPORTFOOTER_WITHOUT_UNDO:
3791 m_xReportDefinition->setReportFooterOn( !m_xReportDefinition->getReportFooterOn() );
3793 case SID_REPORTHEADERFOOTER:
3794 m_xReportDefinition->setReportHeaderOn( bSwitchOn );
3795 m_xReportDefinition->setReportFooterOn( bSwitchOn );
3799 if ( SID_REPORTHEADERFOOTER == _nId )
3800 pUndoContext.reset();
3804void OReportController::switchPageSection(
const sal_Int16 _nId)
3806 OSL_ENSURE(_nId == SID_PAGEHEADERFOOTER || _nId == SID_PAGEHEADER_WITHOUT_UNDO || _nId == SID_PAGEFOOTER_WITHOUT_UNDO ,
"Illegal id given!");
3807 if ( !m_xReportDefinition.is() )
3811 const bool bSwitchOn = !m_xReportDefinition->getPageHeaderOn();
3813 std::unique_ptr< UndoContext > pUndoContext;
3814 if ( SID_PAGEHEADERFOOTER == _nId )
3816 const OUString sUndoAction(
RptResId(bSwitchOn ? RID_STR_UNDO_ADD_REPORTHEADERFOOTER : RID_STR_UNDO_REMOVE_REPORTHEADERFOOTER));
3817 pUndoContext.reset(
new UndoContext( getUndoManager(), sUndoAction ) );
3819 addUndoAction(std::make_unique<OReportSectionUndo>(*m_aReportModel
3820 ,SID_PAGEHEADER_WITHOUT_UNDO
3821 ,::std::mem_fn(&OReportHelper::getPageHeader)
3822 ,m_xReportDefinition
3826 addUndoAction(std::make_unique<OReportSectionUndo>(*m_aReportModel
3827 ,SID_PAGEFOOTER_WITHOUT_UNDO
3828 ,::std::mem_fn(&OReportHelper::getPageFooter)
3829 ,m_xReportDefinition
3835 case SID_PAGEHEADER_WITHOUT_UNDO:
3836 m_xReportDefinition->setPageHeaderOn( bSwitchOn );
3838 case SID_PAGEFOOTER_WITHOUT_UNDO:
3839 m_xReportDefinition->setPageFooterOn( !m_xReportDefinition->getPageFooterOn() );
3841 case SID_PAGEHEADERFOOTER:
3842 m_xReportDefinition->setPageHeaderOn( bSwitchOn );
3843 m_xReportDefinition->setPageFooterOn( bSwitchOn );
3846 if ( SID_PAGEHEADERFOOTER == _nId )
3847 pUndoContext.reset();
3853 if ( !m_xReportDefinition.is() )
3859 uno::Reference< report::XGroup > xGroup =
aMap.getUnpackedValueOrDefault(
PROPERTY_GROUP, uno::Reference< report::XGroup >() );
3864 uno::Reference< report::XGroups > xGroups = m_xReportDefinition->getGroups();
3869 rUndoEnv.
AddElement( xGroup->getFunctions() );
3872 addUndoAction( std::make_unique<OGroupUndo>(
3874 _bAppend ? RID_STR_UNDO_APPEND_GROUP : RID_STR_UNDO_REMOVE_GROUP,
3883 const sal_Int32
nPos = getGroupPosition( xGroup );
3885 xGroups->removeByIndex(
nPos );
3897 if ( !m_xReportDefinition.is() )
3902 uno::Reference< report::XGroup> xGroup =
aMap.getUnpackedValueOrDefault(
PROPERTY_GROUP,uno::Reference< report::XGroup>());
3908 addUndoAction(std::make_unique<OGroupSectionUndo>(*m_aReportModel
3909 ,_bHeader ? SID_GROUPHEADER_WITHOUT_UNDO : SID_GROUPFOOTER_WITHOUT_UNDO
3910 ,_bHeader ? ::std::mem_fn(&OGroupHelper::getHeader) : ::std::mem_fn(&OGroupHelper::getFooter)
3914 (bSwitchOn ? RID_STR_UNDO_ADD_GROUP_HEADER : RID_STR_UNDO_REMOVE_GROUP_HEADER)
3915 :(bSwitchOn ? RID_STR_UNDO_ADD_GROUP_FOOTER : RID_STR_UNDO_REMOVE_GROUP_FOOTER)
3920 xGroup->setHeaderOn( bSwitchOn );
3922 xGroup->setFooterOn( bSwitchOn );
3925void OReportController::collapseSection(
const bool _bCollapse)
3934void OReportController::markSection(
const bool _bNext)
3940 if ( pPrevSection != pSection && pPrevSection )
3943 select(
uno::Any(m_xReportDefinition));
3947 getDesignView()->markSection(_bNext ? 0 : getDesignView()->getSectionCount() - 1);
3948 pSection = getDesignView()->getMarkedSection();
3954void OReportController::createDefaultControl(
const uno::Sequence< beans::PropertyValue>& _aArgs)
3956 uno::Reference< report::XSection > xSection = getDesignView()->getCurrentSection();
3957 if ( !xSection.is() )
3958 xSection = m_xReportDefinition->getDetail();
3960 if ( !xSection.is() )
3963 const beans::PropertyValue* pIter = _aArgs.getConstArray();
3964 const beans::PropertyValue* pEnd = pIter + _aArgs.getLength();
3965 const beans::PropertyValue* pKeyModifier = ::std::find_if(pIter, pEnd,
3966 [] (
const beans::PropertyValue&
x) ->
bool {
3967 return x.Name ==
"KeyModifier";
3969 sal_Int16 nKeyModifier = 0;
3970 if ( pKeyModifier == pEnd || ((pKeyModifier->Value >>= nKeyModifier) && nKeyModifier ==
KEY_MOD1) )
3973 getDesignView()->unmarkAllObjects();
3974 createControl(aCreateArgs,xSection,OUString(),getDesignView()->GetInsertObj());
3979void OReportController::checkChartEnabled()
3981 if ( m_bChartEnabledAsked )
3984 m_bChartEnabledAsked =
true;
3991 bool bChartEnabled =
false;
3992 static constexpr OUStringLiteral sPropertyName(
u"UserData/Chart" );
3994 aConfiguration.
getNodeValue( sPropertyName ) >>= bChartEnabled;
3995 m_bChartEnabled = bChartEnabled;
4004OUString SAL_CALL OReportController::getTitle()
4007 ::osl::MutexGuard aGuard(
getMutex() );
4009 uno::Reference< frame::XTitle> xTitle(m_xReportDefinition,uno::UNO_QUERY_THROW);
4011 return xTitle->getTitle ();
4014void OReportController::getPropertyDefaultByHandle( sal_Int32 ,
Any& _rDefault )
const
4016 _rDefault <<= sal_Int16(100);
4023 describeProperties(aProps);
4024 return new ::cppu::OPropertyArrayHelper(aProps);
4034void SAL_CALL OReportController::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle,
const Any& _aValue)
4038 _aValue >>= m_nZoomValue;
4039 impl_zoom_nothrow();
4042void SAL_CALL OReportController::setMode(
const OUString& aMode )
4044 ::osl::MutexGuard aGuard(
getMutex() );
4047OUString SAL_CALL OReportController::getMode( )
4049 ::osl::MutexGuard aGuard(
getMutex() );
4052css::uno::Sequence< OUString > SAL_CALL OReportController::getSupportedModes( )
4054 return uno::Sequence< OUString> { OUString(
"remote"), OUString(
"normal") };
4056sal_Bool SAL_CALL OReportController::supportsMode(
const OUString& aMode )
4058 uno::Sequence< OUString> aModes = getSupportedModes();
4062bool OReportController::isUiVisible()
const
4064 return m_sMode !=
"remote";
4073 ::std::vector< uno::Reference< uno::XInterface > > aSelection;
4074 getDesignView()->fillControlModelSelection(aSelection);
4075 _rState.
bEnabled = !aSelection.empty();
4080 ::std::vector< uno::Reference< uno::XInterface > >::const_iterator aIter = aSelection.begin();
4081 for(; aIter != aSelection.end() && _rState.
bEnabled ;++aIter)
4083 uno::Reference< beans::XPropertySet> xProp(*aIter,uno::UNO_QUERY);
4086 uno::Any aTemp2 = xProp->getPropertyValue(_sProperty);
4087 if ( aIter == aSelection.begin() )
4091 else if ( aTemp != aTemp2 )
4094 catch(
const beans::UnknownPropertyException&)
4099 if ( aIter == aSelection.end() )
4103void OReportController::impl_zoom_nothrow()
4107 getDesignView()->zoom(aZoom);
4112bool OReportController::isFormatCommandEnabled(sal_uInt16 _nCommand,
const uno::Reference< report::XReportControlFormat>& _xReportControlFormat)
4115 if ( _xReportControlFormat.is() && !uno::Reference< report::XFixedLine>(_xReportControlFormat,uno::UNO_QUERY).is() )
4119 const awt::FontDescriptor aFontDescriptor = _xReportControlFormat->getFontDescriptor();
4123 case SID_ATTR_CHAR_WEIGHT:
4124 bRet = awt::FontWeight::BOLD == aFontDescriptor.Weight;
4126 case SID_ATTR_CHAR_POSTURE:
4127 bRet = awt::FontSlant_ITALIC == aFontDescriptor.Slant;
4129 case SID_ATTR_CHAR_UNDERLINE:
4130 bRet = awt::FontUnderline::SINGLE == aFontDescriptor.Underline;
4136 catch(
const uno::Exception&)
4145 ::std::vector< uno::Reference< uno::XInterface > > aSelection;
4146 uno::Reference< awt::XWindow> xWindow;
4149 const OUString sUndoAction =
RptResId( pUndoResId );
4150 UndoContext aUndoContext( getUndoManager(), sUndoAction );
4152 for (
const auto& rxInterface : aSelection)
4154 const uno::Reference< beans::XPropertySet > xControlModel(rxInterface,uno::UNO_QUERY);
4155 if ( xControlModel.is() )
4162 xControlModel->setPropertyValue(_sProperty,_aValue);
4164 catch(
const UnknownPropertyException&)
4170 return !aSelection.empty();
4173void OReportController::impl_fillCustomShapeState_nothrow(
const char* _pCustomShapeType,
dbaui::FeatureState& _rState)
const
4176 _rState.
bChecked = getDesignView()->GetInsertObj() == SdrObjKind::CustomShape && getDesignView()->GetInsertObjString().equalsAscii(_pCustomShapeType);
4180OSectionWindow* OReportController::getSectionWindow(
const css::uno::Reference< css::report::XSection>& _xSection)
const
4182 if ( getDesignView() )
4184 return getDesignView()->getSectionWindow(_xSection);
4192void OReportController::openZoomDialog()
4198 { SID_ATTR_ZOOM,
true }
4200 std::vector<SfxPoolItem*> pDefaults
4205 pPool->SetDefaultMetric( MapUnit::Map100thMM );
4206 pPool->FreezeIdRanges();
4211 SvxZoomItem aZoomItem( m_eZoomType, m_nZoomValue, SID_ATTR_ZOOM );
4212 aZoomItem.
SetValueSet(SvxZoomEnableFlags::N100|SvxZoomEnableFlags::WHOLEPAGE|SvxZoomEnableFlags::PAGEWIDTH);
4213 aDescriptor.
Put(aZoomItem);
4216 pDlg->SetLimits( 20, 400 );
4217 bool bCancel = (
RET_CANCEL == pDlg->Execute() );
4221 const SvxZoomItem& rZoomItem = pDlg->GetOutputItemSet()->Get( SID_ATTR_ZOOM );
4222 m_eZoomType = rZoomItem.
GetType();
4223 m_nZoomValue = rZoomItem.GetValue();
4224 if ( m_eZoomType != SvxZoomType::PERCENT )
4225 m_nZoomValue = getDesignView()->getZoomFactor( m_eZoomType );
4227 impl_zoom_nothrow();
4230 catch(
const uno::Exception&)
4242void SAL_CALL OReportController::setVisualAreaSize( ::sal_Int64 _nAspect,
const awt::Size& _aSize )
4244 ::osl::MutexGuard aGuard(
getMutex() );
4246 (m_aVisualAreaSize.Width != _aSize.Width ||
4247 m_aVisualAreaSize.Height != _aSize.Height);
4248 m_aVisualAreaSize = _aSize;
4250 setModified(
true );
4251 m_nAspect = _nAspect;
4254awt::Size SAL_CALL OReportController::getVisualAreaSize( ::sal_Int64 )
4256 ::osl::MutexGuard aGuard(
getMutex() );
4257 return m_aVisualAreaSize;
4260embed::VisualRepresentation SAL_CALL OReportController::getPreferredVisualRepresentation( ::sal_Int64 _nAspect )
4263 ::osl::MutexGuard aGuard(
getMutex() );
4264 embed::VisualRepresentation aResult;
4265 if ( !m_bInGeneratePreview )
4267 m_bInGeneratePreview =
true;
4270 if ( !m_xReportEngine.is() )
4271 m_xReportEngine.set( report::ReportEngine::create(
m_xContext) );
4272 const sal_Int32 nOldMaxRows = m_xReportEngine->getMaxRows();
4274 m_xReportEngine->setReportDefinition(m_xReportDefinition);
4279 if ( xTransfer.is() )
4281 xTransfer->setVisualAreaSize(m_nAspect,m_aVisualAreaSize);
4282 aResult = xTransfer->getPreferredVisualRepresentation( _nAspect );
4285 catch(
const uno::Exception&)
4288 m_xReportEngine->setMaxRows(nOldMaxRows);
4290 catch(
const uno::Exception&)
4293 m_bInGeneratePreview =
false;
4298::sal_Int32 SAL_CALL OReportController::getMapUnit( ::sal_Int64 )
4300 return embed::EmbedMapUnits::ONE_100TH_MM;
4303uno::Reference< container::XNameAccess >
const & OReportController::getColumns()
const
4305 if ( !m_xColumns.is() && m_xReportDefinition.is() && !m_xReportDefinition->getCommand().isEmpty() )
4312OUString OReportController::getColumnLabel_throw(
const OUString& i_sColumnName)
const
4315 uno::Reference< container::XNameAccess > xColumns = getColumns();
4316 if ( xColumns.is() && xColumns->hasByName(i_sColumnName) )
4318 uno::Reference< beans::XPropertySet>
xColumn(xColumns->getByName(i_sColumnName),uno::UNO_QUERY_THROW);
4331 std::shared_ptr< OReportModel > pReportModel( getSdrModel() );
4334 SfxUndoManager* pUndoManager( pReportModel->GetSdrUndoManager() );
4335 ENSURE_OR_THROW( pUndoManager !=
nullptr,
"no access to our model's UndoManager" );
4337 return *pUndoManager;
4341void OReportController::clearUndoManager()
const
4343 getUndoManager().
Clear();
4347void OReportController::addUndoAction( std::unique_ptr<SfxUndoAction> i_pAction )
4349 getUndoManager().AddUndoAction( std::move(i_pAction) );
4351 InvalidateFeature( SID_UNDO );
4352 InvalidateFeature( SID_REDO );
4355extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
4357 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any>
const&)
4359 return cppu::acquire(
new OReportController(context));
Reference< XComponentContext > m_xContext
#define RPTUI_ID_METRIC
Note that we deliberately overlap an existing item id, so that we can have contiguous item ids for th...
static void lcl_getReportControlFormat(const Sequence< PropertyValue > &aArgs, ODesignView *_pView, uno::Reference< awt::XWindow > &_xWindow, ::std::vector< uno::Reference< uno::XInterface > > &_rControlsFormats)
#define RPTUI_ID_PAGE_MODE
static sal_uInt16 lcl_getNonVisibleGroupsBefore(const uno::Reference< report::XGroups > &_xGroups, sal_Int32 _nGroupPos,::std::function< bool(OGroupHelper *)> const &_pGroupMemberFunction)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * reportdesign_OReportController_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
#define PROPERTY_ID_ZOOMVALUE
#define MAX_ROWS_FOR_PREVIEW
IMPL_LINK_NOARG(OReportController, OnClipboardChanged, TransferableDataHelper *, void)
IMPL_LINK(OReportController, OnCreateHdl, OAddFieldWindow &, _rAddFieldDlg, void)
constexpr OUStringLiteral sHierarchicalDocumentName
MeasurementSystem getMeasurementSystemEnum() const
void DistributeMarkedObjects(sal_uInt16 SlotID)
size_t GetMarkedObjectCount() const
static rtl::Reference< SdrObject > MakeNewObject(SdrModel &rSdrModel, SdrInventor nInventor, SdrObjKind nObjIdentifier, const tools::Rectangle *pSnapRect=nullptr)
size_t GetObjCount() const
virtual const tools::Rectangle & GetLogicRect() const
sal_uInt16 GetPageNum() const
SdrPageView * GetSdrPageView() const
const css::uno::Reference< css::awt::XControlModel > & GetUnoControlModel() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
virtual short run() override
const SfxItemSet * GetOutputItemSet() const
OUString GetRedoActionComment(size_t nNo=0, bool const i_currentLevel=CurrentLevel) const
OUString GetUndoActionComment(size_t nNo=0, bool const i_currentLevel=CurrentLevel) const
static bool const TopLevel
virtual size_t GetRedoActionCount(bool const i_currentLevel=CurrentLevel) const
virtual size_t GetUndoActionCount(bool const i_currentLevel=CurrentLevel) const
const LocaleDataWrapper & GetLocaleData() const
OUString GetWindowState() const
virtual VclPtr< AbstractSvxZoomDialog > CreateSvxZoomDialog(weld::Window *pParent, const SfxItemSet &rCoreSet)=0
static SvxAbstractDialogFactory * Create()
void SetNumType(SvxNumType eNum)
void SetLandscape(bool bL)
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
void SetDescName(const OUString &rStr)
void SetValueSet(SvxZoomEnableFlags nValues)
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
SvxZoomType GetType() const
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
void AddSnappingPoint(sal_Int32 nNew)
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
static TransferableDataHelper CreateFromSystemClipboard(vcl::Window *pWindow)
static css::uno::Reference< css::awt::XWindow > GetInterface(vcl::Window *pWindow)
const css::uno::Any & get(const OUString &_rValueName) const
bool put(const OUString &_rValueName, const VALUE_TYPE &_rValue)
css::uno::Sequence< css::beans::PropertyValue > getPropertyValues() const
::std::vector< OUString > getNames() const
VALUE_TYPE getOrDefault(const OUString &_rValueName, const VALUE_TYPE &_rDefault) const
::cppu::IPropertyArrayHelper * getArrayHelper()
static std::shared_ptr< rptui::OReportModel > getSdrModel(const css::uno::Reference< css::report::XReportDefinition > &_xReportDefinition)
DlgEdHintKind GetKind() const
Helper class to allow std::mem_fun for SAL_CALL.
void initializeChart(const css::uno::Reference< css::frame::XModel > &_xModel)
virtual short run() override
const css::uno::Reference< css::report::XSection > & getSection() const
void deactivateOle()
deactivate the current active ole object if any
OReportPage * getPage() const
const css::uno::Reference< css::report::XSection > & getSection() const
OSectionView & getSectionView() const
bool isUiActive() const
returns true when an ole object is currently active
bool OnlyShapesMarked() const
void SetMarkedToLayer(SdrLayerID nLayerNo)
SdrLayerID GetLayerIdOfMarkedObjects() const
OReportSection & getReportSection()
void setCollapsed(bool _bCollapsed)
virtual css::uno::Reference< css::drawing::XShape > getUnoShape() override
void CreateMediator(bool _bReverse=false)
creates the m_xMediator when it doesn't already exist.
void AddSection(const css::uno::Reference< css::report::XSection > &_xSection)
void RemoveSection(const css::uno::Reference< css::report::XSection > &_xSection)
Create an object ob OUndoEnvLock locks the undo possibility As long as in the OUndoEnvLock scope,...
This is near the same as OUndoEnvLock but it is also possible to ask for the current mode.
void RemoveElement(const css::uno::Reference< css::uno::XInterface > &Element)
void AddElement(const css::uno::Reference< css::uno::XInterface > &Element)
const css::uno::Reference< css::ui::dialogs::XFilePicker3 > & GetFilePicker() const
void SetTitle(const OUString &rNewTitle)
void SetContext(Context _eNewContext)
css::uno::Any getNodeValue(const OUString &_rPath) const noexcept
bool hasByHierarchicalName(const OUString &_rName) const noexcept
static OConfigurationTreeRoot createWithComponentContext(const css::uno::Reference< css::uno::XComponentContext > &_rxContext, const OUString &_rPath, sal_Int32 _nDepth=-1, CREATION_MODE _eMode=CM_UPDATABLE)
static bool runAsync(const std::shared_ptr< DialogController > &rController, const std::function< void(sal_Int32)> &)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr OUStringLiteral sColor
inline ::Size VCLSize(const css::awt::Size &rAWTSize)
OUString RptResId(TranslateId aId)
Reference< XComponentLoader > m_xFrameLoader
#define DBG_TESTSOLARMUTEX()
#define TOOLS_WARN_EXCEPTION(area, stream)
#define ENSURE_OR_THROW(c, m)
#define DBG_UNHANDLED_EXCEPTION(...)
SfxItemInfo const aItemInfos[]
constexpr OUStringLiteral MIMETYPE_OASIS_OPENDOCUMENT_TEXT_ASCII
constexpr OUStringLiteral MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_ASCII
constexpr sal_uInt16 KEY_MOD1
#define LINK(Instance, Class, Member)
Sequence< sal_Int8 > aSeq
#define SAL_N_ELEMENTS(arr)
tools::Long const nRightMargin
tools::Long const nLeftMargin
class SAL_NO_VTABLE XPropertySet
sal_Int32 findValue(const css::uno::Sequence< T1 > &_rList, const T2 &_rValue)
css::uno::Sequence< css::beans::PropertyValue > InitPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
::cppu::WeakComponentImplHelper< css::frame::XDispatch, css::frame::XDispatchProviderInterceptor, css::util::XModifyListener, css::frame::XFrameActionListener, css::lang::XInitialization, css::lang::XServiceInfo, css::frame::XDispatchInformationProvider, css::frame::XController2, css::frame::XTitle, css::frame::XTitleChangeBroadcaster, css::awt::XUserInputInterception > OGenericUnoController_Base
::osl::Mutex & getMutex()
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
SwView * getView(const uno::Reference< frame::XModel > &xModel)
tools::Rectangle getRectangleFromControl(SdrObject *pControl)
returns a Rectangle of a given SdrObject
@ RPTUI_HINT_SELECTIONCHANGED
uno::Reference< style::XStyle > getUsedStyle(const uno::Reference< report::XReportDefinition > &_xReport)
void correctOverlapping(SdrObject *pControl, OReportSection const &_aReportSection, bool _bInsert=true)
ensures that no control overlaps the given one.
std::map< OUString, TPropertyConverter > TPropertyNamePair
SdrObject * isOver(const tools::Rectangle &_rRect, SdrPage const &_rPage, SdrView const &_rView, bool _bAllObjects=false, SdrObject const *_pIgnore=nullptr, sal_Int16 _nIgnoreType=0)
checks whether the given rectangle overlapps another OUnoObject object in that view.
constexpr SdrLayerID RPT_LAYER_FRONT(0)
::dbaui::DBSubComponentController OReportController_BASE
void setZoomFactor(const Fraction &_aZoom, vcl::Window &_rWindow)
sets the map mode at the window
constexpr SdrLayerID RPT_LAYER_BACK(1)
void applyCharacterSettings(const css::uno::Reference< css::report::XReportControlFormat > &_rxReportControlFormat, const css::uno::Sequence< css::beans::NamedValue > &_rSettings)
applies the character settings previously obtained via openCharDialog
sal_Int32 getPositionInIndexAccess(const css::uno::Reference< css::container::XIndexAccess > &_xCollection, const css::uno::Reference< T > &_xSearch)
returns the position of the object inside the index container
::std::pair< OUString, std::shared_ptr< AnyConverter > > TPropertyConverter
bool openCharDialog(const css::uno::Reference< css::report::XReportControlFormat > &_xReportControlFormat, const css::uno::Reference< css::awt::XWindow > &_xWindow, css::uno::Sequence< css::beans::NamedValue > &_out_rNewValues)
opens the common character font dialog
IMPLEMENT_FORWARD_XTYPEPROVIDER2(ChildWindowPane, ChildWindowPaneInterfaceBase, Pane)
IMPLEMENT_FORWARD_XINTERFACE2(ChildWindowPane, ChildWindowPaneInterfaceBase, Pane)
static constexpr auto Items
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
HashMap_OWString_Interface aMap
constexpr OUStringLiteral PROPERTY_REPORTHEADERON
constexpr OUStringLiteral PROPERTY_LABEL
constexpr OUStringLiteral PROPERTY_NAME
constexpr OUStringLiteral PROPERTY_POSITION
constexpr OUStringLiteral PROPERTY_PAGEFOOTERON
constexpr OUStringLiteral PROPERTY_GROUP
constexpr OUStringLiteral PROPERTY_FONTDESCRIPTOR
constexpr OUStringLiteral REPORTCONTROLFORMAT
constexpr OUStringLiteral PROPERTY_PAGEHEADERON
constexpr OUStringLiteral PROPERTY_TYPE
constexpr OUStringLiteral PROPERTY_RIGHTMARGIN
constexpr OUStringLiteral PROPERTY_ORIENTATION
constexpr OUStringLiteral PROPERTY_DATAFIELD
constexpr OUStringLiteral PROPERTY_CHARCOLOR
constexpr OUStringLiteral PROPERTY_REPORTFOOTERON
constexpr OUStringLiteral PROPERTY_HEADERON
constexpr OUStringLiteral PROPERTY_BACKGROUNDCOLOR
constexpr OUStringLiteral DBPAGEFOOTER
constexpr OUStringLiteral PROPERTY_NUMBERINGTYPE
constexpr OUStringLiteral PROPERTY_CONTROLBORDER
constexpr OUStringLiteral PROPERTY_FONTDESCRIPTORASIAN
constexpr OUStringLiteral DBDETAIL
constexpr OUStringLiteral PROPERTY_COMMAND
constexpr OUStringLiteral PROPERTY_STATE
constexpr OUStringLiteral PROPERTY_CHARHEIGHT
constexpr OUStringLiteral PROPERTY_DATE_STATE
constexpr OUStringLiteral PROPERTY_TOPMARGIN
constexpr OUStringLiteral PROPERTY_APPLYFILTER
constexpr OUStringLiteral PROPERTY_ACTIVECONNECTION
constexpr OUStringLiteral PROPERTY_BACKTRANSPARENT
constexpr OUStringLiteral DBGROUPHEADER
constexpr OUStringLiteral PROPERTY_POSITIONY
constexpr OUStringLiteral PROPERTY_FOOTERON
constexpr OUStringLiteral PROPERTY_FORMATKEYDATE
constexpr OUStringLiteral PROPERTY_FORMATKEYTIME
constexpr OUStringLiteral PROPERTY_FONTCOLOR
constexpr OUStringLiteral PROPERTY_SECTION
constexpr OUStringLiteral PROPERTY_WIDTH
constexpr OUStringLiteral DBREPORTFOOTER
constexpr OUStringLiteral PROPERTY_LEFTMARGIN
constexpr OUStringLiteral PROPERTY_FORMATKEY
constexpr OUStringLiteral PROPERTY_ISLANDSCAPE
constexpr OUStringLiteral PROPERTY_COMMANDTYPE
constexpr OUStringLiteral PROPERTY_FILTER
constexpr OUStringLiteral PROPERTY_PAGESTYLELAYOUT
constexpr OUStringLiteral PROPERTY_IMAGEURL
constexpr OUStringLiteral PROPERTY_PARAADJUST
constexpr OUStringLiteral PROPERTY_ESCAPEPROCESSING
constexpr OUStringLiteral PROPERTY_REPORTNAME
constexpr OUStringLiteral PROPERTY_BACKCOLOR
constexpr OUStringLiteral CURRENT_WINDOW
constexpr OUStringLiteral PROPERTY_TIME_STATE
constexpr OUStringLiteral DBREPORTHEADER
constexpr OUStringLiteral PROPERTY_FORMATSSUPPLIER
constexpr OUStringLiteral DBGROUPFOOTER
constexpr OUStringLiteral PROPERTY_BOTTOMMARGIN
constexpr OUStringLiteral PROPERTY_PAPERSIZE
constexpr OUStringLiteral PROPERTY_BORDER
constexpr OUStringLiteral PROPERTY_FONTDESCRIPTORCOMPLEX
constexpr OUStringLiteral PROPERTY_PRESERVEIRI
constexpr OUStringLiteral PROPERTY_CHARFONTNAME
constexpr OUStringLiteral DBPAGEHEADER
constexpr OUStringLiteral PROPERTY_CONTROLBACKGROUND
constexpr OUStringLiteral PROPERTY_CAPTION
std::optional< bool > bChecked
Reference< XController > xController
Reference< XFrame > xFrame
Reference< XModel > xModel
constexpr OUStringLiteral PERCENT(u"Percent")
#define COL_DEFAULT_SHAPE_FILLING
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLUSESLIDEBACKGROUND)
#define COL_DEFAULT_SHAPE_STROKE