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:
1475 bForceBroadcast =
true;
1478 case SID_ATTR_CHAR_FONT:
1479 if ( aArgs.getLength() == 1 )
1481 awt::FontDescriptor aFont;
1482 if ( aArgs[0].
Value >>= aFont )
1488 case SID_ATTR_CHAR_FONTHEIGHT:
1489 if ( aArgs.getLength() == 1 )
1491 float fSelVal = 0.0;
1492 if ( aArgs[0].
Value >>= fSelVal )
1496 case SID_ATTR_PARA_ADJUST_LEFT:
1497 case SID_ATTR_PARA_ADJUST_CENTER:
1498 case SID_ATTR_PARA_ADJUST_RIGHT:
1499 case SID_ATTR_PARA_ADJUST_BLOCK:
1501 style::ParagraphAdjust eParagraphAdjust = style::ParagraphAdjust_LEFT;
1504 case SID_ATTR_PARA_ADJUST_LEFT:
1505 eParagraphAdjust = style::ParagraphAdjust_LEFT;
1507 case SID_ATTR_PARA_ADJUST_CENTER:
1508 eParagraphAdjust = style::ParagraphAdjust_CENTER;
1510 case SID_ATTR_PARA_ADJUST_RIGHT:
1511 eParagraphAdjust = style::ParagraphAdjust_RIGHT;
1513 case SID_ATTR_PARA_ADJUST_BLOCK:
1514 eParagraphAdjust = style::ParagraphAdjust_BLOCK;
1517 impl_setPropertyAtControls_throw(RID_STR_UNDO_ALIGNMENT,
PROPERTY_PARAADJUST,
uno::Any(
static_cast<sal_Int16
>(eParagraphAdjust)),aArgs);
1519 InvalidateFeature(SID_ATTR_PARA_ADJUST_LEFT);
1520 InvalidateFeature(SID_ATTR_PARA_ADJUST_CENTER);
1521 InvalidateFeature(SID_ATTR_PARA_ADJUST_RIGHT);
1522 InvalidateFeature(SID_ATTR_PARA_ADJUST_BLOCK);
1527 uno::Sequence< beans::NamedValue > aSettings;
1528 uno::Reference< awt::XWindow> xWindow;
1529 ::std::vector< uno::Reference< uno::XInterface > > aControlsFormats;
1532 if ( !aControlsFormats.empty() )
1534 const OUString sUndoAction(
RptResId( RID_STR_UNDO_CHANGEFONT ) );
1535 UndoContext aUndoContext( getUndoManager(), sUndoAction );
1537 for (
const auto& rxControlFormat : aControlsFormats)
1539 uno::Reference< report::XReportControlFormat > xFormat( rxControlFormat, uno::UNO_QUERY );
1540 if ( !xFormat.is() )
1543 if ( !aSettings.hasElements() )
1546 if ( !aSettings.hasElements() )
1557 case SID_INSERT_GRAPHIC:
1560 case SID_SETCONTROLDEFAULTS:
1562 case SID_CONDITIONALFORMATTING:
1564 uno::Reference< report::XFormattedField> xFormattedField(getDesignView()->getCurrentControlModel(),uno::UNO_QUERY);
1565 if ( xFormattedField.is() )
1573 if ( m_xReportDefinition.is() )
1575 if ( !aArgs.hasElements() )
1577 ODateTimeDialog aDlg(getFrameWeld(), getDesignView()->getCurrentSection(),
this);
1581 createDateTime(aArgs);
1584 case SID_INSERT_FLD_PGNUMBER:
1585 if ( m_xReportDefinition.is() )
1587 if ( !aArgs.hasElements() )
1593 createPageNumber(aArgs);
1597 case SID_EXPORTDOCASPDF:
1598 case SID_PRINTPREVIEW:
1605 setEditable(!isEditable());
1611 if ( !aArgs.hasElements() )
1615 else if ( aArgs.getLength() == 1 && aArgs[0].Name ==
"Zoom" )
1619 m_nZoomValue = aZoomItem.GetValue();
1620 m_eZoomType = aZoomItem.
GetType();
1621 impl_zoom_nothrow();
1624 case SID_ATTR_ZOOMSLIDER:
1625 if ( aArgs.getLength() == 1 && aArgs[0].Name ==
"ZoomSlider" )
1629 m_nZoomValue = aZoomSlider.GetValue();
1630 m_eZoomType = SvxZoomType::PERCENT;
1631 impl_zoom_nothrow();
1635 OReportController_BASE::Execute(_nId,aArgs);
1640void OReportController::impl_initialize( )
1642 OReportController_BASE::impl_initialize();
1644 const ::comphelper::NamedValueCollection& rArguments( getInitParams() );
1648 rArguments.get_ensureType(
"DocumentTitle",
m_sName );
1652 if ( m_xReportDefinition.is() )
1657 if ( !m_aReportModel )
1659 m_aReportModel->attachController( *
this );
1667 setEditable( !m_aReportModel->IsReadOnly() );
1668 m_xFormatter.set(util::NumberFormatter::create(
m_xContext), UNO_QUERY_THROW);
1676 uno::Reference<sdbcx::XTablesSupplier> xTablesSup(
getConnection(),uno::UNO_QUERY_THROW);
1677 uno::Reference<container::XNameAccess> xTables = xTablesSup->getTables();
1678 const uno::Sequence< OUString > aNames( xTables->getElementNames() );
1680 if ( aNames.hasElements() )
1682 m_xReportDefinition->setCommand(aNames[0]);
1683 m_xReportDefinition->setCommandType(sdb::CommandType::TABLE);
1687 m_aVisualAreaSize = m_xReportDefinition->getVisualAreaSize(0);
1692 checkChartEnabled();
1694 getDesignView()->toggleGrid(m_bGridVisible);
1695 getDesignView()->showRuler(m_bShowRuler);
1696 getDesignView()->togglePropertyBrowser(m_bShowProperties);
1697 getDesignView()->setCurrentPage(m_sLastActivePage);
1698 getDesignView()->unmarkAllObjects();
1700 if ( m_nPageNum != -1 )
1702 if ( m_nPageNum < m_aReportModel->GetPageCount() )
1704 const OReportPage* pPage =
dynamic_cast<OReportPage*
>(m_aReportModel->GetPage(
static_cast<sal_uInt16
>(m_nPageNum)));
1713 getDesignView()->collapseSections(m_aCollapsedSections);
1714 impl_zoom_nothrow();
1715 getDesignView()->Resize();
1716 getDesignView()->Invalidate();
1719 if ( m_bShowProperties && m_nPageNum == -1 )
1721 m_sLastActivePage =
"Data";
1722 getDesignView()->setCurrentPage(m_sLastActivePage);
1723 executeUnChecked(SID_SELECT_REPORT,{});
1728 catch(
const SQLException&)
1734IMPL_LINK( OReportController, OnCreateHdl, OAddFieldWindow& ,_rAddFieldDlg,
void)
1737 uno::Sequence< beans::PropertyValue > aArgs = _rAddFieldDlg.getSelectedFieldDescriptors();
1739 if ( aArgs.hasElements() )
1741 executeChecked(SID_ADD_CONTROL_PAIR,aArgs);
1749 setView( pMyOwnView );
1753 m_aSystemClipboard.StartClipboardListening( );
1755 m_pClipboardNotifier->AddListener(
getView() );
1757 OReportController_BASE::Construct(pParent);
1763 if ( getBroadcastHelper().bInDispose || getBroadcastHelper().bDisposed )
1767 ::osl::MutexGuard aGuard(
getMutex() );
1776void OReportController::describeSupportedFeatures()
1778 DBSubComponentController::describeSupportedFeatures();
1780 implDescribeSupportedFeature(
".uno:TextDocument", SID_RPT_TEXTDOCUMENT, CommandGroup::APPLICATION );
1781 implDescribeSupportedFeature(
".uno:Spreadsheet", SID_RPT_SPREADSHEET, CommandGroup::APPLICATION );
1783 implDescribeSupportedFeature(
".uno:Redo", SID_REDO, CommandGroup::EDIT );
1784 implDescribeSupportedFeature(
".uno:Undo", SID_UNDO, CommandGroup::EDIT );
1785 implDescribeSupportedFeature(
".uno:SelectAll", SID_SELECTALL, CommandGroup::EDIT );
1786 implDescribeSupportedFeature(
".uno:SelectAllInSection", SID_SELECTALL_IN_SECTION, CommandGroup::EDIT );
1787 implDescribeSupportedFeature(
".uno:Delete", SID_DELETE, CommandGroup::EDIT );
1788 implDescribeSupportedFeature(
".uno:SelectReport", SID_SELECT_REPORT, CommandGroup::EDIT );
1789 implDescribeSupportedFeature(
".uno:ExecuteReport", SID_EXECUTE_REPORT, CommandGroup::EDIT );
1791 implDescribeSupportedFeature(
".uno:GridVisible", SID_GRID_VISIBLE, CommandGroup::VIEW );
1792 implDescribeSupportedFeature(
".uno:GridUse", SID_GRID_USE, CommandGroup::VIEW );
1793 implDescribeSupportedFeature(
".uno:HelplinesMove", SID_HELPLINES_MOVE, CommandGroup::VIEW );
1794 implDescribeSupportedFeature(
".uno:ShowRuler", SID_RULER, CommandGroup::VIEW );
1795 implDescribeSupportedFeature(
".uno:AddField", SID_FM_ADD_FIELD, CommandGroup::VIEW );
1796 implDescribeSupportedFeature(
".uno:ReportNavigator", SID_RPT_SHOWREPORTEXPLORER, CommandGroup::VIEW );
1797 implDescribeSupportedFeature(
".uno:ControlProperties", SID_SHOW_PROPERTYBROWSER, CommandGroup::VIEW );
1798 implDescribeSupportedFeature(
".uno:DbSortingAndGrouping", SID_SORTINGANDGROUPING, CommandGroup::VIEW );
1799 implDescribeSupportedFeature(
".uno:PageHeaderFooter", SID_PAGEHEADERFOOTER, CommandGroup::VIEW );
1800 implDescribeSupportedFeature(
".uno:ReportHeaderFooter", SID_REPORTHEADERFOOTER, CommandGroup::VIEW );
1801 implDescribeSupportedFeature(
".uno:ZoomSlider", SID_ATTR_ZOOMSLIDER );
1802 implDescribeSupportedFeature(
".uno:Zoom", SID_ATTR_ZOOM, CommandGroup::VIEW );
1804 implDescribeSupportedFeature(
".uno:ConditionalFormatting", SID_CONDITIONALFORMATTING, CommandGroup::FORMAT );
1805 implDescribeSupportedFeature(
".uno:PageDialog", SID_PAGEDIALOG, CommandGroup::FORMAT );
1806 implDescribeSupportedFeature(
".uno:ResetAttributes", SID_SETCONTROLDEFAULTS, CommandGroup::FORMAT );
1808 implDescribeSupportedFeature(
".uno:Bold", SID_ATTR_CHAR_WEIGHT, CommandGroup::FORMAT );
1809 implDescribeSupportedFeature(
".uno:Italic", SID_ATTR_CHAR_POSTURE, CommandGroup::FORMAT );
1810 implDescribeSupportedFeature(
".uno:Underline", SID_ATTR_CHAR_UNDERLINE, CommandGroup::FORMAT );
1811 implDescribeSupportedFeature(
".uno:DBBackgroundColor", SID_ATTR_CHAR_COLOR_BACKGROUND, CommandGroup::FORMAT );
1812 implDescribeSupportedFeature(
".uno:BackgroundColor", SID_BACKGROUND_COLOR, CommandGroup::FORMAT );
1813 implDescribeSupportedFeature(
".uno:CharColorExt", SID_ATTR_CHAR_COLOR_EXT);
1814 implDescribeSupportedFeature(
".uno:Color", SID_ATTR_CHAR_COLOR);
1815 implDescribeSupportedFeature(
".uno:FontColor", SID_ATTR_CHAR_COLOR2, CommandGroup::FORMAT );
1816 implDescribeSupportedFeature(
".uno:FontDialog", SID_CHAR_DLG, CommandGroup::FORMAT );
1817 implDescribeSupportedFeature(
".uno:LeftPara", SID_ATTR_PARA_ADJUST_LEFT, CommandGroup::FORMAT );
1818 implDescribeSupportedFeature(
".uno:CenterPara", SID_ATTR_PARA_ADJUST_CENTER, CommandGroup::FORMAT );
1819 implDescribeSupportedFeature(
".uno:RightPara", SID_ATTR_PARA_ADJUST_RIGHT, CommandGroup::FORMAT );
1820 implDescribeSupportedFeature(
".uno:JustifyPara", SID_ATTR_PARA_ADJUST_BLOCK, CommandGroup::FORMAT );
1822 implDescribeSupportedFeature(
".uno:FontHeight", SID_ATTR_CHAR_FONTHEIGHT, CommandGroup::FORMAT );
1823 implDescribeSupportedFeature(
".uno:CharFontName", SID_ATTR_CHAR_FONT, CommandGroup::FORMAT );
1825 implDescribeSupportedFeature(
".uno:ArrangeMenu", SID_ARRANGEMENU, CommandGroup::FORMAT );
1826 implDescribeSupportedFeature(
".uno:BringToFront", SID_FRAME_TO_TOP, CommandGroup::FORMAT );
1827 implDescribeSupportedFeature(
".uno:ObjectBackOne", SID_FRAME_DOWN, CommandGroup::FORMAT );
1828 implDescribeSupportedFeature(
".uno:ObjectForwardOne", SID_FRAME_UP, CommandGroup::FORMAT );
1829 implDescribeSupportedFeature(
".uno:SendToBack", SID_FRAME_TO_BOTTOM, CommandGroup::FORMAT );
1830 implDescribeSupportedFeature(
".uno:SetObjectToForeground", SID_OBJECT_HEAVEN, CommandGroup::FORMAT );
1831 implDescribeSupportedFeature(
".uno:SetObjectToBackground", SID_OBJECT_HELL, CommandGroup::FORMAT );
1833 implDescribeSupportedFeature(
".uno:ObjectAlign", SID_OBJECT_ALIGN, CommandGroup::FORMAT );
1834 implDescribeSupportedFeature(
".uno:ObjectAlignLeft", SID_OBJECT_ALIGN_LEFT, CommandGroup::FORMAT );
1835 implDescribeSupportedFeature(
".uno:AlignCenter", SID_OBJECT_ALIGN_CENTER, CommandGroup::FORMAT );
1836 implDescribeSupportedFeature(
".uno:ObjectAlignRight", SID_OBJECT_ALIGN_RIGHT, CommandGroup::FORMAT );
1837 implDescribeSupportedFeature(
".uno:AlignUp", SID_OBJECT_ALIGN_UP, CommandGroup::FORMAT );
1838 implDescribeSupportedFeature(
".uno:AlignMiddle", SID_OBJECT_ALIGN_MIDDLE, CommandGroup::FORMAT );
1839 implDescribeSupportedFeature(
".uno:AlignDown", SID_OBJECT_ALIGN_DOWN, CommandGroup::FORMAT );
1841 implDescribeSupportedFeature(
".uno:SectionAlign", SID_SECTION_ALIGN );
1842 implDescribeSupportedFeature(
".uno:SectionAlignLeft", SID_SECTION_ALIGN_LEFT, CommandGroup::FORMAT );
1843 implDescribeSupportedFeature(
".uno:SectionAlignCenter", SID_SECTION_ALIGN_CENTER, CommandGroup::FORMAT );
1844 implDescribeSupportedFeature(
".uno:SectionAlignRight", SID_SECTION_ALIGN_RIGHT, CommandGroup::FORMAT );
1845 implDescribeSupportedFeature(
".uno:SectionAlignTop", SID_SECTION_ALIGN_UP, CommandGroup::FORMAT );
1846 implDescribeSupportedFeature(
".uno:SectionAlignMiddle", SID_SECTION_ALIGN_MIDDLE, CommandGroup::FORMAT );
1847 implDescribeSupportedFeature(
".uno:SectionAlignBottom", SID_SECTION_ALIGN_DOWN, CommandGroup::FORMAT );
1848 implDescribeSupportedFeature(
".uno:SectionShrink", SID_SECTION_SHRINK, CommandGroup::FORMAT );
1849 implDescribeSupportedFeature(
".uno:SectionShrinkTop", SID_SECTION_SHRINK_TOP, CommandGroup::FORMAT );
1850 implDescribeSupportedFeature(
".uno:SectionShrinkBottom", SID_SECTION_SHRINK_BOTTOM, CommandGroup::FORMAT );
1852 implDescribeSupportedFeature(
".uno:ObjectResize", SID_OBJECT_RESIZING, CommandGroup::FORMAT );
1853 implDescribeSupportedFeature(
".uno:SmallestWidth", SID_OBJECT_SMALLESTWIDTH, CommandGroup::FORMAT );
1854 implDescribeSupportedFeature(
".uno:SmallestHeight", SID_OBJECT_SMALLESTHEIGHT, CommandGroup::FORMAT );
1855 implDescribeSupportedFeature(
".uno:GreatestWidth", SID_OBJECT_GREATESTWIDTH, CommandGroup::FORMAT );
1856 implDescribeSupportedFeature(
".uno:GreatestHeight", SID_OBJECT_GREATESTHEIGHT, CommandGroup::FORMAT );
1858 implDescribeSupportedFeature(
".uno:DistributeSelection", SID_DISTRIBUTE_DLG, CommandGroup::FORMAT );
1859 implDescribeSupportedFeature(
".uno:DistributeHorzLeft", SID_DISTRIBUTE_HLEFT, CommandGroup::FORMAT );
1860 implDescribeSupportedFeature(
".uno:DistributeHorzCenter", SID_DISTRIBUTE_HCENTER, CommandGroup::FORMAT );
1861 implDescribeSupportedFeature(
".uno:DistributeHorzDistance", SID_DISTRIBUTE_HDISTANCE, CommandGroup::FORMAT );
1862 implDescribeSupportedFeature(
".uno:DistributeHorzRight", SID_DISTRIBUTE_HRIGHT, CommandGroup::FORMAT );
1863 implDescribeSupportedFeature(
".uno:DistributeVertTop", SID_DISTRIBUTE_VTOP, CommandGroup::FORMAT );
1864 implDescribeSupportedFeature(
".uno:DistributeVertCenter", SID_DISTRIBUTE_VCENTER, CommandGroup::FORMAT );
1865 implDescribeSupportedFeature(
".uno:DistributeVertDistance", SID_DISTRIBUTE_VDISTANCE, CommandGroup::FORMAT );
1866 implDescribeSupportedFeature(
".uno:DistributeVertBottom", SID_DISTRIBUTE_VBOTTOM, CommandGroup::FORMAT );
1868 implDescribeSupportedFeature(
".uno:ExportTo", SID_EXPORTDOC, CommandGroup::APPLICATION );
1869 implDescribeSupportedFeature(
".uno:ExportToPDF", SID_EXPORTDOCASPDF, CommandGroup::APPLICATION );
1870 implDescribeSupportedFeature(
".uno:PrintPreview", SID_PRINTPREVIEW, CommandGroup::APPLICATION );
1872 implDescribeSupportedFeature(
".uno:NewDoc", SID_NEWDOC, CommandGroup::DOCUMENT );
1873 implDescribeSupportedFeature(
".uno:Save", SID_SAVEDOC, CommandGroup::DOCUMENT );
1874 implDescribeSupportedFeature(
".uno:SaveAs", SID_SAVEASDOC, CommandGroup::DOCUMENT );
1875 implDescribeSupportedFeature(
".uno:SaveACopy", SID_SAVEACOPY, CommandGroup::DOCUMENT );
1877 implDescribeSupportedFeature(
".uno:InsertPageNumberField", SID_INSERT_FLD_PGNUMBER, CommandGroup::INSERT );
1878 implDescribeSupportedFeature(
".uno:InsertDateTimeField", SID_DATETIME, CommandGroup::INSERT );
1879 implDescribeSupportedFeature(
".uno:InsertObjectChart", SID_INSERT_DIAGRAM, CommandGroup::INSERT );
1880 implDescribeSupportedFeature(
".uno:InsertGraphic", SID_INSERT_GRAPHIC, CommandGroup::INSERT );
1882 implDescribeSupportedFeature(
".uno:SelectObject", SID_OBJECT_SELECT, CommandGroup::INSERT );
1883 implDescribeSupportedFeature(
".uno:Label", SID_FM_FIXEDTEXT, CommandGroup::INSERT );
1884 implDescribeSupportedFeature(
".uno:Edit", SID_FM_EDIT, CommandGroup::INSERT );
1885 implDescribeSupportedFeature(
".uno:ImageControl", SID_FM_IMAGECONTROL, CommandGroup::INSERT );
1886 implDescribeSupportedFeature(
".uno:HFixedLine", SID_INSERT_HFIXEDLINE, CommandGroup::INSERT );
1887 implDescribeSupportedFeature(
".uno:VFixedLine", SID_INSERT_VFIXEDLINE, CommandGroup::INSERT );
1890 implDescribeSupportedFeature(
".uno:BasicShapes", SID_DRAWTBX_CS_BASIC, CommandGroup::INSERT );
1891 implDescribeSupportedFeature(
".uno:BasicShapes.rectangle", SID_DRAWTBX_CS_BASIC1, CommandGroup::INSERT );
1892 implDescribeSupportedFeature(
".uno:BasicShapes.round-rectangle",SID_DRAWTBX_CS_BASIC2, CommandGroup::INSERT );
1893 implDescribeSupportedFeature(
".uno:BasicShapes.quadrat", SID_DRAWTBX_CS_BASIC3, CommandGroup::INSERT );
1894 implDescribeSupportedFeature(
".uno:BasicShapes.round-quadrat", SID_DRAWTBX_CS_BASIC4, CommandGroup::INSERT );
1895 implDescribeSupportedFeature(
".uno:BasicShapes.circle", SID_DRAWTBX_CS_BASIC5, CommandGroup::INSERT );
1896 implDescribeSupportedFeature(
".uno:BasicShapes.ellipse", SID_DRAWTBX_CS_BASIC6, CommandGroup::INSERT );
1897 implDescribeSupportedFeature(
".uno:BasicShapes.circle-pie", SID_DRAWTBX_CS_BASIC7, CommandGroup::INSERT );
1898 implDescribeSupportedFeature(
".uno:BasicShapes.isosceles-triangle",SID_DRAWTBX_CS_BASIC8, CommandGroup::INSERT );
1899 implDescribeSupportedFeature(
".uno:BasicShapes.right-triangle",SID_DRAWTBX_CS_BASIC9, CommandGroup::INSERT );
1900 implDescribeSupportedFeature(
".uno:BasicShapes.trapezoid", SID_DRAWTBX_CS_BASIC10, CommandGroup::INSERT );
1901 implDescribeSupportedFeature(
".uno:BasicShapes.diamond", SID_DRAWTBX_CS_BASIC11, CommandGroup::INSERT );
1902 implDescribeSupportedFeature(
".uno:BasicShapes.parallelogram", SID_DRAWTBX_CS_BASIC12, CommandGroup::INSERT );
1903 implDescribeSupportedFeature(
".uno:BasicShapes.pentagon", SID_DRAWTBX_CS_BASIC13, CommandGroup::INSERT );
1904 implDescribeSupportedFeature(
".uno:BasicShapes.hexagon", SID_DRAWTBX_CS_BASIC14, CommandGroup::INSERT );
1905 implDescribeSupportedFeature(
".uno:BasicShapes.octagon", SID_DRAWTBX_CS_BASIC15, CommandGroup::INSERT );
1906 implDescribeSupportedFeature(
".uno:BasicShapes.cross", SID_DRAWTBX_CS_BASIC16, CommandGroup::INSERT );
1907 implDescribeSupportedFeature(
".uno:BasicShapes.ring", SID_DRAWTBX_CS_BASIC17, CommandGroup::INSERT );
1908 implDescribeSupportedFeature(
".uno:BasicShapes.block-arc", SID_DRAWTBX_CS_BASIC18, CommandGroup::INSERT );
1909 implDescribeSupportedFeature(
".uno:BasicShapes.can", SID_DRAWTBX_CS_BASIC19, CommandGroup::INSERT );
1910 implDescribeSupportedFeature(
".uno:BasicShapes.cube", SID_DRAWTBX_CS_BASIC20, CommandGroup::INSERT );
1911 implDescribeSupportedFeature(
".uno:BasicShapes.paper", SID_DRAWTBX_CS_BASIC21, CommandGroup::INSERT );
1912 implDescribeSupportedFeature(
".uno:BasicShapes.frame", SID_DRAWTBX_CS_BASIC22, CommandGroup::INSERT );
1914 implDescribeSupportedFeature(
".uno:SymbolShapes", SID_DRAWTBX_CS_SYMBOL, CommandGroup::INSERT );
1916 implDescribeSupportedFeature(
".uno:SymbolShapes.smiley" , SID_DRAWTBX_CS_SYMBOL1, CommandGroup::INSERT );
1917 implDescribeSupportedFeature(
".uno:SymbolShapes.sun" , SID_DRAWTBX_CS_SYMBOL2, CommandGroup::INSERT );
1918 implDescribeSupportedFeature(
".uno:SymbolShapes.moon" , SID_DRAWTBX_CS_SYMBOL3, CommandGroup::INSERT );
1919 implDescribeSupportedFeature(
".uno:SymbolShapes.lightning" , SID_DRAWTBX_CS_SYMBOL4, CommandGroup::INSERT );
1920 implDescribeSupportedFeature(
".uno:SymbolShapes.heart" , SID_DRAWTBX_CS_SYMBOL5, CommandGroup::INSERT );
1921 implDescribeSupportedFeature(
".uno:SymbolShapes.flower" , SID_DRAWTBX_CS_SYMBOL6, CommandGroup::INSERT );
1922 implDescribeSupportedFeature(
".uno:SymbolShapes.cloud" , SID_DRAWTBX_CS_SYMBOL7, CommandGroup::INSERT );
1923 implDescribeSupportedFeature(
".uno:SymbolShapes.forbidden" , SID_DRAWTBX_CS_SYMBOL8, CommandGroup::INSERT );
1924 implDescribeSupportedFeature(
".uno:SymbolShapes.puzzle" , SID_DRAWTBX_CS_SYMBOL9, CommandGroup::INSERT );
1925 implDescribeSupportedFeature(
".uno:SymbolShapes.bracket-pair" ,SID_DRAWTBX_CS_SYMBOL10, CommandGroup::INSERT );
1926 implDescribeSupportedFeature(
".uno:SymbolShapes.left-bracket" ,SID_DRAWTBX_CS_SYMBOL11, CommandGroup::INSERT );
1927 implDescribeSupportedFeature(
".uno:SymbolShapes.right-bracket",SID_DRAWTBX_CS_SYMBOL12, CommandGroup::INSERT );
1928 implDescribeSupportedFeature(
".uno:SymbolShapes.brace-pair" , SID_DRAWTBX_CS_SYMBOL13, CommandGroup::INSERT );
1929 implDescribeSupportedFeature(
".uno:SymbolShapes.left-brace" , SID_DRAWTBX_CS_SYMBOL14, CommandGroup::INSERT );
1930 implDescribeSupportedFeature(
".uno:SymbolShapes.right-brace" , SID_DRAWTBX_CS_SYMBOL15, CommandGroup::INSERT );
1931 implDescribeSupportedFeature(
".uno:SymbolShapes.quad-bevel" , SID_DRAWTBX_CS_SYMBOL16, CommandGroup::INSERT );
1932 implDescribeSupportedFeature(
".uno:SymbolShapes.octagon-bevel",SID_DRAWTBX_CS_SYMBOL17, CommandGroup::INSERT );
1933 implDescribeSupportedFeature(
".uno:SymbolShapes.diamond-bevel",SID_DRAWTBX_CS_SYMBOL18, CommandGroup::INSERT );
1935 implDescribeSupportedFeature(
".uno:ArrowShapes.left-arrow" , SID_DRAWTBX_CS_ARROW1, CommandGroup::INSERT );
1936 implDescribeSupportedFeature(
".uno:ArrowShapes.right-arrow" , SID_DRAWTBX_CS_ARROW2, CommandGroup::INSERT );
1937 implDescribeSupportedFeature(
".uno:ArrowShapes.up-arrow" , SID_DRAWTBX_CS_ARROW3, CommandGroup::INSERT );
1938 implDescribeSupportedFeature(
".uno:ArrowShapes.down-arrow" , SID_DRAWTBX_CS_ARROW4, CommandGroup::INSERT );
1939 implDescribeSupportedFeature(
".uno:ArrowShapes.left-right-arrow" , SID_DRAWTBX_CS_ARROW5, CommandGroup::INSERT );
1940 implDescribeSupportedFeature(
".uno:ArrowShapes.up-down-arrow" , SID_DRAWTBX_CS_ARROW6, CommandGroup::INSERT );
1941 implDescribeSupportedFeature(
".uno:ArrowShapes.up-right-arrow" , SID_DRAWTBX_CS_ARROW7, CommandGroup::INSERT );
1942 implDescribeSupportedFeature(
".uno:ArrowShapes.up-right-down-arrow" , SID_DRAWTBX_CS_ARROW8, CommandGroup::INSERT );
1943 implDescribeSupportedFeature(
".uno:ArrowShapes.quad-arrow" , SID_DRAWTBX_CS_ARROW9, CommandGroup::INSERT );
1944 implDescribeSupportedFeature(
".uno:ArrowShapes.corner-right-arrow" , SID_DRAWTBX_CS_ARROW10, CommandGroup::INSERT );
1945 implDescribeSupportedFeature(
".uno:ArrowShapes.split-arrow" , SID_DRAWTBX_CS_ARROW11, CommandGroup::INSERT );
1946 implDescribeSupportedFeature(
".uno:ArrowShapes.striped-right-arrow" , SID_DRAWTBX_CS_ARROW12, CommandGroup::INSERT );
1947 implDescribeSupportedFeature(
".uno:ArrowShapes.notched-right-arrow" , SID_DRAWTBX_CS_ARROW13, CommandGroup::INSERT );
1948 implDescribeSupportedFeature(
".uno:ArrowShapes.pentagon-right" , SID_DRAWTBX_CS_ARROW14, CommandGroup::INSERT );
1949 implDescribeSupportedFeature(
".uno:ArrowShapes.chevron" , SID_DRAWTBX_CS_ARROW15, CommandGroup::INSERT );
1950 implDescribeSupportedFeature(
".uno:ArrowShapes.right-arrow-callout" , SID_DRAWTBX_CS_ARROW16, CommandGroup::INSERT );
1951 implDescribeSupportedFeature(
".uno:ArrowShapes.left-arrow-callout" , SID_DRAWTBX_CS_ARROW17, CommandGroup::INSERT );
1952 implDescribeSupportedFeature(
".uno:ArrowShapes.up-arrow-callout" , SID_DRAWTBX_CS_ARROW18, CommandGroup::INSERT );
1953 implDescribeSupportedFeature(
".uno:ArrowShapes.down-arrow-callout" , SID_DRAWTBX_CS_ARROW19, CommandGroup::INSERT );
1954 implDescribeSupportedFeature(
".uno:ArrowShapes.left-right-arrow-callout",SID_DRAWTBX_CS_ARROW20, CommandGroup::INSERT );
1955 implDescribeSupportedFeature(
".uno:ArrowShapes.up-down-arrow-callout" ,SID_DRAWTBX_CS_ARROW21, CommandGroup::INSERT );
1956 implDescribeSupportedFeature(
".uno:ArrowShapes.up-right-arrow-callout",SID_DRAWTBX_CS_ARROW22, CommandGroup::INSERT );
1957 implDescribeSupportedFeature(
".uno:ArrowShapes.quad-arrow-callout" , SID_DRAWTBX_CS_ARROW23, CommandGroup::INSERT );
1958 implDescribeSupportedFeature(
".uno:ArrowShapes.circular-arrow" , SID_DRAWTBX_CS_ARROW24, CommandGroup::INSERT );
1959 implDescribeSupportedFeature(
".uno:ArrowShapes.split-round-arrow" , SID_DRAWTBX_CS_ARROW25, CommandGroup::INSERT );
1960 implDescribeSupportedFeature(
".uno:ArrowShapes.s-sharped-arrow" , SID_DRAWTBX_CS_ARROW26, CommandGroup::INSERT );
1962 implDescribeSupportedFeature(
".uno:StarShapes.bang" , SID_DRAWTBX_CS_STAR1, CommandGroup::INSERT );
1963 implDescribeSupportedFeature(
".uno:StarShapes.star4" , SID_DRAWTBX_CS_STAR2, CommandGroup::INSERT );
1964 implDescribeSupportedFeature(
".uno:StarShapes.star5" , SID_DRAWTBX_CS_STAR3, CommandGroup::INSERT );
1965 implDescribeSupportedFeature(
".uno:StarShapes.star6" , SID_DRAWTBX_CS_STAR4, CommandGroup::INSERT );
1966 implDescribeSupportedFeature(
".uno:StarShapes.star8" , SID_DRAWTBX_CS_STAR5, CommandGroup::INSERT );
1967 implDescribeSupportedFeature(
".uno:StarShapes.star12" , SID_DRAWTBX_CS_STAR6, CommandGroup::INSERT );
1968 implDescribeSupportedFeature(
".uno:StarShapes.star24" , SID_DRAWTBX_CS_STAR7, CommandGroup::INSERT );
1969 implDescribeSupportedFeature(
".uno:StarShapes.concave-star6" , SID_DRAWTBX_CS_STAR8, CommandGroup::INSERT );
1970 implDescribeSupportedFeature(
".uno:StarShapes.vertical-scroll" , SID_DRAWTBX_CS_STAR9, CommandGroup::INSERT );
1971 implDescribeSupportedFeature(
".uno:StarShapes.horizontal-scroll" , SID_DRAWTBX_CS_STAR10, CommandGroup::INSERT );
1972 implDescribeSupportedFeature(
".uno:StarShapes.signet" , SID_DRAWTBX_CS_STAR11, CommandGroup::INSERT );
1973 implDescribeSupportedFeature(
".uno:StarShapes.doorplate" , SID_DRAWTBX_CS_STAR12, CommandGroup::INSERT );
1975 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-process" , SID_DRAWTBX_CS_FLOWCHART1, CommandGroup::INSERT );
1976 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-alternate-process" , SID_DRAWTBX_CS_FLOWCHART2, CommandGroup::INSERT );
1977 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-decision" , SID_DRAWTBX_CS_FLOWCHART3, CommandGroup::INSERT );
1978 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-data" , SID_DRAWTBX_CS_FLOWCHART4, CommandGroup::INSERT );
1979 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-predefined-process" , SID_DRAWTBX_CS_FLOWCHART5, CommandGroup::INSERT );
1980 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-internal-storage" , SID_DRAWTBX_CS_FLOWCHART6, CommandGroup::INSERT );
1981 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-document" , SID_DRAWTBX_CS_FLOWCHART7, CommandGroup::INSERT );
1982 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-multidocument" , SID_DRAWTBX_CS_FLOWCHART8, CommandGroup::INSERT );
1983 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-terminator" , SID_DRAWTBX_CS_FLOWCHART9, CommandGroup::INSERT );
1984 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-preparation" , SID_DRAWTBX_CS_FLOWCHART10, CommandGroup::INSERT );
1985 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-manual-input" , SID_DRAWTBX_CS_FLOWCHART11, CommandGroup::INSERT );
1986 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-manual-operation" , SID_DRAWTBX_CS_FLOWCHART12, CommandGroup::INSERT );
1987 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-connector" , SID_DRAWTBX_CS_FLOWCHART13, CommandGroup::INSERT );
1988 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-off-page-connector" , SID_DRAWTBX_CS_FLOWCHART14, CommandGroup::INSERT );
1989 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-card" , SID_DRAWTBX_CS_FLOWCHART15, CommandGroup::INSERT );
1990 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-punched-tape" , SID_DRAWTBX_CS_FLOWCHART16, CommandGroup::INSERT );
1991 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-summing-junction" , SID_DRAWTBX_CS_FLOWCHART17, CommandGroup::INSERT );
1992 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-or" , SID_DRAWTBX_CS_FLOWCHART18, CommandGroup::INSERT );
1993 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-collate" , SID_DRAWTBX_CS_FLOWCHART19, CommandGroup::INSERT );
1994 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-sort" , SID_DRAWTBX_CS_FLOWCHART20, CommandGroup::INSERT );
1995 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-extract" , SID_DRAWTBX_CS_FLOWCHART21, CommandGroup::INSERT );
1996 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-merge" , SID_DRAWTBX_CS_FLOWCHART22, CommandGroup::INSERT );
1997 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-stored-data" , SID_DRAWTBX_CS_FLOWCHART23, CommandGroup::INSERT );
1998 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-delay" , SID_DRAWTBX_CS_FLOWCHART24, CommandGroup::INSERT );
1999 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-sequential-access" , SID_DRAWTBX_CS_FLOWCHART25, CommandGroup::INSERT );
2000 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-magnetic-disk" , SID_DRAWTBX_CS_FLOWCHART26, CommandGroup::INSERT );
2001 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-direct-access-storage",SID_DRAWTBX_CS_FLOWCHART27, CommandGroup::INSERT );
2002 implDescribeSupportedFeature(
".uno:FlowChartShapes.flowchart-display" , SID_DRAWTBX_CS_FLOWCHART28, CommandGroup::INSERT );
2004 implDescribeSupportedFeature(
".uno:CalloutShapes.rectangular-callout" , SID_DRAWTBX_CS_CALLOUT1, CommandGroup::INSERT );
2005 implDescribeSupportedFeature(
".uno:CalloutShapes.round-rectangular-callout" , SID_DRAWTBX_CS_CALLOUT2, CommandGroup::INSERT );
2006 implDescribeSupportedFeature(
".uno:CalloutShapes.round-callout" , SID_DRAWTBX_CS_CALLOUT3, CommandGroup::INSERT );
2007 implDescribeSupportedFeature(
".uno:CalloutShapes.cloud-callout" , SID_DRAWTBX_CS_CALLOUT4, CommandGroup::INSERT );
2008 implDescribeSupportedFeature(
".uno:CalloutShapes.line-callout-1" , SID_DRAWTBX_CS_CALLOUT5, CommandGroup::INSERT );
2009 implDescribeSupportedFeature(
".uno:CalloutShapes.line-callout-2" , SID_DRAWTBX_CS_CALLOUT6, CommandGroup::INSERT );
2010 implDescribeSupportedFeature(
".uno:CalloutShapes.line-callout-3" , SID_DRAWTBX_CS_CALLOUT7, CommandGroup::INSERT );
2012 implDescribeSupportedFeature(
".uno:ArrowShapes", SID_DRAWTBX_CS_ARROW, CommandGroup::INSERT );
2014 implDescribeSupportedFeature(
".uno:FlowChartShapes", SID_DRAWTBX_CS_FLOWCHART, CommandGroup::INSERT );
2015 implDescribeSupportedFeature(
".uno:CalloutShapes", SID_DRAWTBX_CS_CALLOUT, CommandGroup::INSERT );
2016 implDescribeSupportedFeature(
".uno:StarShapes", SID_DRAWTBX_CS_STAR, CommandGroup::INSERT );
2020 implDescribeSupportedFeature(
".uno:Escape", SID_ESCAPE);
2023 implDescribeSupportedFeature(
".uno:RPT_RPTHEADER_UNDO", SID_REPORTHEADER_WITHOUT_UNDO);
2024 implDescribeSupportedFeature(
".uno:RPT_RPTFOOTER_UNDO", SID_REPORTFOOTER_WITHOUT_UNDO);
2025 implDescribeSupportedFeature(
".uno:RPT_PGHEADER_UNDO", SID_PAGEHEADER_WITHOUT_UNDO);
2026 implDescribeSupportedFeature(
".uno:RPT_PGFOOTER_UNDO", SID_PAGEFOOTER_WITHOUT_UNDO);
2027 implDescribeSupportedFeature(
".uno:SID_GROUPHEADER", SID_GROUPHEADER);
2028 implDescribeSupportedFeature(
".uno:SID_GROUPHEADER_WITHOUT_UNDO", SID_GROUPHEADER_WITHOUT_UNDO);
2029 implDescribeSupportedFeature(
".uno:SID_GROUPFOOTER", SID_GROUPFOOTER);
2030 implDescribeSupportedFeature(
".uno:SID_GROUPFOOTER_WITHOUT_UNDO", SID_GROUPFOOTER_WITHOUT_UNDO);
2031 implDescribeSupportedFeature(
".uno:SID_GROUP_REMOVE", SID_GROUP_REMOVE);
2032 implDescribeSupportedFeature(
".uno:SID_GROUP_APPEND", SID_GROUP_APPEND);
2033 implDescribeSupportedFeature(
".uno:SID_ADD_CONTROL_PAIR", SID_ADD_CONTROL_PAIR);
2034 implDescribeSupportedFeature(
".uno:SplitPosition", SID_SPLIT_POSITION);
2035 implDescribeSupportedFeature(
".uno:LastPropertyBrowserPage", SID_PROPERTYBROWSER_LAST_PAGE);
2036 implDescribeSupportedFeature(
".uno:Select", SID_SELECT);
2037 implDescribeSupportedFeature(
".uno:InsertFunction", SID_RPT_NEW_FUNCTION);
2038 implDescribeSupportedFeature(
".uno:NextMark", SID_NEXT_MARK);
2039 implDescribeSupportedFeature(
".uno:PrevMark", SID_PREV_MARK);
2040 implDescribeSupportedFeature(
".uno:TerminateInplaceActivation", SID_TERMINATE_INPLACEACTIVATION);
2041 implDescribeSupportedFeature(
".uno:SelectAllLabels", SID_SELECT_ALL_LABELS);
2042 implDescribeSupportedFeature(
".uno:SelectAllEdits", SID_SELECT_ALL_EDITS);
2043 implDescribeSupportedFeature(
".uno:CollapseSection", SID_COLLAPSE_SECTION);
2044 implDescribeSupportedFeature(
".uno:ExpandSection", SID_EXPAND_SECTION);
2045 implDescribeSupportedFeature(
".uno:GetUndoStrings", SID_GETUNDOSTRINGS);
2046 implDescribeSupportedFeature(
".uno:GetRedoStrings", SID_GETREDOSTRINGS);
2049void OReportController::impl_onModifyChanged()
2053 if ( m_xReportDefinition.is() )
2054 m_xReportDefinition->setModified( impl_isModified() );
2055 DBSubComponentController::impl_onModifyChanged();
2057 catch(
const uno::Exception&)
2065 if ( !_xLayoutManager.is() )
2068 static const std::u16string_view s_sMenu[] = {
2069 u"private:resource/statusbar/statusbar"
2070 ,
u"private:resource/toolbar/reportcontrols"
2071 ,
u"private:resource/toolbar/drawbar"
2072 ,
u"private:resource/toolbar/Formatting"
2073 ,
u"private:resource/toolbar/alignmentbar"
2074 ,
u"private:resource/toolbar/sectionalignmentbar"
2075 ,
u"private:resource/toolbar/resizebar"
2076 ,
u"private:resource/toolbar/sectionshrinkbar"
2078 for (
const auto &
i : s_sMenu)
2080 _xLayoutManager->createElement( OUString(
i) );
2081 _xLayoutManager->requestElement( OUString(
i) );
2085void OReportController::notifyGroupSections(
const ContainerEvent& _rEvent,
bool _bShow)
2087 uno::Reference< report::XGroup> xGroup(_rEvent.Element,uno::UNO_QUERY);
2092 ::osl::MutexGuard aGuard(
getMutex() );
2093 sal_Int32 nGroupPos = 0;
2094 _rEvent.Accessor >>= nGroupPos;
2098 xGroup->addPropertyChangeListener(
PROPERTY_HEADERON,
static_cast<XPropertyChangeListener*
>(
this));
2099 xGroup->addPropertyChangeListener(
PROPERTY_FOOTERON,
static_cast<XPropertyChangeListener*
>(
this));
2103 xGroup->removePropertyChangeListener(
PROPERTY_HEADERON,
static_cast<XPropertyChangeListener*
>(
this));
2104 xGroup->removePropertyChangeListener(
PROPERTY_FOOTERON,
static_cast<XPropertyChangeListener*
>(
this));
2107 if ( xGroup->getHeaderOn() )
2112 m_pReportControllerObserver->AddSection(xGroup->getHeader());
2116 m_pReportControllerObserver->RemoveSection(xGroup->getHeader());
2119 if ( xGroup->getFooterOn() )
2124 m_pReportControllerObserver->AddSection(xGroup->getFooter());
2128 m_pReportControllerObserver->RemoveSection(xGroup->getFooter());
2134void SAL_CALL OReportController::elementInserted(
const ContainerEvent& _rEvent )
2136 notifyGroupSections(_rEvent,
true);
2139void SAL_CALL OReportController::elementRemoved(
const ContainerEvent& _rEvent )
2141 notifyGroupSections(_rEvent,
false);
2144void SAL_CALL OReportController::elementReplaced(
const ContainerEvent& )
2147 ::osl::MutexGuard aGuard(
getMutex() );
2148 OSL_FAIL(
"Not yet implemented!");
2151void SAL_CALL OReportController::propertyChange(
const beans::PropertyChangeEvent& evt )
2154 ::osl::MutexGuard aGuard(
getMutex() );
2158 evt.NewValue >>= bShow;
2159 if ( evt.Source == m_xReportDefinition )
2163 const sal_uInt16 nPosition = m_xReportDefinition->getPageHeaderOn() ? 1 : 0;
2166 getDesignView()->addSection(m_xReportDefinition->getReportHeader(),
DBREPORTHEADER,nPosition);
2167 m_pReportControllerObserver->AddSection(m_xReportDefinition->getReportHeader());
2171 getDesignView()->removeSection(nPosition);
2176 sal_uInt16 nPosition = getDesignView()->getSectionCount();
2177 if ( m_xReportDefinition->getPageFooterOn() )
2181 getDesignView()->addSection(m_xReportDefinition->getReportFooter(),
DBREPORTFOOTER,nPosition);
2182 m_pReportControllerObserver->AddSection(m_xReportDefinition->getReportFooter());
2186 getDesignView()->removeSection(nPosition - 1);
2193 getDesignView()->addSection(m_xReportDefinition->getPageHeader(),
DBPAGEHEADER,0);
2194 m_pReportControllerObserver->AddSection(m_xReportDefinition->getPageHeader());
2198 getDesignView()->removeSection(sal_uInt16(0));
2205 getDesignView()->addSection(m_xReportDefinition->getPageFooter(),
DBPAGEFOOTER);
2206 m_pReportControllerObserver->AddSection(m_xReportDefinition->getPageFooter());
2210 getDesignView()->removeSection(getDesignView()->getSectionCount() - 1);
2220 m_xHoldAlive.clear();
2221 InvalidateFeature(SID_FM_ADD_FIELD);
2222 if ( !getDesignView()->isAddFieldVisible() && isUiVisible() )
2223 getDesignView()->toggleAddField();
2231 uno::Reference< report::XGroup> xGroup(evt.Source,uno::UNO_QUERY);
2234 sal_Int32 nGroupPos = getGroupPosition(xGroup);
2236 groupChange(xGroup,evt.PropertyName,nGroupPos,bShow);
2240 catch(
const uno::Exception&)
2247void SAL_CALL OReportController::disposing(
const lang::EventObject& Source )
2250 OReportController_BASE::disposing(Source);
2255 ,sal_Int32 _nGroupPos
2256 ,::std::function<
bool(OGroupHelper *)>
const & _pGroupMemberFunction)
2258 uno::Reference< report::XGroup> xGroup;
2259 sal_uInt16 nNonVisibleGroups = 0;
2260 sal_Int32
nCount = _xGroups->getCount();
2261 for( sal_Int32
i = 0;
i < _nGroupPos &&
i <
nCount; ++
i)
2263 xGroup.set(_xGroups->getByIndex(
i),uno::UNO_QUERY);
2264 OSL_ENSURE(xGroup.is(),
"Group is NULL! -> GPF");
2265 OGroupHelper aGroupHelper(xGroup);
2266 if ( !_pGroupMemberFunction(&aGroupHelper) )
2267 ++nNonVisibleGroups;
2269 return nNonVisibleGroups;
2272void OReportController::groupChange(
const uno::Reference< report::XGroup>& _xGroup,std::u16string_view _sPropName,sal_Int32 _nGroupPos,
bool _bShow)
2274 ::std::function<bool(
OGroupHelper *)> pMemFun = ::std::mem_fn(&OGroupHelper::getHeaderOn);
2275 ::std::function<uno::Reference<report::XSection>(
OGroupHelper *)> pMemFunSection = ::std::mem_fn(&OGroupHelper::getHeader);
2277 sal_uInt16 nPosition = 0;
2278 bool bHandle =
false;
2281 nPosition = m_xReportDefinition->getPageHeaderOn() ? (m_xReportDefinition->getReportHeaderOn() ? 2 : 1) : (m_xReportDefinition->getReportHeaderOn() ? 1 : 0);
2287 pMemFun = ::std::mem_fn(&OGroupHelper::getFooterOn);
2288 pMemFunSection = ::std::mem_fn(&OGroupHelper::getFooter);
2289 nPosition = getDesignView()->getSectionCount();
2291 if ( m_xReportDefinition->getPageFooterOn() )
2293 if ( m_xReportDefinition->getReportFooterOn() )
2306 getDesignView()->addSection(pMemFunSection(&aGroupHelper),
sColor,nPosition);
2310 getDesignView()->removeSection(nPosition);
2317 OnInvalidateClipboard();
2320void OReportController::OnInvalidateClipboard()
2322 InvalidateFeature(SID_CUT);
2323 InvalidateFeature(SID_COPY);
2324 InvalidateFeature(SID_PASTE);
2327void OReportController::openPageDialog(
const uno::Reference<report::XSection>& _xSection)
2329 if ( !m_xReportDefinition.is() )
2335 { SID_ATTR_LRSPACE,
true },
2336 { SID_ATTR_ULSPACE,
true },
2337 { SID_ATTR_PAGE,
true },
2338 { SID_ATTR_PAGE_SIZE,
true },
2339 { SID_ENUM_PAGE_MODE,
true },
2340 { SID_PAPER_START,
true },
2341 { SID_PAPER_END,
true },
2342 { SID_ATTR_BRUSH,
true },
2363 { SID_ATTR_METRIC,
true }
2367 FieldUnit eUserMetric = MeasurementSystem::Metric == eSystem ? FieldUnit::CM : FieldUnit::INCH;
2370 SID_ATTR_METRIC,SID_ATTR_METRIC
2378 const XHatch aNullHatch(aNullLineCol);
2380 std::vector<SfxPoolItem*> pDefaults
2413 pPool->SetDefaults(&pDefaults);
2416 pPool->SetDefaultMetric( MapUnit::Map100thMM );
2417 pPool->FreezeIdRanges();
2423 if ( _xSection.is() )
2432 aDescriptor.
Put(
SfxUInt16Item(SID_ATTR_METRIC,
static_cast<sal_uInt16
>(eUserMetric)));
2434 uno::Reference< style::XStyle> xPageStyle(
getUsedStyle(m_xReportDefinition));
2435 if ( xPageStyle.is() )
2439 uno::Reference<beans::XPropertySet> xProp(xPageStyle,uno::UNO_QUERY_THROW);
2443 aDescriptor.
Put(aPageItem);
2450 getFrameWeld(), &aDescriptor,_xSection.is()
2451 ? OUString(
"BackgroundDialog")
2452 : OUString(
"PageDialog"));
2459 if ( _xSection.is() )
2462 _xSection->setBackColor(sal_Int32(pBrushItem->GetColor()));
2466 uno::Reference< beans::XPropertySet> xProp(
getUsedStyle(m_xReportDefinition),uno::UNO_QUERY_THROW);
2467 const OUString sUndoAction(
RptResId(RID_STR_UNDO_CHANGEPAGE));
2468 UndoContext aUndoContext( getUndoManager(), sUndoAction );
2472 pSizeItem->QueryValue(aValue);
2501 ::Color aBackColor = pBrushItem->GetColor();
2521sal_Bool SAL_CALL OReportController::attachModel(
const uno::Reference< frame::XModel > & xModel)
2523 ::osl::MutexGuard aGuard(
getMutex() );
2525 uno::Reference< report::XReportDefinition > xReportDefinition(
xModel, UNO_QUERY );
2526 if ( !xReportDefinition.is() )
2529 uno::Reference< document::XUndoManagerSupplier > xTestSuppUndo(
xModel, UNO_QUERY );
2530 if ( !xTestSuppUndo.is() )
2533 m_xReportDefinition = xReportDefinition;
2538void OReportController::openSortingAndGroupingDialog()
2540 if ( !m_xReportDefinition.is() )
2542 if (!m_xGroupsFloater)
2544 m_xGroupsFloater = std::make_shared<OGroupsSortingDialog>(getFrameWeld(), !isEditable(),
this);
2545 SvtViewOptions aDlgOpt(EViewType::Window, m_xGroupsFloater->get_help_id());
2547 m_xGroupsFloater->getDialog()->set_window_state(aDlgOpt.
GetWindowState());
2551 if (!m_xGroupsFloater->getDialog()->get_visible())
2558sal_Int32 OReportController::getGroupPosition(
const uno::Reference< report::XGroup >& _xGroup)
2570 const sal_Int32 nSelectionCount = getDesignView()->getMarkedObjectCount();
2571 if ( m_nSelectionCount != nSelectionCount )
2573 m_nSelectionCount = nSelectionCount;
2576 lang::EventObject
aEvent(*
this);
2577 m_aSelectionListeners.forEach(
2578 [&
aEvent] (uno::Reference<view::XSelectionChangeListener>
const& xListener) {
2579 return xListener->selectionChanged(
aEvent);
2585 const OUString sUndoAction =
RptResId(pUndoStrId);
2586 UndoContext aUndoContext( getUndoManager(), sUndoAction );
2587 _pMemfun( getDesignView() );
2588 InvalidateFeature( SID_UNDO );
2593 const OUString sUndoAction =
RptResId(pUndoStrId);
2594 UndoContext aUndoContext( getUndoManager(), sUndoAction );
2595 getDesignView()->alignMarkedObjects(_nControlModification,_bAlignAtSection);
2596 InvalidateFeature( SID_UNDO );
2599void OReportController::shrinkSectionBottom(
const uno::Reference<report::XSection>& _xSection)
2601 const sal_Int32
nElements = _xSection->getCount();
2607 const sal_Int32 nSectionHeight = _xSection->getHeight();
2608 sal_Int32 nMaxPositionY = 0;
2609 uno::Reference< report::XReportComponent> xReportComponent;
2614 xReportComponent.set(_xSection->getByIndex(
i), uno::UNO_QUERY);
2615 const sal_Int32 nReportComponentPositionY = xReportComponent->getPositionY();
2616 const sal_Int32 nReportComponentHeight = xReportComponent->getHeight();
2617 const sal_Int32 nReportComponentPositionYAndHeight = nReportComponentPositionY + nReportComponentHeight;
2618 nMaxPositionY = std::max(nReportComponentPositionYAndHeight, nMaxPositionY);
2622 if (nMaxPositionY > (nSectionHeight - 7) )
2627 _xSection->setHeight(nMaxPositionY);
2630void OReportController::shrinkSectionTop(
const uno::Reference<report::XSection>& _xSection)
2632 const sal_Int32
nElements = _xSection->getCount();
2639 const sal_Int32 nSectionHeight = _xSection->getHeight();
2640 sal_Int32 nMinPositionY = nSectionHeight;
2641 uno::Reference< report::XReportComponent> xReportComponent;
2646 xReportComponent.set(_xSection->getByIndex(
i), uno::UNO_QUERY);
2647 const sal_Int32 nReportComponentPositionY = xReportComponent->getPositionY();
2648 nMinPositionY = std::min(nReportComponentPositionY, nMinPositionY);
2651 if (nMinPositionY == 0)
2658 xReportComponent.set(_xSection->getByIndex(
i), uno::UNO_QUERY);
2659 const sal_Int32 nReportComponentPositionY = xReportComponent->getPositionY();
2660 const sal_Int32 nNewPositionY = nReportComponentPositionY - nMinPositionY;
2661 xReportComponent->setPositionY(nNewPositionY);
2663 const sal_Int32 nNewSectionHeight = nSectionHeight - nMinPositionY;
2664 _xSection->setHeight(nNewSectionHeight);
2667void OReportController::shrinkSection(
TranslateId pUndoStrId,
const uno::Reference<report::XSection>& _xSection, sal_Int32 _nSid)
2669 if ( _xSection.is() )
2671 const OUString sUndoAction =
RptResId(pUndoStrId);
2672 UndoContext aUndoContext( getUndoManager(), sUndoAction );
2674 if (_nSid == SID_SECTION_SHRINK)
2676 shrinkSectionTop(_xSection);
2677 shrinkSectionBottom(_xSection);
2679 else if (_nSid == SID_SECTION_SHRINK_TOP)
2681 shrinkSectionTop(_xSection);
2683 else if (_nSid == SID_SECTION_SHRINK_BOTTOM)
2685 shrinkSectionBottom(_xSection);
2689 InvalidateFeature( SID_UNDO );
2695 ::osl::MutexGuard aGuard(
getMutex() );
2697 const sal_Int32 nCommandIDs[] =
2703 SID_SHOW_PROPERTYBROWSER,
2704 SID_PROPERTYBROWSER_LAST_PAGE,
2709 for (sal_Int32 nCommandID : nCommandIDs)
2711 const FeatureState aFeatureState =
GetState( nCommandID );
2713 OUString sCommandURL( getURLForId( nCommandID ).Main );
2714 OSL_ENSURE( sCommandURL.startsWith(
".uno:" ),
"OReportController::getViewData: illegal command URL!" );
2715 sCommandURL = sCommandURL.copy( 5 );
2718 if ( !!aFeatureState.bChecked )
2719 aCommandState <<= *aFeatureState.bChecked;
2720 else if ( aFeatureState.aValue.hasValue() )
2721 aCommandState = aFeatureState.aValue;
2723 aCommandProperties.
put( sCommandURL, aCommandState );
2729 if ( getDesignView() )
2731 ::std::vector<sal_uInt16> aCollapsedPositions;
2732 getDesignView()->fillCollapsedSections(aCollapsedPositions);
2733 if ( !aCollapsedPositions.empty() )
2735 uno::Sequence<beans::PropertyValue> aCollapsedSections(aCollapsedPositions.size());
2736 beans::PropertyValue* pCollapsedIter = aCollapsedSections.getArray();
2738 for (
const auto& rPos : aCollapsedPositions)
2741 pCollapsedIter->Value <<=
static_cast<sal_Int32
>(rPos);
2746 aViewData.
put(
"CollapsedSections", aCollapsedSections );
2749 OSectionWindow* pSectionWindow = getDesignView()->getMarkedSection();
2750 if ( pSectionWindow )
2756 aViewData.
put(
"ZoomFactor", m_nZoomValue );
2760void SAL_CALL OReportController::restoreViewData(
const uno::Any& i_data)
2762 ::osl::MutexGuard aGuard(
getMutex() );
2766 const ::comphelper::NamedValueCollection aViewData( i_data );
2768 m_aCollapsedSections = aViewData.getOrDefault(
"CollapsedSections", m_aCollapsedSections );
2769 m_nPageNum = aViewData.getOrDefault(
"MarkedSection", m_nPageNum );
2770 m_nZoomValue = aViewData.getOrDefault(
"ZoomFactor", m_nZoomValue );
2777 const ::std::vector< OUString > aCommandNames( aCommandProperties.
getNames() );
2779 for (
const auto& rCommandName : aCommandNames )
2781 const Any& rCommandValue = aCommandProperties.
get( rCommandName );
2788 aCommand.Complete =
".uno:" + rCommandName;
2794 if ( rCommandName ==
"ShowRuler" )
2795 OSL_VERIFY( rCommandValue >>= m_bShowRuler );
2796 else if ( rCommandName ==
"HelplinesMove" )
2797 OSL_VERIFY( rCommandValue >>= m_bHelplinesMove );
2798 else if ( rCommandName ==
"GridVisible" )
2799 OSL_VERIFY( rCommandValue >>= m_bGridVisible );
2800 else if ( rCommandName ==
"GridUse" )
2801 OSL_VERIFY( rCommandValue >>= m_bGridUse );
2802 else if ( rCommandName ==
"ControlProperties" )
2803 OSL_VERIFY( rCommandValue >>= m_bShowProperties );
2804 else if ( rCommandName ==
"LastPropertyBrowserPage" )
2805 OSL_VERIFY( rCommandValue >>= m_sLastActivePage );
2806 else if ( rCommandName ==
"SplitPosition" )
2807 OSL_VERIFY( rCommandValue >>= m_nSplitPos );
2811 catch(
const IllegalArgumentException&)
2823 const sal_Int32 nFrameSearchFlag = frame::FrameSearchFlag::TASKS | frame::FrameSearchFlag::CREATE;
2829uno::Reference<frame::XModel> OReportController::executeReport()
2831 OSL_ENSURE(m_xReportDefinition.is(),
"Where is my report?");
2833 uno::Reference<frame::XModel>
xModel;
2834 if ( m_xReportDefinition.is() )
2837 bool bEnabled = !m_xReportDefinition->getCommand().isEmpty();
2841 const sal_uInt16
nCount = m_aReportModel->GetPageCount();
2843 for (;
i <
nCount && !bEnabled ; ++
i)
2845 const SdrPage* pPage = m_aReportModel->GetPage(
i);
2849 pErrorId = RID_ERR_NO_OBJECTS;
2855 sdb::SQLContext aFirstMessage;
2856 OUString sInfo =
RptResId( pErrorId );
2857 aFirstMessage.Message = sInfo;
2858 aInfo = aFirstMessage;
2861 sal_uInt16 nCommand = 0;
2862 if (pErrorId != RID_ERR_NO_COMMAND)
2864 if ( !m_bShowProperties )
2865 executeUnChecked(SID_SHOW_PROPERTYBROWSER, {});
2867 m_sLastActivePage =
"Data";
2868 getDesignView()->setCurrentPage(m_sLastActivePage);
2869 nCommand = SID_SELECT_REPORT;
2871 else if ( getDesignView() && !getDesignView()->isAddFieldVisible() )
2873 nCommand = SID_FM_ADD_FIELD;
2877 executeUnChecked(nCommand, {});
2883 m_bInGeneratePreview =
true;
2887 if ( !m_xReportEngine.is() )
2888 m_xReportEngine.set( report::ReportEngine::create(
m_xContext) );
2889 m_xReportEngine->setReportDefinition(m_xReportDefinition);
2894 catch(
const sdbc::SQLException&)
2896 aInfo = ::cppu::getCaughtException();
2898 catch(
const uno::Exception& e)
2900 uno::Any aCaughtException( ::cppu::getCaughtException() );
2903 sdb::SQLContext aFirstMessage;
2904 OUString sInfo(
RptResId(RID_STR_CAUGHT_FOREIGN_EXCEPTION));
2905 sInfo = sInfo.replaceAll(
"$type$", aCaughtException.getValueTypeName());
2906 aFirstMessage.Message = sInfo;
2909 sdbc::SQLException aSecondMessage;
2910 aSecondMessage.Message = e.Message;
2911 aSecondMessage.Context = e.Context;
2914 sdbc::SQLException aThirdMessage;
2915 lang::WrappedTargetException aWrapped;
2916 if ( aCaughtException >>= aWrapped )
2918 aThirdMessage.Message = aWrapped.Message;
2919 aThirdMessage.Context = aWrapped.Context;
2922 if ( !aThirdMessage.Message.isEmpty() )
2923 aSecondMessage.NextException <<= aThirdMessage;
2924 aFirstMessage.NextException <<= aSecondMessage;
2926 aInfo = aFirstMessage;
2930 const OUString suSQLContext =
RptResId( RID_STR_COULD_NOT_CREATE_REPORT );
2933 m_bInGeneratePreview =
false;
2944uno::Reference< frame::XModel > SAL_CALL OReportController::getModel()
2946 return m_xReportDefinition;
2949uno::Reference< sdbc::XRowSet >
const & OReportController::getRowSet()
2951 OSL_PRECOND( m_xReportDefinition.is(),
"OReportController::getRowSet: no report definition?!" );
2953 if ( m_xRowSet.is() || !m_xReportDefinition.is() )
2958 uno::Reference< sdbc::XRowSet > xRowSet(
2959 getORB()->getServiceManager()->createInstanceWithContext(
"com.sun.star.sdb.RowSet", getORB()),
2961 uno::Reference< beans::XPropertySet> xRowSetProp( xRowSet, uno::UNO_QUERY_THROW );
2966 auto aNoConverter = std::make_shared<AnyConverter>();
2973 m_xRowSetMediator =
new OPropertyMediator( m_xReportDefinition, xRowSetProp, std::move(aPropertyMediation) );
2974 m_xRowSet = xRowSet;
2976 catch(
const uno::Exception&)
2984void OReportController::insertGraphic()
2986 const OUString sTitle(
RptResId(RID_STR_IMPORT_GRAPHIC));
2990 uno::Reference< report::XSection> xSection = getDesignView()->getCurrentSection();
2991 ::sfx2::FileDialogHelper aDialog(ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW, FileDialogFlags::Graphic, getFrameWeld());
2996 xController->setValue(ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_PREVIEW, 0, css::uno::Any(
true));
2997 xController->enableControl(ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_LINK,
false);
2998 xController->setValue( ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_LINK, 0, css::uno::Any(
true) );
3003 xController->getValue( ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_LINK, 0) >>= bLink;
3008 createControl(aArgs,xSection,OUString(),SdrObjKind::ReportDesignImageControl);
3020 ::osl::MutexGuard aGuard(
getMutex() );
3021 if ( !getDesignView() )
3024 getDesignView()->unmarkAllObjects();
3025 getDesignView()->SetMode(DlgEdMode::Select);
3027 uno::Sequence< uno::Reference<report::XReportComponent> > aElements;
3028 if ( aSelection >>= aElements )
3030 if ( aElements.hasElements() )
3031 getDesignView()->showProperties(uno::Reference<uno::XInterface>(aElements[0],uno::UNO_QUERY));
3032 getDesignView()->setMarked(aElements,
true);
3036 uno::Reference<uno::XInterface> xObject(aSelection,uno::UNO_QUERY);
3037 uno::Reference<report::XReportComponent> xProp(xObject,uno::UNO_QUERY);
3040 getDesignView()->showProperties(xObject);
3041 aElements = { xProp };
3042 getDesignView()->setMarked(aElements,
true);
3046 uno::Reference<report::XSection> xSection(aSelection,uno::UNO_QUERY);
3047 if ( !xSection.is() && xObject.is() )
3048 getDesignView()->showProperties(xObject);
3049 getDesignView()->setMarked(xSection,xSection.is());
3056Any SAL_CALL OReportController::getSelection( )
3058 ::osl::MutexGuard aGuard(
getMutex() );
3060 if ( getDesignView() )
3062 aRet = getDesignView()->getCurrentlyShownProperty();
3064 aRet <<= getDesignView()->getCurrentSection();
3071 m_aSelectionListeners.addInterface( Listener );
3076 m_aSelectionListeners.removeInterface( Listener );
3079void OReportController::createNewFunction(
const uno::Any& _aValue)
3081 uno::Reference< container::XIndexContainer> xFunctions(_aValue,uno::UNO_QUERY_THROW);
3082 const OUString sNewName =
RptResId(RID_STR_FUNCTION);
3083 uno::Reference< report::XFunction> xFunction(report::Function::create(
m_xContext));
3084 xFunction->setName(sNewName);
3086 xFunctions->insertByIndex(xFunctions->getCount(),
uno::Any(xFunction));
3097 getDesignView()->setMarked(_xSection,
true);
3098 OSectionWindow* pSectionWindow = getDesignView()->getMarkedSection();
3099 if ( !pSectionWindow )
3112 uno::Reference< report::XReportComponent> xShapeProp;
3113 if ( _nObjectId == SdrObjKind::CustomShape )
3117 SdrInventor::ReportDesign,
3119 xShapeProp.set(pNewControl->getUnoShape(),uno::UNO_QUERY);
3120 OUString sCustomShapeType = getDesignView()->GetInsertObjString();
3121 if ( sCustomShapeType.isEmpty() )
3122 sCustomShapeType =
"diamond";
3123 OReportSection::createDefault(sCustomShapeType,pNewControl.get());
3126 else if ( _nObjectId == SdrObjKind::OLE2 || SdrObjKind::ReportDesignSubReport == _nObjectId )
3130 SdrInventor::ReportDesign,
3134 xShapeProp.set(pNewControl->getUnoShape(),uno::UNO_QUERY_THROW);
3136 if ( pObj && !pObj->
IsEmpty() )
3147 getDesignView()->GetOutDev(),
3153 SdrInventor::ReportDesign,
3154 SdrObjKind::ReportDesignFixedText,
3166 pNewControl = pControl;
3171 uno::Reference<beans::XPropertySet> xUnoProp(pObj->
GetUnoControlModel(),uno::UNO_QUERY);
3172 xShapeProp.set(pObj->
getUnoShape(),uno::UNO_QUERY);
3173 uno::Reference<beans::XPropertySetInfo> xShapeInfo = xShapeProp->getPropertySetInfo();
3174 uno::Reference<beans::XPropertySetInfo> xInfo = xUnoProp->getPropertySetInfo();
3185 for(
const auto & sProp : sProps)
3187 if ( xInfo->hasPropertyByName(sProp) && xShapeInfo->hasPropertyByName(sProp) )
3188 xUnoProp->setPropertyValue(sProp,xShapeProp->getPropertyValue(sProp));
3197 ReportFormula aFunctionFormula( ReportFormula::Expression, _sFunction );
3211 if ( _nObjectId == SdrObjKind::ReportDesignFixedText )
3213 else if ( _nObjectId == SdrObjKind::ReportDesignVerticalFixedLine )
3215 awt::Size aOlSize = xShapeProp->getSize();
3216 xShapeProp->setSize(awt::Size(aOlSize.Height,aOlSize.Width));
3221 const sal_Int32 nShapeWidth =
aMap.getUnpackedValueOrDefault(
PROPERTY_WIDTH,xShapeProp->getWidth());
3222 if ( nShapeWidth != xShapeProp->getWidth() )
3223 xShapeProp->setWidth( nShapeWidth );
3225 const bool bChangedPos = (aPos.X + nShapeWidth) > nPaperWidth;
3227 aPos.X = nPaperWidth - nShapeWidth;
3228 xShapeProp->setPosition(aPos);
3235 getDesignView()->unmarkAllObjects();
3237 const OUString sUndoAction(
RptResId(RID_STR_UNDO_INSERT_CONTROL));
3238 UndoContext aUndoContext( getUndoManager(), sUndoAction );
3243 uno::Reference< report::XSection> xSection =
aMap.getUnpackedValueOrDefault(
PROPERTY_SECTION,uno::Reference< report::XSection>());
3249 sFunction =
"TODAY()";
3250 createControl(
aMap.getAsConstPropertyValueList(),xSection,sFunction);
3255 sFunction =
"TIMEVALUE(NOW())";
3257 createControl(
aMap.getAsConstPropertyValueList(),xSection,sFunction);
3263 getDesignView()->unmarkAllObjects();
3265 const OUString sUndoAction(
RptResId(RID_STR_UNDO_INSERT_CONTROL));
3266 UndoContext aUndoContext( getUndoManager(), sUndoAction );
3268 if ( !m_xReportDefinition->getPageHeaderOn() )
3270 uno::Sequence< beans::PropertyValue > aArgs;
3271 executeChecked(SID_PAGEHEADERFOOTER,aArgs);
3277 OUString sFunction(
RptResId(STR_RPT_PN_PAGE) );
3278 sFunction = sFunction.replaceFirst(
"#PAGENUMBER#",
"PageNumber()");
3282 sFunction +=
RptResId(STR_RPT_PN_PAGE_OF);
3283 sFunction = sFunction.replaceFirst(
"#PAGECOUNT#",
"PageCount()");
3287 createControl(_aArgs,bInPageHeader ? m_xReportDefinition->getPageHeader() : m_xReportDefinition->getPageFooter(),sFunction);
3293 getDesignView()->unmarkAllObjects();
3297 pSectionWindow[0] = getDesignView()->getMarkedSection();
3299 if ( !pSectionWindow[0] )
3301 select(
uno::Any(m_xReportDefinition->getDetail()));
3302 pSectionWindow[0] = getDesignView()->getMarkedSection();
3303 if ( !pSectionWindow[0] )
3307 uno::Reference<report::XSection> xCurrentSection = getDesignView()->getCurrentSection();
3312 bool bHandleOnlyOne =
false;
3313 for(
const PropertyValue& rArg : aArgs)
3318 if ( !(rArg.Value >>= aValue) )
3320 bHandleOnlyOne =
true;
3325 uno::Reference<report::XSection> xSection =
aMap.getUnpackedValueOrDefault(
"Section",xCurrentSection);
3326 uno::Reference<report::XReportDefinition> xReportDefinition = xSection->getReportDefinition();
3328 getDesignView()->setMarked(xSection,
true);
3329 pSectionWindow[0] = getDesignView()->getMarkedSection();
3338 pSectionWindow[1] = pSectionWindow[0];
3343 pSectionWindow[1] = getDesignView()->getMarkedSection(bLabelAboveTextField ?
PREVIOUS :
POST);
3344 if (!pSectionWindow[1])
3347 pSectionWindow[1] = pSectionWindow[0];
3351 getDesignView()->unmarkAllObjects();
3354 uno::Reference< lang::XComponent > xHoldAlive;
3358 OUString sColumnName;
3359 sal_Int32 nCommandType( -1 );
3364 uno::Reference< container::XNameAccess > xColumns;
3365 uno::Reference< sdbc::XConnection > xConnection(
getConnection() );
3366 if ( !sCommand.isEmpty() && nCommandType != -1 && !sColumnName.isEmpty() && xConnection.is() )
3368 if ( xReportDefinition->getCommand().isEmpty() )
3370 xReportDefinition->setCommand(sCommand);
3371 xReportDefinition->setCommandType(nCommandType);
3375 if ( xColumns.is() && xColumns->hasByName(sColumnName) )
3376 xField.set( xColumns->getByName( sColumnName ), uno::UNO_QUERY );
3381 #if OSL_DEBUG_LEVEL > 0
3384 uno::Reference< beans::XPropertySet > xRowSetProps( getRowSet(), UNO_QUERY_THROW );
3385 OUString sRowSetCommand;
3386 sal_Int32 nRowSetCommandType( -1 );
3387 OSL_VERIFY( xRowSetProps->getPropertyValue(
PROPERTY_COMMAND ) >>= sRowSetCommand );
3389 OSL_ENSURE( ( sRowSetCommand == sCommand ) && ( nCommandType == nRowSetCommandType ),
3390 "OReportController::addPairControls: this only works for a data source which equals our current settings!" );
3403 uno::Reference< sdb::XParametersSupplier > xSuppParam( getRowSet(), uno::UNO_QUERY_THROW );
3404 uno::Reference< container::XIndexAccess > xParams( xSuppParam->getParameters(), uno::UNO_SET_THROW );
3405 sal_Int32 nParamCount( xParams->getCount() );
3406 for ( sal_Int32
i=0;
i<nParamCount; ++
i)
3408 uno::Reference< beans::XPropertySet > xParamCol( xParams->getByIndex(
i), uno::UNO_QUERY_THROW );
3409 OUString sParamName;
3410 OSL_VERIFY( xParamCol->getPropertyValue(
"Name") >>= sParamName );
3411 if ( sParamName == sColumnName )
3423 sal_Int32
nDataType = sdbc::DataType::BINARY;
3427 case sdbc::DataType::BINARY:
3428 case sdbc::DataType::VARBINARY:
3429 case sdbc::DataType::LONGVARBINARY:
3430 nOBJID = SdrObjKind::ReportDesignImageControl;
3433 nOBJID = SdrObjKind::ReportDesignFormattedField;
3437 if ( nOBJID == SdrObjKind::NONE )
3441 if ( !xSupplier.is() )
3454 getDesignView()->GetOutDev(),
3460 SdrInventor::ReportDesign,
3461 SdrObjKind::ReportDesignFixedText,
3471 if ( pControl[0] && pControl[1] )
3476 if ( pPgViews[0] && pPgViews[1] )
3478 OUString sDefaultName;
3483 pObjs[
i] =
dynamic_cast<OUnoObject*
>(pControl[
i].get());
3485 uno::Reference<beans::XPropertySet> xUnoProp(pObjs[
i]->GetUnoControlModel(),uno::UNO_QUERY_THROW);
3486 uno::Reference< report::XReportComponent> xShapeProp(pObjs[
i]->getUnoShape(),uno::UNO_QUERY_THROW);
3489 uno::Reference<beans::XPropertySetInfo> xShapeInfo = xShapeProp->getPropertySetInfo();
3490 uno::Reference<beans::XPropertySetInfo> xInfo = xUnoProp->getPropertySetInfo();
3497 for(
const auto & sProp : sProps)
3499 if ( xInfo->hasPropertyByName(sProp) && xShapeInfo->hasPropertyByName(sProp) )
3500 xUnoProp->setPropertyValue(sProp,xShapeProp->getPropertyValue(sProp));
3506 sDefaultName =
sName;
3516 pObjs[
i]->CreateMediator(
true);
3518 const sal_Int32 nShapeWidth = xShapeProp->getWidth();
3519 const bool bChangedPos = (aPos.X + nShapeWidth) > nPaperWidth;
3521 aPos.X = nPaperWidth - nShapeWidth;
3522 xShapeProp->setPosition(aPos);
3524 aPos.Y += xShapeProp->getHeight();
3525 aPos.X += nShapeWidth;
3528 if ( xField->getPropertySetInfo()->hasPropertyByName(
PROPERTY_LABEL) )
3531 if (pSectionViews[0] != pSectionViews[1] &&
3532 nOBJID == SdrObjKind::ReportDesignFormattedField)
3534 uno::Reference< report::XReportComponent> xShapePropLabel(pObjs[0]->getUnoShape(),uno::UNO_QUERY_THROW);
3535 uno::Reference< report::XReportComponent> xShapePropTextField(pObjs[1]->getUnoShape(),uno::UNO_QUERY_THROW);
3536 if ( !sLabel.isEmpty() )
3537 xShapePropTextField->setName(sLabel);
3538 awt::Point aPosLabel = xShapePropLabel->getPosition();
3539 awt::Point aPosTextField = xShapePropTextField->getPosition();
3540 aPosTextField.X = aPosLabel.X;
3541 xShapePropTextField->setPosition(aPosTextField);
3542 if (bLabelAboveTextField)
3546 aPosLabel.Y = xLabelSection->getHeight() - xShapePropLabel->getHeight();
3553 xShapePropLabel->setPosition(aPosLabel);
3557 uno::Reference< report::XFixedText> xShapeProp(pObj->getUnoShape(),uno::UNO_QUERY_THROW);
3558 xShapeProp->setName(xShapeProp->getName() + sDefaultName );
3565 if (!bLabelAboveTextField )
3567 if ( pSectionViews[0] == pSectionViews[1] )
3574 aLabelAndTextfield.
Union(aTextfield);
3577 bool bOverlapping =
true;
3578 bool bHasToMove =
false;
3579 while ( bOverlapping )
3581 const SdrObject* pOverlappedObj =
isOver(aLabelAndTextfield, *pSectionWindow[0]->getReportSection().getPage(), *pSectionViews[0],
true, pControl, 2);
3582 bOverlapping = pOverlappedObj !=
nullptr;
3595 aTextfield.
Move(0, aLabelAndTextfield.
Top() - aTextfield.
Top());
3597 uno::Reference< report::XReportComponent> xLabel(pControl[0]->getUnoShape(),uno::UNO_QUERY_THROW);
3598 xLabel->setPositionY(
aLabel.Top());
3600 uno::Reference< report::XReportComponent> xTextfield(pControl[1]->getUnoShape(),uno::UNO_QUERY_THROW);
3601 xTextfield->setPositionY(aTextfield.
Top());
3619 OSectionWindow* pSectionWindow = getDesignView()->getMarkedSection();
3620 if ( pSectionWindow )
3622 return pSectionView;
3625void OReportController::changeZOrder(sal_Int32 _nId)
3628 if ( !pSectionView )
3633 case SID_FRAME_TO_BOTTOM:
3636 case SID_FRAME_TO_TOP:
3639 case SID_FRAME_DOWN:
3646 case SID_OBJECT_HEAVEN:
3649 case SID_OBJECT_HELL:
3655void OReportController::listen(
const bool _bAdd)
3662 void (SAL_CALL
XPropertySet::*pPropertyListenerAction)(
const OUString&,
const uno::Reference< XPropertyChangeListener >& ) =
3663 _bAdd ? &XPropertySet::addPropertyChangeListener : &XPropertySet::removePropertyChangeListener;
3665 for (
const auto & aProp : aProps)
3666 (m_xReportDefinition.get()->*pPropertyListenerAction)( aProp,
static_cast< XPropertyChangeListener*
>(
this ) );
3669 uno::Reference< XPropertyChangeListener > xUndo = &rUndoEnv;
3670 const uno::Sequence< beans::Property>
aSeq = m_xReportDefinition->getPropertySetInfo()->getProperties();
3671 const OUString* pPropsBegin = &aProps[0];
3672 const OUString* pPropsEnd = pPropsBegin +
SAL_N_ELEMENTS(aProps) - 3;
3673 for(
const beans::Property& rProp :
aSeq)
3675 if ( ::std::find(pPropsBegin,pPropsEnd,rProp.Name) == pPropsEnd )
3676 (m_xReportDefinition.get()->*pPropertyListenerAction)( rProp.Name, xUndo );
3680 void (
OXUndoEnvironment::*pElementUndoFunction)(
const uno::Reference< uno::XInterface >& ) =
3681 _bAdd ? &OXUndoEnvironment::AddElement : &OXUndoEnvironment::RemoveElement;
3683 (rUndoEnv.*pElementUndoFunction)( m_xReportDefinition->getStyleFamilies() );
3684 (rUndoEnv.*pElementUndoFunction)( m_xReportDefinition->getFunctions() );
3689 if ( m_xReportDefinition->getPageHeaderOn() && _bAdd )
3691 getDesignView()->addSection(m_xReportDefinition->getPageHeader(),
DBPAGEHEADER);
3692 rObserver.
AddSection(m_xReportDefinition->getPageHeader());
3694 if ( m_xReportDefinition->getReportHeaderOn() && _bAdd )
3696 getDesignView()->addSection(m_xReportDefinition->getReportHeader(),
DBREPORTHEADER);
3697 rObserver.
AddSection(m_xReportDefinition->getReportHeader());
3700 uno::Reference< report::XGroups > xGroups = m_xReportDefinition->getGroups();
3701 const sal_Int32
nCount = xGroups->getCount();
3702 _bAdd ? xGroups->addContainerListener(&rUndoEnv) : xGroups->removeContainerListener(&rUndoEnv);
3703 _bAdd ? xGroups->addContainerListener(&rObserver) : xGroups->removeContainerListener(&rObserver);
3707 uno::Reference< report::XGroup > xGroup(xGroups->getByIndex(
i),uno::UNO_QUERY);
3708 (xGroup.get()->*pPropertyListenerAction)( OUString(
PROPERTY_HEADERON),
static_cast< XPropertyChangeListener*
>( this ) );
3709 (xGroup.get()->*pPropertyListenerAction)( OUString(
PROPERTY_FOOTERON),
static_cast< XPropertyChangeListener*
>( this ) );
3711 (rUndoEnv.*pElementUndoFunction)( xGroup );
3712 (rUndoEnv.*pElementUndoFunction)( xGroup->getFunctions() );
3713 if ( xGroup->getHeaderOn() && _bAdd )
3715 getDesignView()->addSection(xGroup->getHeader(),
DBGROUPHEADER);
3722 getDesignView()->addSection(m_xReportDefinition->getDetail(),
DBDETAIL);
3723 rObserver.
AddSection(m_xReportDefinition->getDetail());
3727 uno::Reference< report::XGroup > xGroup(xGroups->getByIndex(
i-1),uno::UNO_QUERY);
3728 if ( xGroup->getFooterOn() )
3730 getDesignView()->addSection(xGroup->getFooter(),
DBGROUPFOOTER);
3734 if ( m_xReportDefinition->getReportFooterOn() )
3736 getDesignView()->addSection(m_xReportDefinition->getReportFooter(),
DBREPORTFOOTER);
3737 rObserver.
AddSection(m_xReportDefinition->getReportFooter());
3739 if ( m_xReportDefinition->getPageFooterOn())
3741 getDesignView()->addSection(m_xReportDefinition->getPageFooter(),
DBPAGEFOOTER);
3742 rObserver.
AddSection(m_xReportDefinition->getPageFooter());
3745 xGroups->addContainerListener(
static_cast<XContainerListener*
>(
this));
3746 m_xReportDefinition->addModifyListener(
static_cast<XModifyListener*
>(
this));
3751 xGroups->removeContainerListener(
static_cast<XContainerListener*
>(
this));
3752 m_xReportDefinition->removeModifyListener(
static_cast<XModifyListener*
>(
this));
3753 m_aReportModel->detachController();
3757void OReportController::switchReportSection(
const sal_Int16 _nId)
3759 OSL_ENSURE(_nId == SID_REPORTHEADER_WITHOUT_UNDO || _nId == SID_REPORTFOOTER_WITHOUT_UNDO || _nId == SID_REPORTHEADERFOOTER ,
"Illegal id given!");
3761 if ( !m_xReportDefinition.is() )
3765 const bool bSwitchOn = !m_xReportDefinition->getReportHeaderOn();
3767 std::unique_ptr< UndoContext > pUndoContext;
3768 if ( SID_REPORTHEADERFOOTER == _nId )
3770 const OUString sUndoAction(
RptResId(bSwitchOn ? RID_STR_UNDO_ADD_REPORTHEADERFOOTER : RID_STR_UNDO_REMOVE_REPORTHEADERFOOTER));
3771 pUndoContext.reset(
new UndoContext( getUndoManager(), sUndoAction ) );
3773 addUndoAction(std::make_unique<OReportSectionUndo>(*m_aReportModel,SID_REPORTHEADER_WITHOUT_UNDO
3774 ,::std::mem_fn(&OReportHelper::getReportHeader)
3775 ,m_xReportDefinition
3779 addUndoAction(std::make_unique<OReportSectionUndo>(*m_aReportModel,SID_REPORTFOOTER_WITHOUT_UNDO
3780 ,::std::mem_fn(&OReportHelper::getReportFooter)
3781 ,m_xReportDefinition
3788 case SID_REPORTHEADER_WITHOUT_UNDO:
3789 m_xReportDefinition->setReportHeaderOn( bSwitchOn );
3791 case SID_REPORTFOOTER_WITHOUT_UNDO:
3792 m_xReportDefinition->setReportFooterOn( !m_xReportDefinition->getReportFooterOn() );
3794 case SID_REPORTHEADERFOOTER:
3795 m_xReportDefinition->setReportHeaderOn( bSwitchOn );
3796 m_xReportDefinition->setReportFooterOn( bSwitchOn );
3800 if ( SID_REPORTHEADERFOOTER == _nId )
3801 pUndoContext.reset();
3805void OReportController::switchPageSection(
const sal_Int16 _nId)
3807 OSL_ENSURE(_nId == SID_PAGEHEADERFOOTER || _nId == SID_PAGEHEADER_WITHOUT_UNDO || _nId == SID_PAGEFOOTER_WITHOUT_UNDO ,
"Illegal id given!");
3808 if ( !m_xReportDefinition.is() )
3812 const bool bSwitchOn = !m_xReportDefinition->getPageHeaderOn();
3814 std::unique_ptr< UndoContext > pUndoContext;
3815 if ( SID_PAGEHEADERFOOTER == _nId )
3817 const OUString sUndoAction(
RptResId(bSwitchOn ? RID_STR_UNDO_ADD_REPORTHEADERFOOTER : RID_STR_UNDO_REMOVE_REPORTHEADERFOOTER));
3818 pUndoContext.reset(
new UndoContext( getUndoManager(), sUndoAction ) );
3820 addUndoAction(std::make_unique<OReportSectionUndo>(*m_aReportModel
3821 ,SID_PAGEHEADER_WITHOUT_UNDO
3822 ,::std::mem_fn(&OReportHelper::getPageHeader)
3823 ,m_xReportDefinition
3827 addUndoAction(std::make_unique<OReportSectionUndo>(*m_aReportModel
3828 ,SID_PAGEFOOTER_WITHOUT_UNDO
3829 ,::std::mem_fn(&OReportHelper::getPageFooter)
3830 ,m_xReportDefinition
3836 case SID_PAGEHEADER_WITHOUT_UNDO:
3837 m_xReportDefinition->setPageHeaderOn( bSwitchOn );
3839 case SID_PAGEFOOTER_WITHOUT_UNDO:
3840 m_xReportDefinition->setPageFooterOn( !m_xReportDefinition->getPageFooterOn() );
3842 case SID_PAGEHEADERFOOTER:
3843 m_xReportDefinition->setPageHeaderOn( bSwitchOn );
3844 m_xReportDefinition->setPageFooterOn( bSwitchOn );
3847 if ( SID_PAGEHEADERFOOTER == _nId )
3848 pUndoContext.reset();
3854 if ( !m_xReportDefinition.is() )
3860 uno::Reference< report::XGroup > xGroup =
aMap.getUnpackedValueOrDefault(
PROPERTY_GROUP, uno::Reference< report::XGroup >() );
3865 uno::Reference< report::XGroups > xGroups = m_xReportDefinition->getGroups();
3870 rUndoEnv.
AddElement( xGroup->getFunctions() );
3873 addUndoAction( std::make_unique<OGroupUndo>(
3875 _bAppend ? RID_STR_UNDO_APPEND_GROUP : RID_STR_UNDO_REMOVE_GROUP,
3884 const sal_Int32
nPos = getGroupPosition( xGroup );
3886 xGroups->removeByIndex(
nPos );
3898 if ( !m_xReportDefinition.is() )
3903 uno::Reference< report::XGroup> xGroup =
aMap.getUnpackedValueOrDefault(
PROPERTY_GROUP,uno::Reference< report::XGroup>());
3909 addUndoAction(std::make_unique<OGroupSectionUndo>(*m_aReportModel
3910 ,_bHeader ? SID_GROUPHEADER_WITHOUT_UNDO : SID_GROUPFOOTER_WITHOUT_UNDO
3911 ,_bHeader ? ::std::mem_fn(&OGroupHelper::getHeader) : ::std::mem_fn(&OGroupHelper::getFooter)
3915 (bSwitchOn ? RID_STR_UNDO_ADD_GROUP_HEADER : RID_STR_UNDO_REMOVE_GROUP_HEADER)
3916 :(bSwitchOn ? RID_STR_UNDO_ADD_GROUP_FOOTER : RID_STR_UNDO_REMOVE_GROUP_FOOTER)
3921 xGroup->setHeaderOn( bSwitchOn );
3923 xGroup->setFooterOn( bSwitchOn );
3926void OReportController::collapseSection(
const bool _bCollapse)
3935void OReportController::markSection(
const bool _bNext)
3941 if ( pPrevSection != pSection && pPrevSection )
3944 select(
uno::Any(m_xReportDefinition));
3948 getDesignView()->markSection(_bNext ? 0 : getDesignView()->getSectionCount() - 1);
3949 pSection = getDesignView()->getMarkedSection();
3955void OReportController::createDefaultControl(
const uno::Sequence< beans::PropertyValue>& _aArgs)
3957 uno::Reference< report::XSection > xSection = getDesignView()->getCurrentSection();
3958 if ( !xSection.is() )
3959 xSection = m_xReportDefinition->getDetail();
3961 if ( !xSection.is() )
3964 const beans::PropertyValue* pIter = _aArgs.getConstArray();
3965 const beans::PropertyValue* pEnd = pIter + _aArgs.getLength();
3966 const beans::PropertyValue* pKeyModifier = ::std::find_if(pIter, pEnd,
3967 [] (
const beans::PropertyValue&
x) ->
bool {
3968 return x.Name ==
"KeyModifier";
3970 sal_Int16 nKeyModifier = 0;
3971 if ( pKeyModifier == pEnd || ((pKeyModifier->Value >>= nKeyModifier) && nKeyModifier ==
KEY_MOD1) )
3974 getDesignView()->unmarkAllObjects();
3975 createControl(aCreateArgs,xSection,OUString(),getDesignView()->GetInsertObj());
3980void OReportController::checkChartEnabled()
3982 if ( m_bChartEnabledAsked )
3985 m_bChartEnabledAsked =
true;
3992 bool bChartEnabled =
false;
3993 static const OUStringLiteral sPropertyName(
u"UserData/Chart" );
3995 aConfiguration.
getNodeValue( sPropertyName ) >>= bChartEnabled;
3996 m_bChartEnabled = bChartEnabled;
4005OUString SAL_CALL OReportController::getTitle()
4008 ::osl::MutexGuard aGuard(
getMutex() );
4010 uno::Reference< frame::XTitle> xTitle(m_xReportDefinition,uno::UNO_QUERY_THROW);
4012 return xTitle->getTitle ();
4015void OReportController::getPropertyDefaultByHandle( sal_Int32 ,
Any& _rDefault )
const
4017 _rDefault <<= sal_Int16(100);
4024 describeProperties(aProps);
4025 return new ::cppu::OPropertyArrayHelper(aProps);
4035void SAL_CALL OReportController::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle,
const Any& _aValue)
4039 _aValue >>= m_nZoomValue;
4040 impl_zoom_nothrow();
4043void SAL_CALL OReportController::setMode(
const OUString& aMode )
4045 ::osl::MutexGuard aGuard(
getMutex() );
4048OUString SAL_CALL OReportController::getMode( )
4050 ::osl::MutexGuard aGuard(
getMutex() );
4053css::uno::Sequence< OUString > SAL_CALL OReportController::getSupportedModes( )
4055 return uno::Sequence< OUString> { OUString(
"remote"), OUString(
"normal") };
4057sal_Bool SAL_CALL OReportController::supportsMode(
const OUString& aMode )
4059 uno::Sequence< OUString> aModes = getSupportedModes();
4063bool OReportController::isUiVisible()
const
4065 return m_sMode !=
"remote";
4074 ::std::vector< uno::Reference< uno::XInterface > > aSelection;
4075 getDesignView()->fillControlModelSelection(aSelection);
4076 _rState.
bEnabled = !aSelection.empty();
4081 ::std::vector< uno::Reference< uno::XInterface > >::const_iterator aIter = aSelection.begin();
4082 for(; aIter != aSelection.end() && _rState.
bEnabled ;++aIter)
4084 uno::Reference< beans::XPropertySet> xProp(*aIter,uno::UNO_QUERY);
4087 uno::Any aTemp2 = xProp->getPropertyValue(_sProperty);
4088 if ( aIter == aSelection.begin() )
4092 else if ( aTemp != aTemp2 )
4095 catch(
const beans::UnknownPropertyException&)
4100 if ( aIter == aSelection.end() )
4104void OReportController::impl_zoom_nothrow()
4108 getDesignView()->zoom(aZoom);
4113bool OReportController::isFormatCommandEnabled(sal_uInt16 _nCommand,
const uno::Reference< report::XReportControlFormat>& _xReportControlFormat)
4116 if ( _xReportControlFormat.is() && !uno::Reference< report::XFixedLine>(_xReportControlFormat,uno::UNO_QUERY).is() )
4120 const awt::FontDescriptor aFontDescriptor = _xReportControlFormat->getFontDescriptor();
4124 case SID_ATTR_CHAR_WEIGHT:
4125 bRet = awt::FontWeight::BOLD == aFontDescriptor.Weight;
4127 case SID_ATTR_CHAR_POSTURE:
4128 bRet = awt::FontSlant_ITALIC == aFontDescriptor.Slant;
4130 case SID_ATTR_CHAR_UNDERLINE:
4131 bRet = awt::FontUnderline::SINGLE == aFontDescriptor.Underline;
4137 catch(
const uno::Exception&)
4146 ::std::vector< uno::Reference< uno::XInterface > > aSelection;
4147 uno::Reference< awt::XWindow> xWindow;
4150 const OUString sUndoAction =
RptResId( pUndoResId );
4151 UndoContext aUndoContext( getUndoManager(), sUndoAction );
4153 for (
const auto& rxInterface : aSelection)
4155 const uno::Reference< beans::XPropertySet > xControlModel(rxInterface,uno::UNO_QUERY);
4156 if ( xControlModel.is() )
4163 xControlModel->setPropertyValue(_sProperty,_aValue);
4165 catch(
const UnknownPropertyException&)
4171 return !aSelection.empty();
4174void OReportController::impl_fillCustomShapeState_nothrow(
const char* _pCustomShapeType,
dbaui::FeatureState& _rState)
const
4177 _rState.
bChecked = getDesignView()->GetInsertObj() == SdrObjKind::CustomShape && getDesignView()->GetInsertObjString().equalsAscii(_pCustomShapeType);
4181OSectionWindow* OReportController::getSectionWindow(
const css::uno::Reference< css::report::XSection>& _xSection)
const
4183 if ( getDesignView() )
4185 return getDesignView()->getSectionWindow(_xSection);
4193void OReportController::openZoomDialog()
4199 { SID_ATTR_ZOOM,
true }
4201 std::vector<SfxPoolItem*> pDefaults
4206 pPool->SetDefaultMetric( MapUnit::Map100thMM );
4207 pPool->FreezeIdRanges();
4212 SvxZoomItem aZoomItem( m_eZoomType, m_nZoomValue, SID_ATTR_ZOOM );
4213 aZoomItem.
SetValueSet(SvxZoomEnableFlags::N100|SvxZoomEnableFlags::WHOLEPAGE|SvxZoomEnableFlags::PAGEWIDTH);
4214 aDescriptor.
Put(aZoomItem);
4217 pDlg->SetLimits( 20, 400 );
4218 bool bCancel = (
RET_CANCEL == pDlg->Execute() );
4222 const SvxZoomItem& rZoomItem = pDlg->GetOutputItemSet()->Get( SID_ATTR_ZOOM );
4223 m_eZoomType = rZoomItem.
GetType();
4224 m_nZoomValue = rZoomItem.GetValue();
4225 if ( m_eZoomType != SvxZoomType::PERCENT )
4226 m_nZoomValue = getDesignView()->getZoomFactor( m_eZoomType );
4228 impl_zoom_nothrow();
4231 catch(
const uno::Exception&)
4243void SAL_CALL OReportController::setVisualAreaSize( ::sal_Int64 _nAspect,
const awt::Size& _aSize )
4245 ::osl::MutexGuard aGuard(
getMutex() );
4247 (m_aVisualAreaSize.Width != _aSize.Width ||
4248 m_aVisualAreaSize.Height != _aSize.Height);
4249 m_aVisualAreaSize = _aSize;
4251 setModified(
true );
4252 m_nAspect = _nAspect;
4255awt::Size SAL_CALL OReportController::getVisualAreaSize( ::sal_Int64 )
4257 ::osl::MutexGuard aGuard(
getMutex() );
4258 return m_aVisualAreaSize;
4261embed::VisualRepresentation SAL_CALL OReportController::getPreferredVisualRepresentation( ::sal_Int64 _nAspect )
4264 ::osl::MutexGuard aGuard(
getMutex() );
4265 embed::VisualRepresentation aResult;
4266 if ( !m_bInGeneratePreview )
4268 m_bInGeneratePreview =
true;
4271 if ( !m_xReportEngine.is() )
4272 m_xReportEngine.set( report::ReportEngine::create(
m_xContext) );
4273 const sal_Int32 nOldMaxRows = m_xReportEngine->getMaxRows();
4275 m_xReportEngine->setReportDefinition(m_xReportDefinition);
4280 if ( xTransfer.is() )
4282 xTransfer->setVisualAreaSize(m_nAspect,m_aVisualAreaSize);
4283 aResult = xTransfer->getPreferredVisualRepresentation( _nAspect );
4286 catch(
const uno::Exception&)
4289 m_xReportEngine->setMaxRows(nOldMaxRows);
4291 catch(
const uno::Exception&)
4294 m_bInGeneratePreview =
false;
4299::sal_Int32 SAL_CALL OReportController::getMapUnit( ::sal_Int64 )
4301 return embed::EmbedMapUnits::ONE_100TH_MM;
4304uno::Reference< container::XNameAccess >
const & OReportController::getColumns()
const
4306 if ( !m_xColumns.is() && m_xReportDefinition.is() && !m_xReportDefinition->getCommand().isEmpty() )
4313OUString OReportController::getColumnLabel_throw(
const OUString& i_sColumnName)
const
4316 uno::Reference< container::XNameAccess > xColumns = getColumns();
4317 if ( xColumns.is() && xColumns->hasByName(i_sColumnName) )
4319 uno::Reference< beans::XPropertySet>
xColumn(xColumns->getByName(i_sColumnName),uno::UNO_QUERY_THROW);
4332 std::shared_ptr< OReportModel > pReportModel( getSdrModel() );
4335 SfxUndoManager* pUndoManager( pReportModel->GetSdrUndoManager() );
4336 ENSURE_OR_THROW( pUndoManager !=
nullptr,
"no access to our model's UndoManager" );
4338 return *pUndoManager;
4342void OReportController::clearUndoManager()
const
4344 getUndoManager().
Clear();
4348void OReportController::addUndoAction( std::unique_ptr<SfxUndoAction> i_pAction )
4350 getUndoManager().AddUndoAction( std::move(i_pAction) );
4352 InvalidateFeature( SID_UNDO );
4353 InvalidateFeature( SID_REDO );
4356extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
4358 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any>
const&)
4360 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)
const 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