diff --git a/accessibility/Library_acc.mk b/accessibility/Library_acc.mk index 1382e00019fa..5acdf2a7be99 100644 --- a/accessibility/Library_acc.mk +++ b/accessibility/Library_acc.mk @@ -71,11 +71,7 @@ $(eval $(call gb_Library_add_exception_objects,acc,\ accessibility/source/extended/textwindowaccessibility \ accessibility/source/helper/acc_factory \ accessibility/source/helper/accresmgr \ - accessibility/source/helper/characterattributeshelper \ accessibility/source/helper/IComboListBoxHelper \ - accessibility/source/standard/accessiblemenubasecomponent \ - accessibility/source/standard/accessiblemenucomponent \ - accessibility/source/standard/accessiblemenuitemcomponent \ accessibility/source/standard/floatingwindowaccessible \ accessibility/source/standard/svtaccessiblenumericfield \ accessibility/source/standard/vclxaccessiblebox \ @@ -92,11 +88,6 @@ $(eval $(call gb_Library_add_exception_objects,acc,\ accessibility/source/standard/vclxaccessiblelist \ accessibility/source/standard/vclxaccessiblelistbox \ accessibility/source/standard/vclxaccessiblelistitem \ - accessibility/source/standard/vclxaccessiblemenu \ - accessibility/source/standard/vclxaccessiblemenubar \ - accessibility/source/standard/vclxaccessiblemenuitem \ - accessibility/source/standard/vclxaccessiblemenuseparator \ - accessibility/source/standard/vclxaccessiblepopupmenu \ accessibility/source/standard/vclxaccessibleradiobutton \ accessibility/source/standard/vclxaccessiblescrollbar \ accessibility/source/standard/vclxaccessiblestatusbar \ diff --git a/accessibility/inc/extended/accessibletabbar.hxx b/accessibility/inc/extended/accessibletabbar.hxx index 86848679ffbb..6d75c83a7e23 100644 --- a/accessibility/inc/extended/accessibletabbar.hxx +++ b/accessibility/inc/extended/accessibletabbar.hxx @@ -79,7 +79,6 @@ namespace accessibility virtual sal_Int32 SAL_CALL getBackground( ) override; // XAccessibleExtendedComponent - virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) override; virtual OUString SAL_CALL getTitledBorderText( ) override; virtual OUString SAL_CALL getToolTipText( ) override; }; diff --git a/accessibility/inc/extended/accessibletabbarpage.hxx b/accessibility/inc/extended/accessibletabbarpage.hxx index 052650c19de0..a8266b55c2a5 100644 --- a/accessibility/inc/extended/accessibletabbarpage.hxx +++ b/accessibility/inc/extended/accessibletabbarpage.hxx @@ -93,7 +93,6 @@ namespace accessibility virtual sal_Int32 SAL_CALL getBackground( ) override; // XAccessibleExtendedComponent - virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) override; virtual OUString SAL_CALL getTitledBorderText( ) override; virtual OUString SAL_CALL getToolTipText( ) override; }; diff --git a/accessibility/inc/extended/accessibletabbarpagelist.hxx b/accessibility/inc/extended/accessibletabbarpagelist.hxx index b3045aa77c6f..950a37167086 100644 --- a/accessibility/inc/extended/accessibletabbarpagelist.hxx +++ b/accessibility/inc/extended/accessibletabbarpagelist.hxx @@ -89,7 +89,6 @@ namespace accessibility virtual sal_Int32 SAL_CALL getBackground( ) override; // XAccessibleExtendedComponent - virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) override; virtual OUString SAL_CALL getTitledBorderText( ) override; virtual OUString SAL_CALL getToolTipText( ) override; diff --git a/accessibility/inc/pch/precompiled_acc.hxx b/accessibility/inc/pch/precompiled_acc.hxx index 885d43ce436f..ca08b4d1858e 100644 --- a/accessibility/inc/pch/precompiled_acc.hxx +++ b/accessibility/inc/pch/precompiled_acc.hxx @@ -90,6 +90,7 @@ #include #include #include +#include #include #include #include @@ -290,7 +291,6 @@ #include #include #include -#include #include #include #include @@ -305,8 +305,6 @@ #include #include #include -#include -#include #include #include #include @@ -342,7 +340,7 @@ #include #endif // PCH_LEVEL >= 3 #if PCH_LEVEL >= 4 -#include +#include #endif // PCH_LEVEL >= 4 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessibleheaderbaritem.hxx b/accessibility/inc/standard/vclxaccessibleheaderbaritem.hxx index 563e86ff5252..337a3db65845 100644 --- a/accessibility/inc/standard/vclxaccessibleheaderbaritem.hxx +++ b/accessibility/inc/standard/vclxaccessibleheaderbaritem.hxx @@ -79,7 +79,6 @@ public: virtual sal_Int32 SAL_CALL getBackground() override; // XAccessibleExtendedComponent - virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) override; virtual OUString SAL_CALL getTitledBorderText( ) override; virtual OUString SAL_CALL getToolTipText( ) override; }; diff --git a/accessibility/inc/standard/vclxaccessiblestatusbaritem.hxx b/accessibility/inc/standard/vclxaccessiblestatusbaritem.hxx index 9556f961d140..87bed611bf0a 100644 --- a/accessibility/inc/standard/vclxaccessiblestatusbaritem.hxx +++ b/accessibility/inc/standard/vclxaccessiblestatusbaritem.hxx @@ -92,7 +92,6 @@ public: virtual sal_Int32 SAL_CALL getBackground( ) override; // XAccessibleExtendedComponent - virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) override; virtual OUString SAL_CALL getTitledBorderText( ) override; virtual OUString SAL_CALL getToolTipText( ) override; diff --git a/accessibility/inc/standard/vclxaccessibletabpage.hxx b/accessibility/inc/standard/vclxaccessibletabpage.hxx index efdc75e2c677..fece8744721a 100644 --- a/accessibility/inc/standard/vclxaccessibletabpage.hxx +++ b/accessibility/inc/standard/vclxaccessibletabpage.hxx @@ -102,7 +102,6 @@ public: virtual sal_Int32 SAL_CALL getBackground( ) override; // XAccessibleExtendedComponent - virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) override; virtual OUString SAL_CALL getTitledBorderText( ) override; virtual OUString SAL_CALL getToolTipText( ) override; diff --git a/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx b/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx index 6fbfc1e55138..e33e61eb568e 100644 --- a/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx +++ b/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx @@ -127,7 +127,6 @@ public: virtual sal_Int32 SAL_CALL getBackground( ) override; // XAccessibleExtendedComponent - virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) override; virtual OUString SAL_CALL getTitledBorderText( ) override; virtual OUString SAL_CALL getToolTipText( ) override; diff --git a/accessibility/source/extended/AccessibleBrowseBox.cxx b/accessibility/source/extended/AccessibleBrowseBox.cxx index b78c6cb65048..c3b48b6b8d86 100644 --- a/accessibility/source/extended/AccessibleBrowseBox.cxx +++ b/accessibility/source/extended/AccessibleBrowseBox.cxx @@ -22,8 +22,9 @@ #include #include #include -#include #include +#include +#include #include @@ -135,12 +136,12 @@ AccessibleBrowseBox::getAccessibleAtPoint( const awt::Point& rPoint ) ensureIsAlive(); sal_Int32 nIndex = 0; - if (mpBrowseBox->ConvertPointToControlIndex(nIndex, VCLUnoHelper::ConvertToVCLPoint(rPoint))) + if (mpBrowseBox->ConvertPointToControlIndex(nIndex, vcl::unohelper::ConvertToVCLPoint(rPoint))) return mpBrowseBox->CreateAccessibleControl(nIndex); // try whether point is in one of the fixed children // (table, header bars, corner control) - Point aPoint(VCLUnoHelper::ConvertToVCLPoint(rPoint)); + Point aPoint(vcl::unohelper::ConvertToVCLPoint(rPoint)); for (nIndex = 0; nIndex < vcl::BBINDEX_FIRSTCONTROL; ++nIndex) { css::uno::Reference< css::accessibility::XAccessible > xCurrChild(implGetFixedChild(nIndex)); @@ -148,7 +149,7 @@ AccessibleBrowseBox::getAccessibleAtPoint( const awt::Point& rPoint ) xCurrChildComp( xCurrChild, uno::UNO_QUERY ); if (xCurrChildComp.is() - && VCLUnoHelper::ConvertToVCLRect(xCurrChildComp->getBounds()).Contains(aPoint)) + && vcl::unohelper::ConvertToVCLRect(xCurrChildComp->getBounds()).Contains(aPoint)) return xCurrChild; } return nullptr; diff --git a/accessibility/source/extended/AccessibleBrowseBoxBase.cxx b/accessibility/source/extended/AccessibleBrowseBoxBase.cxx index 541b5ead7057..6108fa0a1801 100644 --- a/accessibility/source/extended/AccessibleBrowseBoxBase.cxx +++ b/accessibility/source/extended/AccessibleBrowseBoxBase.cxx @@ -26,8 +26,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -211,27 +211,27 @@ lang::Locale SAL_CALL AccessibleBrowseBoxBase::getLocale() sal_Bool SAL_CALL AccessibleBrowseBoxBase::containsPoint( const css::awt::Point& rPoint ) { return tools::Rectangle(Point(), getBoundingBox().GetSize()) - .Contains(VCLUnoHelper::ConvertToVCLPoint(rPoint)); + .Contains(vcl::unohelper::ConvertToVCLPoint(rPoint)); } awt::Rectangle SAL_CALL AccessibleBrowseBoxBase::getBounds() { - return VCLUnoHelper::ConvertToAWTRect(getBoundingBox()); + return vcl::unohelper::ConvertToAWTRect(getBoundingBox()); } awt::Point SAL_CALL AccessibleBrowseBoxBase::getLocation() { - return VCLUnoHelper::ConvertToAWTPoint(getBoundingBox().TopLeft()); + return vcl::unohelper::ConvertToAWTPoint(getBoundingBox().TopLeft()); } awt::Point SAL_CALL AccessibleBrowseBoxBase::getLocationOnScreen() { - return VCLUnoHelper::ConvertToAWTPoint(getBoundingBoxOnScreen().TopLeft()); + return vcl::unohelper::ConvertToAWTPoint(getBoundingBoxOnScreen().TopLeft()); } awt::Size SAL_CALL AccessibleBrowseBoxBase::getSize() { - return VCLUnoHelper::ConvertToAWTSize(getBoundingBox().GetSize()); + return vcl::unohelper::ConvertToAWTSize(getBoundingBox().GetSize()); } void SAL_CALL AccessibleBrowseBoxBase::focusGained( const css::awt::FocusEvent& ) @@ -351,7 +351,7 @@ bool AccessibleBrowseBoxBase::implIsShowing() xParentComp( mxParent->getAccessibleContext(), uno::UNO_QUERY ); if( xParentComp.is() ) bShowing = implGetBoundingBox().Overlaps( - VCLUnoHelper::ConvertToVCLRect(xParentComp->getBounds())); + vcl::unohelper::ConvertToVCLRect(xParentComp->getBounds())); } return bShowing; } diff --git a/accessibility/source/extended/AccessibleBrowseBoxHeaderBar.cxx b/accessibility/source/extended/AccessibleBrowseBoxHeaderBar.cxx index 26704ccb3387..3918c4551308 100644 --- a/accessibility/source/extended/AccessibleBrowseBoxHeaderBar.cxx +++ b/accessibility/source/extended/AccessibleBrowseBoxHeaderBar.cxx @@ -18,8 +18,8 @@ */ #include -#include #include +#include #include using ::com::sun::star::uno::Reference; @@ -78,9 +78,9 @@ AccessibleBrowseBoxHeaderBar::getAccessibleAtPoint( const awt::Point& rPoint ) sal_uInt16 nColumnPos = 0; bool bConverted = isRowBar() - ? mpBrowseBox->ConvertPointToRowHeader(nRow, VCLUnoHelper::ConvertToVCLPoint(rPoint)) + ? mpBrowseBox->ConvertPointToRowHeader(nRow, vcl::unohelper::ConvertToVCLPoint(rPoint)) : mpBrowseBox->ConvertPointToColumnHeader(nColumnPos, - VCLUnoHelper::ConvertToVCLPoint(rPoint)); + vcl::unohelper::ConvertToVCLPoint(rPoint)); return bConverted ? implGetChild( nRow, nColumnPos ) : Reference< XAccessible >(); } diff --git a/accessibility/source/extended/AccessibleBrowseBoxTable.cxx b/accessibility/source/extended/AccessibleBrowseBoxTable.cxx index 83ab211b18f2..99764f4c1f8a 100644 --- a/accessibility/source/extended/AccessibleBrowseBoxTable.cxx +++ b/accessibility/source/extended/AccessibleBrowseBoxTable.cxx @@ -18,8 +18,8 @@ */ #include -#include #include +#include #include @@ -78,7 +78,7 @@ AccessibleBrowseBoxTable::getAccessibleAtPoint( const awt::Point& rPoint ) sal_Int32 nRow = 0; sal_uInt16 nColumnPos = 0; if (mpBrowseBox->ConvertPointToCellAddress(nRow, nColumnPos, - VCLUnoHelper::ConvertToVCLPoint(rPoint))) + vcl::unohelper::ConvertToVCLPoint(rPoint))) xChild = mpBrowseBox->CreateAccessibleCell( nRow, nColumnPos ); return xChild; diff --git a/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx b/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx index bd092a0114b4..dbfce6d4d3a9 100644 --- a/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx +++ b/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx @@ -20,8 +20,8 @@ #include -#include #include +#include #include #include @@ -118,7 +118,7 @@ namespace accessibility if ( !implIsValidIndex( nIndex, implGetText().getLength() ) ) throw IndexOutOfBoundsException(); - aRect = VCLUnoHelper::ConvertToAWTRect( + aRect = vcl::unohelper::ConvertToAWTRect( mpBrowseBox->GetFieldCharacterBounds(getRowPos(), getColumnPos(), nIndex)); } @@ -133,7 +133,7 @@ namespace accessibility ensureIsAlive(); return mpBrowseBox->GetFieldIndexAtPoint(getRowPos(), getColumnPos(), - VCLUnoHelper::ConvertToVCLPoint(_aPoint)); + vcl::unohelper::ConvertToVCLPoint(_aPoint)); } /** @return diff --git a/accessibility/source/extended/AccessibleGridControl.cxx b/accessibility/source/extended/AccessibleGridControl.cxx index 6dcd09748d79..0f9e352e7c46 100644 --- a/accessibility/source/extended/AccessibleGridControl.cxx +++ b/accessibility/source/extended/AccessibleGridControl.cxx @@ -23,10 +23,10 @@ #include #include #include -#include #include #include #include +#include namespace accessibility { @@ -147,13 +147,13 @@ AccessibleGridControl::getAccessibleAtPoint( const awt::Point& rPoint ) ensureIsAlive(); sal_Int32 nIndex = 0; - if (m_aTable.ConvertPointToControlIndex(nIndex, VCLUnoHelper::ConvertToVCLPoint(rPoint))) + if (m_aTable.ConvertPointToControlIndex(nIndex, vcl::unohelper::ConvertToVCLPoint(rPoint))) return m_aTable.CreateAccessibleControl(nIndex); else { // try whether point is in one of the fixed children // (table, header bars, corner control) - Point aPoint(VCLUnoHelper::ConvertToVCLPoint(rPoint)); + Point aPoint(vcl::unohelper::ConvertToVCLPoint(rPoint)); for (nIndex = 0; nIndex < 3; ++nIndex) { css::uno::Reference< css::accessibility::XAccessible > xCurrChild( implGetFixedChild( nIndex ) ); @@ -161,7 +161,7 @@ AccessibleGridControl::getAccessibleAtPoint( const awt::Point& rPoint ) xCurrChildComp( xCurrChild, uno::UNO_QUERY ); if (xCurrChildComp.is() - && VCLUnoHelper::ConvertToVCLRect(xCurrChildComp->getBounds()).Contains(aPoint)) + && vcl::unohelper::ConvertToVCLRect(xCurrChildComp->getBounds()).Contains(aPoint)) return xCurrChild; } } diff --git a/accessibility/source/extended/AccessibleGridControlBase.cxx b/accessibility/source/extended/AccessibleGridControlBase.cxx index 950e927fca86..aff3dc66a247 100644 --- a/accessibility/source/extended/AccessibleGridControlBase.cxx +++ b/accessibility/source/extended/AccessibleGridControlBase.cxx @@ -18,10 +18,10 @@ */ #include -#include #include #include #include +#include #include #include #include @@ -184,27 +184,27 @@ lang::Locale SAL_CALL AccessibleGridControlBase::getLocale() sal_Bool SAL_CALL AccessibleGridControlBase::containsPoint( const awt::Point& rPoint ) { return tools::Rectangle(Point(), getBoundingBox().GetSize()) - .Contains(VCLUnoHelper::ConvertToVCLPoint(rPoint)); + .Contains(vcl::unohelper::ConvertToVCLPoint(rPoint)); } awt::Rectangle SAL_CALL AccessibleGridControlBase::getBounds() { - return VCLUnoHelper::ConvertToAWTRect(getBoundingBox()); + return vcl::unohelper::ConvertToAWTRect(getBoundingBox()); } awt::Point SAL_CALL AccessibleGridControlBase::getLocation() { - return VCLUnoHelper::ConvertToAWTPoint(getBoundingBox().TopLeft()); + return vcl::unohelper::ConvertToAWTPoint(getBoundingBox().TopLeft()); } awt::Point SAL_CALL AccessibleGridControlBase::getLocationOnScreen() { - return VCLUnoHelper::ConvertToAWTPoint(getBoundingBoxOnScreen().TopLeft()); + return vcl::unohelper::ConvertToAWTPoint(getBoundingBoxOnScreen().TopLeft()); } awt::Size SAL_CALL AccessibleGridControlBase::getSize() { - return VCLUnoHelper::ConvertToAWTSize(getBoundingBox().GetSize()); + return vcl::unohelper::ConvertToAWTSize(getBoundingBox().GetSize()); } // css::accessibility::XAccessibleEventBroadcaster @@ -274,7 +274,7 @@ bool AccessibleGridControlBase::implIsShowing() xParentComp( m_xParent->getAccessibleContext(), uno::UNO_QUERY ); if( xParentComp.is() ) bShowing = implGetBoundingBox().Overlaps( - VCLUnoHelper::ConvertToVCLRect(xParentComp->getBounds())); + vcl::unohelper::ConvertToVCLRect(xParentComp->getBounds())); } return bShowing; } diff --git a/accessibility/source/extended/AccessibleGridControlHeader.cxx b/accessibility/source/extended/AccessibleGridControlHeader.cxx index b028f6837141..a50b2c434594 100644 --- a/accessibility/source/extended/AccessibleGridControlHeader.cxx +++ b/accessibility/source/extended/AccessibleGridControlHeader.cxx @@ -23,6 +23,7 @@ #include #include #include +#include using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; @@ -97,7 +98,7 @@ AccessibleGridControlHeader::getAccessibleAtPoint( const awt::Point& rPoint ) sal_Int32 nRow = 0; sal_Int32 nColumnPos = 0; bool bConverted = m_aTable.ConvertPointToCellAddress(nRow, nColumnPos, - VCLUnoHelper::ConvertToVCLPoint(rPoint)); + vcl::unohelper::ConvertToVCLPoint(rPoint)); return bConverted ? implGetChild( nRow, nColumnPos ) : Reference< XAccessible >(); } diff --git a/accessibility/source/extended/AccessibleGridControlTable.cxx b/accessibility/source/extended/AccessibleGridControlTable.cxx index 41308d8d4acf..930d5c9395ce 100644 --- a/accessibility/source/extended/AccessibleGridControlTable.cxx +++ b/accessibility/source/extended/AccessibleGridControlTable.cxx @@ -23,9 +23,9 @@ #include #include #include -#include #include #include +#include #include using ::com::sun::star::uno::Reference; @@ -96,7 +96,7 @@ AccessibleGridControlTable::getAccessibleAtPoint( const awt::Point& rPoint ) sal_Int32 nRow = 0; sal_Int32 nColumnPos = 0; if (m_aTable.ConvertPointToCellAddress(nRow, nColumnPos, - VCLUnoHelper::ConvertToVCLPoint(rPoint))) + vcl::unohelper::ConvertToVCLPoint(rPoint))) xChild = new AccessibleGridControlTableCell(this, m_aTable, nRow, nColumnPos); return xChild; } diff --git a/accessibility/source/extended/AccessibleGridControlTableCell.cxx b/accessibility/source/extended/AccessibleGridControlTableCell.cxx index a24e62d068e3..a1a1af5fe641 100644 --- a/accessibility/source/extended/AccessibleGridControlTableCell.cxx +++ b/accessibility/source/extended/AccessibleGridControlTableCell.cxx @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include @@ -138,7 +138,7 @@ namespace accessibility if ( !implIsValidIndex( nIndex, implGetText().getLength() ) ) throw IndexOutOfBoundsException(); - return VCLUnoHelper::ConvertToAWTRect( + return vcl::unohelper::ConvertToAWTRect( m_aTable.GetFieldCharacterBounds(getRowPos(), getColumnPos(), nIndex)); } @@ -149,7 +149,7 @@ namespace accessibility ensureIsAlive(); return m_aTable.GetFieldIndexAtPoint(getRowPos(), getColumnPos(), - VCLUnoHelper::ConvertToVCLPoint(_aPoint)); + vcl::unohelper::ConvertToVCLPoint(_aPoint)); } /** @return diff --git a/accessibility/source/extended/AccessibleIconView.cxx b/accessibility/source/extended/AccessibleIconView.cxx index a1321c7dded6..25b5f39cdafe 100644 --- a/accessibility/source/extended/AccessibleIconView.cxx +++ b/accessibility/source/extended/AccessibleIconView.cxx @@ -11,8 +11,8 @@ #include -#include #include +#include #include @@ -36,7 +36,7 @@ void AccessibleIconView::ProcessWindowEvent(const VclWindowEvent& rVclWindowEven if (MouseEvent* pMouseEvt = static_cast(rVclWindowEvent.GetData())) { if (auto xChild = getAccessibleAtPoint( - VCLUnoHelper::ConvertToAWTPoint(pMouseEvt->GetPosPixel()))) + vcl::unohelper::ConvertToAWTPoint(pMouseEvt->GetPosPixel()))) { // Allow announcing the element on mouse hover css::uno::Any aNew(xChild); diff --git a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx index 696f7cbea2c0..991a417e080c 100644 --- a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx +++ b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include @@ -129,7 +129,7 @@ namespace accessibility Reference< XAccessibleComponent > xParentComp( xParentContext, uno::UNO_QUERY ); if( xParentComp.is() ) bShowing = GetBoundingBox_Impl().Overlaps( - VCLUnoHelper::ConvertToVCLRect(xParentComp->getBounds())); + vcl::unohelper::ConvertToVCLRect(xParentComp->getBounds())); } return bShowing; @@ -152,7 +152,7 @@ namespace accessibility css::awt::Rectangle AccessibleIconChoiceCtrlEntry::implGetBounds() { - return VCLUnoHelper::ConvertToAWTRect(GetBoundingBox_Impl()); + return vcl::unohelper::ConvertToAWTRect(GetBoundingBox_Impl()); } OUString AccessibleIconChoiceCtrlEntry::implGetText() @@ -324,7 +324,7 @@ namespace accessibility awt::Point SAL_CALL AccessibleIconChoiceCtrlEntry::getLocationOnScreen( ) { - return VCLUnoHelper::ConvertToAWTPoint( GetBoundingBoxOnScreen().TopLeft() ); + return vcl::unohelper::ConvertToAWTPoint( GetBoundingBoxOnScreen().TopLeft() ); } void SAL_CALL AccessibleIconChoiceCtrlEntry::grabFocus( ) @@ -383,7 +383,7 @@ namespace accessibility tools::Rectangle aItemRect = GetBoundingBox_Impl(); tools::Rectangle aCharRect = m_pIconCtrl->GetEntryCharacterBounds( m_nIndex, _nIndex ); aCharRect.Move( -aItemRect.Left(), -aItemRect.Top() ); - aBounds = VCLUnoHelper::ConvertToAWTRect(aCharRect); + aBounds = vcl::unohelper::ConvertToAWTRect(aCharRect); } return aBounds; @@ -400,7 +400,7 @@ namespace accessibility vcl::ControlLayoutData aLayoutData; tools::Rectangle aItemRect = GetBoundingBox_Impl(); m_pIconCtrl->RecordLayoutData( &aLayoutData, aItemRect ); - Point aPnt(VCLUnoHelper::ConvertToVCLPoint(aPoint)); + Point aPnt(vcl::unohelper::ConvertToVCLPoint(aPoint)); aPnt += aItemRect.TopLeft(); nIndex = aLayoutData.GetIndexForPoint( aPnt ); diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx b/accessibility/source/extended/accessiblelistboxentry.cxx index 3a2c616cabe4..f88825818257 100644 --- a/accessibility/source/extended/accessiblelistboxentry.cxx +++ b/accessibility/source/extended/accessiblelistboxentry.cxx @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include @@ -177,7 +177,7 @@ namespace accessibility Reference< XAccessibleComponent > xParentComp( xParentContext, uno::UNO_QUERY ); if( xParentComp.is() ) bShowing = GetBoundingBox_Impl().Overlaps( - VCLUnoHelper::ConvertToVCLRect(xParentComp->getBounds())); + vcl::unohelper::ConvertToVCLRect(xParentComp->getBounds())); } return bShowing; @@ -522,7 +522,7 @@ namespace accessibility sal_Bool SAL_CALL AccessibleListBoxEntry::containsPoint( const awt::Point& rPoint ) { return tools::Rectangle(Point(), GetBoundingBox().GetSize()) - .Contains(VCLUnoHelper::ConvertToVCLPoint(rPoint)); + .Contains(vcl::unohelper::ConvertToVCLPoint(rPoint)); } Reference< XAccessible > SAL_CALL AccessibleListBoxEntry::getAccessibleAtPoint( const awt::Point& _aPoint ) @@ -532,7 +532,7 @@ namespace accessibility EnsureIsAlive(); SvTreeListEntry* pEntry - = m_pTreeListBox->GetEntry(VCLUnoHelper::ConvertToVCLPoint(_aPoint)); + = m_pTreeListBox->GetEntry(vcl::unohelper::ConvertToVCLPoint(_aPoint)); if ( !pEntry ) throw RuntimeException(u"AccessibleListBoxEntry::getAccessibleAtPoint - pEntry cannot be empty!"_ustr); @@ -541,29 +541,29 @@ namespace accessibility assert(xListBox.is()); auto pAccEntry = xListBox->implGetAccessible(*pEntry); tools::Rectangle aRect = pAccEntry->GetBoundingBox_Impl(); - if (aRect.Contains(VCLUnoHelper::ConvertToVCLPoint(_aPoint))) + if (aRect.Contains(vcl::unohelper::ConvertToVCLPoint(_aPoint))) xAcc = pAccEntry.get(); return xAcc; } awt::Rectangle SAL_CALL AccessibleListBoxEntry::getBounds( ) { - return VCLUnoHelper::ConvertToAWTRect(GetBoundingBox()); + return vcl::unohelper::ConvertToAWTRect(GetBoundingBox()); } awt::Point SAL_CALL AccessibleListBoxEntry::getLocation( ) { - return VCLUnoHelper::ConvertToAWTPoint(GetBoundingBox().TopLeft()); + return vcl::unohelper::ConvertToAWTPoint(GetBoundingBox().TopLeft()); } awt::Point SAL_CALL AccessibleListBoxEntry::getLocationOnScreen( ) { - return VCLUnoHelper::ConvertToAWTPoint(GetBoundingBoxOnScreen().TopLeft()); + return vcl::unohelper::ConvertToAWTPoint(GetBoundingBoxOnScreen().TopLeft()); } awt::Size SAL_CALL AccessibleListBoxEntry::getSize( ) { - return VCLUnoHelper::ConvertToAWTSize(GetBoundingBox().GetSize()); + return vcl::unohelper::ConvertToAWTSize(GetBoundingBox().GetSize()); } void SAL_CALL AccessibleListBoxEntry::grabFocus( ) @@ -627,7 +627,7 @@ namespace accessibility m_pTreeListBox->RecordLayoutData( &aLayoutData, aItemRect ); tools::Rectangle aCharRect = aLayoutData.GetCharacterBounds( nIndex ); aCharRect.Move( -aItemRect.Left(), -aItemRect.Top() ); - aBounds = VCLUnoHelper::ConvertToAWTRect(aCharRect); + aBounds = vcl::unohelper::ConvertToAWTRect(aCharRect); } return aBounds; @@ -647,7 +647,7 @@ namespace accessibility vcl::ControlLayoutData aLayoutData; tools::Rectangle aItemRect = GetBoundingBox(); m_pTreeListBox->RecordLayoutData( &aLayoutData, aItemRect ); - Point aPnt(VCLUnoHelper::ConvertToVCLPoint(aPoint)); + Point aPnt(vcl::unohelper::ConvertToVCLPoint(aPoint)); aPnt += aItemRect.TopLeft(); nIndex = aLayoutData.GetIndexForPoint( aPnt ); } diff --git a/accessibility/source/extended/accessibletabbar.cxx b/accessibility/source/extended/accessibletabbar.cxx index 2b1522f30a28..ede35977d93a 100644 --- a/accessibility/source/extended/accessibletabbar.cxx +++ b/accessibility/source/extended/accessibletabbar.cxx @@ -33,8 +33,7 @@ #include #include #include -#include -#include +#include namespace accessibility { @@ -145,7 +144,7 @@ namespace accessibility { awt::Rectangle aBounds; if ( m_pTabBar ) - aBounds = VCLUnoHelper::ConvertToAWTRect( + aBounds = vcl::unohelper::ConvertToAWTRect( tools::Rectangle(m_pTabBar->GetPosPixel(), m_pTabBar->GetSizePixel())); return aBounds; @@ -362,8 +361,8 @@ namespace accessibility Reference< XAccessibleComponent > xComp( xAcc->getAccessibleContext(), UNO_QUERY ); if ( xComp.is() ) { - tools::Rectangle aRect = VCLUnoHelper::ConvertToVCLRect(xComp->getBounds()); - Point aPos = VCLUnoHelper::ConvertToVCLPoint(rPoint); + tools::Rectangle aRect = vcl::unohelper::ConvertToVCLRect(xComp->getBounds()); + Point aPos = vcl::unohelper::ConvertToVCLPoint(rPoint); if ( aRect.Contains( aPos ) ) { return xAcc; @@ -427,32 +426,6 @@ namespace accessibility // XAccessibleExtendedComponent - - Reference< awt::XFont > AccessibleTabBar::getFont( ) - { - OExternalLockGuard aGuard( this ); - - Reference< awt::XFont > xFont; - if ( m_pTabBar ) - { - Reference< awt::XDevice > xDev( m_pTabBar->GetComponentInterface(), UNO_QUERY ); - if ( xDev.is() ) - { - vcl::Font aFont; - if ( m_pTabBar->IsControlFont() ) - aFont = m_pTabBar->GetControlFont(); - else - aFont = m_pTabBar->GetFont(); - rtl::Reference pVCLXFont = new VCLXFont; - pVCLXFont->Init( *xDev, aFont ); - xFont = pVCLXFont; - } - } - - return xFont; - } - - OUString AccessibleTabBar::getTitledBorderText( ) { OExternalLockGuard aGuard( this ); diff --git a/accessibility/source/extended/accessibletabbarpage.cxx b/accessibility/source/extended/accessibletabbarpage.cxx index 97af7f39d8b1..f2de152f871f 100644 --- a/accessibility/source/extended/accessibletabbarpage.cxx +++ b/accessibility/source/extended/accessibletabbarpage.cxx @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include @@ -164,7 +164,7 @@ namespace accessibility if ( m_pTabBar ) { // get bounding rectangle relative to the AccessibleTabBar - aBounds = VCLUnoHelper::ConvertToAWTRect(m_pTabBar->GetPageRect(m_nPageId)); + aBounds = vcl::unohelper::ConvertToAWTRect(m_pTabBar->GetPageRect(m_nPageId)); // get position of the AccessibleTabBarPageList relative to the AccessibleTabBar Reference< XAccessible > xParent = getAccessibleParent(); @@ -371,24 +371,6 @@ namespace accessibility // XAccessibleExtendedComponent - - Reference< awt::XFont > AccessibleTabBarPage::getFont( ) - { - OExternalLockGuard aGuard( this ); - - Reference< awt::XFont > xFont; - Reference< XAccessible > xParent = getAccessibleParent(); - if ( xParent.is() ) - { - Reference< XAccessibleExtendedComponent > xParentComp( xParent->getAccessibleContext(), UNO_QUERY ); - if ( xParentComp.is() ) - xFont = xParentComp->getFont(); - } - - return xFont; - } - - OUString AccessibleTabBarPage::getTitledBorderText( ) { OExternalLockGuard aGuard( this ); diff --git a/accessibility/source/extended/accessibletabbarpagelist.cxx b/accessibility/source/extended/accessibletabbarpagelist.cxx index db553e40e0ce..4bde87630738 100644 --- a/accessibility/source/extended/accessibletabbarpagelist.cxx +++ b/accessibility/source/extended/accessibletabbarpagelist.cxx @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include @@ -306,7 +306,7 @@ namespace accessibility { awt::Rectangle aBounds; if ( m_pTabBar ) - aBounds = VCLUnoHelper::ConvertToAWTRect(m_pTabBar->GetPageArea()); + aBounds = vcl::unohelper::ConvertToAWTRect(m_pTabBar->GetPageArea()); return aBounds; } @@ -491,8 +491,8 @@ namespace accessibility Reference< XAccessibleComponent > xComp( xAcc->getAccessibleContext(), UNO_QUERY ); if ( xComp.is() ) { - tools::Rectangle aRect = VCLUnoHelper::ConvertToVCLRect(xComp->getBounds()); - Point aPos = VCLUnoHelper::ConvertToVCLPoint(rPoint); + tools::Rectangle aRect = vcl::unohelper::ConvertToVCLRect(xComp->getBounds()); + Point aPos = vcl::unohelper::ConvertToVCLPoint(rPoint); if ( aRect.Contains( aPos ) ) { xChild = xAcc; @@ -548,24 +548,6 @@ namespace accessibility // XAccessibleExtendedComponent - - Reference< awt::XFont > AccessibleTabBarPageList::getFont( ) - { - OExternalLockGuard aGuard( this ); - - Reference< awt::XFont > xFont; - Reference< XAccessible > xParent = getAccessibleParent(); - if ( xParent.is() ) - { - Reference< XAccessibleExtendedComponent > xParentComp( xParent->getAccessibleContext(), UNO_QUERY ); - if ( xParentComp.is() ) - xFont = xParentComp->getFont(); - } - - return xFont; - } - - OUString AccessibleTabBarPageList::getTitledBorderText( ) { return OUString(); diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx index 8068d118ed9f..04939fee3b3a 100644 --- a/accessibility/source/extended/textwindowaccessibility.cxx +++ b/accessibility/source/extended/textwindowaccessibility.cxx @@ -37,9 +37,9 @@ #include #include #include +#include #include #include -#include #include #include @@ -876,7 +876,7 @@ Document::retrieveCharacterBounds(Paragraph const * pParagraph, if ( nIndex == nLength ) { aBounds - = VCLUnoHelper::ConvertToAWTRect(m_rEngine.PaMtoEditCursor(::TextPaM(nNumber, nIndex))); + = vcl::unohelper::ConvertToAWTRect(m_rEngine.PaMtoEditCursor(::TextPaM(nNumber, nIndex))); } else { diff --git a/accessibility/source/helper/acc_factory.cxx b/accessibility/source/helper/acc_factory.cxx index d95d47b214d9..191cc7528703 100644 --- a/accessibility/source/helper/acc_factory.cxx +++ b/accessibility/source/helper/acc_factory.cxx @@ -42,8 +42,6 @@ #include #include #include -#include -#include #include #include #include @@ -115,8 +113,6 @@ public: createAccessibleContext( SVTXNumericField* _pXWindow ) override; virtual css::uno::Reference< css::accessibility::XAccessibleContext > createAccessibleContext( VCLXWindow* _pXWindow ) override; - virtual css::uno::Reference< css::accessibility::XAccessible > - createAccessible( Menu* _pMenu, bool _bIsMenuBar ) override; // ::vcl::IAccessibleFactory virtual vcl::IAccessibleTabListBox* @@ -224,17 +220,6 @@ AccessibleFactory::~AccessibleFactory() { } -Reference< XAccessible > AccessibleFactory::createAccessible( Menu* _pMenu, bool _bIsMenuBar ) -{ - rtl::Reference pAccessible; - if ( _bIsMenuBar ) - pAccessible = new VCLXAccessibleMenuBar( _pMenu ); - else - pAccessible = new VCLXAccessiblePopupMenu( _pMenu ); - pAccessible->SetStates(); - return pAccessible; -} - Reference< XAccessibleContext > AccessibleFactory::createAccessibleContext( VCLXButton* _pXWindow ) { return new VCLXAccessibleButton( _pXWindow ); diff --git a/accessibility/source/standard/svtaccessiblenumericfield.cxx b/accessibility/source/standard/svtaccessiblenumericfield.cxx index f3192d4212f0..50a17a1373ec 100644 --- a/accessibility/source/standard/svtaccessiblenumericfield.cxx +++ b/accessibility/source/standard/svtaccessiblenumericfield.cxx @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include @@ -50,9 +50,9 @@ css::uno::Any SAL_CALL SVTXAccessibleNumericField::getCurrentValue() OExternalLockGuard aGuard(this); double dValue = 0; - SVTXNumericField* pField = static_cast(GetVCLXWindow()); + VclPtr pField = GetAs(); if (pField) - dValue = pField->getValue(); + dValue = pField->GetFormatter().GetValue(); return css::uno::Any(dValue); } @@ -61,13 +61,13 @@ sal_Bool SVTXAccessibleNumericField::setCurrentValue(const css::uno::Any& aNumbe { OExternalLockGuard aGuard(this); - SVTXNumericField* pField = static_cast(GetVCLXWindow()); + VclPtr pField = GetAs(); if (!pField) return false; double dValue = 0; aNumber >>= dValue; - pField->setValue(dValue); + pField->GetFormatter().SetValue(dValue); return true; } @@ -76,9 +76,9 @@ css::uno::Any SAL_CALL SVTXAccessibleNumericField::getMaximumValue() OExternalLockGuard aGuard(this); double dValue = 0; - SVTXNumericField* pField = static_cast(GetVCLXWindow()); + VclPtr pField = GetAs(); if (pField) - dValue = pField->getMax(); + dValue = pField->GetFormatter().GetMaxValue(); return css::uno::Any(dValue); } @@ -88,9 +88,9 @@ css::uno::Any SAL_CALL SVTXAccessibleNumericField::getMinimumValue() OExternalLockGuard aGuard(this); double dValue = 0; - SVTXNumericField* pField = static_cast(GetVCLXWindow()); + VclPtr pField = GetAs(); if (pField) - dValue = pField->getMin(); + dValue = pField->GetFormatter().GetMinValue(); return css::uno::Any(dValue); } @@ -100,9 +100,9 @@ css::uno::Any SAL_CALL SVTXAccessibleNumericField::getMinimumIncrement() OExternalLockGuard aGuard(this); double dValue = 0; - SVTXNumericField* pField = static_cast(GetVCLXWindow()); + VclPtr pField = GetAs(); if (pField) - dValue = pField->getSpinSize(); + dValue = pField->GetFormatter().GetSpinSize(); return css::uno::Any(dValue); } diff --git a/accessibility/source/standard/vclxaccessiblebox.cxx b/accessibility/source/standard/vclxaccessiblebox.cxx index 9e8569ce0826..9690eff35ee2 100644 --- a/accessibility/source/standard/vclxaccessiblebox.cxx +++ b/accessibility/source/standard/vclxaccessiblebox.cxx @@ -26,10 +26,11 @@ #include #include #include + +#include #include #include #include -#include using namespace ::com::sun::star; using namespace ::com::sun::star::uno; diff --git a/accessibility/source/standard/vclxaccessiblebutton.cxx b/accessibility/source/standard/vclxaccessiblebutton.cxx index 7ede9e02c808..56f30c3d2148 100644 --- a/accessibility/source/standard/vclxaccessiblebutton.cxx +++ b/accessibility/source/standard/vclxaccessiblebutton.cxx @@ -27,8 +27,8 @@ #include #include #include -#include +#include #include #include #include diff --git a/accessibility/source/standard/vclxaccessiblecheckbox.cxx b/accessibility/source/standard/vclxaccessiblecheckbox.cxx index 46c3e8749e92..debdb086df1e 100644 --- a/accessibility/source/standard/vclxaccessiblecheckbox.cxx +++ b/accessibility/source/standard/vclxaccessiblecheckbox.cxx @@ -19,7 +19,6 @@ #include -#include #include #include @@ -54,25 +53,15 @@ VCLXAccessibleCheckBox::VCLXAccessibleCheckBox( VCLXWindow* pVCLWindow ) bool VCLXAccessibleCheckBox::IsChecked() const { - bool bChecked = false; - - VCLXCheckBox* pVCLXCheckBox = static_cast< VCLXCheckBox* >( GetVCLXWindow() ); - if ( pVCLXCheckBox && pVCLXCheckBox->getState() == sal_Int16(1) ) - bChecked = true; - - return bChecked; + VclPtr pCheckBox = GetAs(); + return pCheckBox && pCheckBox->IsChecked(); } bool VCLXAccessibleCheckBox::IsIndeterminate() const { - bool bIndeterminate = false; - - VCLXCheckBox* pVCLXCheckBox = static_cast< VCLXCheckBox* >( GetVCLXWindow() ); - if ( pVCLXCheckBox && pVCLXCheckBox->getState() == sal_Int16(2) ) - bIndeterminate = true; - - return bIndeterminate; + VclPtr pCheckBox = GetAs(); + return pCheckBox && pCheckBox->GetState() == TRISTATE_INDET; } @@ -176,23 +165,22 @@ sal_Bool VCLXAccessibleCheckBox::doAccessibleAction ( sal_Int32 nIndex ) if ( nIndex != 0 ) throw IndexOutOfBoundsException(); - VclPtr< CheckBox > pCheckBox = GetAs< CheckBox >(); - VCLXCheckBox* pVCLXCheckBox = static_cast< VCLXCheckBox* >( GetVCLXWindow() ); - if ( pCheckBox && pVCLXCheckBox ) + VclPtr pCheckBox = GetAs(); + if (pCheckBox) { sal_Int32 nValueMax = sal_Int32(1); if ( pCheckBox->IsTriStateEnabled() ) nValueMax = sal_Int32(2); - sal_Int32 nValue = static_cast(pVCLXCheckBox->getState()); + sal_Int32 nValue = static_cast(pCheckBox->GetState()); ++nValue; if ( nValue > nValueMax ) nValue = 0; - pVCLXCheckBox->setState( static_cast(nValue) ); + pCheckBox->SetState(static_cast(nValue)); } return true; @@ -259,9 +247,9 @@ Any VCLXAccessibleCheckBox::getCurrentValue( ) Any aValue; - VCLXCheckBox* pVCLXCheckBox = static_cast< VCLXCheckBox* >( GetVCLXWindow() ); - if ( pVCLXCheckBox ) - aValue <<= static_cast(pVCLXCheckBox->getState()); + VclPtr pCheckBox = GetAs(); + if (pCheckBox) + aValue <<= static_cast(pCheckBox->GetState()); return aValue; } @@ -273,8 +261,8 @@ sal_Bool VCLXAccessibleCheckBox::setCurrentValue( const Any& aNumber ) bool bReturn = false; - VCLXCheckBox* pVCLXCheckBox = static_cast< VCLXCheckBox* >( GetVCLXWindow() ); - if ( pVCLXCheckBox ) + VclPtr pCheckBox = GetAs(); + if (pCheckBox) { sal_Int32 nValue = 0, nValueMin = 0, nValueMax = 0; OSL_VERIFY( aNumber >>= nValue ); @@ -285,7 +273,7 @@ sal_Bool VCLXAccessibleCheckBox::setCurrentValue( const Any& aNumber ) else if ( nValue > nValueMax ) nValue = nValueMax; - pVCLXCheckBox->setState( static_cast(nValue) ); + pCheckBox->SetState(static_cast(nValue)); bReturn = true; } diff --git a/accessibility/source/standard/vclxaccessibleedit.cxx b/accessibility/source/standard/vclxaccessibleedit.cxx index 73298a4ff255..e87ed8960503 100644 --- a/accessibility/source/standard/vclxaccessibleedit.cxx +++ b/accessibility/source/standard/vclxaccessibleedit.cxx @@ -20,7 +20,6 @@ #include #include -#include #include #include @@ -38,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -108,12 +108,12 @@ void VCLXAccessibleEdit::FillAccessibleStateSet( sal_Int64& rStateSet ) { VCLXAccessibleTextComponent::FillAccessibleStateSet( rStateSet ); - VCLXWindow* pVCLXWindow = GetVCLXWindow(); - if (pVCLXWindow) + vcl::Window* pWindow = GetWindow(); + if (pWindow) { rStateSet |= AccessibleStateType::FOCUSABLE; - if (GetWindow() && GetWindow()->GetType() == WindowType::MULTILINEEDIT) + if (pWindow->GetType() == WindowType::MULTILINEEDIT) rStateSet |= AccessibleStateType::MULTI_LINE; else rStateSet |= AccessibleStateType::SINGLE_LINE; @@ -390,7 +390,7 @@ awt::Rectangle VCLXAccessibleEdit::getCharacterBounds( sal_Int32 nIndex ) } else { - aBounds = VCLUnoHelper::ConvertToAWTRect(pControl->GetCharacterBounds(nIndex)); + aBounds = vcl::unohelper::ConvertToAWTRect(pControl->GetCharacterBounds(nIndex)); } } diff --git a/accessibility/source/standard/vclxaccessibleheaderbaritem.cxx b/accessibility/source/standard/vclxaccessibleheaderbaritem.cxx index df740cd7cf62..7bbc2684524d 100644 --- a/accessibility/source/standard/vclxaccessibleheaderbaritem.cxx +++ b/accessibility/source/standard/vclxaccessibleheaderbaritem.cxx @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include using namespace ::com::sun::star; @@ -76,7 +76,7 @@ awt::Rectangle VCLXAccessibleHeaderBarItem::implGetBounds() if ( m_pHeadBar ) aBounds - = VCLUnoHelper::ConvertToAWTRect(m_pHeadBar->GetItemRect(sal_uInt16(m_nIndexInParent))); + = vcl::unohelper::ConvertToAWTRect(m_pHeadBar->GetItemRect(sal_uInt16(m_nIndexInParent))); return aBounds; } @@ -227,13 +227,6 @@ sal_Int32 VCLXAccessibleHeaderBarItem::getBackground() // XAccessibleExtendedComponent - -Reference< awt::XFont > VCLXAccessibleHeaderBarItem::getFont() -{ - return Reference< awt::XFont >(); -} - - OUString VCLXAccessibleHeaderBarItem::getTitledBorderText() { return OUString(); diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx b/accessibility/source/standard/vclxaccessiblelist.cxx index 335ffffe6624..d84a631687fc 100644 --- a/accessibility/source/standard/vclxaccessiblelist.cxx +++ b/accessibility/source/standard/vclxaccessiblelist.cxx @@ -30,10 +30,10 @@ #include #include #include -#include #include #include #include +#include using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -877,7 +877,7 @@ awt::Rectangle VCLXAccessibleList::implGetBounds() && (m_pListBoxHelper->GetStyle() & WB_DROPDOWN ) == WB_DROPDOWN ) { if ( m_pListBoxHelper->IsInDropDown() ) - aBounds = VCLUnoHelper::ConvertToAWTRect(m_pListBoxHelper->GetDropDownPosSizePixel()); + aBounds = vcl::unohelper::ConvertToAWTRect(m_pListBoxHelper->GetDropDownPosSizePixel()); } else { @@ -910,7 +910,7 @@ awt::Point VCLXAccessibleList::getLocationOnScreen( ) && (m_pListBoxHelper->GetStyle() & WB_DROPDOWN ) == WB_DROPDOWN ) { if ( m_pListBoxHelper->IsInDropDown() ) - aPos = VCLUnoHelper::ConvertToAWTPoint( + aPos = vcl::unohelper::ConvertToAWTPoint( m_pListBoxHelper->GetDropDownPosSizePixel().TopLeft()); } else diff --git a/accessibility/source/standard/vclxaccessiblelistitem.cxx b/accessibility/source/standard/vclxaccessiblelistitem.cxx index 7625d05cdf24..0a9d2bee1806 100644 --- a/accessibility/source/standard/vclxaccessiblelistitem.cxx +++ b/accessibility/source/standard/vclxaccessiblelistitem.cxx @@ -18,7 +18,6 @@ */ #include -#include #include #include @@ -32,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -289,7 +289,7 @@ sal_Bool SAL_CALL VCLXAccessibleListItem::containsPoint( const awt::Point& _aPoi { tools::Rectangle aRect(pListBoxHelper->GetBoundingRectangle(static_cast(m_nIndexInParent))); aRect.Move(-aRect.Left(), -aRect.Top()); - bInside = aRect.Contains(VCLUnoHelper::ConvertToVCLPoint(_aPoint)); + bInside = aRect.Contains(vcl::unohelper::ConvertToVCLPoint(_aPoint)); } return bInside; } @@ -307,7 +307,7 @@ awt::Rectangle SAL_CALL VCLXAccessibleListItem::getBounds( ) awt::Rectangle aRect; ::accessibility::IComboListBoxHelper* pListBoxHelper = m_xParent.is() ? m_xParent->getListBoxHelper() : nullptr; if (pListBoxHelper) - aRect = VCLUnoHelper::ConvertToAWTRect( + aRect = vcl::unohelper::ConvertToAWTRect( pListBoxHelper->GetBoundingRectangle(static_cast(m_nIndexInParent))); return aRect; @@ -325,7 +325,7 @@ awt::Point SAL_CALL VCLXAccessibleListItem::getLocation( ) tools::Rectangle aRect = pListBoxHelper->GetBoundingRectangle( static_cast(m_nIndexInParent) ); aPoint = aRect.TopLeft(); } - return VCLUnoHelper::ConvertToAWTPoint(aPoint); + return vcl::unohelper::ConvertToAWTPoint(aPoint); } awt::Point SAL_CALL VCLXAccessibleListItem::getLocationOnScreen( ) @@ -341,7 +341,7 @@ awt::Point SAL_CALL VCLXAccessibleListItem::getLocationOnScreen( ) aPoint = aRect.TopLeft(); aPoint += Point(pListBoxHelper->GetWindowExtentsAbsolute().TopLeft()); } - return VCLUnoHelper::ConvertToAWTPoint(aPoint); + return vcl::unohelper::ConvertToAWTPoint(aPoint); } awt::Size SAL_CALL VCLXAccessibleListItem::getSize( ) @@ -354,7 +354,7 @@ awt::Size SAL_CALL VCLXAccessibleListItem::getSize( ) if (pListBoxHelper) aSize = pListBoxHelper->GetBoundingRectangle( static_cast(m_nIndexInParent) ).GetSize(); - return VCLUnoHelper::ConvertToAWTSize(aSize); + return vcl::unohelper::ConvertToAWTSize(aSize); } void SAL_CALL VCLXAccessibleListItem::grabFocus( ) @@ -414,7 +414,7 @@ awt::Rectangle SAL_CALL VCLXAccessibleListItem::getCharacterBounds( sal_Int32 nI tools::Rectangle aCharRect = pListBoxHelper->GetEntryCharacterBounds( m_nIndexInParent, nIndex ); tools::Rectangle aItemRect = pListBoxHelper->GetBoundingRectangle( static_cast(m_nIndexInParent) ); aCharRect.Move( -aItemRect.Left(), -aItemRect.Top() ); - aBounds = VCLUnoHelper::ConvertToAWTRect(aCharRect); + aBounds = vcl::unohelper::ConvertToAWTRect(aCharRect); } return aBounds; @@ -438,7 +438,7 @@ sal_Int32 SAL_CALL VCLXAccessibleListItem::getIndexAtPoint( const awt::Point& aP { sal_Int32 nPos = LISTBOX_ENTRY_NOTFOUND; tools::Rectangle aItemRect = pListBoxHelper->GetBoundingRectangle( static_cast(m_nIndexInParent) ); - Point aPnt(VCLUnoHelper::ConvertToVCLPoint(aPoint)); + Point aPnt(vcl::unohelper::ConvertToVCLPoint(aPoint)); aPnt += aItemRect.TopLeft(); sal_Int32 nI = pListBoxHelper->GetIndexForPoint( aPnt, nPos ); if ( nI != -1 && m_nIndexInParent == nPos ) diff --git a/accessibility/source/standard/vclxaccessibleradiobutton.cxx b/accessibility/source/standard/vclxaccessibleradiobutton.cxx index 3e1cd085fdfb..03d12bb3ffc0 100644 --- a/accessibility/source/standard/vclxaccessibleradiobutton.cxx +++ b/accessibility/source/standard/vclxaccessibleradiobutton.cxx @@ -30,11 +30,11 @@ #include #include #include +#include #include #include #include #include -#include using namespace ::com::sun::star; using namespace ::com::sun::star::uno; diff --git a/accessibility/source/standard/vclxaccessiblescrollbar.cxx b/accessibility/source/standard/vclxaccessiblescrollbar.cxx index 7ffc11da3390..cc58f17efa06 100644 --- a/accessibility/source/standard/vclxaccessiblescrollbar.cxx +++ b/accessibility/source/standard/vclxaccessiblescrollbar.cxx @@ -28,9 +28,9 @@ #include #include #include +#include #include #include -#include using namespace ::com::sun::star; using namespace ::com::sun::star::uno; diff --git a/accessibility/source/standard/vclxaccessiblestatusbar.cxx b/accessibility/source/standard/vclxaccessiblestatusbar.cxx index 416c5781b156..877abf27e090 100644 --- a/accessibility/source/standard/vclxaccessiblestatusbar.cxx +++ b/accessibility/source/standard/vclxaccessiblestatusbar.cxx @@ -19,12 +19,12 @@ #include #include -#include #include #include #include #include #include +#include #include @@ -307,7 +307,7 @@ Reference< XAccessible > VCLXAccessibleStatusBar::getAccessibleAtPoint( const aw Reference< XAccessible > xChild; if ( m_pStatusBar ) { - sal_uInt16 nItemId = m_pStatusBar->GetItemId(VCLUnoHelper::ConvertToVCLPoint(rPoint)); + sal_uInt16 nItemId = m_pStatusBar->GetItemId(vcl::unohelper::ConvertToVCLPoint(rPoint)); sal_Int32 nItemPos = m_pStatusBar->GetItemPos( nItemId ); if ( nItemPos >= 0 && o3tl::make_unsigned(nItemPos) < m_aAccessibleChildren.size() ) xChild = getAccessibleChild( nItemPos ); diff --git a/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx b/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx index b49f3cbecd4b..58eb5f42005c 100644 --- a/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx +++ b/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx @@ -18,8 +18,6 @@ */ #include -#include -#include #include #include @@ -30,8 +28,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -148,7 +148,7 @@ awt::Rectangle VCLXAccessibleStatusBarItem::implGetBounds() awt::Rectangle aBounds( 0, 0, 0, 0 ); if ( m_pStatusBar ) - aBounds = VCLUnoHelper::ConvertToAWTRect(m_pStatusBar->GetItemRect(m_nItemId)); + aBounds = vcl::unohelper::ConvertToAWTRect(m_pStatusBar->GetItemRect(m_nItemId)); return aBounds; } @@ -378,24 +378,6 @@ sal_Int32 VCLXAccessibleStatusBarItem::getBackground( ) // XAccessibleExtendedComponent - -Reference< awt::XFont > VCLXAccessibleStatusBarItem::getFont( ) -{ - OExternalLockGuard aGuard( this ); - - Reference< awt::XFont > xFont; - Reference< XAccessible > xParent = getAccessibleParent(); - if ( xParent.is() ) - { - Reference< XAccessibleExtendedComponent > xParentComp( xParent->getAccessibleContext(), UNO_QUERY ); - if ( xParentComp.is() ) - xFont = xParentComp->getFont(); - } - - return xFont; -} - - OUString VCLXAccessibleStatusBarItem::getTitledBorderText( ) { OExternalLockGuard aGuard( this ); @@ -500,7 +482,7 @@ awt::Rectangle VCLXAccessibleStatusBarItem::getCharacterBounds( sal_Int32 nIndex m_pStatusBar->RecordLayoutData( &aLayoutData, aItemRect ); tools::Rectangle aCharRect = aLayoutData.GetCharacterBounds( nIndex ); aCharRect.Move( -aItemRect.Left(), -aItemRect.Top() ); - aBounds = VCLUnoHelper::ConvertToAWTRect(aCharRect); + aBounds = vcl::unohelper::ConvertToAWTRect(aCharRect); } return aBounds; @@ -517,7 +499,7 @@ sal_Int32 VCLXAccessibleStatusBarItem::getIndexAtPoint( const awt::Point& aPoint vcl::ControlLayoutData aLayoutData; tools::Rectangle aItemRect = m_pStatusBar->GetItemRect( m_nItemId ); m_pStatusBar->RecordLayoutData( &aLayoutData, aItemRect ); - Point aPnt(VCLUnoHelper::ConvertToVCLPoint(aPoint)); + Point aPnt(vcl::unohelper::ConvertToVCLPoint(aPoint)); aPnt += aItemRect.TopLeft(); nIndex = aLayoutData.GetIndexForPoint( aPnt ); } diff --git a/accessibility/source/standard/vclxaccessibletabpage.cxx b/accessibility/source/standard/vclxaccessibletabpage.cxx index 1cf1330cfbe9..f4a221ec687f 100644 --- a/accessibility/source/standard/vclxaccessibletabpage.cxx +++ b/accessibility/source/standard/vclxaccessibletabpage.cxx @@ -18,8 +18,6 @@ */ #include -#include -#include #include #include @@ -30,8 +28,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -191,7 +191,7 @@ awt::Rectangle VCLXAccessibleTabPage::implGetBounds() awt::Rectangle aBounds( 0, 0, 0, 0 ); if ( m_pTabControl ) - aBounds = VCLUnoHelper::ConvertToAWTRect(m_pTabControl->GetTabBounds(m_nPageId)); + aBounds = vcl::unohelper::ConvertToAWTRect(m_pTabControl->GetTabBounds(m_nPageId)); return aBounds; } @@ -407,8 +407,8 @@ Reference< XAccessible > VCLXAccessibleTabPage::getAccessibleAtPoint( const awt: Reference< XAccessibleComponent > xComp( xAcc->getAccessibleContext(), UNO_QUERY ); if ( xComp.is() ) { - tools::Rectangle aRect = VCLUnoHelper::ConvertToVCLRect(xComp->getBounds()); - Point aPos = VCLUnoHelper::ConvertToVCLPoint(rPoint); + tools::Rectangle aRect = vcl::unohelper::ConvertToVCLRect(xComp->getBounds()); + Point aPos = vcl::unohelper::ConvertToVCLPoint(rPoint); if ( aRect.Contains( aPos ) ) { return xAcc; @@ -469,24 +469,6 @@ sal_Int32 VCLXAccessibleTabPage::getBackground( ) // XAccessibleExtendedComponent - -Reference< awt::XFont > VCLXAccessibleTabPage::getFont( ) -{ - OExternalLockGuard aGuard( this ); - - Reference< awt::XFont > xFont; - Reference< XAccessible > xParent = getAccessibleParent(); - if ( xParent.is() ) - { - Reference< XAccessibleExtendedComponent > xParentComp( xParent->getAccessibleContext(), UNO_QUERY ); - if ( xParentComp.is() ) - xFont = xParentComp->getFont(); - } - - return xFont; -} - - OUString VCLXAccessibleTabPage::getTitledBorderText( ) { OExternalLockGuard aGuard( this ); @@ -586,7 +568,7 @@ awt::Rectangle VCLXAccessibleTabPage::getCharacterBounds( sal_Int32 nIndex ) tools::Rectangle aPageRect = m_pTabControl->GetTabBounds( m_nPageId ); tools::Rectangle aCharRect; // m_pTabControl->GetCharacterBounds( m_nPageId, nIndex ); aCharRect.Move( -aPageRect.Left(), -aPageRect.Top() ); - aBounds = VCLUnoHelper::ConvertToAWTRect(aCharRect); + aBounds = vcl::unohelper::ConvertToAWTRect(aCharRect); } return aBounds; @@ -602,7 +584,7 @@ sal_Int32 VCLXAccessibleTabPage::getIndexAtPoint( const awt::Point& /*aPoint*/ ) // { // sal_uInt16 nPageId = 0; // tools::Rectangle aPageRect = m_pTabControl->GetTabBounds( m_nPageId ); -// Point aPnt( VCLUnoHelper::ConvertToVCLPoint( aPoint ) ); +// Point aPnt( vcl::unohelper::ConvertToVCLPoint( aPoint ) ); // aPnt += aPageRect.TopLeft(); // sal_Int32 nI = m_pTabControl->GetIndexForPoint( aPnt, nPageId ); // if ( nI != -1 && m_nPageId == nPageId ) diff --git a/accessibility/source/standard/vclxaccessibletabpagewindow.cxx b/accessibility/source/standard/vclxaccessibletabpagewindow.cxx index 32424e807cec..be41e86b1634 100644 --- a/accessibility/source/standard/vclxaccessibletabpagewindow.cxx +++ b/accessibility/source/standard/vclxaccessibletabpagewindow.cxx @@ -19,9 +19,9 @@ #include #include -#include #include #include +#include #include using namespace ::com::sun::star; @@ -72,7 +72,7 @@ awt::Rectangle VCLXAccessibleTabPageWindow::implGetBounds() { tools::Rectangle aRect( m_pTabPage->GetPosPixel(), m_pTabPage->GetSizePixel() ); aRect.Move( -aPageRect.Left(), -aPageRect.Top() ); - aBounds = VCLUnoHelper::ConvertToAWTRect(aRect); + aBounds = vcl::unohelper::ConvertToAWTRect(aRect); } } diff --git a/accessibility/source/standard/vclxaccessibletextcomponent.cxx b/accessibility/source/standard/vclxaccessibletextcomponent.cxx index 8085759cc948..ba2324b1bc94 100644 --- a/accessibility/source/standard/vclxaccessibletextcomponent.cxx +++ b/accessibility/source/standard/vclxaccessibletextcomponent.cxx @@ -18,20 +18,20 @@ */ #include -#include -#include #include #include #include #include #include +#include #include #include #include #include #include #include +#include #include using namespace ::com::sun::star; @@ -250,7 +250,7 @@ awt::Rectangle VCLXAccessibleTextComponent::getCharacterBounds( sal_Int32 nIndex awt::Rectangle aRect; VclPtr< Control > pControl = GetAs< Control >(); if ( pControl ) - aRect = VCLUnoHelper::ConvertToAWTRect(pControl->GetCharacterBounds(nIndex)); + aRect = vcl::unohelper::ConvertToAWTRect(pControl->GetCharacterBounds(nIndex)); return aRect; } @@ -271,7 +271,7 @@ sal_Int32 VCLXAccessibleTextComponent::getIndexAtPoint( const awt::Point& aPoint sal_Int32 nIndex = -1; VclPtr< Control > pControl = GetAs< Control >(); if ( pControl ) - nIndex = pControl->GetIndexForPoint(VCLUnoHelper::ConvertToVCLPoint(aPoint)); + nIndex = pControl->GetIndexForPoint(vcl::unohelper::ConvertToVCLPoint(aPoint)); return nIndex; } diff --git a/accessibility/source/standard/vclxaccessibletoolbox.cxx b/accessibility/source/standard/vclxaccessibletoolbox.cxx index 9d4cb3aaf203..d2a1e8d23e27 100644 --- a/accessibility/source/standard/vclxaccessibletoolbox.cxx +++ b/accessibility/source/standard/vclxaccessibletoolbox.cxx @@ -20,13 +20,13 @@ #include #include -#include #include #include #include #include #include +#include #include #include #include @@ -664,7 +664,7 @@ Reference< XAccessible > SAL_CALL VCLXAccessibleToolBox::getAccessibleAtPoint( c if ( pToolBox ) { ToolBox::ImplToolItems::size_type nItemPos - = pToolBox->GetItemPos(VCLUnoHelper::ConvertToVCLPoint(_rPoint)); + = pToolBox->GetItemPos(vcl::unohelper::ConvertToVCLPoint(_rPoint)); if ( nItemPos != ToolBox::ITEM_NOTFOUND ) xAccessible = getAccessibleChild( nItemPos ); } diff --git a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx index bb6796ba4d76..754bbad58392 100644 --- a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx +++ b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx @@ -18,7 +18,6 @@ */ #include -#include #include #include #include @@ -31,13 +30,14 @@ #include #include #include +#include #include #include +#include #include #include #include #include -#include #include #include @@ -208,7 +208,7 @@ awt::Rectangle VCLXAccessibleToolBoxItem::implGetBounds( ) { awt::Rectangle aRect; if ( m_pToolBox ) - aRect = VCLUnoHelper::ConvertToAWTRect(m_pToolBox->GetItemPosRect(m_nIndexInParent)); + aRect = vcl::unohelper::ConvertToAWTRect(m_pToolBox->GetItemPosRect(m_nIndexInParent)); return aRect; } @@ -477,7 +477,7 @@ awt::Rectangle SAL_CALL VCLXAccessibleToolBoxItem::getCharacterBounds( sal_Int32 tools::Rectangle aCharRect = m_pToolBox->GetCharacterBounds( m_nItemId, nIndex ); tools::Rectangle aItemRect = m_pToolBox->GetItemRect( m_nItemId ); aCharRect.Move( -aItemRect.Left(), -aItemRect.Top() ); - aBounds = VCLUnoHelper::ConvertToAWTRect(aCharRect); + aBounds = vcl::unohelper::ConvertToAWTRect(aCharRect); } return aBounds; @@ -492,7 +492,7 @@ sal_Int32 SAL_CALL VCLXAccessibleToolBoxItem::getIndexAtPoint( const awt::Point& { ToolBoxItemId nItemId; tools::Rectangle aItemRect = m_pToolBox->GetItemRect( m_nItemId ); - Point aPnt(VCLUnoHelper::ConvertToVCLPoint(aPoint)); + Point aPnt(vcl::unohelper::ConvertToVCLPoint(aPoint)); aPnt += aItemRect.TopLeft(); sal_Int32 nIdx = m_pToolBox->GetIndexForPoint( aPnt, nItemId ); if ( nIdx != -1 && nItemId == m_nItemId ) @@ -594,10 +594,6 @@ sal_Int32 SAL_CALL VCLXAccessibleToolBoxItem::getBackground( ) } // XAccessibleExtendedComponent -Reference< awt::XFont > SAL_CALL VCLXAccessibleToolBoxItem::getFont( ) -{ - return uno::Reference< awt::XFont >(); -} OUString SAL_CALL VCLXAccessibleToolBoxItem::getTitledBorderText( ) { diff --git a/autogen.sh b/autogen.sh index 889bb463b830..7fe3e05eea0d 100755 --- a/autogen.sh +++ b/autogen.sh @@ -45,7 +45,10 @@ sub sanity_checks($) $autoconf => "autoconf is required", $aclocal => "$aclocal is required", ); - + if ($ENV{WSL_DISTRO_NAME} && $ENV{PATH} =~ /mingw64/) { + # for wsl-as-helper build we only need the m4 macros like for macOS + delete $required{'pkg-config'}; + } for my $elem (@path) { for my $app (keys %required) { if (-f "$elem/$app") { @@ -160,7 +163,8 @@ if (defined $ENV{LODE_HOME}) my $aclocal_flags = $ENV{ACLOCAL_FLAGS}; $aclocal_flags .= " -I $src_path/m4"; -$aclocal_flags .= " -I $src_path/m4/mac" if ($system eq 'Darwin'); +# the m4/mac directory provides the pkg-config macros used in configure +$aclocal_flags .= " -I $src_path/m4/mac" if ($system eq 'Darwin' || ($ENV{WSL_DISTRO_NAME} && $ENV{PATH} =~ /mingw64/)); $ENV{AUTOMAKE_EXTRA_FLAGS} = '--warnings=no-portability' if (!($system eq 'Darwin')); diff --git a/basctl/source/accessibility/accessibledialogcontrolshape.cxx b/basctl/source/accessibility/accessibledialogcontrolshape.cxx index 22e9403bfed2..ce65b97f819d 100644 --- a/basctl/source/accessibility/accessibledialogcontrolshape.cxx +++ b/basctl/source/accessibility/accessibledialogcontrolshape.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include namespace basctl @@ -146,7 +147,7 @@ awt::Rectangle AccessibleDialogControlShape::GetBounds() const // clip the shape's bounding box with the bounding box of its parent tools::Rectangle aParentRect( Point( 0, 0 ), m_pDialogWindow->GetSizePixel() ); aRect = aRect.GetIntersection( aParentRect ); - aBounds = VCLUnoHelper::ConvertToAWTRect(aRect); + aBounds = vcl::unohelper::ConvertToAWTRect(aRect); } } @@ -480,33 +481,6 @@ sal_Int32 AccessibleDialogControlShape::getBackground( ) // XAccessibleExtendedComponent - -Reference< awt::XFont > AccessibleDialogControlShape::getFont( ) -{ - OExternalLockGuard aGuard( this ); - - Reference< awt::XFont > xFont; - vcl::Window* pWindow = GetWindow(); - if ( pWindow ) - { - Reference< awt::XDevice > xDev( pWindow->GetComponentInterface(), UNO_QUERY ); - if ( xDev.is() ) - { - vcl::Font aFont; - if ( pWindow->IsControlFont() ) - aFont = pWindow->GetControlFont(); - else - aFont = pWindow->GetFont(); - rtl::Reference pVCLXFont = new VCLXFont; - pVCLXFont->Init( *xDev, aFont ); - xFont = pVCLXFont; - } - } - - return xFont; -} - - OUString AccessibleDialogControlShape::getTitledBorderText( ) { OExternalLockGuard aGuard( this ); diff --git a/basctl/source/accessibility/accessibledialogwindow.cxx b/basctl/source/accessibility/accessibledialogwindow.cxx index 39b19e8a4462..d648340beb69 100644 --- a/basctl/source/accessibility/accessibledialogwindow.cxx +++ b/basctl/source/accessibility/accessibledialogwindow.cxx @@ -35,10 +35,9 @@ #include #include #include -#include -#include #include #include +#include #include namespace basctl @@ -409,7 +408,7 @@ awt::Rectangle AccessibleDialogWindow::implGetBounds() { awt::Rectangle aBounds; if ( m_pDialogWindow ) - aBounds = VCLUnoHelper::ConvertToAWTRect( + aBounds = vcl::unohelper::ConvertToAWTRect( tools::Rectangle(m_pDialogWindow->GetPosPixel(), m_pDialogWindow->GetSizePixel())); return aBounds; @@ -685,8 +684,8 @@ Reference< XAccessible > AccessibleDialogWindow::getAccessibleAtPoint( const awt Reference< XAccessibleComponent > xComp( xAcc->getAccessibleContext(), UNO_QUERY ); if ( xComp.is() ) { - tools::Rectangle aRect = VCLUnoHelper::ConvertToVCLRect(xComp->getBounds()); - Point aPos = VCLUnoHelper::ConvertToVCLPoint(rPoint); + tools::Rectangle aRect = vcl::unohelper::ConvertToVCLRect(xComp->getBounds()); + Point aPos = vcl::unohelper::ConvertToVCLPoint(rPoint); if ( aRect.Contains( aPos ) ) { xChild = std::move(xAcc); @@ -750,32 +749,6 @@ sal_Int32 AccessibleDialogWindow::getBackground( ) // XAccessibleExtendedComponent - -Reference< awt::XFont > AccessibleDialogWindow::getFont( ) -{ - OExternalLockGuard aGuard( this ); - - Reference< awt::XFont > xFont; - if ( m_pDialogWindow ) - { - Reference< awt::XDevice > xDev( m_pDialogWindow->GetComponentInterface(), UNO_QUERY ); - if ( xDev.is() ) - { - vcl::Font aFont; - if ( m_pDialogWindow->IsControlFont() ) - aFont = m_pDialogWindow->GetControlFont(); - else - aFont = m_pDialogWindow->GetFont(); - rtl::Reference pVCLXFont = new VCLXFont; - pVCLXFont->Init( *xDev, aFont ); - xFont = pVCLXFont; - } - } - - return xFont; -} - - OUString AccessibleDialogWindow::getTitledBorderText( ) { OExternalLockGuard aGuard( this ); diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx index 3909f696708e..991fd7d8a4c0 100644 --- a/basctl/source/basicide/moduldlg.cxx +++ b/basctl/source/basicide/moduldlg.cxx @@ -981,7 +981,8 @@ SbModule* createModImpl(weld::Window* pWin, const ScriptDocument& rDocument, // the module has existed if( rDocument.hasModule( aLibName, aModName ) ) return nullptr; - rDocument.createModule( aLibName, aModName, bMain, sModuleCode ); + if (!rDocument.createModule(aLibName, aModName, bMain, sModuleCode)) + return nullptr; BasicManager* pBasMgr = rDocument.getBasicManager(); StarBASIC* pBasic = pBasMgr? pBasMgr->GetLib( aLibName ) : nullptr; if ( pBasic ) diff --git a/basctl/source/inc/accessibledialogcontrolshape.hxx b/basctl/source/inc/accessibledialogcontrolshape.hxx index 3af6e3da90ee..6979fee0f025 100644 --- a/basctl/source/inc/accessibledialogcontrolshape.hxx +++ b/basctl/source/inc/accessibledialogcontrolshape.hxx @@ -110,7 +110,6 @@ public: virtual sal_Int32 SAL_CALL getBackground( ) override; // XAccessibleExtendedComponent - virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) override; virtual OUString SAL_CALL getTitledBorderText( ) override; virtual OUString SAL_CALL getToolTipText( ) override; }; diff --git a/basctl/source/inc/accessibledialogwindow.hxx b/basctl/source/inc/accessibledialogwindow.hxx index 0332b98a4175..42c1f9390433 100644 --- a/basctl/source/inc/accessibledialogwindow.hxx +++ b/basctl/source/inc/accessibledialogwindow.hxx @@ -124,7 +124,6 @@ public: virtual sal_Int32 SAL_CALL getBackground( ) override; // XAccessibleExtendedComponent - virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) override; virtual OUString SAL_CALL getTitledBorderText( ) override; virtual OUString SAL_CALL getToolTipText( ) override; diff --git a/canvas/source/directx/dx_canvas.cxx b/canvas/source/directx/dx_canvas.cxx index c19ea1ea9017..c2ef4d311f10 100644 --- a/canvas/source/directx/dx_canvas.cxx +++ b/canvas/source/directx/dx_canvas.cxx @@ -122,17 +122,17 @@ namespace dxcanvas OUString SAL_CALL Canvas::getServiceName( ) { - return "com.sun.star.rendering.Canvas.GDI+"; + return u"com.sun.star.rendering.Canvas.GDI+"_ustr; } // XServiceInfo css::uno::Sequence Canvas::getSupportedServiceNames( ) { - return { "com.sun.star.rendering.Canvas.GDI+" }; + return { u"com.sun.star.rendering.Canvas.GDI+"_ustr }; } OUString Canvas::getImplementationName( ) { - return "com.sun.star.comp.rendering.Canvas.GDI+"; + return u"com.sun.star.comp.rendering.Canvas.GDI+"_ustr; } sal_Bool Canvas::supportsService( const OUString& sServiceName ) { @@ -212,17 +212,17 @@ namespace dxcanvas OUString SAL_CALL BitmapCanvas::getServiceName( ) { - return "com.sun.star.rendering.BitmapCanvas.GDI+"; + return u"com.sun.star.rendering.BitmapCanvas.GDI+"_ustr; } // XServiceInfo css::uno::Sequence BitmapCanvas::getSupportedServiceNames( ) { - return { "com.sun.star.rendering.BitmapCanvas.GDI+" }; + return { u"com.sun.star.rendering.BitmapCanvas.GDI+"_ustr }; } OUString BitmapCanvas::getImplementationName( ) { - return "com.sun.star.comp.rendering.BitmapCanvas.GDI+"; + return u"com.sun.star.comp.rendering.BitmapCanvas.GDI+"_ustr; } sal_Bool BitmapCanvas::supportsService( const OUString& sServiceName ) { diff --git a/chart2/source/controller/accessibility/AccessibleChartElement.cxx b/chart2/source/controller/accessibility/AccessibleChartElement.cxx index 2ed0d06e29c4..adec462c4db3 100644 --- a/chart2/source/controller/accessibility/AccessibleChartElement.cxx +++ b/chart2/source/controller/accessibility/AccessibleChartElement.cxx @@ -138,25 +138,6 @@ OUString SAL_CALL AccessibleChartElement::getAccessibleDescription() } // ________ AccessibleChartElement::XAccessibleExtendedComponent ________ -Reference< awt::XFont > SAL_CALL AccessibleChartElement::getFont() -{ - CheckDisposeState(); - - Reference< awt::XFont > xFont; - Reference< awt::XDevice > xDevice( Reference< awt::XWindow >( GetInfo().m_xWindow ), uno::UNO_QUERY ); - - if( xDevice.is()) - { - Reference< beans::XMultiPropertySet > xObjProp( - ObjectIdentifier::getObjectPropertySet( - GetInfo().m_aOID.getObjectCID(), GetInfo().m_xChartDocument ), uno::UNO_QUERY ); - awt::FontDescriptor aDescr( - CharacterProperties::createFontDescriptorFromPropertySet( xObjProp )); - xFont = xDevice->getFont( aDescr ); - } - - return xFont; -} OUString SAL_CALL AccessibleChartElement::getTitledBorderText() { diff --git a/chart2/source/controller/accessibility/AccessibleChartElement.hxx b/chart2/source/controller/accessibility/AccessibleChartElement.hxx index 283efed69d80..e2a94bf69ff8 100644 --- a/chart2/source/controller/accessibility/AccessibleChartElement.hxx +++ b/chart2/source/controller/accessibility/AccessibleChartElement.hxx @@ -70,7 +70,6 @@ public: virtual OUString SAL_CALL getAccessibleDescription() override; // ________ XAccessibleExtendedComponent ________ - virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont() override; virtual OUString SAL_CALL getTitledBorderText() override; virtual OUString SAL_CALL getToolTipText() override; diff --git a/chart2/source/controller/accessibility/AccessibleChartShape.cxx b/chart2/source/controller/accessibility/AccessibleChartShape.cxx index f0ebacf77a86..6d573762eb95 100644 --- a/chart2/source/controller/accessibility/AccessibleChartShape.cxx +++ b/chart2/source/controller/accessibility/AccessibleChartShape.cxx @@ -215,15 +215,6 @@ sal_Int32 AccessibleChartShape::getBackground() } // ________ XAccessibleExtendedComponent ________ -Reference< awt::XFont > AccessibleChartShape::getFont() -{ - Reference< awt::XFont > xFont; - if ( m_pAccShape.is() ) - { - xFont.set( m_pAccShape->getFont() ); - } - return xFont; -} OUString AccessibleChartShape::getTitledBorderText() { diff --git a/chart2/source/controller/accessibility/AccessibleChartShape.hxx b/chart2/source/controller/accessibility/AccessibleChartShape.hxx index c31204ed3c8a..3f8975921e68 100644 --- a/chart2/source/controller/accessibility/AccessibleChartShape.hxx +++ b/chart2/source/controller/accessibility/AccessibleChartShape.hxx @@ -69,7 +69,6 @@ public: virtual sal_Int32 SAL_CALL getBackground() override; // ________ XAccessibleExtendedComponent ________ - virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont() override; virtual OUString SAL_CALL getTitledBorderText() override; virtual OUString SAL_CALL getToolTipText() override; diff --git a/compilerplugins/clang/unusedfields.py b/compilerplugins/clang/unusedfields.py index bbfbd0164dca..83e21bb8df62 100755 --- a/compilerplugins/clang/unusedfields.py +++ b/compilerplugins/clang/unusedfields.py @@ -174,13 +174,8 @@ for d in definitionSet: if "Guard" in fieldType: continue # these are just all model classes - if (srcLoc.startswith("oox/") - or srcLoc.startswith("lotuswordpro/") - or srcLoc.startswith("include/oox/") - or srcLoc.startswith("include/filter/") - or srcLoc.startswith("hwpfilter/") - or srcLoc.startswith("filter/") - or srcLoc.startswith("vcl/source/filter/")): + if (srcLoc.startswith("lotuswordpro/") + or srcLoc.startswith("hwpfilter/")): continue if "(lambda at " in d[0]: continue diff --git a/config_host.mk.in b/config_host.mk.in index 4b7bf923a4b9..7ce742cf3987 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -383,6 +383,7 @@ export JDK_FOR_BUILD=@JDK_FOR_BUILD@ export JDK_SECURITYMANAGER_DISALLOWED_FOR_BUILD=@JDK_SECURITYMANAGER_DISALLOWED_FOR_BUILD@ export JFREEREPORT_JAR=@JFREEREPORT_JAR@ export JITC_PROCESSOR_TYPE=@JITC_PROCESSOR_TYPE@ +JOM=@JOM@ export JQ=@JQ@ export JVM_ONE_PATH_CHECK=@JVM_ONE_PATH_CHECK@ export KF5_CFLAGS=$(gb_SPACE)@KF5_CFLAGS@ diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx index 6b38219eacde..15e218f55fc0 100644 --- a/configmgr/source/xcuparser.cxx +++ b/configmgr/source/xcuparser.cxx @@ -219,6 +219,10 @@ XcuParser::Operation XcuParser::parseOperation(xmlreader::Span const & text) { "invalid op " + text.convertFromUtf8()); } +bool XcuParser::isAlreadyFinalized(int finalizedLayer) const { + return finalizedLayer != Data::NO_LAYER && finalizedLayer <= valueParser_.getLayer(); +} + void XcuParser::handleComponentData(xmlreader::XmlReader & reader) { OStringBuffer buf(256); buf.append('.'); @@ -301,14 +305,13 @@ void XcuParser::handleComponentData(xmlreader::XmlReader & reader) { throw css::uno::RuntimeException( "invalid operation on root node in " + reader.getUrl()); } - int finalizedLayer = std::min( - finalized ? valueParser_.getLayer() : Data::NO_LAYER, - node->getFinalized()); - node->setFinalized(finalizedLayer); - if (finalizedLayer < valueParser_.getLayer()) { + if (isAlreadyFinalized(node->getFinalized())) { state_.push(State::Ignore(true)); return; } + if (finalized) { + node->setFinalized(valueParser_.getLayer()); + } state_.push(State::Modify(node)); } @@ -367,7 +370,7 @@ void XcuParser::handleItem(xmlreader::XmlReader & reader) { default: break; } - if (finalizedLayer < valueParser_.getLayer()) { + if (isAlreadyFinalized(finalizedLayer)) { state_.push(State::Ignore(true)); return; } @@ -660,14 +663,13 @@ void XcuParser::handlePlainGroupProp( state_.push(State::Ignore(true)); return; } - int finalizedLayer = std::min( - finalized ? valueParser_.getLayer() : Data::NO_LAYER, - property->getFinalized()); - property->setFinalized(finalizedLayer); - if (finalizedLayer < valueParser_.getLayer()) { + if (isAlreadyFinalized(property->getFinalized())) { state_.push(State::Ignore(true)); return; } + if (finalized) { + property->setFinalized(valueParser_.getLayer()); + } if (type != TYPE_ERROR && property->getStaticType() != TYPE_ANY && type != property->getStaticType()) { @@ -703,14 +705,13 @@ void XcuParser::handleLocalizedGroupProp( state_.push(State::Ignore(true)); return; } - int finalizedLayer = std::min( - finalized ? valueParser_.getLayer() : Data::NO_LAYER, - property->getFinalized()); - property->setFinalized(finalizedLayer); - if (finalizedLayer < valueParser_.getLayer()) { + if (isAlreadyFinalized(property->getFinalized())) { state_.push(State::Ignore(true)); return; } + if (finalized) { + property->setFinalized(valueParser_.getLayer()); + } if (type != TYPE_ERROR && property->getStaticType() != TYPE_ANY && type != property->getStaticType()) { @@ -798,14 +799,13 @@ void XcuParser::handleGroupNode( throw css::uno::RuntimeException( "invalid operation on group node in " + reader.getUrl()); } - int finalizedLayer = std::min( - finalized ? valueParser_.getLayer() : Data::NO_LAYER, - child->getFinalized()); - child->setFinalized(finalizedLayer); - if (finalizedLayer < valueParser_.getLayer()) { + if (isAlreadyFinalized(child->getFinalized())) { state_.push(State::Ignore(true)); return; } + if (finalized) { + child->setFinalized(valueParser_.getLayer()); + } state_.push(State::Modify(child)); } @@ -877,12 +877,15 @@ void XcuParser::handleSetNode(xmlreader::XmlReader & reader, SetNode * set) { "set member node " + name + " references undefined template " + templateName + " in " + reader.getUrl()); } + bool alreadyFinalized = false; int finalizedLayer = finalized ? valueParser_.getLayer() : Data::NO_LAYER; int mandatoryLayer = mandatory ? valueParser_.getLayer() : Data::NO_LAYER; NodeMap & members = set->getMembers(); NodeMap::iterator i(members.find(name)); if (i != members.end()) { - finalizedLayer = std::min(finalizedLayer, i->second->getFinalized()); + auto const fin = i->second->getFinalized(); + alreadyFinalized = isAlreadyFinalized(fin); + finalizedLayer = std::min(finalizedLayer, fin); i->second->setFinalized(finalizedLayer); mandatoryLayer = std::min(mandatoryLayer, i->second->getMandatory()); i->second->setMandatory(mandatoryLayer); @@ -891,7 +894,7 @@ void XcuParser::handleSetNode(xmlreader::XmlReader & reader, SetNode * set) { return; } } - if (finalizedLayer < valueParser_.getLayer()) { + if (alreadyFinalized) { state_.push(State::Ignore(true)); return; } diff --git a/configmgr/source/xcuparser.hxx b/configmgr/source/xcuparser.hxx index e50b7b5a0fc8..680b294bd6b3 100644 --- a/configmgr/source/xcuparser.hxx +++ b/configmgr/source/xcuparser.hxx @@ -73,6 +73,8 @@ private: static Operation parseOperation(xmlreader::Span const & text); + bool isAlreadyFinalized(int finalizedLayer) const; + void handleComponentData(xmlreader::XmlReader & reader); void handleItem(xmlreader::XmlReader & reader); diff --git a/configure.ac b/configure.ac index 2a1063232fa4..370cedc91c29 100644 --- a/configure.ac +++ b/configure.ac @@ -9,7 +9,7 @@ dnl in order to create a configure script. # several non-alphanumeric characters, those are split off and used only for the # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no idea. -AC_INIT([LibreOffice],[25.2.0.0.alpha1+],[],[],[http://documentfoundation.org/]) +AC_INIT([LibreOffice],[25.8.0.0.alpha0+],[],[],[http://documentfoundation.org/]) dnl libnumbertext needs autoconf 2.68, but that can pick up autoconf268 just fine if it is installed dnl whereas aclocal (as run by autogen.sh) insists on using autoconf and fails hard @@ -335,6 +335,7 @@ if test -n "$WSL_DISTRO_NAME" && $(echo $PATH |grep -q mingw64); then fi STRAWBERRY_TOOLS="$formatted_path/c/bin" STRAWBERRY_PERL="$formatted_path/perl/bin/perl.exe" + STRAWBERRY_PERL_UNIX="$formatted_path_unix/perl/bin/perl.exe" AC_ARG_WITH([wsl-command], [AS_HELP_STRING([--with-wsl-command], [Specify your wsl distro command if it isn't the default/the one used with just wsl.exe – @@ -6834,14 +6835,22 @@ dnl Testing for required Perl modules dnl =================================================================== AC_MSG_CHECKING([for required Perl modules]) +dnl Digest::MD5 seems only be used for packaging, but is basically a given perl_use_string="use Cwd ; use Digest::MD5" +perl_use_string_spp="use Cwd ; use Digest::MD5" if test "$_os" = "WINNT"; then if test -n "$PKGFORMAT"; then for i in $PKGFORMAT; do case "$i" in msi) # for getting fonts versions to use in MSI - perl_use_string="$perl_use_string ; use Font::TTF::Font" + if test -n "$WSL_ONLY_AS_HELPER"; then + # in case of a wsl-as-helper build, the packaging is done using strawberry-perl + # and not the perl provided by git-bash + perl_use_string_spp="$perl_use_string_spp ; use Font::TTF::Font" + else + perl_use_string="$perl_use_string ; use Font::TTF::Font" + fi ;; esac done @@ -6852,10 +6861,38 @@ if test "$with_system_hsqldb" = "yes"; then fi if test "$enable_openssl" = "yes" -a "$with_system_openssl" != "yes"; then # OpenSSL needs that to build - perl_use_string="$perl_use_string ; use FindBin" + if test -n "$WSL_ONLY_AS_HELPER"; then + # OpenSSL is built via spp, FindBin is provided by default, but deps might change in future + perl_use_string_spp="$perl_use_string_spp ; use FindBin" + else + perl_use_string="$perl_use_string ; use FindBin" + fi fi +dnl in WSL_ONLY_AS_HELPER case the test should be done with git-bash-provided-perl and not perl from +dnl the wsl container, but that can wait until we require a module that's not provided by default if $PERL -e "$perl_use_string">/dev/null 2>&1; then AC_MSG_RESULT([all modules found]) + if test -n "$WSL_ONLY_AS_HELPER"; then + AC_MSG_CHECKING([for required Perl modules in Strawberry Perl]) + if $STRAWBERRY_PERL_UNIX -e "$perl_use_string_spp">/dev/null 2>&1; then + AC_MSG_RESULT([all modules found]) + else + AC_MSG_RESULT([failed to find some modules]) + # Find out which modules are missing. + for i in $perl_use_string_spp; do + if test "$i" != "use" -a "$i" != ";"; then + if ! $STRAWBERRY_PERL_UNIX -e "use $i;">/dev/null 2>&1; then + missing_perl_modules="$missing_perl_modules $i" + fi + fi + done + PathFormat "$(dirname $STRAWBERRY_PERL_UNIX)" + spp_cpan_command='PATH="$(cygpath.exe -up "'$STRAWBERRY_TOOLS';'$formatted_path'"):$PATH" cpanm' + AC_MSG_ERROR([ + The missing Perl modules are: $missing_perl_modules + Install them with »$spp_cpan_command $missing_perl_modules«]) + fi + fi else AC_MSG_RESULT([failed to find some modules]) # Find out which modules are missing. @@ -10441,7 +10478,7 @@ if test \( "$cross_compiling" = yes -a -z "$PYTHON_FOR_BUILD" \) -o "$enable_pyt SYSTEM_PYTHON= PYTHON_VERSION_MAJOR=3 PYTHON_VERSION_MINOR=10 - PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.15 + PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.16 if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in download.lst]) fi @@ -15609,6 +15646,22 @@ else fi AC_SUBST(KEEP_AWAKE_CMD) +dnl ========================================= +dnl Check for Jom (parallel nmake) +dnl ========================================= +if test "$_os" = "WINNT"; then + AC_MSG_CHECKING([for jom (parallel nmake)]) + AC_PATH_PROG([JOM], [jom.exe]) + if test -z "$JOM"; then + AC_MSG_NOTICE([jom can help accelerate your build, but is completely optional. Get it from https://wiki.qt.io/Jom]) + AC_MSG_NOTICE([and put it in PATH or add JOM=/unix/style/path/to/jom.exe to your autogen.input to use it]) + else + PathFormat "$JOM" + JOM="$formatted_path" + fi + AC_SUBST(JOM) +fi + dnl =================================================================== dnl Setting up the environment. dnl =================================================================== @@ -15788,6 +15841,7 @@ if test -n "$WSL_ONLY_AS_HELPER"; then WGET= GNUTAR="tar.exe" SHA256SUM="sha256sum.exe" + COMPRESSIONTOOL="/usr/bin/gzip" # TODO: maybe switch to strawberry-perl right away? # only openssl seems to actually require it (for Pod/Usage.pm and maybe more) PERL="perl.exe" diff --git a/cui/Library_cui.mk b/cui/Library_cui.mk index 4942d1548524..5745cf821341 100644 --- a/cui/Library_cui.mk +++ b/cui/Library_cui.mk @@ -32,7 +32,7 @@ $(eval $(call gb_Library_use_sdk_api,cui)) $(eval $(call gb_Library_use_libraries,cui,\ $(call gb_Helper_optional,AVMEDIA,avmedia) \ - basctl \ + $(call gb_Helper_optional,SCRIPTING,basctl) \ basegfx \ comphelper \ cppu \ @@ -148,7 +148,8 @@ $(eval $(call gb_Library_add_exception_objects,cui,\ cui/source/dialogs/GraphicTestsDialog \ cui/source/dialogs/ImageViewerDialog \ cui/source/dialogs/scriptdlg \ - cui/source/dialogs/MacroManagerDialog \ + $(call gb_Helper_optional,SCRIPTING, \ + cui/source/dialogs/MacroManagerDialog) \ cui/source/dialogs/SignatureLineDialogBase \ cui/source/dialogs/SignatureLineDialog \ cui/source/dialogs/SignSignatureLineDialog \ diff --git a/cui/inc/strings.hrc b/cui/inc/strings.hrc index 0b5068b6fcae..96ab2285b4ee 100644 --- a/cui/inc/strings.hrc +++ b/cui/inc/strings.hrc @@ -421,6 +421,7 @@ #define STR_AVOID_NEWLINES_SPACE NC_("STR_AVOID_NEWLINES_SPACE", "Check if document contains new lines to create space.") #define STR_AVOID_SPACES_SPACE NC_("STR_AVOID_SPACES_SPACE", "Check if document contains extra spaces to create space.") #define STR_AVOID_TABS_FORMATTING NC_("STR_AVOID_TABS_FORMATTING", "Check if document contains tabs for formatting.") +#define STR_AVOID_EMPTY_NUM_PARA NC_("STR_AVOID_EMPTY_NUM_PARA", "Check if document contains new empty lines between numbered paragraphs.") #define STR_HEADINGS_NOT_IN_ORDER NC_("STR_HEADINGS_NOT_IN_ORDER", "Check if the outline levels of all headings are in sequential order.") #define STR_TEXT_FORMATTING_CONVEYS_MEAN NC_("STR_TEXT_FORMATTING_CONVEYS_MEANING", "Check if the document contains direct formatting.") #define STR_NON_INTERACTIVE_FORMS NC_("STR_NON_INTERACTIVE_FORMS", "Check if the document contains interactive input fields.") diff --git a/cui/source/dialogs/MacroManagerDialog.cxx b/cui/source/dialogs/MacroManagerDialog.cxx index 021bcaf19751..a017e4da31fb 100644 --- a/cui/source/dialogs/MacroManagerDialog.cxx +++ b/cui/source/dialogs/MacroManagerDialog.cxx @@ -188,7 +188,7 @@ void ScriptContainersListBox::Remove(const weld::TreeIter* pEntryIter, bool bRem while (m_xTreeView->iter_compare(*xIter, *pEntryIter) != 0) { m_xTreeView->copy_iterator(*xIter, *xRemoveIter); - m_xTreeView->iter_previous(*xIter); + (void)m_xTreeView->iter_previous(*xIter); ScriptContainerInfo* pScriptContainerInfo = weld::fromId(m_xTreeView->get_id(*xRemoveIter)); if (pScriptContainerInfo) @@ -1153,7 +1153,7 @@ void MacroManagerDialog::CheckButtons() } } - // scripts list box state dependant buttons + // scripts list box state dependent buttons weld::TreeView& rScriptsTreeView = m_xScriptsListBox->get_widget(); std::unique_ptr xScriptsSelectedIter = rScriptsTreeView.make_iterator(); if (rScriptsTreeView.n_children() @@ -2156,7 +2156,7 @@ OUString MacroManagerDialog::getListOfChildren( return result.makeStringAndClear(); } -// modified verson of void SvxScriptOrgDialog::deleteEntry(const weld::TreeIter& rEntry) +// modified version of void SvxScriptOrgDialog::deleteEntry(const weld::TreeIter& rEntry) // cui/source/dialogs/scriptdlg.cxx void MacroManagerDialog::ScriptingFrameworkScriptsDeleteEntry(weld::TreeView& rTreeView, const weld::TreeIter& rEntry) diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index 2018878eaefa..bb1561f4803c 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -1003,13 +1003,31 @@ VclPtr AbstractDialogFactory_Impl::CreateMacroManagerDialog(weld::Window* pParent, const Reference& rxFrame) { +#if HAVE_FEATURE_SCRIPTING return VclPtr::Create( std::make_shared(pParent, rxFrame)); +#else + (void)pParent; + (void)rxFrame; + return nullptr; +#endif } -OUString AbstractMacroManagerDialog_Impl::GetScriptURL() const { return m_xDlg->GetScriptURL(); } +OUString AbstractMacroManagerDialog_Impl::GetScriptURL() const +{ +#if HAVE_FEATURE_SCRIPTING + return m_xDlg->GetScriptURL(); +#else + return OUString(); +#endif +} -void AbstractMacroManagerDialog_Impl::LoadLastUsedMacro() const { m_xDlg->LoadLastUsedMacro(); } +void AbstractMacroManagerDialog_Impl::LoadLastUsedMacro() const +{ +#if HAVE_FEATURE_SCRIPTING + m_xDlg->LoadLastUsedMacro(); +#endif +} VclPtr AbstractDialogFactory_Impl::CreateSvxScriptOrgDialog(weld::Window* pParent, const OUString& rLanguage) diff --git a/cui/source/inc/MacroManagerDialog.hxx b/cui/source/inc/MacroManagerDialog.hxx index 64854d6980a6..25b24c1b6c8e 100644 --- a/cui/source/inc/MacroManagerDialog.hxx +++ b/cui/source/inc/MacroManagerDialog.hxx @@ -151,10 +151,6 @@ public: { m_xTreeView->connect_changed(rLink); } - void set_size_request(int nWidth, int nHeight) - { - m_xTreeView->set_size_request(nWidth, nHeight); - } weld::TreeView& get_widget() { return *m_xTreeView; } void ClearAll(); diff --git a/cui/source/options/optaccessibility.cxx b/cui/source/options/optaccessibility.cxx index 41cb13f358ac..27971df71360 100644 --- a/cui/source/options/optaccessibility.cxx +++ b/cui/source/options/optaccessibility.cxx @@ -37,10 +37,13 @@ namespace { u"NoAltOleObj"_ustr, { sfx::AccessibilityIssueID::NO_ALT_OLE, STR_NO_ALT_OLE } }, { u"NoAltGraphicObj"_ustr, { sfx::AccessibilityIssueID::NO_ALT_GRAPHIC, STR_NO_ALT_GRAPHIC } }, { u"NoAltShapeObj"_ustr, { sfx::AccessibilityIssueID::NO_ALT_SHAPE, STR_NO_ALT_SHAPE } }, - { u"TextFormattings"_ustr, { sfx::AccessibilityIssueID::TEXT_FORMATTING, STR_AVOID_NEWLINES_SPACE } }, + { u"TableMergeSplit"_ustr, { sfx::AccessibilityIssueID::TABLE_MERGE_SPLIT, STR_TABLE_MERGE_SPLIT } }, + { u"TextNewLines"_ustr, { sfx::AccessibilityIssueID::TEXT_NEW_LINES, STR_AVOID_NEWLINES_SPACE } }, + { u"TextSpaces"_ustr, { sfx::AccessibilityIssueID::TEXT_SPACES, STR_AVOID_SPACES_SPACE } }, + { u"TextTabs"_ustr, { sfx::AccessibilityIssueID::TEXT_TABS, STR_AVOID_TABS_FORMATTING } }, + { u"TextEmptyNums"_ustr, { sfx::AccessibilityIssueID::TEXT_EMPTY_NUM_PARA, STR_AVOID_EMPTY_NUM_PARA } }, { u"DirectFormattings"_ustr, { sfx::AccessibilityIssueID::DIRECT_FORMATTING, STR_TEXT_FORMATTING_CONVEYS_MEAN } }, { u"TableFormattings"_ustr, { sfx::AccessibilityIssueID::TABLE_FORMATTING, STR_TABLE_FORMATTING } }, - { u"TableMergeSplit"_ustr, { sfx::AccessibilityIssueID::TABLE_MERGE_SPLIT, STR_TABLE_MERGE_SPLIT } }, { u"HyperlinkText"_ustr, { sfx::AccessibilityIssueID::HYPERLINK_IS_TEXT, STR_HYPERLINK_TEXT_IS_LINK } }, { u"HyperlinkShort"_ustr, { sfx::AccessibilityIssueID::HYPERLINK_SHORT, STR_HYPERLINK_TEXT_IS_SHORT } }, { u"HyperlinkNoName"_ustr, { sfx::AccessibilityIssueID::HYPERLINK_NO_NAME, STR_HYPERLINK_NO_NAME } }, @@ -198,8 +201,20 @@ bool SvxAccessibilityOptionsTabPage::FillItemSet( SfxItemSet* ) officecfg::Office::Common::AccessibilityIssues::NoAltShapeObj::set(bChecked, batch); break; - case sfx::AccessibilityIssueID::TEXT_FORMATTING: - officecfg::Office::Common::AccessibilityIssues::TextFormattings::set(bChecked, batch); + case sfx::AccessibilityIssueID::TEXT_NEW_LINES: + officecfg::Office::Common::AccessibilityIssues::TextNewLines::set(bChecked, batch); + break; + + case sfx::AccessibilityIssueID::TEXT_SPACES: + officecfg::Office::Common::AccessibilityIssues::TextSpaces::set(bChecked, batch); + break; + + case sfx::AccessibilityIssueID::TEXT_TABS: + officecfg::Office::Common::AccessibilityIssues::TextTabs::set(bChecked, batch); + break; + + case sfx::AccessibilityIssueID::TEXT_EMPTY_NUM_PARA: + officecfg::Office::Common::AccessibilityIssues::TextEmptyNums::set(bChecked, batch); break; case sfx::AccessibilityIssueID::DIRECT_FORMATTING: @@ -394,8 +409,20 @@ void SvxAccessibilityOptionsTabPage::Reset( const SfxItemSet* ) bChecked = officecfg::Office::Common::AccessibilityIssues::NoAltShapeObj::get(); break; - case sfx::AccessibilityIssueID::TEXT_FORMATTING: - bChecked = officecfg::Office::Common::AccessibilityIssues::TextFormattings::get(); + case sfx::AccessibilityIssueID::TEXT_NEW_LINES: + bChecked = officecfg::Office::Common::AccessibilityIssues::TextNewLines::get(); + break; + + case sfx::AccessibilityIssueID::TEXT_SPACES: + bChecked = officecfg::Office::Common::AccessibilityIssues::TextSpaces::get(); + break; + + case sfx::AccessibilityIssueID::TEXT_TABS: + bChecked = officecfg::Office::Common::AccessibilityIssues::TextTabs::get(); + break; + + case sfx::AccessibilityIssueID::TEXT_EMPTY_NUM_PARA: + bChecked = officecfg::Office::Common::AccessibilityIssues::TextEmptyNums::get(); break; case sfx::AccessibilityIssueID::DIRECT_FORMATTING: diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx index 8e008e2c8069..1f2d455a1cf0 100644 --- a/cui/source/options/optcolor.cxx +++ b/cui/source/options/optcolor.cxx @@ -278,9 +278,9 @@ private: void SetLinks(Link const&, Link const&, Link const&); - void Update (ColorConfigValue const&, const std::u16string_view&, + void Update (ColorConfigValue const&, std::u16string_view, css::uno::Reference const&); - void Update (ExtendedColorConfigValue const&, const std::u16string_view&, + void Update (ExtendedColorConfigValue const&, std::u16string_view, css::uno::Reference const&); void ColorChanged (ColorConfigValue&); void ColorChanged (ExtendedColorConfigValue&); @@ -387,7 +387,7 @@ void ColorConfigWindow_Impl::Entry::SetLinks(Link const& } // updates a default color config entry -void ColorConfigWindow_Impl::Entry::Update(ColorConfigValue const& rValue, const std::u16string_view& rConfigPath, +void ColorConfigWindow_Impl::Entry::Update(ColorConfigValue const& rValue, std::u16string_view rConfigPath, css::uno::Reference const& xReadWriteAccess) { Color aColor(rValue.nColor); @@ -418,7 +418,7 @@ void ColorConfigWindow_Impl::Entry::Update(ColorConfigValue const& rValue, const } // updates an extended color config entry -void ColorConfigWindow_Impl::Entry::Update(ExtendedColorConfigValue const& rValue, const std::u16string_view& rConfigPath, +void ColorConfigWindow_Impl::Entry::Update(ExtendedColorConfigValue const& rValue, std::u16string_view rConfigPath, css::uno::Reference const& xReadWriteAccess) { Color aColor(rValue.getColor()); diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx index 39699b90dec5..a82743627d4a 100644 --- a/desktop/source/app/updater.cxx +++ b/desktop/source/app/updater.cxx @@ -403,9 +403,9 @@ public: } }; -OUString toOUString(const std::string_view& rStr) +OUString toOUString(std::string_view str) { - return OUString::fromUtf8(rStr); + return OUString::fromUtf8(str); } update_file parse_update_file(orcus::json::node& rNode) diff --git a/download.lst b/download.lst index 74945585f4bc..06cfad37f134 100644 --- a/download.lst +++ b/download.lst @@ -320,8 +320,8 @@ GLM_TARBALL := glm-1.0.1.zip # three static lines # so that git cherry-pick # will not run into conflicts -GPGME_SHA256SUM := 61e3a6ad89323fecfaff176bc1728fb8c3312f2faa83424d9d5077ba20f5f7da -GPGME_TARBALL := gpgme-1.24.0.tar.bz2 +GPGME_SHA256SUM := ea05d0258e71061d61716584ec34cef59330a91340571edc46b78374973ba85f +GPGME_TARBALL := gpgme-1.24.1.tar.bz2 # three static lines # so that git cherry-pick # will not run into conflicts @@ -593,8 +593,8 @@ POSTGRESQL_TARBALL := postgresql-14.15.tar.bz2 # three static lines # so that git cherry-pick # will not run into conflicts -PYTHON_SHA256SUM := aab0950817735172601879872d937c1e4928a57c409ae02369ec3d91dccebe79 -PYTHON_TARBALL := Python-3.10.15.tar.xz +PYTHON_SHA256SUM := bfb249609990220491a1b92850a07135ed0831e41738cf681d63cf01b2a8fbd1 +PYTHON_TARBALL := Python-3.10.16.tar.xz # three static lines # so that git cherry-pick # will not run into conflicts diff --git a/editeng/source/accessibility/AccessibleComponentBase.cxx b/editeng/source/accessibility/AccessibleComponentBase.cxx index 5e95afbd2f70..4b1d5438b735 100644 --- a/editeng/source/accessibility/AccessibleComponentBase.cxx +++ b/editeng/source/accessibility/AccessibleComponentBase.cxx @@ -114,12 +114,6 @@ sal_Int32 SAL_CALL AccessibleComponentBase::getBackground() // XAccessibleExtendedComponent -css::uno::Reference< css::awt::XFont > SAL_CALL - AccessibleComponentBase::getFont() -{ - return uno::Reference(); -} - OUString SAL_CALL AccessibleComponentBase::getTitledBorderText() { diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 15dcc2d7dc5a..ee4f23275377 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -439,10 +439,10 @@ sal_Int32 EditEngine::GetLineNumberAtIndex( sal_Int32 nPara, sal_Int32 nIndex ) return getImpl().GetLineNumberAtIndex(nPara, nIndex); } -sal_uInt32 EditEngine::GetLineHeight( sal_Int32 nParagraph ) +sal_uInt32 EditEngine::GetLineHeight( sal_Int32 nParagraph, sal_Int32 nLine ) { // If someone calls GetLineHeight() with an empty Engine. - return getImpl().GetLineHeight( nParagraph, 0 ); + return getImpl().GetLineHeight( nParagraph, nLine ); } tools::Rectangle EditEngine::GetParaBounds( sal_Int32 nPara ) diff --git a/editeng/source/outliner/outlin2.cxx b/editeng/source/outliner/outlin2.cxx index 0e791eee9a36..a0e384d1388f 100644 --- a/editeng/source/outliner/outlin2.cxx +++ b/editeng/source/outliner/outlin2.cxx @@ -318,9 +318,9 @@ sal_Int32 Outliner::GetLineLen( sal_Int32 nParagraph, sal_Int32 nLine ) const return pEditEngine->GetLineLen( nParagraph, nLine ); } -sal_uInt32 Outliner::GetLineHeight( sal_Int32 nParagraph ) +sal_uInt32 Outliner::GetLineHeight( sal_Int32 nParagraph, sal_Int32 nLine ) { - return pEditEngine->GetLineHeight( nParagraph ); + return pEditEngine->GetLineHeight( nParagraph, nLine ); } void Outliner::RemoveCharAttribs( sal_Int32 nPara, sal_uInt16 nWhich ) diff --git a/extensions/source/scanner/sane.cxx b/extensions/source/scanner/sane.cxx index 731355e59db4..e1fde5e5213c 100644 --- a/extensions/source/scanner/sane.cxx +++ b/extensions/source/scanner/sane.cxx @@ -110,8 +110,7 @@ inline oslGenericFunction Sane::LoadSymbol( const char* pSymbolname ) oslGenericFunction pFunction = osl_getAsciiFunctionSymbol( pSaneLib, pSymbolname ); if( ! pFunction ) { - fprintf( stderr, "Could not load symbol %s\n", - pSymbolname ); + SAL_WARN( "extensions.scanner", "Could not load symbol " << pSymbolname ); bSaneSymbolLoadFailed = true; } return pFunction; @@ -269,11 +268,11 @@ void Sane::ReloadOptions() SANE_Status nStatus = p_control_option( maHandle, 0, SANE_ACTION_GET_VALUE, static_cast(pOptions), nullptr ); if( nStatus != SANE_STATUS_GOOD ) - fprintf( stderr, "Error: sane driver returned %s while reading number of options !\n", p_strstatus( nStatus ) ); + SAL_WARN( "extensions.scanner", "Error: sane driver returned " << p_strstatus( nStatus ) << " while reading number of options !" ); mnOptions = pOptions[ 0 ]; if( o3tl::make_unsigned(pZero->size) > sizeof( SANE_Word ) ) - fprintf( stderr, "driver returned number of options with larger size than SANE_Word!!!\n" ); + SAL_WARN( "extensions.scanner", "driver returned number of options with larger size than SANE_Word!!!" ); mppOptions.reset(new const SANE_Option_Descriptor*[ mnOptions ]); mppOptions[ 0 ] = pZero; for( int i = 1; i < mnOptions; i++ ) @@ -668,7 +667,7 @@ bool Sane::Start( BitmapTransporter& rBitmap ) eType = FrameStyle_Separated; break; default: - fprintf( stderr, "Warning: unknown frame style !!!\n" ); + SAL_WARN( "extensions.scanner", "Unknown frame style" ); } bool bSynchronousRead = true; @@ -717,7 +716,7 @@ bool Sane::Start( BitmapTransporter& rBitmap ) tv.tv_sec = 5; tv.tv_usec = 0; if( select( fd+1, &fdset, nullptr, nullptr, &tv ) == 0 ) - fprintf( stderr, "Timeout on sane_read descriptor\n" ); + SAL_WARN( "extensions.scanner", "Timeout on sane_read descriptor" ); } nLen = 0; nStatus = p_read( maHandle, pBuffer.get(), BYTE_BUFFER_SIZE, &nLen ); diff --git a/external/boost/0001-Add-a-comma-before-ellipsis-in-constexpr_swap.patch.2 b/external/boost/0001-Add-a-comma-before-ellipsis-in-constexpr_swap.patch.2 new file mode 100644 index 000000000000..3c3c8755fbfa --- /dev/null +++ b/external/boost/0001-Add-a-comma-before-ellipsis-in-constexpr_swap.patch.2 @@ -0,0 +1,28 @@ +From 2dfe66886d71b9a341433ea8b6ff225cc07da80b Mon Sep 17 00:00:00 2001 +From: Andrey Semashev +Date: Mon, 2 Dec 2024 19:22:20 +0300 +Subject: Add a comma before ellipsis in constexpr_swap. + +gcc 15 complains that the comma is required before vararg ellipsis. + +Fixes https://github.com/boostorg/integer/issues/35. +--- + include/boost/integer/common_factor_rt.hpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/boost/integer/common_factor_rt.hpp b/include/boost/integer/common_factor_rt.hpp +index d6765d4..817682f 100644 +--- a/include/boost/integer/common_factor_rt.hpp ++++ b/include/boost/integer/common_factor_rt.hpp +@@ -64,7 +64,7 @@ namespace boost { + return a.swap(b); + } + template +- inline constexpr void constexpr_swap(T&a, U& b...) BOOST_GCD_NOEXCEPT(T) ++ inline constexpr void constexpr_swap(T& a, U& b, ...) BOOST_GCD_NOEXCEPT(T) + { + T t(static_cast(a)); + a = static_cast(b); +-- +2.47.1 + diff --git a/external/boost/0001-Avoid-Wdeprecated-variadic-comma-omission-with-GCC-1.patch.2 b/external/boost/0001-Avoid-Wdeprecated-variadic-comma-omission-with-GCC-1.patch.2 new file mode 100644 index 000000000000..e7ebc6e18b62 --- /dev/null +++ b/external/boost/0001-Avoid-Wdeprecated-variadic-comma-omission-with-GCC-1.patch.2 @@ -0,0 +1,38 @@ +From aa25af1928cc275537276c1a50e6ba49333a3aec Mon Sep 17 00:00:00 2001 +From: Stephan Bergmann +Date: Mon, 2 Dec 2024 19:06:25 +0100 +Subject: Avoid -Wdeprecated-variadic-comma-omission with GCC 15 trunk + -std=c++26 + +...since + +"c++: Implement C++26 P3176R1 - The Oxford variadic comma" +--- + include/boost/move/detail/unique_ptr_meta_utils.hpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/include/boost/move/detail/unique_ptr_meta_utils.hpp b/include/boost/move/detail/unique_ptr_meta_utils.hpp +index 4c6aeb5..27154e0 100644 +--- a/include/boost/move/detail/unique_ptr_meta_utils.hpp ++++ b/include/boost/move/detail/unique_ptr_meta_utils.hpp +@@ -497,7 +497,7 @@ struct is_unary_function_impl + { static const bool value = true; }; + + template +-struct is_unary_function_impl ++struct is_unary_function_impl + { static const bool value = true; }; + + #else // BOOST_MOVE_TT_TEST_MSC_FUNC_SIGS +@@ -519,7 +519,7 @@ struct is_unary_function_impl + { static const bool value = true; }; + + template +-struct is_unary_function_impl ++struct is_unary_function_impl + { static const bool value = true; }; + + #endif +-- +2.47.1 + diff --git a/external/boost/UnpackedTarball_boost.mk b/external/boost/UnpackedTarball_boost.mk index 23b9a3c23dc8..3a8033bbea1e 100644 --- a/external/boost/UnpackedTarball_boost.mk +++ b/external/boost/UnpackedTarball_boost.mk @@ -36,6 +36,12 @@ boost_patches += Wundef.patch.0 boost_patches += boost.spirit.noreturn.patch +boost_patches += 0001-Add-a-comma-before-ellipsis-in-constexpr_swap.patch.2 + +# Sent upstream as "Avoid +# -Wdeprecated-variadic-comma-omission with GCC 15 trunk -std=c++26": +boost_patches += 0001-Avoid-Wdeprecated-variadic-comma-omission-with-GCC-1.patch.2 + $(eval $(call gb_UnpackedTarball_UnpackedTarball,boost)) $(eval $(call gb_UnpackedTarball_set_tarball,boost,$(BOOST_TARBALL))) diff --git a/external/gpgmepp/ExternalPackage_gpgmepp.mk b/external/gpgmepp/ExternalPackage_gpgmepp.mk index 098df90cefd8..731e3a6a87bc 100644 --- a/external/gpgmepp/ExternalPackage_gpgmepp.mk +++ b/external/gpgmepp/ExternalPackage_gpgmepp.mk @@ -15,8 +15,8 @@ ifneq ($(DISABLE_DYNLOADING),TRUE) ifeq ($(OS),LINUX) -$(eval $(call gb_ExternalPackage_add_file,gpgmepp,$(LIBO_LIB_FOLDER)/libgpgmepp.so.6,lang/cpp/src/.libs/libgpgmepp.so.6.21.0)) -$(eval $(call gb_ExternalPackage_add_file,gpgmepp,$(LIBO_LIB_FOLDER)/libgpgme.so.11,src/.libs/libgpgme.so.11.33.0)) +$(eval $(call gb_ExternalPackage_add_file,gpgmepp,$(LIBO_LIB_FOLDER)/libgpgmepp.so.6,lang/cpp/src/.libs/libgpgmepp.so.6.21.1)) +$(eval $(call gb_ExternalPackage_add_file,gpgmepp,$(LIBO_LIB_FOLDER)/libgpgme.so.11,src/.libs/libgpgme.so.11.33.1)) else ifeq ($(OS),MACOSX) diff --git a/external/gpgmepp/UnpackedTarball_gpgmepp.mk b/external/gpgmepp/UnpackedTarball_gpgmepp.mk index 58126ba4a29d..30bef6435ee5 100644 --- a/external/gpgmepp/UnpackedTarball_gpgmepp.mk +++ b/external/gpgmepp/UnpackedTarball_gpgmepp.mk @@ -28,7 +28,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,gpgmepp, \ external/gpgmepp/w32-build-fixes-2.patch \ $(if $(filter LINUX,$(OS)),external/gpgmepp/asan.patch) \ $(if $(filter LINUX,$(OS)),external/gpgmepp/rpath.patch) \ - $(if $(filter LINUX,$(OS)),external/gpgmepp/gettid.patch) \ external/gpgmepp/ubsan.patch \ external/gpgmepp/c++20.patch \ external/gpgmepp/clang-cl.patch \ diff --git a/external/gpgmepp/gettid.patch b/external/gpgmepp/gettid.patch deleted file mode 100644 index 292cc4a4baa7..000000000000 --- a/external/gpgmepp/gettid.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- src/debug.c 2024-11-08 13:08:06.174085089 +0100 -+++ src/debug.c 2024-11-08 13:11:43.133601548 +0100 -@@ -152,8 +152,10 @@ - #ifdef HAVE_W32_SYSTEM - thread = (uintptr_t)GetCurrentThreadId (); - #elif defined(__linux) -+#ifdef SYS_gettid - thread = (uintptr_t)gettid (); - #endif -+#endif - if (sizeof (thread) < len) - { - int zerolen = len; - diff --git a/external/openssl/ExternalProject_openssl.mk b/external/openssl/ExternalProject_openssl.mk index 910c957484c4..a31945fab0db 100644 --- a/external/openssl/ExternalProject_openssl.mk +++ b/external/openssl/ExternalProject_openssl.mk @@ -64,11 +64,12 @@ $(eval $(call gb_ExternalProject_use_nmake,openssl,build)) $(call gb_ExternalProject_get_state_target,openssl,build): export PERL:=$(if $(MSYSTEM),$(STRAWBERRY_PERL),$(shell cygpath -m $(PERL))) +# PARALLELISM_OPTION might be -j 16 -l 24, for jom ignore the load limit/only use the job limit $(call gb_ExternalProject_get_state_target,openssl,build): $(call gb_Trace_StartRange,openssl,EXTERNAL) $(call gb_ExternalProject_run,build,\ CONFIGURE_INSIST=1 $(PERL) Configure $(OPENSSL_PLATFORM) no-tests no-multilib \ - && nmake -f makefile \ + && $(if $(JOM),$(JOM) $(wordlist 1,2,$(PARALLELISM_OPTION)),nmake) -f makefile \ $(if $(call gb_Module__symbols_enabled,openssl),DEBUG_FLAGS_VALUE="$(gb_DEBUGINFO_FLAGS)") \ ) $(call gb_Trace_EndRange,openssl,EXTERNAL) diff --git a/external/redland/ExternalProject_raptor.mk b/external/redland/ExternalProject_raptor.mk index 259f87d2dc11..80fe12117be1 100644 --- a/external/redland/ExternalProject_raptor.mk +++ b/external/redland/ExternalProject_raptor.mk @@ -35,6 +35,7 @@ $(call gb_ExternalProject_get_state_target,raptor,build): $(if $(filter LINUX FREEBSD,$(OS)),$(strip -Wl,-z,origin -Wl,-rpath,\$$$$ORIGIN -Wl,-rpath-link,$(INSTROOT)/$(LIBO_URE_LIB_FOLDER))) \ $(if $(SYSBASE),$(if $(filter LINUX SOLARIS,$(OS)),-L$(SYSBASE)/lib -L$(SYSBASE)/usr/lib -lpthread -ldl)))' \ CPPFLAGS="$(if $(SYSBASE),-I$(SYSBASE)/usr/include) $(gb_EMSCRIPTEN_CPPFLAGS)" \ + ICU_LIBS='$(if $(filter-out MACOSX,$(OS)),$(ICU_LIBS))' \ $(gb_RUN_CONFIGURE) ./configure --disable-gtk-doc \ --enable-parsers="rdfxml ntriples turtle trig guess rss-tag-soup" \ --without-www \ diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx index 5571a38419f3..edffd563ffc5 100644 --- a/filter/source/msfilter/eschesdo.cxx +++ b/filter/source/msfilter/eschesdo.cxx @@ -53,7 +53,6 @@ ImplEESdrWriter::ImplEESdrWriter( EscherEx& rEx ) : mpEscherEx(&rEx) , mpPicStrm(nullptr) , mpHostAppData(nullptr) - , mbIsTitlePossible(false) , mpSdrPage( nullptr ) { } @@ -829,16 +828,9 @@ sal_uInt32 ImplEESdrWriter::ImplEnterAdditionalTextGroup( const Reference< XShap } -void ImplEESdrWriter::ImplInitPageValues() -{ - mbIsTitlePossible = true; // With more than one title PowerPoint will fail. -} - void ImplEESdrWriter::ImplWritePage( EscherSolverContainer& rSolverContainer, bool ooxmlExport ) { - ImplInitPageValues(); - const sal_uInt32 nShapes = mXShapes->getCount(); for( sal_uInt32 n = 0; n < nShapes; ++n ) { @@ -875,7 +867,6 @@ bool ImplEESdrWriter::ImplInitPage( const SdrPage& rPage ) mXShapes = mXDrawPage; if ( !mXShapes.is() ) return false; - ImplInitPageValues(); mpSdrPage = &rPage; mpSolverContainer.reset( new EscherSolverContainer ); @@ -898,8 +889,6 @@ bool ImplEESdrWriter::ImplInitUnoShapes( const Reference< XShapes >& rxShapes ) mXDrawPage.clear(); mXShapes = rxShapes; - ImplInitPageValues(); - mpSolverContainer.reset( new EscherSolverContainer ); return true; } diff --git a/filter/source/msfilter/eschesdo.hxx b/filter/source/msfilter/eschesdo.hxx index bd2c1153eacb..5e4bda191e1f 100644 --- a/filter/source/msfilter/eschesdo.hxx +++ b/filter/source/msfilter/eschesdo.hxx @@ -105,11 +105,9 @@ class ImplEESdrWriter SvStream* mpPicStrm; // own extensions EscherExHostAppData* mpHostAppData; - bool mbIsTitlePossible; const SdrPage* mpSdrPage; std::unique_ptr mpSolverContainer; - void ImplInitPageValues(); void ImplWritePage( EscherSolverContainer& rSolver, bool ooxmlExport ); sal_uInt32 ImplWriteShape( ImplEESdrObject& rObj, EscherSolverContainer& rSolver, diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index bea4a2aec8e5..20d3e5d9bc96 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -4408,32 +4408,11 @@ PPTStyleSheet::~PPTStyleSheet() } PPTParaPropSet::PPTParaPropSet() - : mnOriginalTextPos(0) - , mxParaSet( new ImplPPTParaPropSet ) + : mxParaSet( new ImplPPTParaPropSet ) { mxParaSet->mnHasAnm = 1; } -PPTParaPropSet::PPTParaPropSet( PPTParaPropSet const & rParaPropSet ) -{ - mxParaSet = rParaPropSet.mxParaSet; - mnOriginalTextPos = rParaPropSet.mnOriginalTextPos; -} - -PPTParaPropSet::~PPTParaPropSet() -{ -} - -PPTParaPropSet& PPTParaPropSet::operator=( const PPTParaPropSet& rParaPropSet ) -{ - if ( this != &rParaPropSet ) - { - mxParaSet = rParaPropSet.mxParaSet; - mnOriginalTextPos = rParaPropSet.mnOriginalTextPos; - } - return *this; -} - PPTCharPropSet::PPTCharPropSet(sal_uInt32 nParagraph) : mnOriginalTextPos(0) , mnParagraph(nParagraph) @@ -5069,7 +5048,6 @@ void PPTStyleTextPropReader::ReadParaProps(SvStream& rIn, const DffRecordHeader& OSL_FAIL( "SJ:PPTStyleTextPropReader::could not get this PPT_PST_StyleTextPropAtom by reading the paragraph attributes" ); } PPTParaPropSet* pPara = new PPTParaPropSet( aParaPropSet ); - pPara->mnOriginalTextPos = nCharReadCnt; aParaPropList.emplace_back( pPara ); if ( nCharCount ) { @@ -5079,7 +5057,6 @@ void PPTStyleTextPropReader::ReadParaProps(SvStream& rIn, const DffRecordHeader& if ( pDat[ nCount ] == 0xd ) { pPara = new PPTParaPropSet( aParaPropSet ); - pPara->mnOriginalTextPos = nCharReadCnt + nCount + 1; aParaPropList.emplace_back( pPara ); } } diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index 8c42ebb7a5fa..5956933154c6 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -361,7 +361,7 @@ static OUString getMimetypeForDocument( const Reference< XComponentContext >& xC } uno::Reference -PDFExport::GetCertificateFromSubjectName(const std::u16string_view& rSubjectName) const +PDFExport::GetCertificateFromSubjectName(std::u16string_view rSubjectName) const { uno::Reference xSEInitializer = xml::crypto::SEInitializer::create(mxContext); diff --git a/filter/source/pdf/pdfexport.hxx b/filter/source/pdf/pdfexport.hxx index 8bfd1c363038..0e8e7fc429bc 100644 --- a/filter/source/pdf/pdfexport.hxx +++ b/filter/source/pdf/pdfexport.hxx @@ -66,7 +66,7 @@ private: void ImplWriteWatermark( vcl::PDFWriter& rWriter, const Size& rPageSize ); void ImplWriteTiledWatermark( vcl::PDFWriter& rWriter, const Size& rPageSize ); - css::uno::Reference GetCertificateFromSubjectName(const std::u16string_view& rSubjectName) const; + css::uno::Reference GetCertificateFromSubjectName(std::u16string_view rSubjectName) const; public: diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index f7b30e5b446e..63e829653046 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -1792,11 +1792,6 @@ void SVGFilter::implGetPagePropSet( const Reference< css::drawing::XDrawPage > & mVisiblePagePropSet.bIsBackgroundVisible = true; mVisiblePagePropSet.bAreBackgroundObjectsVisible = true; mVisiblePagePropSet.bIsPageNumberFieldVisible = false; - mVisiblePagePropSet.bIsHeaderFieldVisible = false; - mVisiblePagePropSet.bIsFooterFieldVisible = true; - mVisiblePagePropSet.bIsDateTimeFieldVisible = true; - mVisiblePagePropSet.bIsDateTimeFieldFixed = true; - mVisiblePagePropSet.nDateTimeFormat = SvxDateFormat::B; mVisiblePagePropSet.nPageNumberingType = css::style::NumberingType::ARABIC; // We collect info on master page elements visibility, and placeholder text shape content. @@ -1811,14 +1806,6 @@ void SVGFilter::implGetPagePropSet( const Reference< css::drawing::XDrawPage > & implSafeGetPagePropSet( u"IsBackgroundVisible"_ustr, xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bIsBackgroundVisible; implSafeGetPagePropSet( u"IsBackgroundObjectsVisible"_ustr, xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bAreBackgroundObjectsVisible; implSafeGetPagePropSet( u"IsPageNumberVisible"_ustr, xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bIsPageNumberFieldVisible; - implSafeGetPagePropSet( u"IsHeaderVisible"_ustr, xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bIsHeaderFieldVisible; - implSafeGetPagePropSet( u"IsFooterVisible"_ustr, xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bIsFooterFieldVisible; - implSafeGetPagePropSet( u"IsDateTimeVisible"_ustr, xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bIsDateTimeFieldVisible; - - implSafeGetPagePropSet( u"IsDateTimeFixed"_ustr, xPropSet, xPropSetInfo ) >>= mVisiblePagePropSet.bIsDateTimeFieldFixed; - sal_Int32 nTmp; - if (implSafeGetPagePropSet( u"DateTimeFormat"_ustr, xPropSet, xPropSetInfo ) >>= nTmp) - mVisiblePagePropSet.nDateTimeFormat = static_cast(nTmp); if( mVisiblePagePropSet.bIsPageNumberFieldVisible ) { diff --git a/filter/source/svg/svgfilter.hxx b/filter/source/svg/svgfilter.hxx index 29b0a7d29374..90bd682fdb95 100644 --- a/filter/source/svg/svgfilter.hxx +++ b/filter/source/svg/svgfilter.hxx @@ -122,22 +122,12 @@ struct PagePropertySet bool bIsBackgroundVisible; bool bAreBackgroundObjectsVisible; bool bIsPageNumberFieldVisible; - bool bIsDateTimeFieldVisible; - bool bIsFooterFieldVisible; - bool bIsHeaderFieldVisible; sal_Int32 nPageNumberingType; - bool bIsDateTimeFieldFixed; - SvxDateFormat nDateTimeFormat; PagePropertySet() : bIsBackgroundVisible(false) , bAreBackgroundObjectsVisible(false) , bIsPageNumberFieldVisible(false) - , bIsDateTimeFieldVisible(false) - , bIsFooterFieldVisible(false) - , bIsHeaderFieldVisible(false) , nPageNumberingType(0) - , bIsDateTimeFieldFixed(false) - , nDateTimeFormat(SvxDateFormat::AppDefault) { } }; diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 6a9ae6b6219f..00c3f1eb0e40 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -1858,7 +1858,6 @@ SVGActionWriter::SVGActionWriter( SVGExport& rExport, SVGFontExport& rFontExport maAttributeWriter( rExport, rFontExport, mrCurrentState ), maTextWriter(rExport, maAttributeWriter, *this), mpVDev(VclPtr::Create()), - mbClipAttrChanged( false ), mbIsPlaceholderShape( false ), mpEmbeddedBitmapsMap( nullptr ), mbIsPreview( false ) @@ -4054,8 +4053,6 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, const_cast(pAction)->Execute( mpVDev ); const vcl::Region aClipRegion = mpVDev->GetActiveClipRegion(); ImplWriteClipPath( aClipRegion.GetAsPolyPolygon() ); - - mbClipAttrChanged = true; } break; diff --git a/filter/source/svg/svgwriter.hxx b/filter/source/svg/svgwriter.hxx index d87e2e67d4df..a798b8b74a78 100644 --- a/filter/source/svg/svgwriter.hxx +++ b/filter/source/svg/svgwriter.hxx @@ -316,7 +316,6 @@ private: SVGTextWriter maTextWriter; VclPtr mpVDev; MapMode maTargetMapMode; - bool mbClipAttrChanged; bool mbIsPlaceholderShape; const MetaBitmapActionMap* mpEmbeddedBitmapsMap; bool mbIsPreview; diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx index a4f6a70e651f..01d0b05ac201 100644 --- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx +++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -1497,7 +1498,7 @@ void ToolbarLayoutManager::implts_setElementData( UIElement& rElement, const uno xWindow->setPosSize( aPixelPos.X(), aPixelPos.Y(), 0, 0, awt::PosSize::POS ); if( bSetSize ) - xWindow->setOutputSize(VCLUnoHelper::ConvertToAWTSize(aSize)); + xWindow->setOutputSize(vcl::unohelper::ConvertToAWTSize(aSize)); if ( pWindow ) { @@ -1725,8 +1726,8 @@ awt::Point ToolbarLayoutManager::implts_findNextCascadeFloatingPos() SolarMutexGuard aGuard; VclPtr pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow ); if ( pContainerWindow ) - aStartPos = VCLUnoHelper::ConvertToAWTPoint( - pContainerWindow->OutputToScreenPixel(VCLUnoHelper::ConvertToVCLPoint(aStartPos))); + aStartPos = vcl::unohelper::ConvertToAWTPoint( + pContainerWindow->OutputToScreenPixel(vcl::unohelper::ConvertToVCLPoint(aStartPos))); } // Determine size of top and left docking area @@ -3394,14 +3395,14 @@ awt::DockingData SAL_CALL ToolbarLayoutManager::docking( const awt::DockingEvent if ( aFloatSize.Width > 0 && aFloatSize.Height > 0 ) { aUIDockingElement.m_aFloatingData.m_aPos - = VCLUnoHelper::ConvertToAWTPoint(pContainerWindow->ScreenToOutputPixel( - VCLUnoHelper::ConvertToVCLPoint(e.MousePos))); + = vcl::unohelper::ConvertToAWTPoint(pContainerWindow->ScreenToOutputPixel( + vcl::unohelper::ConvertToVCLPoint(e.MousePos))); aDockingData.TrackingRectangle.Height = aFloatSize.Height; aDockingData.TrackingRectangle.Width = aFloatSize.Width; } else { - aFloatSize = VCLUnoHelper::ConvertToAWTSize(pToolBox->CalcWindowSizePixel()); + aFloatSize = vcl::unohelper::ConvertToAWTSize(pToolBox->CalcWindowSizePixel()); if ( !bIsHorizontal ) { // Floating toolbars are always horizontal aligned! We have to swap @@ -3417,8 +3418,8 @@ awt::DockingData SAL_CALL ToolbarLayoutManager::docking( const awt::DockingEvent // For the first time we don't have any data about the floating size of a toolbar. // We calculate it and store it for later use. aUIDockingElement.m_aFloatingData.m_aPos - = VCLUnoHelper::ConvertToAWTPoint(pContainerWindow->ScreenToOutputPixel( - VCLUnoHelper::ConvertToVCLPoint(e.MousePos))); + = vcl::unohelper::ConvertToAWTPoint(pContainerWindow->ScreenToOutputPixel( + vcl::unohelper::ConvertToVCLPoint(e.MousePos))); aUIDockingElement.m_aFloatingData.m_aSize = aFloatSize; aUIDockingElement.m_aFloatingData.m_nLines = pToolBox->GetFloatingLines(); aUIDockingElement.m_aFloatingData.m_bIsHorizontal = isToolboxHorizontalAligned( pToolBox ); @@ -3574,8 +3575,8 @@ sal_Bool SAL_CALL ToolbarLayoutManager::prepareToggleFloatingMode( const lang::E { ToolBox* pToolBox = static_cast< ToolBox *>( pWindow.get() ); aUIDockingElement.m_aFloatingData.m_aPos - = VCLUnoHelper::ConvertToAWTPoint(pToolBox->GetPosPixel()); - aUIDockingElement.m_aFloatingData.m_aSize = VCLUnoHelper::ConvertToAWTSize(pToolBox->GetOutputSizePixel()); + = vcl::unohelper::ConvertToAWTPoint(pToolBox->GetPosPixel()); + aUIDockingElement.m_aFloatingData.m_aSize = vcl::unohelper::ConvertToAWTSize(pToolBox->GetOutputSizePixel()); aUIDockingElement.m_aFloatingData.m_nLines = pToolBox->GetFloatingLines(); aUIDockingElement.m_aFloatingData.m_bIsHorizontal = isToolboxHorizontalAligned( pToolBox ); } @@ -3643,9 +3644,9 @@ void SAL_CALL ToolbarLayoutManager::toggleFloatingMode( const lang::EventObject& if ( !bSetSize ) { if ( pToolBox ) - aUIDockingElement.m_aFloatingData.m_aSize = VCLUnoHelper::ConvertToAWTSize(pToolBox->CalcFloatingWindowSizePixel()); + aUIDockingElement.m_aFloatingData.m_aSize = vcl::unohelper::ConvertToAWTSize(pToolBox->CalcFloatingWindowSizePixel()); else if ( pWindow ) - aUIDockingElement.m_aFloatingData.m_aSize = VCLUnoHelper::ConvertToAWTSize(pWindow->GetOutputSizePixel()); + aUIDockingElement.m_aFloatingData.m_aSize = vcl::unohelper::ConvertToAWTSize(pWindow->GetOutputSizePixel()); } xWindow->setPosSize( aUIDockingElement.m_aFloatingData.m_aPos.X, @@ -3682,7 +3683,7 @@ void SAL_CALL ToolbarLayoutManager::toggleFloatingMode( const lang::EventObject& ::Size aSize = pToolBox->CalcWindowSizePixel( 1 ); awt::Rectangle aRect = xWindow->getPosSize(); xWindow->setPosSize( aRect.X, aRect.Y, 0, 0, awt::PosSize::POS ); - xWindow->setOutputSize(VCLUnoHelper::ConvertToAWTSize(aSize)); + xWindow->setOutputSize(vcl::unohelper::ConvertToAWTSize(aSize)); } } diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index c262a990a8c6..caa0aaa36ce3 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -115,7 +115,7 @@ Any SAL_CALL MenuBarManager::getMenuHandle( const Sequence< sal_Int8 >& /*Proces { SystemMenuData aSystemMenuData; - m_pVCLMenu->GetSystemMenuData( &aSystemMenuData ); + m_pVCLMenu->GetSystemMenuData(aSystemMenuData); #ifdef _WIN32 if( SystemType == SystemDependent::SYSTEM_WIN32 ) { diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx index 9c3dabd0067b..4fbbf6839b07 100644 --- a/framework/source/uielement/popuptoolbarcontroller.cxx +++ b/framework/source/uielement/popuptoolbarcontroller.cxx @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -207,7 +208,7 @@ PopupMenuToolbarController::createPopupWindow() css::uno::Reference< css::awt::XPopupMenu > xPopupMenu ( m_xPopupMenu ); sal_uInt16 nId = xPopupMenu->execute( css::uno::Reference< css::awt::XWindowPeer >( getParent(), css::uno::UNO_QUERY ), - VCLUnoHelper::ConvertToAWTRect( pToolBox->GetItemRect( m_nToolBoxId ) ), + vcl::unohelper::ConvertToAWTRect( pToolBox->GetItemRect( m_nToolBoxId ) ), ( eAlign == WindowAlign::Top || eAlign == WindowAlign::Bottom ) ? css::awt::PopupMenuDirection::EXECUTE_DOWN : css::awt::PopupMenuDirection::EXECUTE_RIGHT ); diff --git a/helpcontent2 b/helpcontent2 index dc50ebde81a0..0321da3f2b7f 160000 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit dc50ebde81a0e9266806878b69de81da422ec39c +Subproject commit 0321da3f2b7fca3f7bda1655d64206f28231818e diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx b/i18npool/qa/cppunit/test_breakiterator.cxx index 24666ca4ac80..80bdeb15c7be 100644 --- a/i18npool/qa/cppunit/test_breakiterator.cxx +++ b/i18npool/qa/cppunit/test_breakiterator.cxx @@ -49,6 +49,7 @@ public: void testHebrewGereshGershaim(); void testLegacySurrogatePairs(); void testWordCount(); + void testDictionaryIteratorLanguages(); CPPUNIT_TEST_SUITE(TestBreakIterator); CPPUNIT_TEST(testLineBreaking); @@ -70,6 +71,7 @@ public: CPPUNIT_TEST(testHebrewGereshGershaim); CPPUNIT_TEST(testLegacySurrogatePairs); CPPUNIT_TEST(testWordCount); + CPPUNIT_TEST(testDictionaryIteratorLanguages); CPPUNIT_TEST_SUITE_END(); private: @@ -1612,6 +1614,25 @@ void TestBreakIterator::doTestJapanese(uno::Reference< i18n::XBreakIterator > co CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aBounds.startPos); CPPUNIT_ASSERT_EQUAL(sal_Int32(6), aBounds.endPos); } + + { + // tdf#162912: Double-clicking should only select one Basic identifier + static constexpr OUString aTest = u"ThisComponent.CurrentSelection"_ustr; + + aBounds = xBreak->getWordBoundary(aTest, 5, aLocale, i18n::WordType::DICTIONARY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(30), aBounds.endPos); + + aBounds = xBreak->getWordBoundary(aTest, 5, aLocale, + i18n::WordType::ANYWORD_IGNOREWHITESPACES, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(13), aBounds.endPos); + + aBounds = xBreak->getWordBoundary(aTest, 15, aLocale, + i18n::WordType::ANYWORD_IGNOREWHITESPACES, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(14), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(30), aBounds.endPos); + } } void TestBreakIterator::testJapanese() @@ -1914,7 +1935,7 @@ void TestBreakIterator::testWordCount() const OUString aStr = u"Wordの様にワード数をするのにTest\n植松町"_ustr; - CPPUNIT_ASSERT_EQUAL(7, fnCountWords(aStr, aLocale)); + CPPUNIT_ASSERT_EQUAL(8, fnCountWords(aStr, aLocale)); } // tdf#150621 Korean words should be counted individually, rather than by syllable. @@ -1941,6 +1962,232 @@ void TestBreakIterator::testWordCount() } } +void TestBreakIterator::testDictionaryIteratorLanguages() +{ + // Thai + { + lang::Locale aLocale{ "th", "TH", "" }; + + const OUString aStr = u"รอนานหรือเปล่า"_ustr; + + i18n::Boundary aBounds; + + aBounds + = m_xBreak->getWordBoundary(aStr, 1, aLocale, i18n::WordType::DICTIONARY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aBounds.endPos); + + aBounds + = m_xBreak->getWordBoundary(aStr, 3, aLocale, i18n::WordType::DICTIONARY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), aBounds.endPos); + + aBounds + = m_xBreak->getWordBoundary(aStr, 6, aLocale, i18n::WordType::DICTIONARY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(9), aBounds.endPos); + + aBounds + = m_xBreak->getWordBoundary(aStr, 10, aLocale, i18n::WordType::DICTIONARY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(9), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(14), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 1, aLocale, i18n::WordType::ANY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 3, aLocale, i18n::WordType::ANY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 6, aLocale, i18n::WordType::ANY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(9), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 10, aLocale, i18n::WordType::ANY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(9), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(14), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 1, aLocale, + i18n::WordType::ANYWORD_IGNOREWHITESPACES, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 3, aLocale, + i18n::WordType::ANYWORD_IGNOREWHITESPACES, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 6, aLocale, + i18n::WordType::ANYWORD_IGNOREWHITESPACES, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(9), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 10, aLocale, + i18n::WordType::ANYWORD_IGNOREWHITESPACES, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(9), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(14), aBounds.endPos); + } + + // Japanese + { + lang::Locale aLocale{ "ja", "JP", "" }; + + const OUString aStr = u"通産省工業技術院北海道"_ustr; + + i18n::Boundary aBounds; + + aBounds + = m_xBreak->getWordBoundary(aStr, 1, aLocale, i18n::WordType::DICTIONARY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aBounds.endPos); + + aBounds + = m_xBreak->getWordBoundary(aStr, 2, aLocale, i18n::WordType::DICTIONARY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aBounds.endPos); + + aBounds + = m_xBreak->getWordBoundary(aStr, 4, aLocale, i18n::WordType::DICTIONARY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), aBounds.endPos); + + aBounds + = m_xBreak->getWordBoundary(aStr, 6, aLocale, i18n::WordType::DICTIONARY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(7), aBounds.endPos); + + aBounds + = m_xBreak->getWordBoundary(aStr, 7, aLocale, i18n::WordType::DICTIONARY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(7), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(8), aBounds.endPos); + + aBounds + = m_xBreak->getWordBoundary(aStr, 9, aLocale, i18n::WordType::DICTIONARY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(8), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(11), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 1, aLocale, i18n::WordType::ANY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 2, aLocale, i18n::WordType::ANY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 4, aLocale, i18n::WordType::ANY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 6, aLocale, i18n::WordType::ANY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(7), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 7, aLocale, i18n::WordType::ANY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(7), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(8), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 9, aLocale, i18n::WordType::ANY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(8), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(11), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 1, aLocale, + i18n::WordType::ANYWORD_IGNOREWHITESPACES, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 2, aLocale, + i18n::WordType::ANYWORD_IGNOREWHITESPACES, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 4, aLocale, + i18n::WordType::ANYWORD_IGNOREWHITESPACES, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 6, aLocale, + i18n::WordType::ANYWORD_IGNOREWHITESPACES, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(7), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 7, aLocale, + i18n::WordType::ANYWORD_IGNOREWHITESPACES, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(7), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(8), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 9, aLocale, + i18n::WordType::ANYWORD_IGNOREWHITESPACES, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(8), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(11), aBounds.endPos); + } + + // Chinese + { + lang::Locale aLocale{ "zh", "CN", "" }; + + const OUString aStr = u"很高兴认识你"_ustr; + + i18n::Boundary aBounds; + + aBounds + = m_xBreak->getWordBoundary(aStr, 0, aLocale, i18n::WordType::DICTIONARY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aBounds.endPos); + + aBounds + = m_xBreak->getWordBoundary(aStr, 1, aLocale, i18n::WordType::DICTIONARY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aBounds.endPos); + + aBounds + = m_xBreak->getWordBoundary(aStr, 3, aLocale, i18n::WordType::DICTIONARY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), aBounds.endPos); + + aBounds + = m_xBreak->getWordBoundary(aStr, 5, aLocale, i18n::WordType::DICTIONARY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(6), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 0, aLocale, i18n::WordType::ANY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 1, aLocale, i18n::WordType::ANY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 3, aLocale, i18n::WordType::ANY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 5, aLocale, i18n::WordType::ANY_WORD, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(6), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 0, aLocale, + i18n::WordType::ANYWORD_IGNOREWHITESPACES, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 1, aLocale, + i18n::WordType::ANYWORD_IGNOREWHITESPACES, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 3, aLocale, + i18n::WordType::ANYWORD_IGNOREWHITESPACES, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), aBounds.endPos); + + aBounds = m_xBreak->getWordBoundary(aStr, 5, aLocale, + i18n::WordType::ANYWORD_IGNOREWHITESPACES, true); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), aBounds.startPos); + CPPUNIT_ASSERT_EQUAL(sal_Int32(6), aBounds.endPos); + } +} + void TestBreakIterator::setUp() { BootstrapFixtureBase::setUp(); diff --git a/i18npool/source/breakiterator/breakiterator_unicode.cxx b/i18npool/source/breakiterator/breakiterator_unicode.cxx index 5992b6144b0b..4e5df75d2701 100644 --- a/i18npool/source/breakiterator/breakiterator_unicode.cxx +++ b/i18npool/source/breakiterator/breakiterator_unicode.cxx @@ -74,16 +74,6 @@ class OOoRuleBasedBreakIterator : public icu::RuleBasedBreakIterator }; -bool locale_requires_dictionary_iterator(const css::lang::Locale& rLocale) -{ - return rLocale.Language == "bo" || // Tibetan - rLocale.Language == "dz" || // Dzongkha - rLocale.Language == "ja" || // Japanese - rLocale.Language == "km" || // Khmer - rLocale.Language == "lo" || // Lao - rLocale.Language == "th" || // Thai - rLocale.Language == "zh"; // Chinese -} } // loading ICU breakiterator on demand. @@ -189,7 +179,7 @@ void BreakIterator_Unicode::loadICUBreakIterator(const css::lang::Locale& rLocal rbi.reset(); } } - else if(!locale_requires_dictionary_iterator(rLocale)) + else { // language;rule (not langtag, unless we'd actually load such) OString aLanguage( LanguageTag( rLocale).getLanguage().toUtf8()); diff --git a/icon-themes/colibre/sc/res/calculator_red.png b/icon-themes/colibre/sc/res/calculator_red.png new file mode 100644 index 000000000000..8580bbfa792f Binary files /dev/null and b/icon-themes/colibre/sc/res/calculator_red.png differ diff --git a/icon-themes/colibre_svg/sc/res/calculator_red.svg b/icon-themes/colibre_svg/sc/res/calculator_red.svg new file mode 100644 index 000000000000..eed78c352241 --- /dev/null +++ b/icon-themes/colibre_svg/sc/res/calculator_red.svg @@ -0,0 +1 @@ + diff --git a/include/drawinglayer/primitive2d/textprimitive2d.hxx b/include/drawinglayer/primitive2d/textprimitive2d.hxx index a71c24732d45..878ef9d8291c 100644 --- a/include/drawinglayer/primitive2d/textprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/textprimitive2d.hxx @@ -179,7 +179,7 @@ public: virtual bool hasTextRelief() const; virtual bool hasShadow() const; virtual bool hasTextDecoration() const; - virtual bool hasOutline() const; + bool hasOutline() const; /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const override; diff --git a/include/editeng/AccessibleComponentBase.hxx b/include/editeng/AccessibleComponentBase.hxx index 80b0c2b95030..cf73a5bd2144 100644 --- a/include/editeng/AccessibleComponentBase.hxx +++ b/include/editeng/AccessibleComponentBase.hxx @@ -92,7 +92,6 @@ public: virtual sal_Int32 SAL_CALL getBackground() override; //===== XAccessibleExtendedComponent ==================================== - virtual css::uno::Reference SAL_CALL getFont() override; virtual OUString SAL_CALL getTitledBorderText() override; virtual OUString SAL_CALL getToolTipText() override; diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx index 9636a260ccac..a5dde05c00c7 100644 --- a/include/editeng/editeng.hxx +++ b/include/editeng/editeng.hxx @@ -294,7 +294,7 @@ public: sal_Int32 GetLineLen( sal_Int32 nParagraph, sal_Int32 nLine ) const; void GetLineBoundaries( /*out*/sal_Int32& rStart, /*out*/sal_Int32& rEnd, sal_Int32 nParagraph, sal_Int32 nLine ) const; sal_Int32 GetLineNumberAtIndex( sal_Int32 nPara, sal_Int32 nIndex ) const; - SAL_DLLPRIVATE sal_uInt32 GetLineHeight( sal_Int32 nParagraph ); + SAL_DLLPRIVATE sal_uInt32 GetLineHeight( sal_Int32 nParagraph, sal_Int32 nLine = 0 ); SAL_DLLPRIVATE tools::Rectangle GetParaBounds( sal_Int32 nPara ); SAL_DLLPRIVATE ParagraphInfos GetParagraphInfos( sal_Int32 nPara ); SAL_DLLPRIVATE sal_Int32 FindParagraph( tools::Long nDocPosY ); diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index 9a57b6c6aef1..b18690050037 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -868,7 +868,7 @@ public: sal_uInt32 GetLineCount( sal_Int32 nParagraph ) const; sal_Int32 GetLineLen( sal_Int32 nParagraph, sal_Int32 nLine ) const; - sal_uInt32 GetLineHeight( sal_Int32 nParagraph ); + sal_uInt32 GetLineHeight( sal_Int32 nParagraph, sal_Int32 nLine = 0 ); ErrCode Read( SvStream& rInput, const OUString& rBaseURL, EETextFormat, SvKeyValueIterator* pHTTPHeaderAttrs = nullptr ); diff --git a/include/filter/msfilter/svdfppt.hxx b/include/filter/msfilter/svdfppt.hxx index dcb6f87061d2..f1dfa6332c7e 100644 --- a/include/filter/msfilter/svdfppt.hxx +++ b/include/filter/msfilter/svdfppt.hxx @@ -903,14 +903,8 @@ struct ImplPPTParaPropSet final : public salhelper::SimpleReferenceObject struct PPTParaPropSet { - sal_uInt32 mnOriginalTextPos; rtl::Reference mxParaSet; - - PPTParaPropSet(); - PPTParaPropSet( PPTParaPropSet const & rParaPropSet ); - ~PPTParaPropSet(); - - PPTParaPropSet& operator=( const PPTParaPropSet& rParaPropSet ); + PPTParaPropSet(); }; struct ImplPPTCharPropSet diff --git a/include/oox/core/contexthandler2.hxx b/include/oox/core/contexthandler2.hxx index 0101bd956a21..dab78e8ed7a6 100644 --- a/include/oox/core/contexthandler2.hxx +++ b/include/oox/core/contexthandler2.hxx @@ -72,7 +72,7 @@ struct ElementInfo; class OOX_DLLPUBLIC SAL_LOPLUGIN_ANNOTATE("crosscast") ContextHandler2Helper { public: - explicit ContextHandler2Helper( bool bEnableTrimSpace, XmlFilterBase& rFilter ); + explicit ContextHandler2Helper( bool bEnableTrimSpace ); explicit ContextHandler2Helper( const ContextHandler2Helper& rParent ); virtual ~ContextHandler2Helper(); @@ -202,7 +202,6 @@ protected: void implEndRecord( sal_Int32 nRecId ); bool prepareMceContext( sal_Int32 nElement, const AttributeList& rAttribs ); - XmlFilterBase& getDocFilter() const { return mrFilter; } enum class MCE_STATE { @@ -233,7 +232,6 @@ private: protected: bool mbEnableTrimSpace; ///< True = trim whitespace in characters(). - XmlFilterBase& mrFilter; }; class OOX_DLLPUBLIC ContextHandler2 : public ContextHandler, public ContextHandler2Helper diff --git a/include/sfx2/AccessibilityIssue.hxx b/include/sfx2/AccessibilityIssue.hxx index abb7a1318f05..65174e0fdfdb 100644 --- a/include/sfx2/AccessibilityIssue.hxx +++ b/include/sfx2/AccessibilityIssue.hxx @@ -31,7 +31,10 @@ enum class AccessibilityIssueID NO_ALT_GRAPHIC, NO_ALT_SHAPE, TABLE_MERGE_SPLIT, - TEXT_FORMATTING, + TEXT_NEW_LINES, + TEXT_SPACES, + TEXT_TABS, + TEXT_EMPTY_NUM_PARA, DIRECT_FORMATTING, TABLE_FORMATTING, HYPERLINK_IS_TEXT, diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx index ff12fe30b3d0..216b101923d4 100644 --- a/include/sfx2/childwin.hxx +++ b/include/sfx2/childwin.hxx @@ -29,6 +29,7 @@ #include #include +#include namespace com::sun::star::frame { class XFrame; } @@ -184,6 +185,8 @@ const int nCloseResponseToJustHide = -42; { \ SfxChildWinFactory aFact( \ Class::CreateImpl, MyID, Pos ); \ + if (comphelper::LibreOfficeKit::isActive() && nFlags == SfxChildWindowFlags::NONE) \ + nFlags |= SfxChildWindowFlags::NEVERCLONE; \ aFact.aInfo.nFlags |= nFlags; \ aFact.aInfo.bVisible = bVis; \ SfxChildWindow::RegisterChildWindow(pMod, aFact); \ diff --git a/include/sfx2/minfitem.hxx b/include/sfx2/minfitem.hxx index bbf4744afd62..1b6ff400c6bf 100644 --- a/include/sfx2/minfitem.hxx +++ b/include/sfx2/minfitem.hxx @@ -64,7 +64,6 @@ public: { aLibName = r; } const BasicManager* GetBasicManager() const { return pBasicManager; } - OUString GetQualifiedName() const; const OUString& GetLocation() const { return aLocationName; } }; diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc index bf56856c2344..a8843e8ff26d 100644 --- a/include/sfx2/strings.hrc +++ b/include/sfx2/strings.hrc @@ -259,7 +259,7 @@ #define STR_NONCHECKEDOUT_DOCUMENT NC_("STR_NONCHECKEDOUT_DOCUMENT", "This document is not checked out on the server.") #define STR_GET_INVOLVED_TEXT NC_("STR_GET_INVOLVED_TEXT", "Help us make %PRODUCTNAME even better!") #define STR_GET_INVOLVED_BUTTON NC_("STR_GET_INVOLVED_BUTTON", "Get involved") -#define STR_DONATE_TEXT NC_("STR_DONATE_TEXT", "Your donations support our worldwide community.") +#define STR_DONATE_TEXT NC_("STR_DONATE_TEXT", "Support the development of %PRODUCTNAME.") // Translators: text will be abbreviated at >8 characters, eg. "Please D..." #define STR_DONATE_BUTTON NC_("STR_DONATE_BUTTON", "Donate") #define STR_WHATSNEW_TEXT NC_("STR_WHATSNEW", "You are running version %PRODUCTVERSION of %PRODUCTNAME for the first time. Do you want to learn what's new?") diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx index 336fe80c11dd..b63bac0db100 100644 --- a/include/sfx2/tabdlg.hxx +++ b/include/sfx2/tabdlg.hxx @@ -265,8 +265,8 @@ public: virtual void FillUserData(); virtual bool IsReadOnly() const; // Whether the user has canceled the dialog. Allows to restore settings, etc. - virtual bool IsCancelMode() { return mbCancel; } - virtual void SetCancelMode(bool bCancel) { mbCancel = bCancel; } + bool IsCancelMode() { return mbCancel; } + void SetCancelMode(bool bCancel) { mbCancel = bCancel; } virtual void PageCreated (const SfxAllItemSet& aSet); virtual void ChangesApplied(); static const SfxPoolItem* GetItem( const SfxItemSet& rSet, sal_uInt16 nSlot, bool bDeep = true ); diff --git a/include/toolkit/awt/vclxaccessiblecomponent.hxx b/include/toolkit/awt/vclxaccessiblecomponent.hxx index d3aaa30f5646..551c7dcb607b 100644 --- a/include/toolkit/awt/vclxaccessiblecomponent.hxx +++ b/include/toolkit/awt/vclxaccessiblecomponent.hxx @@ -41,7 +41,7 @@ class AccessibleRelationSetHelper; -class TOOLKIT_DLLPUBLIC SAL_LOPLUGIN_ANNOTATE("crosscast") VCLXAccessibleComponent +class TOOLKIT_DLLPUBLIC VCLXAccessibleComponent :public cppu::ImplInheritanceHelper< comphelper::OAccessibleExtendedComponentHelper, css::lang::XServiceInfo> { @@ -100,7 +100,6 @@ public: virtual sal_Int32 SAL_CALL getBackground( ) override; // css::accessibility::XAccessibleExtendedComponent - virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) override; virtual OUString SAL_CALL getTitledBorderText( ) override; virtual OUString SAL_CALL getToolTipText( ) override; diff --git a/include/toolkit/awt/vclxfont.hxx b/include/toolkit/awt/vclxfont.hxx index c3276de03c9f..4452659e8e4e 100644 --- a/include/toolkit/awt/vclxfont.hxx +++ b/include/toolkit/awt/vclxfont.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_TOOLKIT_AWT_VCLXFONT_HXX -#define INCLUDED_TOOLKIT_AWT_VCLXFONT_HXX +#pragma once #include #include @@ -48,10 +47,9 @@ class UNLESS_MERGELIBS_MORE(TOOLKIT_DLLPUBLIC) VCLXFont final : bool ImplAssertValidFontMetric(); public: - VCLXFont(); - virtual ~VCLXFont() override; + VCLXFont(css::awt::XDevice& rxDev, const vcl::Font& rFont); + virtual ~VCLXFont() override; - void Init( css::awt::XDevice& rxDev, const vcl::Font& rFont ); const vcl::Font& GetFont() const { return maFont; } // css::lang::XFont @@ -67,7 +65,4 @@ public: sal_Bool SAL_CALL hasGlyphs( const OUString& aText ) override; }; - -#endif // INCLUDED_TOOLKIT_AWT_VCLXFONT_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/toolkit/helper/accessiblefactory.hxx b/include/toolkit/helper/accessiblefactory.hxx index 6c0532ce9edb..2b2c3455abd7 100644 --- a/include/toolkit/helper/accessiblefactory.hxx +++ b/include/toolkit/helper/accessiblefactory.hxx @@ -133,11 +133,6 @@ namespace toolkit virtual css::uno::Reference< css::accessibility::XAccessibleContext > createAccessibleContext( VCLXWindow* _pXWindow ) = 0; - /** creates an accessible component for the given menu - */ - virtual css::uno::Reference< css::accessibility::XAccessible > - createAccessible( Menu* _pMenu, bool _bIsMenuBar ) = 0; - protected: virtual ~IAccessibleFactory() override {} }; diff --git a/include/toolkit/helper/vclunohelper.hxx b/include/toolkit/helper/vclunohelper.hxx index 16616119e1aa..4c364963b36b 100644 --- a/include/toolkit/helper/vclunohelper.hxx +++ b/include/toolkit/helper/vclunohelper.hxx @@ -24,9 +24,7 @@ #include #include -#include #include -#include #include #include @@ -125,38 +123,6 @@ public: /// @throws css::lang::IllegalArgumentException static MapUnit /* MapModeUnit */ ConvertToMapModeUnit(sal_Int16 /* com.sun.star.util.MeasureUnit.* */ _nMeasureUnit); - static inline ::Size ConvertToVCLSize(const css::awt::Size& rAWTSize) - { - return ::Size(rAWTSize.Width, rAWTSize.Height); - } - - static inline css::awt::Size ConvertToAWTSize(const Size& rVCLSize) - { - return css::awt::Size(rVCLSize.Width(), rVCLSize.Height()); - } - - static inline ::Point ConvertToVCLPoint(const css::awt::Point& rAWTPoint) - { - return ::Point(rAWTPoint.X, rAWTPoint.Y); - } - - static inline css::awt::Point ConvertToAWTPoint(const PointTemplateBase& rVCLPoint) - { - return css::awt::Point(rVCLPoint.X(), rVCLPoint.Y()); - } - - static inline ::tools::Rectangle ConvertToVCLRect(const css::awt::Rectangle& rAWTRect) - { - return ::tools::Rectangle(::Point(rAWTRect.X, rAWTRect.Y), - ::Size(rAWTRect.Width, rAWTRect.Height)); - } - - static inline css::awt::Rectangle ConvertToAWTRect(const RectangleTemplateBase& rVCLRect) - { - return css::awt::Rectangle(rVCLRect.Left(), rVCLRect.Top(), rVCLRect.GetWidth(), - rVCLRect.GetHeight()); - } - static css::awt::MouseEvent createMouseEvent( const ::MouseEvent& _rVclEvent, diff --git a/include/unotest/macros_test.hxx b/include/unotest/macros_test.hxx index 663fcf22b68d..7757e1436545 100644 --- a/include/unotest/macros_test.hxx +++ b/include/unotest/macros_test.hxx @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -92,6 +93,11 @@ public: const OUString& rCommand, const css::uno::Sequence& rPropertyValues); + static css::uno::Any + queryDispatchStatus(css::uno::Reference const& xComponent, + css::uno::Reference const& xContext, + OUString const& rURL); + /// Opens rStreamName from rTempFile, assuming it's a ZIP storage. static std::unique_ptr parseExportStream(const OUString& url, const OUString& rStreamName); diff --git a/include/vbahelper/vbahelper.hxx b/include/vbahelper/vbahelper.hxx index 5dd3e00dbdc1..82c676710263 100644 --- a/include/vbahelper/vbahelper.hxx +++ b/include/vbahelper/vbahelper.hxx @@ -131,7 +131,7 @@ namespace ooo::vba VBAHELPER_DLLPUBLIC bool setPropertyValue( css::uno::Sequence< css::beans::PropertyValue >& aProp, const OUString& aName, const css::uno::Any& aValue ); VBAHELPER_DLLPUBLIC void setOrAppendPropertyValue( css::uno::Sequence< css::beans::PropertyValue >& aProp, const OUString& aName, const css::uno::Any& aValue ); - VBAHELPER_DLLPUBLIC bool executeRunTimeLibrary(const std::u16string_view& rSbRtl_command, + VBAHELPER_DLLPUBLIC bool executeRunTimeLibrary(std::u16string_view rSbRtl_command, SbxArray* pParameters); class VBAHELPER_DLLPUBLIC Millimeter diff --git a/accessibility/inc/helper/characterattributeshelper.hxx b/include/vcl/accessibility/characterattributeshelper.hxx similarity index 95% rename from accessibility/inc/helper/characterattributeshelper.hxx rename to include/vcl/accessibility/characterattributeshelper.hxx index a73ee76c09f2..2e58761ea27e 100644 --- a/accessibility/inc/helper/characterattributeshelper.hxx +++ b/include/vcl/accessibility/characterattributeshelper.hxx @@ -21,12 +21,13 @@ #include #include +#include #include #include #include -class CharacterAttributesHelper +class VCL_DLLPUBLIC CharacterAttributesHelper { private: typedef std::map AttributeMap; diff --git a/accessibility/inc/strings.hxx b/include/vcl/accessibility/strings.hxx similarity index 99% rename from accessibility/inc/strings.hxx rename to include/vcl/accessibility/strings.hxx index 6fd402a9ba06..720252140418 100644 --- a/accessibility/inc/strings.hxx +++ b/include/vcl/accessibility/strings.hxx @@ -19,5 +19,4 @@ inline constexpr OUString RID_STR_ACC_ACTION_DECLINE = u"decrementLine"_ustr; inline constexpr OUString RID_STR_ACC_ACTION_INCBLOCK = u"incrementBlock"_ustr; inline constexpr OUString RID_STR_ACC_ACTION_DECBLOCK = u"decrementBlock"_ustr; - /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx index b102ced8ba9b..ebc56930192e 100644 --- a/include/vcl/bitmapex.hxx +++ b/include/vcl/bitmapex.hxx @@ -467,7 +467,7 @@ private: }; -/** Create a blend frame as BitmapEx +/** Create a blend frame as BitmapEx using an alpha value @param nAlpha The blend value defines how strong the frame will be blended with the @@ -480,14 +480,13 @@ private: @param rSize The size of the frame in pixels */ -BitmapEx VCL_DLLPUBLIC createBlendFrame( +BitmapEx VCL_DLLPUBLIC createAlphaBlendFrame( const Size& rSize, sal_uInt8 nAlpha, Color aColorTopLeft, Color aColorBottomRight); - -/** Create a blend frame as BitmapEx +/** Create a blend frame as BitmapEx using an alpha value @param nAlpha The blend value defines how strong the frame will be blended with the @@ -499,7 +498,7 @@ BitmapEx VCL_DLLPUBLIC createBlendFrame( @param rSize The size of the frame in pixels */ -BitmapEx createBlendFrame( +BitmapEx createAlphaBlendFrame( const Size& rSize, sal_uInt8 nAlpha, Color aColorTopLeft, diff --git a/include/vcl/jsdialog/executor.hxx b/include/vcl/jsdialog/executor.hxx index ef667a70ce26..260be394d6b8 100644 --- a/include/vcl/jsdialog/executor.hxx +++ b/include/vcl/jsdialog/executor.hxx @@ -44,6 +44,16 @@ public: rTreeView.signal_row_activated(); } + static void trigger_popup_menu(weld::TreeView& rTreeView, const CommandEvent& rCommand) + { + rTreeView.signal_popup_menu(rCommand); + } + + static void trigger_activated(weld::Menu& rMenu, const OUString& rIdent) + { + rMenu.signal_activate(rIdent); + } + static void trigger_item_activated(weld::IconView& rIconView) { rIconView.signal_item_activated(); diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx index 90f6d22b0ebd..e241609fcdb6 100644 --- a/include/vcl/menu.hxx +++ b/include/vcl/menu.hxx @@ -126,7 +126,7 @@ private: ImplMenuDelData* mpFirstDel; std::unique_ptr pItemList; // list with MenuItems VclPtr pStartedFrom; - VclPtr pWindow; + VclPtr m_pWindow; Link aActivateHdl; // Active-Handler Link aDeactivateHdl; // Deactivate-Handler @@ -182,7 +182,7 @@ protected: DECL_DLLPRIVATE_LINK(ImplCallSelect, void*, void ); SAL_DLLPRIVATE void ImplFillLayoutData() const; - SAL_DLLPRIVATE SalMenu* ImplGetSalMenu() { return mpSalMenu.get(); } + SAL_DLLPRIVATE SalMenu* ImplGetSalMenu() const { return mpSalMenu.get(); } SAL_DLLPRIVATE OUString ImplGetHelpText( sal_uInt16 nItemId ) const; // returns native check and option menu symbol height in rCheckHeight and rRadioHeight @@ -201,7 +201,7 @@ protected: size_t nPos, const OUString &rIdent); /// Close the 'pStartedFrom' menu window. - virtual void ClosePopup(Menu* pMenu) = 0; + virtual void ClosePopup(PopupMenu* pPopupMenu) = 0; /// Forward the KeyInput call to the MenuBar. virtual void MenuBarKeyInput(const KeyEvent& rEvent); @@ -209,7 +209,6 @@ protected: public: SAL_DLLPRIVATE void ImplKillLayoutData() const; - SAL_DLLPRIVATE vcl::Window* ImplGetWindow() const { return pWindow; } #if defined(MACOSX) void ImplSelectWithStart( Menu* pStartMenu = nullptr ); #endif @@ -355,8 +354,7 @@ public: } // returns the system's menu handle if native menus are supported - // pData must point to a SystemMenuData structure - void GetSystemMenuData( SystemMenuData* pData ) const; + void GetSystemMenuData(SystemMenuData& rData) const; // accessibility helpers @@ -376,7 +374,7 @@ public: // gets the activation key of the specified item KeyEvent GetActivationKey( sal_uInt16 nItemId ) const; - vcl::Window* GetWindow() const { return pWindow; } + vcl::Window* GetWindow() const { return m_pWindow; } void SetAccessibleName( sal_uInt16 nItemId, const OUString& rStr ); OUString GetAccessibleName( sal_uInt16 nItemId ) const; @@ -403,6 +401,9 @@ public: * Get the ID of the window. */ const OUString& get_id() const { return maID; } + +private: + css::uno::Reference CreateAccessible(); }; struct MenuBarButtonCallbackArg @@ -419,20 +420,15 @@ class VCL_DLLPUBLIC MenuBar final : public Menu bool mbHideBtnVisible : 1; bool mbDisplayable : 1; - friend class Application; friend class Menu; friend class MenuBarWindow; - friend class MenuFloatingWindow; friend class SystemWindow; - SAL_DLLPRIVATE static VclPtr ImplCreate(vcl::Window* pParent, vcl::Window* pWindow, MenuBar* pMenu); + SAL_DLLPRIVATE static VclPtr ImplCreate(vcl::Window* pParent, MenuBarWindow* pWindow, MenuBar* pMenu); SAL_DLLPRIVATE static void ImplDestroy(MenuBar* pMenu, bool bDelete); SAL_DLLPRIVATE bool ImplHandleKeyEvent(const KeyEvent& rKEvent); SAL_DLLPRIVATE bool ImplHandleCmdEvent(const CommandEvent& rCEvent); - /// Return the MenuBarWindow. - SAL_DLLPRIVATE MenuBarWindow* getMenuBarWindow(); - public: MenuBar(); SAL_DLLPRIVATE MenuBar( const MenuBar& rMenu ); @@ -443,8 +439,11 @@ public: virtual bool IsMenuBar() const override { return true; } + /// Return the MenuBarWindow. + SAL_DLLPRIVATE MenuBarWindow* getMenuBarWindow(); + /// Close the 'pStartedFrom' menu window. - virtual void ClosePopup(Menu* pMenu) override; + virtual void ClosePopup(PopupMenu* pPopupMenu) override; /// Forward the KeyInput call to the MenuBar. SAL_DLLPRIVATE virtual void MenuBarKeyInput(const KeyEvent& rEvent) override; @@ -503,7 +502,6 @@ class VCL_DLLPUBLIC PopupMenu final : public Menu private: SAL_DLLPRIVATE MenuFloatingWindow * ImplGetFloatingWindow() const; - SAL_DLLPRIVATE bool PrepareRun(const VclPtr& pParentWin, tools::Rectangle& rRect, FloatWinPopupFlags& nPopupModeFlags, Menu* pSFrom, bool& bRealExecute, VclPtr&); SAL_DLLPRIVATE bool Run(const VclPtr&, bool bRealExecute, bool bPreSelectFirst, FloatWinPopupFlags nPopupModeFlags, Menu* pSFrom, const tools::Rectangle& rRect); SAL_DLLPRIVATE void FinishRun(const VclPtr&, const VclPtr& pParentWin, bool bRealExecute, bool bIsNativeMenu); SAL_DLLPRIVATE sal_uInt16 ImplExecute(const VclPtr& pParentWin, const tools::Rectangle& rRect, FloatWinPopupFlags nPopupModeFlags, Menu* pSFrom, bool bPreSelectFirst); @@ -519,7 +517,7 @@ public: virtual bool IsMenuBar() const override { return false; } /// Close the 'pStartedFrom' menu window. - SAL_DLLPRIVATE virtual void ClosePopup(Menu* pMenu) override; + SAL_DLLPRIVATE virtual void ClosePopup(PopupMenu* pPopupMenu) override; void SetText( const OUString& rTitle ) { diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx index f511af70d977..962308e327dc 100644 --- a/include/vcl/print.hxx +++ b/include/vcl/print.hxx @@ -417,6 +417,9 @@ public: bool isUIOptionEnabled( const OUString& rPropName ) const; SAL_DLLPRIVATE bool isUIChoiceEnabled( const OUString& rPropName, sal_Int32 nChoice ) const; + /// Defines which options in a UI element should be disabled or enabled. + void setUIChoicesDisabled(const OUString& rPropName, css::uno::Sequence& rChoicesDisabled); + /** MakeEnabled will change the property rPropName depends on to the value that makes rPropName enabled. If the dependency itself is also disabled, diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx index d7cbcc174792..401da27abf7d 100644 --- a/include/vcl/settings.hxx +++ b/include/vcl/settings.hxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -84,11 +85,13 @@ enum class MouseWheelBehaviour class VCL_DLLPUBLIC MouseSettings { private: - SAL_DLLPRIVATE void CopyData(); - std::shared_ptr mxData; + o3tl::cow_wrapper mxData; public: MouseSettings(); + MouseSettings(const MouseSettings&); + ~MouseSettings(); + MouseSettings& operator=(const MouseSettings&); void SetOptions( MouseSettingsOptions nOptions ); MouseSettingsOptions GetOptions() const; @@ -136,7 +139,6 @@ public: MouseWheelBehaviour GetWheelBehavior() const; bool operator ==( const MouseSettings& rSet ) const; - bool operator !=( const MouseSettings& rSet ) const; }; struct DialogStyle @@ -217,13 +219,14 @@ enum class ComboBoxTextSelectionMode class VCL_DLLPUBLIC StyleSettings { - SAL_DLLPRIVATE void CopyData(); - private: - std::shared_ptr mxData; + o3tl::cow_wrapper mxData; public: StyleSettings(); + StyleSettings(const StyleSettings&); + ~StyleSettings(); + StyleSettings& operator=(const StyleSettings&); SAL_DLLPRIVATE void Set3DColors( const Color& rColor ); @@ -457,6 +460,11 @@ public: void SetUseFontAAFromSystem(bool bUseFontAAFromSystem); bool GetUseFontAAFromSystem() const; + // Using subpixel anti-aliasing is unwanted in some cases, like when saving to file, + // even when the use of anti-aliasing itself is defined by system settings. + void SetUseSubpixelAA(bool val); + bool GetUseSubpixelAA() const; + SAL_DLLPRIVATE void SetUseFlatBorders( bool bUseFlatBorders ); SAL_DLLPRIVATE bool GetUseFlatBorders() const; @@ -646,7 +654,6 @@ public: void SetStandardStyles(); bool operator ==( const StyleSettings& rSet ) const; - bool operator !=( const StyleSettings& rSet ) const; // Batch setters used by various backends void BatchSetBackgrounds( const Color &aBackColor, @@ -716,12 +723,13 @@ namespace o3tl class VCL_DLLPUBLIC AllSettings { private: - SAL_DLLPRIVATE void CopyData(); - - std::shared_ptr mxData; + o3tl::cow_wrapper mxData; public: AllSettings(); + AllSettings(const AllSettings&); + ~AllSettings(); + AllSettings& operator=(const AllSettings&); void SetMouseSettings( const MouseSettings& rSet ); const MouseSettings& GetMouseSettings() const; @@ -758,9 +766,8 @@ public: SAL_DLLPRIVATE AllSettingsFlags GetChangeFlags( const AllSettings& rSettings ) const; SAL_DLLPRIVATE bool operator ==( const AllSettings& rSet ) const; - SAL_DLLPRIVATE bool operator !=( const AllSettings& rSet ) const; SAL_DLLPRIVATE static void LocaleSettingsChanged( ConfigurationHints nHint ); - SAL_DLLPRIVATE SvtSysLocale& GetSysLocale(); + SAL_DLLPRIVATE const SvtSysLocale& GetSysLocale() const; }; #endif // INCLUDED_VCL_SETTINGS_HXX diff --git a/include/vcl/themecolors.hxx b/include/vcl/themecolors.hxx index 8cadf21f552d..fec422adbac9 100644 --- a/include/vcl/themecolors.hxx +++ b/include/vcl/themecolors.hxx @@ -23,7 +23,7 @@ public: static bool IsThemeLoaded() { return m_bIsThemeLoaded; } static void SetThemeLoaded(bool bLoaded) { m_bIsThemeLoaded = bLoaded; } - static bool IsAutomaticTheme(const std::u16string_view& rThemeName) + static bool IsAutomaticTheme(std::u16string_view rThemeName) { return rThemeName == svtools::AUTOMATIC_COLOR_SCHEME; } diff --git a/include/vcl/toolkit/fmtfield.hxx b/include/vcl/toolkit/fmtfield.hxx index f62c5a3a2517..34b7ea755707 100644 --- a/include/vcl/toolkit/fmtfield.hxx +++ b/include/vcl/toolkit/fmtfield.hxx @@ -26,7 +26,7 @@ #include #include -class UNLESS_MERGELIBS(VCL_DLLPUBLIC) FormattedField : public SpinField +class VCL_DLLPUBLIC FormattedField : public SpinField { public: FormattedField(vcl::Window* pParent, WinBits nStyle); diff --git a/include/vcl/toolkit/unowrap.hxx b/include/vcl/toolkit/unowrap.hxx index 359810652e05..9d1231919229 100644 --- a/include/vcl/toolkit/unowrap.hxx +++ b/include/vcl/toolkit/unowrap.hxx @@ -65,10 +65,6 @@ public: virtual void WindowDestroyed( vcl::Window* pWindow ) = 0; - // Accessibility - virtual css::uno::Reference< css::accessibility::XAccessible > - CreateAccessible( Menu* pMenu, bool bIsMenuBar ) = 0; - /** Get the application's UNO wrapper object. Note that this static function will only ever try to create UNO wrapper object once, and diff --git a/include/vcl/unohelp.hxx b/include/vcl/unohelp.hxx index c7b9dcc06956..9c6aa3470855 100644 --- a/include/vcl/unohelp.hxx +++ b/include/vcl/unohelp.hxx @@ -22,7 +22,11 @@ #include #include +#include +#include +#include #include +#include #include namespace com::sun::star::i18n { @@ -43,6 +47,13 @@ VCL_DLLPUBLIC float ConvertFontWeight( FontWeight eWeight ); VCL_DLLPUBLIC FontWeight ConvertFontWeight( float f ); VCL_DLLPUBLIC css::awt::FontSlant ConvertFontSlant( FontItalic eWeight ); VCL_DLLPUBLIC FontItalic ConvertFontSlant( css::awt::FontSlant ); +VCL_DLLPUBLIC Size ConvertToVCLSize(const css::awt::Size& rAWTSize); +VCL_DLLPUBLIC css::awt::Size ConvertToAWTSize(const Size& rVCLSize); +VCL_DLLPUBLIC Point ConvertToVCLPoint(const css::awt::Point& rAWTPoint); +VCL_DLLPUBLIC css::awt::Point ConvertToAWTPoint(const PointTemplateBase& rVCLPoint); +VCL_DLLPUBLIC tools::Rectangle ConvertToVCLRect(const css::awt::Rectangle& rAWTRect); +VCL_DLLPUBLIC css::awt::Rectangle ConvertToAWTRect(const RectangleTemplateBase& rVCLRect); + } // namespace vcl::unohelper #endif // INCLUDED_VCL_UNOHELP_HXX diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index d68bced12c04..74290a3c9ec7 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -95,6 +95,26 @@ protected: Link m_aMouseMotionHdl; Link m_aMouseReleaseHdl; + void signal_focus_in() { m_aFocusInHdl.Call(*this); } + void signal_focus_out() { m_aFocusOutHdl.Call(*this); } + bool signal_mnemonic_activate() { return m_aMnemonicActivateHdl.Call(*this); } + void signal_style_updated() { m_aStyleUpdatedHdl.Call(*this); } + void signal_size_allocate(const Size& rSize) { m_aSizeAllocateHdl.Call(rSize); } + bool signal_key_press(const KeyEvent& rKeyEvent) { return m_aKeyPressHdl.Call(rKeyEvent); } + bool signal_key_release(const KeyEvent& rKeyEvent) { return m_aKeyReleaseHdl.Call(rKeyEvent); } + bool signal_mouse_press(const MouseEvent& rMouseEvent) + { + return m_aMousePressHdl.Call(rMouseEvent); + } + bool signal_mouse_motion(const MouseEvent& rMouseEvent) + { + return m_aMouseMotionHdl.Call(rMouseEvent); + } + bool signal_mouse_release(const MouseEvent& rMouseEvent) + { + return m_aMouseReleaseHdl.Call(rMouseEvent); + } + public: virtual void set_sensitive(bool sensitive) = 0; virtual bool get_sensitive() const = 0; @@ -989,6 +1009,8 @@ protected: return m_aEditingDoneHdl.Call(rIterText); } + void signal_popup_menu(const CommandEvent& rCommand) { m_aPopupMenuHdl.Call(rCommand); } + Link m_aQueryTooltipHdl; OUString signal_query_tooltip(const TreeIter& rIter) { return m_aQueryTooltipHdl.Call(rIter); } @@ -1484,8 +1506,14 @@ public: virtual OUString get_selected_text() const = 0; //by index. Don't select when frozen, select after thaw. Note selection doesn't survive a freeze. + virtual OUString get_id(int pos) const = 0; virtual void select(int pos) = 0; virtual void unselect(int pos) = 0; + virtual void set_image(int pos, VirtualDevice* pDevice) = 0; + virtual void set_text(int pos, const OUString& rText) = 0; + virtual void set_id(int pos, const OUString& rId) = 0; + virtual void remove(int pos) = 0; + virtual tools::Rectangle get_rect(int pos) const = 0; //via iter virtual std::unique_ptr make_iterator(const TreeIter* pOrig = nullptr) const = 0; @@ -1495,6 +1523,7 @@ public: virtual bool get_iter_first(TreeIter& rIter) const = 0; virtual OUString get_id(const TreeIter& rIter) const = 0; virtual OUString get_text(const TreeIter& rIter) const = 0; + virtual bool iter_next_sibling(TreeIter& rIter) const = 0; virtual void scroll_to_item(const TreeIter& rIter) = 0; // call func on each selected element until func returns true or we run out of elements @@ -2422,6 +2451,8 @@ enum class Placement class VCL_DLLPUBLIC Menu { + friend class ::LOKTrigger; + Link m_aActivateHdl; protected: diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 008415417350..a9a6ac6eee3a 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -1122,8 +1122,8 @@ public: /// Use OS specific way to bring user attention to current window virtual void FlashWindow() const; - virtual void SetTaskBarProgress(int nCurrentProgress); - virtual void SetTaskBarState(VclTaskBarStates eTaskBarState); + void SetTaskBarProgress(int nCurrentProgress); + void SetTaskBarState(VclTaskBarStates eTaskBarState); /** @name Accessibility */ diff --git a/offapi/com/sun/star/accessibility/XAccessibleExtendedComponent.idl b/offapi/com/sun/star/accessibility/XAccessibleExtendedComponent.idl index d8d755fe0b2a..ea9afea783b1 100644 --- a/offapi/com/sun/star/accessibility/XAccessibleExtendedComponent.idl +++ b/offapi/com/sun/star/accessibility/XAccessibleExtendedComponent.idl @@ -37,14 +37,6 @@ module com { module sun { module star { module accessibility { */ interface XAccessibleExtendedComponent : XAccessibleComponent { - /** Returns the font of this object. - - @return - The returned reference to a font object is empty if a font is not - supported by this object. - */ - ::com::sun::star::awt::XFont getFont (); - /** Returns the titled border text.

This method stems from the Java interface diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index 4ed3683d2fc3..67e62985321c 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -6340,13 +6340,43 @@ true - + - Enables accessibility check of Text formattings, inside the document structure - while the user edits the document. + Enables accessibility check of empty new line text formattings, inside the document + structure while the user edits the document. - + + + true + + + + + Enables accessibility check of extra spaces for formattings, inside the document + structure while the user edits the document. + + + + true + + + + + Enables accessibility check of extra tabs for formattings, inside the document + structure while the user edits the document. + + + + true + + + + + Enables accessibility check of empty new line between numberings, inside the document + structure while the user edits the document. + + true diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs index 1ca15926fec9..4265e09f7b8b 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs @@ -1035,7 +1035,7 @@ Specifies whether protected spaces are shown on the screen. - false + true diff --git a/oox/source/core/contexthandler2.cxx b/oox/source/core/contexthandler2.cxx index 5c4ab66987ab..5eb725204125 100644 --- a/oox/source/core/contexthandler2.cxx +++ b/oox/source/core/contexthandler2.cxx @@ -45,11 +45,10 @@ struct ElementInfo explicit ElementInfo() : maChars( 0), mnElement( XML_TOKEN_INVALID ), mbTrimSpaces( false ) {} }; -ContextHandler2Helper::ContextHandler2Helper( bool bEnableTrimSpace, XmlFilterBase& rFilter ) : +ContextHandler2Helper::ContextHandler2Helper( bool bEnableTrimSpace ) : mxContextStack( std::make_shared() ), mnRootStackSize( 0 ), - mbEnableTrimSpace( bEnableTrimSpace ), - mrFilter( rFilter ) + mbEnableTrimSpace( bEnableTrimSpace ) { pushElementInfo( XML_ROOT_CONTEXT ); } @@ -57,8 +56,7 @@ ContextHandler2Helper::ContextHandler2Helper( bool bEnableTrimSpace, XmlFilterBa ContextHandler2Helper::ContextHandler2Helper( const ContextHandler2Helper& rParent ) : mxContextStack( rParent.mxContextStack ), mnRootStackSize( rParent.mxContextStack->size() ), - mbEnableTrimSpace( rParent.mbEnableTrimSpace ), - mrFilter(rParent.mrFilter) + mbEnableTrimSpace( rParent.mbEnableTrimSpace ) { } diff --git a/oox/source/core/fragmenthandler2.cxx b/oox/source/core/fragmenthandler2.cxx index e4eeef076f41..aac1d0c3899e 100644 --- a/oox/source/core/fragmenthandler2.cxx +++ b/oox/source/core/fragmenthandler2.cxx @@ -33,7 +33,7 @@ using namespace ::com::sun::star::xml::sax; FragmentHandler2::FragmentHandler2( XmlFilterBase& rFilter, const OUString& rFragmentPath, bool bEnableTrimSpace ) : FragmentHandler( rFilter, rFragmentPath ), - ContextHandler2Helper( bEnableTrimSpace, rFilter ) + ContextHandler2Helper( bEnableTrimSpace ) { } diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 18334ad0516a..d3bc81b08b26 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -4305,9 +4305,27 @@ void DrawingML::WriteText(const Reference& rXIface, bool bBodyPr, bo } else { - // tdf#127030: Only custom shapes obey the TextAutoGrowHeight option. + bool bAutoGrowHeightEnabled = false; + const SdrObject* pObj = xShape.is() ? SdrObject::getSdrObjectFromXShape(xShape) : nullptr; + if (pObj) + { + switch (pObj->GetObjIdentifier()) + { + case SdrObjKind::NONE: + case SdrObjKind::Text: + case SdrObjKind::TitleText: + case SdrObjKind::OutlineText: + case SdrObjKind::Caption: + case SdrObjKind::CustomShape: + bAutoGrowHeightEnabled = true; + break; + default: + bAutoGrowHeightEnabled = false; + } + } + bool bTextAutoGrowHeight = false; - if (dynamic_cast(rXIface.get()) && GetProperty(rXPropSet, u"TextAutoGrowHeight"_ustr)) + if (bAutoGrowHeightEnabled && GetProperty(rXPropSet, u"TextAutoGrowHeight"_ustr)) mAny >>= bTextAutoGrowHeight; mpFS->singleElementNS(XML_a, (bTextAutoGrowHeight ? XML_spAutoFit : XML_noAutofit)); } diff --git a/oox/source/shape/WpsContext.cxx b/oox/source/shape/WpsContext.cxx index 4734505302bb..56abef55fcc1 100644 --- a/oox/source/shape/WpsContext.cxx +++ b/oox/source/shape/WpsContext.cxx @@ -682,6 +682,8 @@ oox::core::ContextHandlerRef WpsContext::onCreateContext(sal_Int32 nElementToken xPropertySet->setPropertyValue(u"InteropGrabBag"_ustr, uno::Any(aGrabBag)); } + auto xPropertySetInfo = xPropertySet->getPropertySetInfo(); + if (xServiceInfo.is()) { // Handle inset attributes for Writer textframes. @@ -701,83 +703,104 @@ oox::core::ContextHandlerRef WpsContext::onCreateContext(sal_Int32 nElementToken = { u"TextLeftDistance"_ustr, u"TextUpperDistance"_ustr, u"TextRightDistance"_ustr, u"TextLowerDistance"_ustr }; for (std::size_t i = 0; i < SAL_N_ELEMENTS(aShapeProps); ++i) - if (oInsets[i]) + { + if (!oInsets[i]) + continue; + if (xPropertySetInfo && xPropertySetInfo->hasPropertyByName(aShapeProps[i])) xPropertySet->setPropertyValue(aShapeProps[i], uno::Any(*oInsets[i])); + else + SAL_WARN("oox", "Property: " << aShapeProps[i] << " not supported"); + } } // Handle text vertical adjustment inside a text frame if (rAttribs.hasAttribute(XML_anchor)) { - drawing::TextVerticalAdjust eAdjust - = drawingml::GetTextVerticalAdjust(rAttribs.getToken(XML_anchor, XML_t)); - xPropertySet->setPropertyValue(u"TextVerticalAdjust"_ustr, uno::Any(eAdjust)); + if (xPropertySetInfo + && xPropertySetInfo->hasPropertyByName(u"TextVerticalAdjust"_ustr)) + { + drawing::TextVerticalAdjust eAdjust = drawingml::GetTextVerticalAdjust( + rAttribs.getToken(XML_anchor, XML_t)); + xPropertySet->setPropertyValue(u"TextVerticalAdjust"_ustr, + uno::Any(eAdjust)); + } + else + SAL_WARN("oox", "Property: TextVerticalAdjust not supported"); } // Apply character color of the shape to the shape's textbox. uno::Reference xText(mxShape, uno::UNO_QUERY); - uno::Any xCharColor = xPropertySet->getPropertyValue(u"CharColor"_ustr); - Color aColor = COL_AUTO; - if ((xCharColor >>= aColor) && aColor != COL_AUTO) + if (xText) { - // tdf#135923 Apply character color of the shape to the textrun - // when the character color of the textrun is default. - // tdf#153791 But only if the run has no background color (shd element in OOXML) - if (uno::Reference paraEnumAccess{ - xText, uno::UNO_QUERY }) + uno::Any xCharColor = xPropertySet->getPropertyValue(u"CharColor"_ustr); + Color aColor = COL_AUTO; + if ((xCharColor >>= aColor) && aColor != COL_AUTO) { - uno::Reference paraEnum( - paraEnumAccess->createEnumeration()); - - while (paraEnum->hasMoreElements()) + // tdf#135923 Apply character color of the shape to the textrun + // when the character color of the textrun is default. + // tdf#153791 But only if the run has no background color (shd element in OOXML) + if (uno::Reference paraEnumAccess{ + xText, uno::UNO_QUERY }) { - uno::Reference xParagraph(paraEnum->nextElement(), - uno::UNO_QUERY); - uno::Reference runEnumAccess( - xParagraph, uno::UNO_QUERY); - if (!runEnumAccess.is()) - continue; - if (uno::Reference xParaPropSet{ xParagraph, - uno::UNO_QUERY }) - if ((xParaPropSet->getPropertyValue(u"ParaBackColor"_ustr) - >>= aColor) - && aColor != COL_AUTO) - continue; + uno::Reference paraEnum( + paraEnumAccess->createEnumeration()); - uno::Reference runEnum - = runEnumAccess->createEnumeration(); - - while (runEnum->hasMoreElements()) + while (paraEnum->hasMoreElements()) { - uno::Reference xRun(runEnum->nextElement(), - uno::UNO_QUERY); - const uno::Reference xRunState( - xRun, uno::UNO_QUERY); - if (!xRunState - || xRunState->getPropertyState(u"CharColor"_ustr) - == beans::PropertyState_DEFAULT_VALUE) - { - uno::Reference xRunPropSet(xRun, - uno::UNO_QUERY); - if (!xRunPropSet) - continue; - if ((xRunPropSet->getPropertyValue(u"CharBackColor"_ustr) + uno::Reference xParagraph(paraEnum->nextElement(), + uno::UNO_QUERY); + uno::Reference runEnumAccess( + xParagraph, uno::UNO_QUERY); + if (!runEnumAccess.is()) + continue; + if (uno::Reference xParaPropSet{ + xParagraph, uno::UNO_QUERY }) + if ((xParaPropSet->getPropertyValue(u"ParaBackColor"_ustr) >>= aColor) && aColor != COL_AUTO) continue; - if (!(xRunPropSet->getPropertyValue(u"CharColor"_ustr) - >>= aColor) - || aColor == COL_AUTO) - xRunPropSet->setPropertyValue(u"CharColor"_ustr, - xCharColor); + + uno::Reference runEnum + = runEnumAccess->createEnumeration(); + + while (runEnum->hasMoreElements()) + { + uno::Reference xRun(runEnum->nextElement(), + uno::UNO_QUERY); + const uno::Reference xRunState( + xRun, uno::UNO_QUERY); + if (!xRunState + || xRunState->getPropertyState(u"CharColor"_ustr) + == beans::PropertyState_DEFAULT_VALUE) + { + uno::Reference xRunPropSet( + xRun, uno::UNO_QUERY); + if (!xRunPropSet) + continue; + if ((xRunPropSet->getPropertyValue(u"CharBackColor"_ustr) + >>= aColor) + && aColor != COL_AUTO) + continue; + if (!(xRunPropSet->getPropertyValue(u"CharColor"_ustr) + >>= aColor) + || aColor == COL_AUTO) + xRunPropSet->setPropertyValue(u"CharColor"_ustr, + xCharColor); + } } } } } } - auto nWrappingType = rAttribs.getToken(XML_wrap, XML_square); - xPropertySet->setPropertyValue(u"TextWordWrap"_ustr, - uno::Any(nWrappingType == XML_square)); + if (xPropertySetInfo && xPropertySetInfo->hasPropertyByName(u"TextWordWrap"_ustr)) + { + auto nWrappingType = rAttribs.getToken(XML_wrap, XML_square); + xPropertySet->setPropertyValue(u"TextWordWrap"_ustr, + uno::Any(nWrappingType == XML_square)); + } + else + SAL_WARN("oox", "Property: TextWordWrap not supported"); return this; } @@ -831,9 +854,18 @@ oox::core::ContextHandlerRef WpsContext::onCreateContext(sal_Int32 nElementToken u"FrameIsAutomaticHeight"_ustr, uno::Any(getBaseToken(nElementToken) == XML_spAutoFit)); else - xPropertySet->setPropertyValue( - u"TextAutoGrowHeight"_ustr, - uno::Any(getBaseToken(nElementToken) == XML_spAutoFit)); + { + auto xPropertySetInfo = xPropertySet->getPropertySetInfo(); + if (xPropertySetInfo + && xPropertySetInfo->hasPropertyByName(u"TextAutoGrowHeight"_ustr)) + { + xPropertySet->setPropertyValue( + u"TextAutoGrowHeight"_ustr, + uno::Any(getBaseToken(nElementToken) == XML_spAutoFit)); + } + else + SAL_WARN("oox", "Property: TextAutoGrowHeight not supported"); + } } } break; diff --git a/postprocess/CustomTarget_registry.mk b/postprocess/CustomTarget_registry.mk index 4be442c49ae4..6b96ef28c36d 100644 --- a/postprocess/CustomTarget_registry.mk +++ b/postprocess/CustomTarget_registry.mk @@ -408,12 +408,10 @@ postprocess_FILES_onlineupdate := \ $(call gb_XcuModuleTarget_get_target,extensions/source/update/check)/org/openoffice/Office/Jobs-onlineupdate.xcu endif -ifeq ($(ENABLE_OPENGL_TRANSITIONS),TRUE) postprocess_XCDS += ogltrans.xcd postprocess_DEPS_ogltrans := main postprocess_FILES_ogltrans := \ $(postprocess_MOD)/org/openoffice/Office/Impress-ogltrans.xcu -endif ifeq ($(ENABLE_PDFIMPORT),TRUE) postprocess_XCDS += pdfimport.xcd diff --git a/qadevOOo/objdsc/svtools/com.sun.star.comp.svtools.AccessibleTabBar.csv b/qadevOOo/objdsc/svtools/com.sun.star.comp.svtools.AccessibleTabBar.csv index 73948b2fc6f0..93aca238e1fc 100644 --- a/qadevOOo/objdsc/svtools/com.sun.star.comp.svtools.AccessibleTabBar.csv +++ b/qadevOOo/objdsc/svtools/com.sun.star.comp.svtools.AccessibleTabBar.csv @@ -1,4 +1,3 @@ -"AccessibleTabBar";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getFont()" "AccessibleTabBar";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getTitledBorderText()" "AccessibleTabBar";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getToolTipText()" "AccessibleTabBar";"com::sun::star::accessibility::XAccessibleEventBroadcaster";"addEventListener()" diff --git a/qadevOOo/objdsc/svtools/com.sun.star.comp.svtools.AccessibleTabBarPage.csv b/qadevOOo/objdsc/svtools/com.sun.star.comp.svtools.AccessibleTabBarPage.csv index 32b30d64b1a5..0390988618e1 100644 --- a/qadevOOo/objdsc/svtools/com.sun.star.comp.svtools.AccessibleTabBarPage.csv +++ b/qadevOOo/objdsc/svtools/com.sun.star.comp.svtools.AccessibleTabBarPage.csv @@ -1,4 +1,3 @@ -"AccessibleTabBarPage";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getFont()" "AccessibleTabBarPage";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getTitledBorderText()" "AccessibleTabBarPage";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getToolTipText()" "AccessibleTabBarPage";"com::sun::star::accessibility::XAccessibleEventBroadcaster";"addEventListener()" diff --git a/qadevOOo/objdsc/svtools/com.sun.star.comp.svtools.AccessibleTabBarPageList.csv b/qadevOOo/objdsc/svtools/com.sun.star.comp.svtools.AccessibleTabBarPageList.csv index b4f87286f6b7..fcb2912662d8 100644 --- a/qadevOOo/objdsc/svtools/com.sun.star.comp.svtools.AccessibleTabBarPageList.csv +++ b/qadevOOo/objdsc/svtools/com.sun.star.comp.svtools.AccessibleTabBarPageList.csv @@ -1,4 +1,3 @@ -"AccessibleTabBarPageList";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getFont()" "AccessibleTabBarPageList";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getTitledBorderText()" "AccessibleTabBarPageList";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getToolTipText()" "AccessibleTabBarPageList";"com::sun::star::accessibility::XAccessibleEventBroadcaster";"addEventListener()" diff --git a/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessibleControlShape.csv b/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessibleControlShape.csv index 887d3151b4c5..832b17a4368f 100644 --- a/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessibleControlShape.csv +++ b/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessibleControlShape.csv @@ -1,4 +1,3 @@ -"AccessibleControlShape";"com::sun::star::accessibility::XAccessibleExtendedComponent#optional";"getFont()" "AccessibleControlShape";"com::sun::star::accessibility::XAccessibleExtendedComponent#optional";"getTitledBorderText()" "AccessibleControlShape";"com::sun::star::accessibility::XAccessibleExtendedComponent#optional";"getToolTipText()" "AccessibleControlShape";"com::sun::star::accessibility::XAccessibleEventBroadcaster#optional";"addEventListener()" diff --git a/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessibleGraphicShape.csv b/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessibleGraphicShape.csv index 2db06b3e8b53..35ca0d8dc5f5 100644 --- a/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessibleGraphicShape.csv +++ b/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessibleGraphicShape.csv @@ -1,4 +1,3 @@ -"AccessibleGraphicShape";"com::sun::star::accessibility::XAccessibleExtendedComponent#optional";"getFont()" "AccessibleGraphicShape";"com::sun::star::accessibility::XAccessibleExtendedComponent#optional";"getTitledBorderText()" "AccessibleGraphicShape";"com::sun::star::accessibility::XAccessibleExtendedComponent#optional";"getToolTipText()" "AccessibleGraphicShape";"com::sun::star::accessibility::XAccessibleEventBroadcaster#optional";"addEventListener()" diff --git a/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessibleOLEShape.csv b/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessibleOLEShape.csv index e5db4c6989e8..a8a99d8561f9 100644 --- a/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessibleOLEShape.csv +++ b/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessibleOLEShape.csv @@ -1,4 +1,3 @@ -"AccessibleOLEShape";"com::sun::star::accessibility::XAccessibleExtendedComponent#optional";"getFont()" "AccessibleOLEShape";"com::sun::star::accessibility::XAccessibleExtendedComponent#optional";"getTitledBorderText()" "AccessibleOLEShape";"com::sun::star::accessibility::XAccessibleExtendedComponent#optional";"getToolTipText()" "AccessibleOLEShape";"com::sun::star::accessibility::XAccessibleEventBroadcaster#optional";"addEventListener()" diff --git a/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessiblePageShape.csv b/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessiblePageShape.csv index 8a61c76902dd..0ac7da9bf9b9 100644 --- a/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessiblePageShape.csv +++ b/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessiblePageShape.csv @@ -1,4 +1,3 @@ -"AccessiblePageShape";"com::sun::star::accessibility::XAccessibleExtendedComponent#optional";"getFont()" "AccessiblePageShape";"com::sun::star::accessibility::XAccessibleExtendedComponent#optional";"getTitledBorderText()" "AccessiblePageShape";"com::sun::star::accessibility::XAccessibleExtendedComponent#optional";"getToolTipText()" "AccessiblePageShape";"com::sun::star::accessibility::XAccessibleEventBroadcaster#optional";"addEventListener()" diff --git a/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessiblePresentationGraphicShape.csv b/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessiblePresentationGraphicShape.csv index 991f2b8f078c..1e57d8568041 100644 --- a/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessiblePresentationGraphicShape.csv +++ b/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessiblePresentationGraphicShape.csv @@ -1,4 +1,3 @@ -"AccessiblePresentationGraphicShape";"com::sun::star::accessibility::XAccessibleExtendedComponent#optional";"getFont()" "AccessiblePresentationGraphicShape";"com::sun::star::accessibility::XAccessibleExtendedComponent#optional";"getTitledBorderText()" "AccessiblePresentationGraphicShape";"com::sun::star::accessibility::XAccessibleExtendedComponent#optional";"getToolTipText()" "AccessiblePresentationGraphicShape";"com::sun::star::accessibility::XAccessibleEventBroadcaster#optional";"addEventListener()" diff --git a/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessiblePresentationOLEShape.csv b/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessiblePresentationOLEShape.csv index c37eea41cb82..c69cbd7e00b1 100644 --- a/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessiblePresentationOLEShape.csv +++ b/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessiblePresentationOLEShape.csv @@ -1,4 +1,3 @@ -"AccessiblePresentationOLEShape";"com::sun::star::accessibility::XAccessibleExtendedComponent#optional";"getFont()" "AccessiblePresentationOLEShape";"com::sun::star::accessibility::XAccessibleExtendedComponent#optional";"getTitledBorderText()" "AccessiblePresentationOLEShape";"com::sun::star::accessibility::XAccessibleExtendedComponent#optional";"getToolTipText()" "AccessiblePresentationOLEShape";"com::sun::star::accessibility::XAccessibleEventBroadcaster#optional";"addEventListener()" diff --git a/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessiblePresentationShape.csv b/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessiblePresentationShape.csv index 84d3ebc1fe12..6ba64047c3ab 100644 --- a/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessiblePresentationShape.csv +++ b/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessiblePresentationShape.csv @@ -1,4 +1,3 @@ -"AccessiblePresentationShape";"com::sun::star::accessibility::XAccessibleExtendedComponent#optional";"getFont()" "AccessiblePresentationShape";"com::sun::star::accessibility::XAccessibleExtendedComponent#optional";"getTitledBorderText()" "AccessiblePresentationShape";"com::sun::star::accessibility::XAccessibleExtendedComponent#optional";"getToolTipText()" "AccessiblePresentationShape";"com::sun::star::accessibility::XAccessibleEventBroadcaster#optional";"addEventListener()" diff --git a/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessibleShape.csv b/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessibleShape.csv index 154ee27961c0..24c5fbdb945a 100644 --- a/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessibleShape.csv +++ b/qadevOOo/objdsc/svx/com.sun.star.comp.unknown.AccessibleShape.csv @@ -1,4 +1,3 @@ -"AccessibleShape";"com::sun::star::accessibility::XAccessibleExtendedComponent#optional";"getFont()" "AccessibleShape";"com::sun::star::accessibility::XAccessibleExtendedComponent#optional";"getTitledBorderText()" "AccessibleShape";"com::sun::star::accessibility::XAccessibleExtendedComponent#optional";"getToolTipText()" "AccessibleShape";"com::sun::star::accessibility::XAccessibleEventBroadcaster#optional";"addEventListener()" diff --git a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleButton.csv b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleButton.csv index b5074fae0796..ebef697030df 100644 --- a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleButton.csv +++ b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleButton.csv @@ -1,4 +1,3 @@ -"AccessibleButton";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getFont()" "AccessibleButton";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getTitledBorderText()" "AccessibleButton";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getToolTipText()" "AccessibleButton";"com::sun::star::accessibility::XAccessibleValue";"getCurrentValue()" diff --git a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleCheckBox.csv b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleCheckBox.csv index f55d013eae03..59e2efe3799a 100644 --- a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleCheckBox.csv +++ b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleCheckBox.csv @@ -1,4 +1,3 @@ -"AccessibleCheckBox";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getFont()" "AccessibleCheckBox";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getTitledBorderText()" "AccessibleCheckBox";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getToolTipText()" "AccessibleCheckBox";"com::sun::star::accessibility::XAccessibleValue";"getCurrentValue()" diff --git a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleComboBox.csv b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleComboBox.csv index 30956a4ef8a0..b2c7d4414714 100644 --- a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleComboBox.csv +++ b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleComboBox.csv @@ -1,4 +1,3 @@ -"AccessibleComboBox";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getFont()" "AccessibleComboBox";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getTitledBorderText()" "AccessibleComboBox";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getToolTipText()" "AccessibleComboBox";"com::sun::star::accessibility::XAccessibleEventBroadcaster#optional";"addEventListener()" diff --git a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleDropDownComboBox.csv b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleDropDownComboBox.csv index 96e3d27f3ba4..593fdcab0416 100644 --- a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleDropDownComboBox.csv +++ b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleDropDownComboBox.csv @@ -1,4 +1,3 @@ -"AccessibleDropDownComboBox";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getFont()" "AccessibleDropDownComboBox";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getTitledBorderText()" "AccessibleDropDownComboBox";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getToolTipText()" "AccessibleDropDownComboBox";"com::sun::star::accessibility::XAccessibleEventBroadcaster#optional";"addEventListener()" diff --git a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleDropDownListBox.csv b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleDropDownListBox.csv index 2df3ecb2f6a3..be66442c2e93 100644 --- a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleDropDownListBox.csv +++ b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleDropDownListBox.csv @@ -1,4 +1,3 @@ -"AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getFont()" "AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getTitledBorderText()" "AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getToolTipText()" "AccessibleDropDownListBox";"com::sun::star::accessibility::XAccessibleEventBroadcaster#optional";"addEventListener()" diff --git a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleEdit.csv b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleEdit.csv index ab60d7412017..004352673b9d 100644 --- a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleEdit.csv +++ b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleEdit.csv @@ -1,4 +1,3 @@ -"AccessibleEdit";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getFont()" "AccessibleEdit";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getTitledBorderText()" "AccessibleEdit";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getToolTipText()" "AccessibleEdit";"com::sun::star::accessibility::XAccessibleEventBroadcaster";"addEventListener()" diff --git a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleFixedText.csv b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleFixedText.csv index 0a58a7933a6c..c736c47d402f 100644 --- a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleFixedText.csv +++ b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleFixedText.csv @@ -1,4 +1,3 @@ -"AccessibleFixedText";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getFont()" "AccessibleFixedText";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getTitledBorderText()" "AccessibleFixedText";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getToolTipText()" "AccessibleFixedText";"com::sun::star::accessibility::XAccessibleEventBroadcaster";"addEventListener()" diff --git a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleList.csv b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleList.csv index ddbc2a586b70..4952e9f2b1dc 100644 --- a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleList.csv +++ b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleList.csv @@ -1,4 +1,3 @@ -"AccessibleList";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getFont()" "AccessibleList";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getTitledBorderText()" "AccessibleList";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getToolTipText()" "AccessibleList";"com::sun::star::accessibility::XAccessibleEventBroadcaster#optional";"addEventListener()" diff --git a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleListBox.csv b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleListBox.csv index fbf420288a74..819e661c184a 100644 --- a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleListBox.csv +++ b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleListBox.csv @@ -1,4 +1,3 @@ -"AccessibleListBox";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getFont()" "AccessibleListBox";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getTitledBorderText()" "AccessibleListBox";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getToolTipText()" "AccessibleListBox";"com::sun::star::accessibility::XAccessibleEventBroadcaster#optional";"addEventListener()" diff --git a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleMenu.csv b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleMenu.csv index 017a8ff4e902..8d0e92af515a 100644 --- a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleMenu.csv +++ b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleMenu.csv @@ -1,4 +1,3 @@ -"AccessibleMenu";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getFont()" "AccessibleMenu";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getTitledBorderText()" "AccessibleMenu";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getToolTipText()" "AccessibleMenu";"com::sun::star::accessibility::XAccessibleValue";"getCurrentValue()" diff --git a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleMenuBar.csv b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleMenuBar.csv index 580dcf2b2bb8..f1c3c3696961 100644 --- a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleMenuBar.csv +++ b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleMenuBar.csv @@ -1,4 +1,3 @@ -"AccessibleMenuBar";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getFont()" "AccessibleMenuBar";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getTitledBorderText()" "AccessibleMenuBar";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getToolTipText()" "AccessibleMenuBar";"com::sun::star::accessibility::XAccessibleEventBroadcaster";"addEventListener()" diff --git a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleMenuItem.csv b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleMenuItem.csv index 12978754ab68..9c69804ab849 100644 --- a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleMenuItem.csv +++ b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleMenuItem.csv @@ -1,4 +1,3 @@ -"AccessibleMenuItem";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getFont()" "AccessibleMenuItem";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getTitledBorderText()" "AccessibleMenuItem";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getToolTipText()" "AccessibleMenuItem";"com::sun::star::accessibility::XAccessibleValue";"getCurrentValue()" diff --git a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleMenuSeparator.csv b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleMenuSeparator.csv index d0fd63b66dce..ada369f7263f 100644 --- a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleMenuSeparator.csv +++ b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleMenuSeparator.csv @@ -1,4 +1,3 @@ -"AccessibleMenuSeparator";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getFont()" "AccessibleMenuSeparator";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getTitledBorderText()" "AccessibleMenuSeparator";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getToolTipText()" "AccessibleMenuSeparator";"com::sun::star::accessibility::XAccessibleEventBroadcaster";"addEventListener()" diff --git a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessiblePopupMenu.csv b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessiblePopupMenu.csv index ec26fdf299e8..205f80cd9c08 100644 --- a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessiblePopupMenu.csv +++ b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessiblePopupMenu.csv @@ -1,4 +1,3 @@ -"AccessiblePopupMenu";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getFont()" "AccessiblePopupMenu";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getTitledBorderText()" "AccessiblePopupMenu";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getToolTipText()" "AccessiblePopupMenu";"com::sun::star::accessibility::XAccessibleEventBroadcaster";"addEventListener()" diff --git a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleRadioButton.csv b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleRadioButton.csv index e6b09510472c..b64a3aa8ed24 100644 --- a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleRadioButton.csv +++ b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleRadioButton.csv @@ -1,4 +1,3 @@ -"AccessibleRadioButton";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getFont()" "AccessibleRadioButton";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getTitledBorderText()" "AccessibleRadioButton";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getToolTipText()" "AccessibleRadioButton";"com::sun::star::accessibility::XAccessibleValue";"getCurrentValue()" diff --git a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleScrollBar.csv b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleScrollBar.csv index 38ef1161a39e..e5d9daee7c10 100644 --- a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleScrollBar.csv +++ b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleScrollBar.csv @@ -1,4 +1,3 @@ -"AccessibleScrollBar";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getFont()" "AccessibleScrollBar";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getTitledBorderText()" "AccessibleScrollBar";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getToolTipText()" "AccessibleScrollBar";"com::sun::star::accessibility::XAccessibleValue";"getCurrentValue()" diff --git a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleStatusBar.csv b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleStatusBar.csv index 3850e15f2969..e2c8e4e2c009 100644 --- a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleStatusBar.csv +++ b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleStatusBar.csv @@ -1,4 +1,3 @@ -"AccessibleStatusBar";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getFont()" "AccessibleStatusBar";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getTitledBorderText()" "AccessibleStatusBar";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getToolTipText()" "AccessibleStatusBar";"com::sun::star::accessibility::XAccessibleEventBroadcaster";"addEventListener()" diff --git a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleStatusBarItem.csv b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleStatusBarItem.csv index 78254662dd4b..0d08841628d0 100644 --- a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleStatusBarItem.csv +++ b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleStatusBarItem.csv @@ -1,4 +1,3 @@ -"AccessibleStatusBarItem";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getFont()" "AccessibleStatusBarItem";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getTitledBorderText()" "AccessibleStatusBarItem";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getToolTipText()" "AccessibleStatusBarItem";"com::sun::star::accessibility::XAccessibleEventBroadcaster";"addEventListener()" diff --git a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleTabControl.csv b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleTabControl.csv index 34936b28a5c1..d8434f71616a 100644 --- a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleTabControl.csv +++ b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleTabControl.csv @@ -1,4 +1,3 @@ -"AccessibleTabControl";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getFont()" "AccessibleTabControl";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getTitledBorderText()" "AccessibleTabControl";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getToolTipText()" "AccessibleTabControl";"com::sun::star::accessibility::XAccessibleEventBroadcaster";"addEventListener()" diff --git a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleTabPage.csv b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleTabPage.csv index 9df4ff13dc9c..de2248619165 100644 --- a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleTabPage.csv +++ b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleTabPage.csv @@ -1,4 +1,3 @@ -"AccessibleTabPage";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getFont()" "AccessibleTabPage";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getTitledBorderText()" "AccessibleTabPage";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getToolTipText()" "AccessibleTabPage";"com::sun::star::accessibility::XAccessibleEventBroadcaster";"addEventListener()" diff --git a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleToolBox.csv b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleToolBox.csv index 38b6e66890d4..a230ea8b3282 100644 --- a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleToolBox.csv +++ b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleToolBox.csv @@ -1,4 +1,3 @@ -"AccessibleToolBox";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getFont()" "AccessibleToolBox";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getTitledBorderText()" "AccessibleToolBox";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getToolTipText()" "AccessibleToolBox";"com::sun::star::accessibility::XAccessibleEventBroadcaster#optional";"addEventListener()" diff --git a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleToolBoxItem.csv b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleToolBoxItem.csv index c37673d7e271..b38537283fc9 100644 --- a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleToolBoxItem.csv +++ b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleToolBoxItem.csv @@ -1,4 +1,3 @@ -"AccessibleToolBoxItem";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getFont()" "AccessibleToolBoxItem";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getTitledBorderText()" "AccessibleToolBoxItem";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getToolTipText()" "AccessibleToolBoxItem";"com::sun::star::accessibility::XAccessibleValue";"getCurrentValue()" diff --git a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleWindow.csv b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleWindow.csv index c59a575c8fb2..b8679d33948a 100644 --- a/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleWindow.csv +++ b/qadevOOo/objdsc/toolkit/com.sun.star.comp.toolkit.AccessibleWindow.csv @@ -1,4 +1,3 @@ -"AccessibleWindow";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getFont()" "AccessibleWindow";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getTitledBorderText()" "AccessibleWindow";"com::sun::star::accessibility::XAccessibleExtendedComponent";"getToolTipText()" "AccessibleWindow";"com::sun::star::accessibility::XAccessibleEventBroadcaster";"addEventListener()" diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleExtendedComponent.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleExtendedComponent.java index 2156c09a00dc..902722a6a1a5 100644 --- a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleExtendedComponent.java +++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleExtendedComponent.java @@ -29,7 +29,6 @@ import com.sun.star.awt.XFont; *

    *
  • getForeground()
  • *
  • getBackground()
  • - *
  • getFont()
  • *
  • isEnabled()
  • *
  • getTitledBorderText()
  • *
  • getToolTipText()
  • @@ -60,15 +59,6 @@ public class _XAccessibleExtendedComponent extends MultiMethodTest { tRes.tested("getBackground()", true); } - /** - * Just calls the method. - */ - public void _getFont() { - XFont font = oObj.getFont(); - log.println("getFont(): " + font); - tRes.tested("getFont()", true); - } - /** * Calls the method and checks returned value. * Has OK status if returned value isn't null. diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx index eb834838734f..9f56510451ea 100644 --- a/reportdesign/source/ui/inspection/GeometryHandler.cxx +++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx @@ -67,6 +67,7 @@ #include #include +#include #include #include @@ -1598,11 +1599,11 @@ void GeometryHandler::checkPosAndSize( const awt::Point& _aNewPos, if ( !xSection.is() || uno::Reference< report::XShape>(xSourceReportComponent,uno::UNO_QUERY).is() ) // shapes can overlap. return; - ::Point aPos(VCLUnoHelper::ConvertToVCLPoint(_aNewPos)); + ::Point aPos(vcl::unohelper::ConvertToVCLPoint(_aNewPos)); if ( aPos.X() < 0 || aPos.Y() < 0 ) // TODO: have to check size with pos aka || (aPos.X() + aAwtSize.Width) > m_xSection->getReportDefinition()-> throw beans::PropertyVetoException(RptResId(RID_STR_ILLEGAL_POSITION),xSourceReportComponent); - ::tools::Rectangle aSourceRect(aPos, VCLUnoHelper::ConvertToVCLSize(_aSize)); + ::tools::Rectangle aSourceRect(aPos, vcl::unohelper::ConvertToVCLSize(_aSize)); const sal_Int32 nCount = xSection->getCount(); for (sal_Int32 i = 0; i < nCount ; ++i) @@ -1611,8 +1612,8 @@ void GeometryHandler::checkPosAndSize( const awt::Point& _aNewPos, if ( xReportComponent.is() && xReportComponent != xSourceReportComponent ) { const ::tools::Rectangle aBoundRect( - VCLUnoHelper::ConvertToVCLPoint(xReportComponent->getPosition()), - VCLUnoHelper::ConvertToVCLSize(xReportComponent->getSize())); + vcl::unohelper::ConvertToVCLPoint(xReportComponent->getPosition()), + vcl::unohelper::ConvertToVCLSize(xReportComponent->getSize())); const ::tools::Rectangle aRect = aSourceRect.GetIntersection(aBoundRect); if ( !aRect.IsEmpty() && (aRect.Left() != aRect.Right() && aRect.Top() != aRect.Bottom() ) ) throw beans::PropertyVetoException(RptResId( RID_STR_OVERLAP_OTHER_CONTROL),xSourceReportComponent); diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx index cbaad4ebd14a..ba51cb2ccc6a 100644 --- a/reportdesign/source/ui/misc/UITools.cxx +++ b/reportdesign/source/ui/misc/UITools.cxx @@ -936,8 +936,8 @@ tools::Rectangle getRectangleFromControl(SdrObject* _pControl) uno::Reference< report::XReportComponent > xComponent( _pControl->getUnoShape(), uno::UNO_QUERY); if (xComponent.is()) { - tools::Rectangle aRect(VCLUnoHelper::ConvertToVCLPoint(xComponent->getPosition()), - VCLUnoHelper::ConvertToVCLSize(xComponent->getSize())); + tools::Rectangle aRect(vcl::unohelper::ConvertToVCLPoint(xComponent->getPosition()), + vcl::unohelper::ConvertToVCLSize(xComponent->getSize())); aRect.setHeight(aRect.getOpenHeight() + 1); aRect.setWidth(aRect.getOpenWidth() + 1); return aRect; diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 1fa4beb1466c..42ed5b8f36ce 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -67,6 +67,7 @@ #include #include +#include #include #include @@ -2414,7 +2415,7 @@ void OReportController::openPageDialog(const uno::Reference& _ else { aDescriptor.Put(SvxSizeItem(RPTUI_ID_SIZE, - VCLUnoHelper::ConvertToVCLSize(getStyleProperty(m_xReportDefinition,PROPERTY_PAPERSIZE)))); + vcl::unohelper::ConvertToVCLSize(getStyleProperty(m_xReportDefinition,PROPERTY_PAPERSIZE)))); aDescriptor.Put(SvxLRSpaceItem(SvxIndentValue::twips(getStyleProperty( m_xReportDefinition, PROPERTY_LEFTMARGIN)), SvxIndentValue::twips(getStyleProperty( diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index ca9842cef7ab..77ad558e0396 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include @@ -53,6 +52,7 @@ #include #include +#include #include #include @@ -255,8 +255,8 @@ void OReportSection::Paste(const uno::Sequence< beans::NamedValue >& _aAllreadyC // Clone to target SdrModel rtl::Reference pNewObj(pObject->CloneSdrObject(*m_pModel)); m_pPage->InsertObject(pNewObj.get(), SAL_MAX_SIZE); - tools::Rectangle aRet(VCLUnoHelper::ConvertToVCLPoint(rCopy->getPosition()), - VCLUnoHelper::ConvertToVCLSize(rCopy->getSize())); + tools::Rectangle aRet(vcl::unohelper::ConvertToVCLPoint(rCopy->getPosition()), + vcl::unohelper::ConvertToVCLSize(rCopy->getSize())); aRet.setHeight(aRet.getOpenHeight() + 1); aRet.setWidth(aRet.getOpenWidth() + 1); bool bOverlapping = true; @@ -538,8 +538,8 @@ void OReportSection::impl_adjustObjectSizePosition(sal_Int32 i_nPaperWidth,sal_I xReportComponent->setPosition(aPos); correctOverlapping(pObject,*this,false); tools::Rectangle aRet( - VCLUnoHelper::ConvertToVCLPoint(xReportComponent->getPosition()), - VCLUnoHelper::ConvertToVCLSize(xReportComponent->getSize())); + vcl::unohelper::ConvertToVCLPoint(xReportComponent->getPosition()), + vcl::unohelper::ConvertToVCLSize(xReportComponent->getSize())); aRet.setHeight(aRet.getOpenHeight() + 1); aRet.setWidth(aRet.getOpenWidth() + 1); if ( m_xSection.is() && (o3tl::make_unsigned(aRet.getOpenHeight() + aRet.Top()) > m_xSection->getHeight()) ) @@ -771,7 +771,7 @@ sal_Int8 OReportSection::ExecuteDrop( const ExecuteDropEvent& _rEvt ) aCurrent.realloc(nLength + 3); auto pCurrent = aCurrent.getArray(); pCurrent[nLength].Name = PROPERTY_POSITION; - pCurrent[nLength++].Value <<= VCLUnoHelper::ConvertToAWTPoint(aDropPos); + pCurrent[nLength++].Value <<= vcl::unohelper::ConvertToAWTPoint(aDropPos); // give also the DND Action (Shift|Ctrl) Key to really say what we want pCurrent[nLength].Name = "DNDAction"; pCurrent[nLength++].Value <<= _rEvt.mnAction; diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index 3dfb95ead12f..7ac2a49e14eb 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -1238,7 +1239,7 @@ void OViewsWindow::EndDragObj(bool _bControlKeyPressed, const OSectionView* _pSe for (; pColIter != pColEnd; ++pColIter) { uno::Reference< report::XReportComponent> xRC(*pColIter); - aPrevious = VCLUnoHelper::ConvertToVCLPoint(xRC->getPosition()); + aPrevious = vcl::unohelper::ConvertToVCLPoint(xRC->getPosition()); awt::Size aSize = xRC->getSize(); if ( aNewPos.X() < nLeftMargin ) @@ -1259,13 +1260,13 @@ void OViewsWindow::EndDragObj(bool _bControlKeyPressed, const OSectionView* _pSe aNewPos.setX( 0 ); xRC->setSize(aSize); } - xRC->setPosition(VCLUnoHelper::ConvertToAWTPoint(aNewPos)); + xRC->setPosition(vcl::unohelper::ConvertToAWTPoint(aNewPos)); if ( (pColIter+1) != pColEnd ) { // bring aNewPos to the position of the next object uno::Reference< report::XReportComponent> xRCNext = *(pColIter + 1); Point aNextPosition - = VCLUnoHelper::ConvertToVCLPoint(xRCNext->getPosition()); + = vcl::unohelper::ConvertToVCLPoint(xRCNext->getPosition()); aNewPos += aNextPosition - aPrevious; } } diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk index 824b02714f4d..5a0aa6107562 100644 --- a/sc/Library_sc.mk +++ b/sc/Library_sc.mk @@ -378,6 +378,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\ sc/source/ui/Accessibility/AccessibleTableBase \ sc/source/ui/Accessibility/AccessibleText \ sc/source/ui/Accessibility/DrawModelBroadcaster \ + sc/source/ui/app/acctrl \ sc/source/ui/app/client \ sc/source/ui/app/drwtrans \ sc/source/ui/app/inputhdl \ diff --git a/sc/inc/bitmaps.hlst b/sc/inc/bitmaps.hlst index 540e44bd0bf1..34cf808d8754 100644 --- a/sc/inc/bitmaps.hlst +++ b/sc/inc/bitmaps.hlst @@ -124,4 +124,6 @@ inline constexpr OUString RID_SVXBMP_SLIDERBUTTON = u"svx/res/slidezoombutton_10 inline constexpr OUString RID_SVXBMP_SLIDERDECREASE = u"svx/res/slidezoomout_10.png"_ustr; inline constexpr OUString RID_SVXBMP_SLIDERINCREASE = u"svx/res/slidezoomin_10.png"_ustr; +inline constexpr OUString RID_BMP_CALCULATOR_RED = u"sc/res/calculator_red.png"_ustr; + /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx index 04aa7ea18d2d..046761650847 100644 --- a/sc/inc/compiler.hxx +++ b/sc/inc/compiler.hxx @@ -331,7 +331,7 @@ private: bool NextNewToken(bool bInArray); bool ToUpperAsciiOrI18nIsAscii( OUString& rUpper, const OUString& rOrg ) const; - short GetPossibleParaCount( const std::u16string_view& rLambdaFormula ) const; + short GetPossibleParaCount( std::u16string_view rLambdaFormula ) const; virtual void SetError(FormulaError nError) override; diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx index a179d8d8d875..fe708bc6e356 100644 --- a/sc/inc/conditio.hxx +++ b/sc/inc/conditio.hxx @@ -85,20 +85,6 @@ enum class ScConditionMode EndsWith, ContainsText, NotContainsText, - Formula, - Today, - Yesterday, - Tomorrow, - Last7days, - ThisWeek, - LastWeek, - NextWeek, - ThisMonth, - LastMonth, - NextMonth, - ThisYear, - LastYear, - NextYear, NONE }; @@ -183,48 +169,6 @@ inline std::basic_ostream & operator <<(std::basic_ostream IconSetBitmapMap; @@ -486,7 +465,7 @@ private: std::unique_ptr pExtDocOptions; // for import etc. std::unique_ptr mpClipOptions; // clipboard options std::unique_ptr pConsolidateDlgData; - ScConditionEasyDialogData pConditionalFormatDialogData; + std::unique_ptr pConditionalFormatDialogMode; std::unique_ptr pAutoNameCache; // for automatic name lookup during CompileXML @@ -734,10 +713,10 @@ public: void SetConsolidateDlgData( std::unique_ptr pData ); const ScConsolidateParam* GetConsolidateDlgData() const { return pConsolidateDlgData.get(); } - void SetEasyConditionalFormatDialogData(const ScConditionEasyDialogData& data); - const ScConditionEasyDialogData & GetEasyConditionalFormatDialogData() const + void SetEasyConditionalFormatDialogData(std::unique_ptr pMode); + const ScConditionMode* GetEasyConditionalFormatDialogData() const { - return pConditionalFormatDialogData; + return pConditionalFormatDialogMode.get(); } void Clear( bool bFromDestructor = false ); @@ -927,7 +906,6 @@ public: SC_DLLPUBLIC bool HasPivotTable() const; SC_DLLPUBLIC ScDPCollection* GetDPCollection(); SC_DLLPUBLIC const ScDPCollection* GetDPCollection() const; - SC_DLLPUBLIC const ScDPObject* GetDPAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const; SC_DLLPUBLIC ScDPObject* GetDPAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab) const; SC_DLLPUBLIC ScDPObject* GetDPAtCursor(ScAddress const& rAddress) const { diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc index 743a57913196..ceca2b5d31c7 100644 --- a/sc/inc/globstr.hrc +++ b/sc/inc/globstr.hrc @@ -271,7 +271,6 @@ #define STR_HIDE NC_("STR_HIDE", "Hide") #define STR_PRINT NC_("STR_PRINT", "Print") #define STR_INVALID_AFAREA NC_("STR_INVALID_AFAREA", "To apply an AutoFormat,\na table range of at least\n3 × 3 cells must be selected.") -#define STR_AUTOFORMAT_WAIT_WARNING_TITLE NC_("STR_AUTOFORMAT_WAIT_WARNING_TITLE", "") #define STR_AUTOFORMAT_WAIT_WARNING NC_("STR_AUTOFORMAT_WAIT_WARNING", "Applying AutoFormat to the selected range (more than one million cells) may take a long time.\nDo you want to proceed?") #define STR_OPTIONAL NC_("STR_OPTIONAL", "(optional)") #define STR_REQUIRED NC_("STR_REQUIRED", "(required)") diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index 1d297a58f22b..245869363f2e 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -93,9 +93,10 @@ public: virtual std::unique_ptr GetConditionalFormatList() = 0; virtual bool CondFormatsChanged() const = 0; - virtual void ShowEasyConditionalDialog(bool isEdit = false) = 0; virtual void SetModified() = 0; + + virtual ScConditionalFormat* GetCondFormatSelected() = 0; }; class AbstractScDataPilotDatabaseDlg :public VclAbstractDialog diff --git a/sc/inc/strings.hrc b/sc/inc/strings.hrc index faaa5e64998b..193061581938 100644 --- a/sc/inc/strings.hrc +++ b/sc/inc/strings.hrc @@ -447,5 +447,6 @@ #define STR_CONTENT_WITH_UNKNOWN_ENCRYPTION NC_("STR_CONTENT_WITH_UNKNOWN_ENCRYPTION", "Document contains DRM content that is encrypted with an unknown encryption method. Only the un-encrypted content will be shown.") +#define STR_AUTOCALC_OFF NC_("STR_AUTOCALC_OFF", "AutoCalculate: Off\nClick to enable.") /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/qa/uitest/conditional_format/tdf100793.py b/sc/qa/uitest/conditional_format/tdf100793.py index b7d253ea2ba4..692c3c8109b2 100644 --- a/sc/qa/uitest/conditional_format/tdf100793.py +++ b/sc/qa/uitest/conditional_format/tdf100793.py @@ -5,6 +5,7 @@ # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. +# from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file @@ -31,14 +32,14 @@ class tdf100793(UITestCase): # check that we have exactly one conditional formats in the beginning xList = xCondFormatMgr.getChild("CONTAINER") list_state = get_state_as_dict(xList) - self.assertEqual(list_state['Children'], '3') + self.assertEqual(list_state['Children'], '1') #3) Click Edit & try to change to intended one, F18:K33 xEditBtn = xCondFormatMgr.getChild("edit") with self.ui_test.execute_dialog_through_action(xEditBtn, "CLICK", event_name = "ModelessDialogVisible") as xCondFormatDlg: #modify textbox - xedassign = xCondFormatDlg.getChild("entryRange") + xedassign = xCondFormatDlg.getChild("edassign") #go at the beginning xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "END"})) xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "HOME"})) @@ -64,9 +65,9 @@ class tdf100793(UITestCase): # and still only 1 conditional format in the document xList = xCondFormatMgr.getChild("CONTAINER") list_state = get_state_as_dict(xList) - self.assertEqual(list_state['Children'], '3') + self.assertEqual(list_state['Children'], '1') - self.assertEqual(conditional_format_list.getLength(), 2) + self.assertEqual(conditional_format_list.getLength(), 1) # close the conditional format manager xOKBtn = xCondFormatMgr.getChild("ok") @@ -74,11 +75,9 @@ class tdf100793(UITestCase): #verify - reopen, check range with self.ui_test.execute_dialog_through_command(".uno:ConditionalFormatManagerDialog", close_button="") as xCondFormatMgr: - xCondFormatMgr.getChild("CONTAINER").executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"})) - xCondFormatMgr.getChild("CONTAINER").executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"})) xEditBtn = xCondFormatMgr.getChild("edit") with self.ui_test.execute_dialog_through_action(xEditBtn, "CLICK", event_name = "ModelessDialogVisible") as xCondFormatDlg: - xedassign = xCondFormatDlg.getChild("entryRange") + xedassign = xCondFormatDlg.getChild("edassign") self.assertEqual(get_state_as_dict(xedassign)["Text"], "G18:K29,F18:K33,F20:F29") xCondFormatMgr = self.xUITest.getTopFocusWindow() diff --git a/sc/qa/uitest/conditional_format/tdf105544.py b/sc/qa/uitest/conditional_format/tdf105544.py index 3e5fd6730277..b172d4067a1d 100644 --- a/sc/qa/uitest/conditional_format/tdf105544.py +++ b/sc/qa/uitest/conditional_format/tdf105544.py @@ -27,7 +27,7 @@ class tdf105544(UITestCase): # check that we have exactly four conditional formats in the beginning xList = xCondFormatMgr.getChild("CONTAINER") list_state = get_state_as_dict(xList) - self.assertEqual(list_state['Children'], '5') + self.assertEqual(list_state['Children'], '4') #select B3:B37 range and click edit, then click yes xList.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"})) #2nd position in the list @@ -41,7 +41,7 @@ class tdf105544(UITestCase): # check again that we still have 4 entry in the list xList = xCondFormatMgr.getChild("CONTAINER") list_state = get_state_as_dict(xList) - self.assertEqual(list_state['Children'], '5') + self.assertEqual(list_state['Children'], '4') # close the conditional format manager xOKBtn = xCondFormatMgr.getChild("ok") diff --git a/sc/qa/uitest/conditional_format/tdf96453.py b/sc/qa/uitest/conditional_format/tdf96453.py index bcb602ad3452..453a9ff48eb5 100644 --- a/sc/qa/uitest/conditional_format/tdf96453.py +++ b/sc/qa/uitest/conditional_format/tdf96453.py @@ -53,9 +53,9 @@ class ConditionalFormatDlgTest(UITestCase): # and still only 2 conditional formats in the document xList = xCondFormatMgr.getChild("CONTAINER") list_state = get_state_as_dict(xList) - self.assertEqual(list_state['Children'], '3') + self.assertEqual(list_state['Children'], '2') - self.assertEqual(conditional_format_list.getLength(), 3) + self.assertEqual(conditional_format_list.getLength(), 2) # close the conditional format manager xCancelBtn = xCondFormatMgr.getChild("cancel") diff --git a/sc/qa/uitest/pasteSpecial/tdf86253.py b/sc/qa/uitest/pasteSpecial/tdf86253.py index fa39f3bfebfe..6e6e1bcd4983 100644 --- a/sc/qa/uitest/pasteSpecial/tdf86253.py +++ b/sc/qa/uitest/pasteSpecial/tdf86253.py @@ -44,7 +44,7 @@ class tdf86253(UITestCase): # check that we have exactly 1 conditional format and range is C1:C17 xList = xCondFormatMgr.getChild("CONTAINER") list_state = get_state_as_dict(xList) - self.assertEqual(list_state['Children'], '2') # We can now display both condition separate on same range + self.assertEqual(list_state['Children'], '1') xTreeEntry = xList.getChild('0') self.assertEqual(get_state_as_dict(xTreeEntry)["Text"], "A1:A6,C1:C17\tCell value >= 0") diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx index b24072714cb5..b58bee67cb88 100644 --- a/sc/qa/unit/helper/qahelper.cxx +++ b/sc/qa/unit/helper/qahelper.cxx @@ -290,7 +290,7 @@ void ScModelTestBase::goToCell(const OUString& rCell) dispatchCommand(mxComponent, u".uno:GoToCell"_ustr, aArgs); } -void ScModelTestBase::typeString(const std::u16string_view& rStr) +void ScModelTestBase::typeString(std::u16string_view rStr) { ScModelObj* pModelObj = comphelper::getFromUnoTunnel(mxComponent); for (const char16_t c : rStr) @@ -301,7 +301,7 @@ void ScModelTestBase::typeString(const std::u16string_view& rStr) } } -void ScModelTestBase::insertStringToCell(const OUString& rCell, const std::u16string_view& rStr) +void ScModelTestBase::insertStringToCell(const OUString& rCell, std::u16string_view rStr) { goToCell(rCell); @@ -313,7 +313,7 @@ void ScModelTestBase::insertStringToCell(const OUString& rCell, const std::u16st Scheduler::ProcessEventsToIdle(); } -void ScModelTestBase::insertArrayToCell(const OUString& rCell, const std::u16string_view& rStr) +void ScModelTestBase::insertArrayToCell(const OUString& rCell, std::u16string_view rStr) { goToCell(rCell); diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx index 6eeb111ad25b..a2d46916a521 100644 --- a/sc/qa/unit/helper/qahelper.hxx +++ b/sc/qa/unit/helper/qahelper.hxx @@ -179,9 +179,9 @@ public: void testFormats(ScDocument* pDoc,std::u16string_view sFormat); void goToCell(const OUString& rCell); - void typeString(const std::u16string_view& rStr); - void insertStringToCell(const OUString& rCell, const std::u16string_view& rStr); - void insertArrayToCell(const OUString& rCell, const std::u16string_view& rStr); + void typeString(std::u16string_view rStr); + void insertStringToCell(const OUString& rCell, std::u16string_view rStr); + void insertArrayToCell(const OUString& rCell, std::u16string_view rStr); void insertNewSheet(ScDocument& rDoc); void executeAutoSum(); diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi index 6e39cda9a7c3..44e87cd69119 100644 --- a/sc/sdi/cellsh.sdi +++ b/sc/sdi/cellsh.sdi @@ -219,11 +219,7 @@ interface CellSelection SID_POPUP_EASY_CONDITIONAL_FORMAT [] SfxVoidItem ConditionalFormatEasy SID_EASY_CONDITIONAL_FORMAT_DIALOG ( - SfxInt16Item FormatRule FN_PARAM_1, - SfxBoolItem Managed FN_PARAM_2, - SfxInt32Item FormatKey FN_PARAM_3, - SfxInt32Item EntryIndex FN_PARAM_4, - SfxStringItem Formula FN_PARAM_5 + SfxInt16Item FormatRule FN_PARAM_1 ) [ ExecMethod = Execute; diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 825d0bb58d02..7c2cd876f906 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -2725,22 +2725,47 @@ void ScColumn::GetBackColorFilterEntries(SCROW nRow1, SCROW nRow2, ScFilterEntri ScAddress aCell(GetCol(), 0, GetTab()); ScDocument& rDoc = GetDoc(); + ScConditionalFormatList* pCondFormList = rDoc.GetCondFormList(aCell.Tab()); // cache the output of GetCondResult const ScPatternAttr* pPrevPattern = nullptr; ScRefCellValue aPrevCellValue; Color aPrevPatternColor; + Color aPrevInsertColor; + const ScPatternAttr* pPattern = nullptr; + ScConditionalFormat* pCondFormat = nullptr; + const ScCondFormatIndexes* pCondFormats = nullptr; + Color aBackgroundBrushColor; + SCROW nPatternStartRow = -1; + SCROW nPatternEndRow = -1; while (nRow1 <= nRow2) { aCell.SetRow(nRow1); Color aBackColor; bool bCondBackColor = false; - const ScPatternAttr* pPattern = rDoc.GetPattern(aCell.Col(), aCell.Row(), aCell.Tab()); - ScConditionalFormat* pCondFormat = rDoc.GetCondFormat(aCell.Col(), aCell.Row(), aCell.Tab()); + + if (nRow1 <= nPatternEndRow) + ; // then the previous value of pPattern and pCondFormat and pCondFormats and aBackgroundBrushColor is still valid + else + { + pPattern = pAttrArray->GetPatternRange(nPatternStartRow, nPatternEndRow, nRow1); + pCondFormats = &pPattern->GetItem(ATTR_CONDITIONAL).GetCondFormatData(); + sal_uInt32 nIndex = 0; + if(!pCondFormats->empty()) + nIndex = (*pCondFormats)[0]; + if (nIndex) + { + assert(pCondFormList); + pCondFormat = pCondFormList->GetFormat( nIndex ); + } + else + pCondFormat = nullptr; + aBackgroundBrushColor = pPattern->GetItem(ATTR_BACKGROUND).GetColor(); + } if (pPattern) { - if (!pPattern->GetItem(ATTR_CONDITIONAL).GetCondFormatData().empty()) + if (!pCondFormats->empty()) { // Speed up processing when dealing with runs of identical cells. This avoids // an expensive GetCondResult call. @@ -2753,8 +2778,8 @@ void ScColumn::GetBackColorFilterEntries(SCROW nRow1, SCROW nRow2, ScFilterEntri else { const SfxItemSet* pCondSet = rDoc.GetCondResult(GetCol(), nRow1, GetTab()); - const SvxBrushItem* pBrush = &pPattern->GetItem(ATTR_BACKGROUND, pCondSet); - aBackColor = pBrush->GetColor(); + const SvxBrushItem* pCondBrush = &pPattern->GetItem(ATTR_BACKGROUND, pCondSet); + aBackColor = pCondBrush->GetColor(); bCondBackColor = true; aPrevCellValue = aCellValue; pPrevPattern = pPattern; @@ -2783,11 +2808,14 @@ void ScColumn::GetBackColorFilterEntries(SCROW nRow1, SCROW nRow2, ScFilterEntri if (!bCondBackColor) { - const SvxBrushItem* pBrush = rDoc.GetAttr(aCell, ATTR_BACKGROUND); - aBackColor = pBrush->GetColor(); + aBackColor = aBackgroundBrushColor; } - rFilterEntries.addBackgroundColor(aBackColor); + if (aPrevInsertColor != aBackColor) + { + rFilterEntries.addBackgroundColor(aBackColor); + aPrevInsertColor = aBackColor; + } nRow1++; } } diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index 94ced759894a..97b1c73b0e08 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -1139,22 +1139,6 @@ bool ScConditionEntry::IsValid( double nArg, const ScAddress& rPos ) const if( eOp == ScConditionMode::NotContainsText ) bValid = !bValid; break; - case ScConditionMode::Formula: - case ScConditionMode::Today: - case ScConditionMode::Yesterday: - case ScConditionMode::Tomorrow: - case ScConditionMode::Last7days: - case ScConditionMode::ThisWeek: - case ScConditionMode::LastWeek: - case ScConditionMode::NextWeek: - case ScConditionMode::ThisMonth: - case ScConditionMode::LastMonth: - case ScConditionMode::NextMonth: - case ScConditionMode::ThisYear: - case ScConditionMode::LastYear: - case ScConditionMode::NextYear: - bValid = true; - break; default: SAL_WARN("sc", "unknown operation at ScConditionEntry"); break; diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index 2fe0a63ec09a..3890a5194e85 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -1185,13 +1185,9 @@ void ScDocument::SetConsolidateDlgData( std::unique_ptr pDat pConsolidateDlgData = std::move(pData); } -void ScDocument::SetEasyConditionalFormatDialogData(const ScConditionEasyDialogData& data) +void ScDocument::SetEasyConditionalFormatDialogData(std::unique_ptr pMode) { - pConditionalFormatDialogData.Mode = data.Mode; - pConditionalFormatDialogData.IsManaged = data.IsManaged; - pConditionalFormatDialogData.Formula = data.Formula; - pConditionalFormatDialogData.FormatKey = data.FormatKey; - pConditionalFormatDialogData.EntryIndex = data.EntryIndex; + pConditionalFormatDialogMode = std::move(pMode); } void ScDocument::SetChangeViewSettings(const ScChangeViewSettings& rNew) diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index 602d3b573535..3c95015874c0 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -379,20 +379,6 @@ const ScDPCollection* ScDocument::GetDPCollection() const return pDPCollection.get(); } -const ScDPObject* ScDocument::GetDPAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const -{ - if (!pDPCollection) - return nullptr; - - sal_uInt16 nCount = pDPCollection->GetCount(); - ScRange aRange(nCol1, nRow1, nTab, nCol2, nRow2, nTab); - for (sal_uInt16 i = 0; i < nCount; i++) - if ((*pDPCollection)[i].GetOutRange() == aRange) - return &(*pDPCollection)[i]; - - return nullptr; -} - ScDPObject* ScDocument::GetDPAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab) const { if (!pDPCollection) diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 2425b311844c..8b5c948e9779 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -4412,7 +4412,7 @@ bool ScCompiler::ToUpperAsciiOrI18nIsAscii( OUString& rUpper, const OUString& rO } } -short ScCompiler::GetPossibleParaCount( const std::u16string_view& rLambdaFormula ) const +short ScCompiler::GetPossibleParaCount( std::u16string_view rLambdaFormula ) const { sal_Unicode cSep = mxSymbols->getSymbolChar(ocSep); sal_Unicode cOpen = mxSymbols->getSymbolChar(ocOpen); diff --git a/sc/source/ui/Accessibility/AccessibleContextBase.cxx b/sc/source/ui/Accessibility/AccessibleContextBase.cxx index 4300cf98cbab..b121893e2f6c 100644 --- a/sc/source/ui/Accessibility/AccessibleContextBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleContextBase.cxx @@ -159,7 +159,7 @@ sal_Bool SAL_CALL ScAccessibleContextBase::containsPoint(const awt::Point& rPoin SolarMutexGuard aGuard; IsObjectValid(); return tools::Rectangle(Point(), GetBoundingBox().GetSize()) - .Contains(VCLUnoHelper::ConvertToVCLPoint(rPoint)); + .Contains(vcl::unohelper::ConvertToVCLPoint(rPoint)); } uno::Reference< XAccessible > SAL_CALL ScAccessibleContextBase::getAccessibleAtPoint( @@ -173,28 +173,28 @@ awt::Rectangle SAL_CALL ScAccessibleContextBase::getBounds( ) { SolarMutexGuard aGuard; IsObjectValid(); - return VCLUnoHelper::ConvertToAWTRect(GetBoundingBox()); + return vcl::unohelper::ConvertToAWTRect(GetBoundingBox()); } awt::Point SAL_CALL ScAccessibleContextBase::getLocation( ) { SolarMutexGuard aGuard; IsObjectValid(); - return VCLUnoHelper::ConvertToAWTPoint(GetBoundingBox().TopLeft()); + return vcl::unohelper::ConvertToAWTPoint(GetBoundingBox().TopLeft()); } awt::Point SAL_CALL ScAccessibleContextBase::getLocationOnScreen( ) { SolarMutexGuard aGuard; IsObjectValid(); - return VCLUnoHelper::ConvertToAWTPoint(GetBoundingBoxOnScreen().TopLeft()); + return vcl::unohelper::ConvertToAWTPoint(GetBoundingBoxOnScreen().TopLeft()); } awt::Size SAL_CALL ScAccessibleContextBase::getSize( ) { SolarMutexGuard aGuard; IsObjectValid(); - return VCLUnoHelper::ConvertToAWTSize(GetBoundingBox().GetSize()); + return vcl::unohelper::ConvertToAWTSize(GetBoundingBox().GetSize()); } bool ScAccessibleContextBase::isShowing( ) @@ -208,8 +208,8 @@ bool ScAccessibleContextBase::isShowing( ) if (xParentComponent.is()) { tools::Rectangle aParentBounds( - VCLUnoHelper::ConvertToVCLRect(xParentComponent->getBounds())); - tools::Rectangle aBounds(VCLUnoHelper::ConvertToVCLRect(getBounds())); + vcl::unohelper::ConvertToVCLRect(xParentComponent->getBounds())); + tools::Rectangle aBounds(vcl::unohelper::ConvertToVCLRect(getBounds())); bShowing = aBounds.Overlaps(aParentBounds); } } diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index d4eca4f99487..5658ee2a27a9 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -58,6 +58,7 @@ #include #include #include +#include #include #include @@ -572,10 +573,10 @@ uno::Reference< XAccessible > ScChildrenShapes::GetAt(const awt::Point& rPoint) if (pShape->pAccShape.is()) { - Point aPoint(VCLUnoHelper::ConvertToVCLPoint(rPoint)); + Point aPoint(vcl::unohelper::ConvertToVCLPoint(rPoint)); aPoint - -= VCLUnoHelper::ConvertToVCLRect(pShape->pAccShape->getBounds()).TopLeft(); - if (pShape->pAccShape->containsPoint(VCLUnoHelper::ConvertToAWTPoint(aPoint))) + -= vcl::unohelper::ConvertToVCLRect(pShape->pAccShape->getBounds()).TopLeft(); + if (pShape->pAccShape->containsPoint(vcl::unohelper::ConvertToAWTPoint(aPoint))) { xAccessible = pShape->pAccShape.get(); bFound = true; @@ -1640,8 +1641,8 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleDocument::getAccessibleAtPoin uno::Reference< XAccessibleComponent > xComp(xCont, uno::UNO_QUERY); if (xComp.is()) { - tools::Rectangle aBound(VCLUnoHelper::ConvertToVCLRect(xComp->getBounds())); - if (aBound.Contains(VCLUnoHelper::ConvertToVCLPoint(rPoint))) + tools::Rectangle aBound(vcl::unohelper::ConvertToVCLRect(xComp->getBounds())); + if (aBound.Contains(vcl::unohelper::ConvertToVCLPoint(rPoint))) xAccessible = mxTempAcc; } } diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx index fa51d4818983..5ba18208d110 100644 --- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx @@ -50,6 +50,7 @@ #include #include #include +#include #include #include @@ -924,13 +925,13 @@ struct ScShapePointFound { Point maPoint; explicit ScShapePointFound(const awt::Point& rPoint) - : maPoint(VCLUnoHelper::ConvertToVCLPoint(rPoint)) + : maPoint(vcl::unohelper::ConvertToVCLPoint(rPoint)) { } bool operator() (const ScShapeChild& rShape) { bool bResult(false); - if (VCLUnoHelper::ConvertToVCLRect(rShape.mpAccShape->getBounds()).Contains(maPoint)) + if (vcl::unohelper::ConvertToVCLRect(rShape.mpAccShape->getBounds()).Contains(maPoint)) bResult = true; return bResult; } @@ -1030,8 +1031,8 @@ void ScShapeChildren::FillShapes(const tools::Rectangle& aPixelPaintRect, const if (xShape.is()) { tools::Rectangle aRect(pWin->LogicToPixel( - tools::Rectangle(VCLUnoHelper::ConvertToVCLPoint(xShape->getPosition()), - VCLUnoHelper::ConvertToVCLSize(xShape->getSize())), aMapMode)); + tools::Rectangle(vcl::unohelper::ConvertToVCLPoint(xShape->getPosition()), + vcl::unohelper::ConvertToVCLSize(xShape->getSize())), aMapMode)); if(!aClippedPixelPaintRect.GetIntersection(aRect).IsEmpty()) { ScShapeChild aShape; @@ -1305,8 +1306,8 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleDocumentPagePreview::getAcces mpTable->Init(); } if (mpTable.is() - && VCLUnoHelper::ConvertToVCLRect(mpTable->getBounds()) - .Contains(VCLUnoHelper::ConvertToVCLPoint(rPoint))) + && vcl::unohelper::ConvertToVCLRect(mpTable->getBounds()) + .Contains(vcl::unohelper::ConvertToVCLPoint(rPoint))) xAccessible = mpTable.get(); } if (!xAccessible.is()) @@ -1328,11 +1329,11 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleDocumentPagePreview::getAcces } } - Point aPoint(VCLUnoHelper::ConvertToVCLPoint(rPoint)); + Point aPoint(vcl::unohelper::ConvertToVCLPoint(rPoint)); - if (VCLUnoHelper::ConvertToVCLRect(mpHeader->getBounds()).Contains(aPoint)) + if (vcl::unohelper::ConvertToVCLRect(mpHeader->getBounds()).Contains(aPoint)) xAccessible = mpHeader.get(); - else if (VCLUnoHelper::ConvertToVCLRect(mpFooter->getBounds()).Contains(aPoint)) + else if (vcl::unohelper::ConvertToVCLRect(mpFooter->getBounds()).Contains(aPoint)) xAccessible = mpFooter.get(); } if (!xAccessible.is()) diff --git a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx index 89ed4343ff35..4881e2a8ce60 100644 --- a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx +++ b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx @@ -34,8 +34,8 @@ #include #include #include -#include #include +#include using namespace ::com::sun::star; using namespace ::com::sun::star::accessibility; @@ -234,9 +234,9 @@ AbsoluteScreenPixelRectangle ScAccessiblePageHeaderArea::GetBoundingBoxOnScreen( // has the same size and position on screen like the parent aRect = AbsoluteScreenPixelRectangle( AbsoluteScreenPixelPoint( - VCLUnoHelper::ConvertToVCLPoint(xComp->getLocationOnScreen())), + vcl::unohelper::ConvertToVCLPoint(xComp->getLocationOnScreen())), AbsoluteScreenPixelSize( - VCLUnoHelper::ConvertToVCLRect(xComp->getBounds()).GetSize())); + vcl::unohelper::ConvertToVCLRect(xComp->getBounds()).GetSize())); } } return aRect; @@ -253,7 +253,7 @@ tools::Rectangle ScAccessiblePageHeaderArea::GetBoundingBox() const { // has the same size and position on screen like the parent and so the pos is (0, 0) tools::Rectangle aNewRect(Point(0, 0), - VCLUnoHelper::ConvertToVCLRect(xComp->getBounds()).GetSize()); + vcl::unohelper::ConvertToVCLRect(xComp->getBounds()).GetSize()); aRect = aNewRect; } } diff --git a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx index 9bcbb14e3b92..c0aefc808cc8 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include @@ -221,7 +221,7 @@ tools::Rectangle ScAccessiblePreviewCell::GetBoundingBox() const if (xAccParentComp.is()) { tools::Rectangle aParentRect( - VCLUnoHelper::ConvertToVCLRect(xAccParentComp->getBounds())); + vcl::unohelper::ConvertToVCLRect(xAccParentComp->getBounds())); aCellRect.Move(-aParentRect.Left(), -aParentRect.Top()); } } diff --git a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx index c16ae0f72c37..670d45ff0cb9 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx @@ -34,6 +34,7 @@ #include #include +#include #include #include @@ -326,7 +327,7 @@ tools::Rectangle ScAccessiblePreviewHeaderCell::GetBoundingBox() const if (xAccParentComp.is()) { tools::Rectangle aParentRect( - VCLUnoHelper::ConvertToVCLRect(xAccParentComp->getBounds())); + vcl::unohelper::ConvertToVCLRect(xAccParentComp->getBounds())); aCellRect.Move(-aParentRect.Left(), -aParentRect.Top()); } } diff --git a/sc/source/ui/app/acctrl.cxx b/sc/source/ui/app/acctrl.cxx new file mode 100644 index 000000000000..bff92c18e684 --- /dev/null +++ b/sc/source/ui/app/acctrl.cxx @@ -0,0 +1,84 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +SFX_IMPL_STATUSBAR_CONTROL(ScAutoCalculateControl, SfxBoolItem); + +ScAutoCalculateControl::ScAutoCalculateControl(sal_uInt16 _nSlotId, sal_uInt16 _nId, + StatusBar& rStb) + : SfxStatusBarControl(_nSlotId, _nId, rStb) + , m_bIsActive(false) +{ +} + +ScAutoCalculateControl::~ScAutoCalculateControl() {} + +void ScAutoCalculateControl::StateChangedAtStatusBarControl(sal_uInt16, SfxItemState eState, + const SfxPoolItem* pState) +{ + if (eState != SfxItemState::DEFAULT || SfxItemState::DISABLED == eState) + return; + + auto pItem = static_cast(pState); + if (!pItem) + { + SAL_WARN("sc", "Item wasn't a SfxBoolItem"); + return; + } + m_bIsActive = pItem->GetValue(); + + GetStatusBar().SetQuickHelpText(GetId(), m_bIsActive ? "" : ScResId(STR_AUTOCALC_OFF)); + GetStatusBar().Invalidate(); +} + +void ScAutoCalculateControl::Paint(const UserDrawEvent& rUsrEvt) +{ + vcl::RenderContext* pDev = rUsrEvt.GetRenderContext(); + tools::Rectangle aRect(rUsrEvt.GetRect()); + pDev->Erase(); + + if (!m_bIsActive) + { + const Image aImage(StockImage::Yes, RID_BMP_CALCULATOR_RED); + + Point aPt = aRect.TopLeft(); + aPt += Point((aRect.GetSize().getWidth() - aImage.GetSizePixel().getWidth()) / 2, + (aRect.GetSize().getHeight() - aImage.GetSizePixel().getHeight()) / 2); + + pDev->DrawImage(aPt, aImage); + } +} + +void ScAutoCalculateControl::Click() +{ + if (!m_bIsActive) + SfxStatusBarControl::Click(); // exec FID_AUTO_CALC and toggle AutoCalc on +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx index 694e7afdb666..f581ad886bfd 100644 --- a/sc/source/ui/app/scdll.cxx +++ b/sc/source/ui/app/scdll.cxx @@ -86,6 +86,7 @@ #include #include +#include OUString ScResId(TranslateId aId) { @@ -173,6 +174,7 @@ void ScDLL::Init() SvxZoomSliderControl ::RegisterControl(SID_ATTR_ZOOMSLIDER, pMod); SvxModifyControl ::RegisterControl(SID_DOC_MODIFIED, pMod); XmlSecStatusBarControl ::RegisterControl( SID_SIGNATURE, pMod ); + ScAutoCalculateControl ::RegisterControl(FID_AUTO_CALC, pMod); SvxPosSizeStatusBarControl ::RegisterControl(SID_ATTR_SIZE, pMod); @@ -221,9 +223,7 @@ void ScDLL::Init() SvxHlinkDlgWrapper ::RegisterChildWindow(false, pMod); SvxFontWorkChildWindow ::RegisterChildWindow(false, pMod); SvxIMapDlgChildWindow ::RegisterChildWindow(false, pMod); - ScSpellDialogChildWindow::RegisterChildWindow( - false, pMod, comphelper::LibreOfficeKit::isActive() ? SfxChildWindowFlags::NEVERCLONE - : SfxChildWindowFlags::NONE); + ScSpellDialogChildWindow ::RegisterChildWindow(false, pMod); ScValidityRefChildWin::RegisterChildWindow(false, pMod); sc::SearchResultsDlgWrapper::RegisterChildWindow(false, pMod); diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index 9f8c1a32bae2..c088322f01a2 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -734,9 +734,9 @@ void AbstractScCondFormatManagerDlg_Impl::SetModified() return m_xDlg->SetModified(); } -void AbstractScCondFormatManagerDlg_Impl::ShowEasyConditionalDialog(bool isEdit) +ScConditionalFormat* AbstractScCondFormatManagerDlg_Impl::GetCondFormatSelected() { - m_xDlg->ShowEasyConditionalDialog(isEdit); + return m_xDlg->GetCondFormatSelected(); } int AbstractScMetricInputDlg_Impl::GetInputValue() const diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index 77cd3e217cf7..fe60d59bc8e6 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -115,7 +115,7 @@ public: virtual std::unique_ptr GetConditionalFormatList() override; virtual bool CondFormatsChanged() const override; virtual void SetModified() override; - virtual void ShowEasyConditionalDialog(bool isEdit = false) override; + virtual ScConditionalFormat* GetCondFormatSelected() override; }; class AbstractScDataPilotDatabaseDlg_Impl :public AbstractScDataPilotDatabaseDlg diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index 6906d4fb5316..d534227d197b 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -108,6 +108,27 @@ void ScCondFrmtEntry::Deselect() mbActive = false; } +//condition + +namespace +{ + +void FillStyleListBox(const ScDocument* pDoc, weld::ComboBox& rLbStyle) +{ + std::set aStyleNames; + SfxStyleSheetIterator aStyleIter(pDoc->GetStyleSheetPool(), SfxStyleFamily::Para); + for (SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle; pStyle = aStyleIter.Next()) + { + aStyleNames.insert(pStyle->GetName()); + } + for (const auto& rStyleName : aStyleNames) + { + rLbStyle.append_text(rStyleName); + } +} + +} + const ScConditionMode ScConditionFrmtEntry::mpEntryToCond[ScConditionFrmtEntry::NUM_COND_ENTRIES] = { ScConditionMode::Equal, ScConditionMode::Less, @@ -132,21 +153,7 @@ const ScConditionMode ScConditionFrmtEntry::mpEntryToCond[ScConditionFrmtEntry:: ScConditionMode::BeginsWith, ScConditionMode::EndsWith, ScConditionMode::ContainsText, - ScConditionMode::NotContainsText, - ScConditionMode::Formula, - ScConditionMode::Today, - ScConditionMode::Yesterday, - ScConditionMode::Tomorrow, - ScConditionMode::Last7days, - ScConditionMode::ThisWeek, - ScConditionMode::LastWeek, - ScConditionMode::NextWeek, - ScConditionMode::ThisMonth, - ScConditionMode::LastMonth, - ScConditionMode::NextMonth, - ScConditionMode::ThisYear, - ScConditionMode::LastYear, - ScConditionMode::NextYear }; + ScConditionMode::NotContainsText }; ScConditionFrmtEntry::ScConditionFrmtEntry(ScCondFormatList* pParent, ScDocument& rDoc, ScCondFormatDlg* pDialogParent, const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry) @@ -221,7 +228,7 @@ void ScConditionFrmtEntry::Init(ScCondFormatDlg* pDialogParent) mxEdVal1->SetModifyHdl( LINK( this, ScConditionFrmtEntry, OnEdChanged ) ); mxEdVal2->SetModifyHdl( LINK( this, ScConditionFrmtEntry, OnEdChanged ) ); - ScCondFormatHelper::FillStyleListBox(mrDoc, *mxLbStyle); + FillStyleListBox(&mrDoc, *mxLbStyle); mxLbStyle->connect_changed( LINK( this, ScConditionFrmtEntry, StyleSelectHdl ) ); mxLbCondType->connect_changed( LINK( this, ScConditionFrmtEntry, ConditionTypeSelectHdl ) ); @@ -248,7 +255,50 @@ ScFormatEntry* ScConditionFrmtEntry::createConditionEntry() const IMPL_LINK(ScConditionFrmtEntry, OnEdChanged, formula::RefEdit&, rRefEdit, void) { weld::Entry& rEdit = *rRefEdit.GetWidget(); - ScCondFormatHelper::ValidateInputField(rEdit, *mxFtVal, mrDoc, maPos); + OUString aFormula = rEdit.get_text(); + + if (aFormula.isEmpty()) + { + mxFtVal->set_label(ScResId(STR_ENTER_VALUE)); + return; + } + + ScCompiler aComp(mrDoc, maPos, mrDoc.GetGrammar()); + aComp.SetExtendedErrorDetection( + ScCompiler::ExtendedErrorDetection::EXTENDED_ERROR_DETECTION_NAME_BREAK); + std::unique_ptr ta(aComp.CompileString(aFormula)); + + // Error, warn the user if it is not an unknown name. + if (ta->GetCodeError() != FormulaError::NoName + && (ta->GetCodeError() != FormulaError::NONE || ta->GetLen() == 0)) + { + rEdit.set_message_type(weld::EntryMessageType::Error); + mxFtVal->set_label(ScResId(STR_VALID_DEFERROR)); + return; + } + + // Unrecognized name, warn the user; i.e. happens when starting to type and + // will go away once a valid name is completed. + if (ta->GetCodeError() == FormulaError::NoName) + { + rEdit.set_message_type(weld::EntryMessageType::Warning); + mxFtVal->set_label(ScResId(STR_UNQUOTED_STRING)); + return; + } + + // Generate RPN to detect further errors. + if (ta->GetLen() > 0) + aComp.CompileTokenArray(); + // Error, warn the user. + if (ta->GetCodeError() != FormulaError::NONE || (ta->GetCodeLen() == 0)) + { + rEdit.set_message_type(weld::EntryMessageType::Error); + mxFtVal->set_label(ScResId(STR_VALID_DEFERROR)); + return; + } + + rEdit.set_message_type(weld::EntryMessageType::Normal); + mxFtVal->set_label(""); } void ScConditionFrmtEntry::Select() @@ -309,20 +359,6 @@ sal_Int32 ScConditionFrmtEntry::GetNumberEditFields( ScConditionMode eMode ) case ScConditionMode::BelowEqualAverage: case ScConditionMode::Duplicate: case ScConditionMode::NotDuplicate: - case ScConditionMode::Formula: - case ScConditionMode::Today: - case ScConditionMode::Yesterday: - case ScConditionMode::Tomorrow: - case ScConditionMode::Last7days: - case ScConditionMode::ThisWeek: - case ScConditionMode::LastWeek: - case ScConditionMode::NextWeek: - case ScConditionMode::ThisMonth: - case ScConditionMode::LastMonth: - case ScConditionMode::NextMonth: - case ScConditionMode::ThisYear: - case ScConditionMode::LastYear: - case ScConditionMode::NextYear: return 0; case ScConditionMode::Between: case ScConditionMode::NotBetween: @@ -376,19 +412,109 @@ void ScConditionFrmtEntry::SetInactive() Deselect(); } +namespace +{ + +void UpdateStyleList(weld::ComboBox& rLbStyle, const ScDocument* pDoc) +{ + OUString aSelectedStyle = rLbStyle.get_active_text(); + for (sal_Int32 i = rLbStyle.get_count(); i > 1; --i) + rLbStyle.remove(i - 1); + FillStyleListBox(pDoc, rLbStyle); + rLbStyle.set_active_text(aSelectedStyle); +} + +} + void ScConditionFrmtEntry::Notify(SfxBroadcaster&, const SfxHint& rHint) { if(rHint.GetId() == SfxHintId::StyleSheetModified || rHint.GetId() == SfxHintId::StyleSheetModifiedExtended) { if(!mbIsInStyleCreate) - ScCondFormatHelper::UpdateStyleList(*mxLbStyle, mrDoc); + UpdateStyleList(*mxLbStyle, &mrDoc); } } +namespace +{ + +void StyleSelect(weld::Window* pDialogParent, weld::ComboBox& rLbStyle, const ScDocument* pDoc, + SvxFontPrevWindow& rWdPreview) +{ + if (rLbStyle.get_active() == 0) + { + // call new style dialog + SfxUInt16Item aFamilyItem(SID_STYLE_FAMILY, sal_uInt16(SfxStyleFamily::Para)); + SfxStringItem aRefItem(SID_STYLE_REFERENCE, ScResId(STR_STYLENAME_STANDARD)); + css::uno::Any aAny(pDialogParent->GetXWindow()); + SfxUnoAnyItem aDialogParent(SID_DIALOG_PARENT, aAny); + + // unlock the dispatcher so SID_STYLE_NEW can be executed + // (SetDispatcherLock would affect all Calc documents) + if (ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell()) + { + if (SfxDispatcher* pDisp = pViewShell->GetDispatcher()) + { + bool bLocked = pDisp->IsLocked(); + if (bLocked) + pDisp->Lock(false); + + // Execute the "new style" slot, complete with undo and all necessary updates. + // The return value (SfxUInt16Item) is ignored, look for new styles instead. + pDisp->ExecuteList(SID_STYLE_NEW, SfxCallMode::SYNCHRON | SfxCallMode::RECORD, + { &aFamilyItem, &aRefItem }, { &aDialogParent }); + + if (bLocked) + pDisp->Lock(true); + + // Find the new style and add it into the style list boxes + SfxStyleSheetIterator aStyleIter(pDoc->GetStyleSheetPool(), SfxStyleFamily::Para); + bool bFound = false; + for (SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle && !bFound; + pStyle = aStyleIter.Next()) + { + const OUString& aName = pStyle->GetName(); + if (rLbStyle.find_text(aName) == -1) // all lists contain the same entries + { + for (sal_Int32 i = 1, n = rLbStyle.get_count(); i <= n && !bFound; ++i) + { + OUString aStyleName + = ScGlobal::getCharClass().uppercase(rLbStyle.get_text(i)); + if (i == n) + { + rLbStyle.append_text(aName); + rLbStyle.set_active_text(aName); + bFound = true; + } + else if (aStyleName > ScGlobal::getCharClass().uppercase(aName)) + { + rLbStyle.insert_text(i, aName); + rLbStyle.set_active_text(aName); + bFound = true; + } + } + } + } + } + } + } + + OUString aStyleName = rLbStyle.get_active_text(); + SfxStyleSheetBase* pStyleSheet + = pDoc->GetStyleSheetPool()->Find(aStyleName, SfxStyleFamily::Para); + if (pStyleSheet) + { + const SfxItemSet& rSet = pStyleSheet->GetItemSet(); + rWdPreview.SetFromItemSet(rSet, false); + } +} + +} + IMPL_LINK_NOARG(ScConditionFrmtEntry, StyleSelectHdl, weld::ComboBox&, void) { mbIsInStyleCreate = true; - ScCondFormatHelper::StyleSelect(mpParent->GetFrameWeld(), *mxLbStyle, mrDoc, maWdPreview); + StyleSelect(mpParent->GetFrameWeld(), *mxLbStyle, &mrDoc, maWdPreview); mbIsInStyleCreate = false; } @@ -430,13 +556,13 @@ void ScFormulaFrmtEntry::Init(ScCondFormatDlg* pDialogParent) { mxEdFormula->SetGetFocusHdl( LINK( pDialogParent, ScCondFormatDlg, RangeGetFocusHdl ) ); - ScCondFormatHelper::FillStyleListBox(mrDoc, *mxLbStyle); + FillStyleListBox(&mrDoc, *mxLbStyle); mxLbStyle->connect_changed( LINK( this, ScFormulaFrmtEntry, StyleSelectHdl ) ); } IMPL_LINK_NOARG(ScFormulaFrmtEntry, StyleSelectHdl, weld::ComboBox&, void) { - ScCondFormatHelper::StyleSelect(mpParent->GetFrameWeld(), *mxLbStyle, mrDoc, maWdPreview); + StyleSelect(mpParent->GetFrameWeld(), *mxLbStyle, &mrDoc, maWdPreview); } ScFormatEntry* ScFormulaFrmtEntry::createFormulaEntry() const @@ -1143,7 +1269,7 @@ void ScDateFrmtEntry::Init() mxLbDateEntry->set_active(0); mxLbType->set_active(3); - ScCondFormatHelper::FillStyleListBox(mrDoc, *mxLbStyle); + FillStyleListBox(&mrDoc, *mxLbStyle); mxLbStyle->connect_changed( LINK( this, ScDateFrmtEntry, StyleSelectHdl ) ); mxLbStyle->set_active(1); } @@ -1173,7 +1299,7 @@ void ScDateFrmtEntry::Notify( SfxBroadcaster&, const SfxHint& rHint ) if(rHint.GetId() == SfxHintId::StyleSheetModified || rHint.GetId() == SfxHintId::StyleSheetModifiedExtended) { if(!mbIsInStyleCreate) - ScCondFormatHelper::UpdateStyleList(*mxLbStyle, mrDoc); + UpdateStyleList(*mxLbStyle, &mrDoc); } } @@ -1195,7 +1321,7 @@ OUString ScDateFrmtEntry::GetExpressionString() IMPL_LINK_NOARG( ScDateFrmtEntry, StyleSelectHdl, weld::ComboBox&, void ) { mbIsInStyleCreate = true; - ScCondFormatHelper::StyleSelect(mpParent->GetFrameWeld(), *mxLbStyle, mrDoc, maWdPreview); + StyleSelect(mpParent->GetFrameWeld(), *mxLbStyle, &mrDoc, maWdPreview); mbIsInStyleCreate = false; } diff --git a/sc/source/ui/condformat/condformateasydlg.cxx b/sc/source/ui/condformat/condformateasydlg.cxx index 677d10c3b9d5..71ae8745df53 100644 --- a/sc/source/ui/condformat/condformateasydlg.cxx +++ b/sc/source/ui/condformat/condformateasydlg.cxx @@ -15,43 +15,30 @@ #include #include #include -#include namespace { -condformat::ScCondFormatDateType GetScCondFormatDateType(ScConditionMode mode) +void FillStyleListBox(const ScDocument* pDocument, weld::ComboBox& rCombo) { - switch (mode) + std::set aStyleNames; + SfxStyleSheetIterator aStyleIter(pDocument->GetStyleSheetPool(), SfxStyleFamily::Para); + for (SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle; pStyle = aStyleIter.Next()) { - case ScConditionMode::Today: - return condformat::ScCondFormatDateType::TODAY; - case ScConditionMode::Yesterday: - return condformat::ScCondFormatDateType::YESTERDAY; - case ScConditionMode::Tomorrow: - return condformat::ScCondFormatDateType::TOMORROW; - case ScConditionMode::Last7days: - return condformat::ScCondFormatDateType::LAST7DAYS; - case ScConditionMode::ThisWeek: - return condformat::ScCondFormatDateType::THISWEEK; - case ScConditionMode::LastWeek: - return condformat::ScCondFormatDateType::LASTWEEK; - case ScConditionMode::NextWeek: - return condformat::ScCondFormatDateType::NEXTWEEK; - case ScConditionMode::ThisMonth: - return condformat::ScCondFormatDateType::THISMONTH; - case ScConditionMode::LastMonth: - return condformat::ScCondFormatDateType::LASTMONTH; - case ScConditionMode::NextMonth: - return condformat::ScCondFormatDateType::NEXTMONTH; - case ScConditionMode::ThisYear: - return condformat::ScCondFormatDateType::THISYEAR; - case ScConditionMode::LastYear: - return condformat::ScCondFormatDateType::LASTYEAR; - case ScConditionMode::NextYear: - return condformat::ScCondFormatDateType::NEXTYEAR; - default: - return condformat::ScCondFormatDateType::TODAY; + aStyleNames.insert(pStyle->GetName()); } + for (const auto& rStyleName : aStyleNames) + { + rCombo.append_text(rStyleName); + } +} + +void UpdateStyleList(const ScDocument* pDocument, weld::ComboBox& rCombo) +{ + OUString sSelectedStyle = rCombo.get_active_text(); + for (sal_Int32 i = rCombo.get_count(); i > 1; --i) + rCombo.remove(i - 1); + FillStyleListBox(pDocument, rCombo); + rCombo.set_active_text(sSelectedStyle); } } @@ -69,29 +56,22 @@ ConditionalFormatEasyDialog::ConditionalFormatEasyDialog(SfxBindings* pBindings, : ScAnyRefDlgController(pBindings, pChildWindow, pParent, u"modules/scalc/ui/conditionaleasydialog.ui"_ustr, u"CondFormatEasyDlg"_ustr) - , mpParent(pParent) , mpViewData(pViewData) , mrDocument(mpViewData->GetDocument()) - , mbIsManaged(false) - , mnFormatKey(0) - , mnEntryIndex(0) , mxNumberEntry(m_xBuilder->weld_entry(u"entryNumber"_ustr)) , mxNumberEntry2(m_xBuilder->weld_entry(u"entryNumber2"_ustr)) , mxAllInputs(m_xBuilder->weld_container(u"allInputs"_ustr)) - , mxWarningLabel(m_xBuilder->weld_label(u"warning"_ustr)) , mxRangeEntry(new formula::RefEdit(m_xBuilder->weld_entry(u"entryRange"_ustr))) , mxButtonRangeEdit(new formula::RefButton(m_xBuilder->weld_button(u"rbassign"_ustr))) , mxStyles(m_xBuilder->weld_combo_box(u"themeCombo"_ustr)) - , mxWdPreviewWin(m_xBuilder->weld_widget(u"previewwin"_ustr)) - , mxWdPreview(new weld::CustomWeld(*m_xBuilder, "preview", maWdPreview)) , mxDescription(m_xBuilder->weld_label(u"description"_ustr)) , mxButtonOk(m_xBuilder->weld_button(u"ok"_ustr)) , mxButtonCancel(m_xBuilder->weld_button(u"cancel"_ustr)) { mxButtonRangeEdit->SetReferences(this, mxRangeEntry.get()); - const ScConditionEasyDialogData CurrentData + const ScConditionMode* pCurrentMode = pViewData->GetDocument().GetEasyConditionalFormatDialogData(); - if (!CurrentData.Mode) + if (!pCurrentMode) { SAL_WARN( "sc", @@ -100,11 +80,7 @@ ConditionalFormatEasyDialog::ConditionalFormatEasyDialog(SfxBindings* pBindings, } else { - meMode = *CurrentData.Mode; - mbIsManaged = CurrentData.IsManaged; - msFormula = CurrentData.Formula; - mnFormatKey = CurrentData.FormatKey; - mnEntryIndex = CurrentData.EntryIndex; + meMode = *pCurrentMode; } mxNumberEntry2->hide(); switch (meMode) @@ -193,62 +169,6 @@ ConditionalFormatEasyDialog::ConditionalFormatEasyDialog(SfxBindings* pBindings, case ScConditionMode::NotContainsText: SetDescription(ScResId(STR_CONDITION_NOT_CONTAINS_TEXT)); break; - case ScConditionMode::Formula: - SetDescription(ScResId(STR_CONDITION_FORMULA)); - mxAllInputs->hide(); - break; - case ScConditionMode::Today: - SetDescription(ScResId(STR_CONDITION_TODAY)); - mxAllInputs->hide(); - break; - case ScConditionMode::Yesterday: - SetDescription(ScResId(STR_CONDITION_YESTERDAY)); - mxAllInputs->hide(); - break; - case ScConditionMode::Tomorrow: - SetDescription(ScResId(STR_CONDITION_TOMORROW)); - mxAllInputs->hide(); - break; - case ScConditionMode::Last7days: - SetDescription(ScResId(STR_CONDITION_LAST7DAYS)); - mxAllInputs->hide(); - break; - case ScConditionMode::ThisWeek: - SetDescription(ScResId(STR_CONDITION_THISWEEK)); - mxAllInputs->hide(); - break; - case ScConditionMode::LastWeek: - SetDescription(ScResId(STR_CONDITION_LASTWEEK)); - mxAllInputs->hide(); - break; - case ScConditionMode::NextWeek: - SetDescription(ScResId(STR_CONDITION_NEXTWEEK)); - mxAllInputs->hide(); - break; - case ScConditionMode::ThisMonth: - SetDescription(ScResId(STR_CONDITION_THISMONTH)); - mxAllInputs->hide(); - break; - case ScConditionMode::LastMonth: - SetDescription(ScResId(STR_CONDITION_LASTMONTH)); - mxAllInputs->hide(); - break; - case ScConditionMode::NextMonth: - SetDescription(ScResId(STR_CONDITION_NEXTMONTH)); - mxAllInputs->hide(); - break; - case ScConditionMode::ThisYear: - SetDescription(ScResId(STR_CONDITION_THISYEAR)); - mxAllInputs->hide(); - break; - case ScConditionMode::LastYear: - SetDescription(ScResId(STR_CONDITION_LASTYEAR)); - mxAllInputs->hide(); - break; - case ScConditionMode::NextYear: - SetDescription(ScResId(STR_CONDITION_NEXTYEAR)); - mxAllInputs->hide(); - break; default: SAL_WARN("sc", "ConditionalFormatEasyDialog::ConditionalFormatEasyDialog: invalid format"); @@ -257,78 +177,33 @@ ConditionalFormatEasyDialog::ConditionalFormatEasyDialog(SfxBindings* pBindings, mxButtonOk->connect_clicked(LINK(this, ConditionalFormatEasyDialog, ButtonPressed)); mxButtonCancel->connect_clicked(LINK(this, ConditionalFormatEasyDialog, ButtonPressed)); - mxStyles->connect_changed(LINK(this, ConditionalFormatEasyDialog, StyleSelectHdl)); - mxNumberEntry->connect_changed(LINK(this, ConditionalFormatEasyDialog, OnEdChanged)); - mxNumberEntry2->connect_changed(LINK(this, ConditionalFormatEasyDialog, OnEdChanged)); ScRangeList aRange; mpViewData->GetMarkData().FillRangeListWithMarks(&aRange, false); - ScConditionalFormat* format - = mrDocument.GetCondFormList(mpViewData->GetTabNo())->GetFormat(mnFormatKey); - if (aRange.empty() && mnFormatKey != -1 && mnEntryIndex != -1) - { - aRange = format->GetRangeList(); - } - else if (aRange.empty()) + if (aRange.empty()) { ScAddress aPosition(mpViewData->GetCurX(), mpViewData->GetCurY(), mpViewData->GetTabNo()); aRange.push_back(ScRange(aPosition)); } maPosition = aRange.GetTopLeftCorner(); - // FIX me: Tab is always 0 in some cases - // Refer to test tdf100793 - maPosition.SetTab(mpViewData->GetTabNo()); OUString sRangeString; aRange.Format(sRangeString, ScRefFlags::VALID, mrDocument, mrDocument.GetAddressConvention()); mxRangeEntry->SetText(sRangeString); - OUString sStyleName; - if (format) - { - const ScFormatEntry* entry = format->GetEntry(mnEntryIndex); - if (!entry) - return; - ScFormatEntry::Type type = entry->GetType(); - if (type == ScFormatEntry::Type::Condition) - { - const ScCondFormatEntry* condEntry = static_cast(entry); - sStyleName = condEntry->GetStyle(); - if (mxNumberEntry->get_visible()) - mxNumberEntry->set_text(condEntry->GetExpression(aRange.GetTopLeftCorner(), 0)); - if (mxNumberEntry2->get_visible()) - mxNumberEntry2->set_text(condEntry->GetExpression(aRange.GetTopLeftCorner(), 1)); - } - else if (type == ScFormatEntry::Type::Date) - { - const ScCondDateFormatEntry* dateEntry - = static_cast(entry); - sStyleName = dateEntry->GetStyleName(); - } - } + StartListening(*(mrDocument.GetStyleSheetPool()), DuplicateHandling::Prevent); + FillStyleListBox(&mrDocument, *mxStyles); - StartListening(*mrDocument.GetStyleSheetPool(), DuplicateHandling::Prevent); - ScCondFormatHelper::FillStyleListBox(mrDocument, *mxStyles); - - mxStyles->set_active_text(sStyleName); - StyleSelectHdl(*mxStyles); - mxWdPreviewWin->show(); + mxStyles->set_active(1); } -ConditionalFormatEasyDialog::~ConditionalFormatEasyDialog() -{ - if (mbIsManaged) - { - GetBindings().GetDispatcher()->Execute(SID_OPENDLG_CONDFRMT_MANAGER, - SfxCallMode::ASYNCHRON); - } -} +ConditionalFormatEasyDialog::~ConditionalFormatEasyDialog() {} void ConditionalFormatEasyDialog::Notify(SfxBroadcaster&, const SfxHint& rHint) { if (rHint.GetId() == SfxHintId::StyleSheetModified || rHint.GetId() == SfxHintId::StyleSheetModifiedExtended) - ScCondFormatHelper::UpdateStyleList(*mxStyles, mrDocument); + UpdateStyleList(&mrDocument, *mxStyles); } void ConditionalFormatEasyDialog::SetReference(const ScRange& rRange, ScDocument&) @@ -360,11 +235,6 @@ IMPL_LINK(ConditionalFormatEasyDialog, ButtonPressed, weld::Button&, rButton, vo { if (&rButton == mxButtonOk.get()) { - if (mnEntryIndex != -1 && mnFormatKey != -1) // isEdit - mrDocument.GetCondFormList(maPosition.Tab()) - ->GetFormat(mnFormatKey) - ->RemoveEntry(mnEntryIndex); - std::unique_ptr pFormat(new ScConditionalFormat(0, &mrDocument)); OUString sExpression1 = (mxNumberEntry->get_visible() && mxAllInputs->get_visible() @@ -387,30 +257,9 @@ IMPL_LINK(ConditionalFormatEasyDialog, ButtonPressed, weld::Button&, rButton, vo break; } - std::unique_ptr xEntry; - if (meMode < ScConditionMode::Formula) - { - xEntry.reset(new ScCondFormatEntry(meMode, sExpression1, sExpression2, mrDocument, - maPosition, mxStyles->get_active_text())); - } - else if (meMode >= ScConditionMode::Today && meMode < ScConditionMode::NONE) - { - ScCondDateFormatEntry entry(&mrDocument); - entry.SetDateType(GetScCondFormatDateType(meMode)); - entry.SetStyleName(mxStyles->get_active_text()); - xEntry.reset(new ScCondDateFormatEntry(&mrDocument, entry)); - } - else if (meMode == ScConditionMode::Formula) - { - xEntry.reset(new ScCondFormatEntry(ScConditionMode::Direct, msFormula, OUString(), - mrDocument, maPosition, - mxStyles->get_active_text())); - } - else - { - DBG_ASSERT(false, "Invalid condition type selected."); - return; - } + std::unique_ptr pEntry + = std::make_unique(meMode, sExpression1, sExpression2, mrDocument, + maPosition, mxStyles->get_active_text()); ScRangeList aRange; ScRefFlags nFlags @@ -418,7 +267,7 @@ IMPL_LINK(ConditionalFormatEasyDialog, ButtonPressed, weld::Button&, rButton, vo mpViewData->GetDocument().GetAddressConvention(), maPosition.Tab()); if ((nFlags & ScRefFlags::VALID) && !aRange.empty()) { - pFormat->AddEntry(xEntry.release()); + pFormat->AddEntry(pEntry.release()); pFormat->SetRange(aRange); auto& rRangeList = pFormat->GetRange(); mpViewData->GetDocShell()->GetDocFunc().ReplaceConditionalFormat( @@ -430,21 +279,6 @@ IMPL_LINK(ConditionalFormatEasyDialog, ButtonPressed, weld::Button&, rButton, vo m_xDialog->response(RET_CANCEL); } -IMPL_LINK_NOARG(ConditionalFormatEasyDialog, StyleSelectHdl, weld::ComboBox&, void) -{ - ScCondFormatHelper::StyleSelect(mpParent, *mxStyles, mpViewData->GetDocument(), maWdPreview); -} - -IMPL_LINK(ConditionalFormatEasyDialog, OnEdChanged, weld::Entry&, rEntry, void) -{ - ScCondFormatHelper::ValidateInputField(rEntry, *mxWarningLabel, mrDocument, maPosition); - - if (!mxWarningLabel->get_label().isEmpty()) - mxWarningLabel->show(); - else - mxWarningLabel->hide(); -} - } // namespace sc /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sc/source/ui/condformat/condformathelper.cxx b/sc/source/ui/condformat/condformathelper.cxx index 39e183278666..2bee433a7295 100644 --- a/sc/source/ui/condformat/condformathelper.cxx +++ b/sc/source/ui/condformat/condformathelper.cxx @@ -15,15 +15,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include namespace { @@ -137,65 +128,62 @@ OUString getDateString(sal_Int32 nIndex) } -OUString ScCondFormatHelper::GetExpression(const ScFormatEntry* rEntry, const ScAddress& rPos) -{ - OUStringBuffer aBuffer; - switch (rEntry->GetType()) - { - case ScFormatEntry::Type::Condition: - case ScFormatEntry::Type::ExtCondition: - { - const ScConditionEntry* pEntry = static_cast(rEntry); - ScConditionMode eMode = pEntry->GetOperation(); - if (eMode == ScConditionMode::Direct) - { - aBuffer.append(getTextForType(FORMULA) + " " + pEntry->GetExpression(rPos, 0)); - } - else - { - aBuffer.append(getTextForType(CONDITION) + " " - + getExpression(static_cast(eMode)) + " "); - if (eMode == ScConditionMode::Between || eMode == ScConditionMode::NotBetween) - { - aBuffer.append(pEntry->GetExpression(rPos, 0) + " " + ScResId(STR_COND_AND) - + " " + pEntry->GetExpression(rPos, 1)); - } - else if (eMode <= ScConditionMode::NotEqual || eMode >= ScConditionMode::BeginsWith) - { - aBuffer.append(pEntry->GetExpression(rPos, 0)); - } - } - } - - break; - case ScFormatEntry::Type::Databar: - aBuffer.append(getTextForType(DATABAR)); - break; - case ScFormatEntry::Type::Colorscale: - aBuffer.append(getTextForType(COLORSCALE)); - break; - case ScFormatEntry::Type::Iconset: - aBuffer.append(getTextForType(ICONSET)); - break; - case ScFormatEntry::Type::Date: - { - sal_Int32 nDateEntry = static_cast( - static_cast(rEntry)->GetDateType()); - aBuffer.append(getTextForType(DATE) + " " + getDateString(nDateEntry)); - } - break; - } - return aBuffer.makeStringAndClear(); -} - OUString ScCondFormatHelper::GetExpression(const ScConditionalFormat& rFormat, const ScAddress& rPos) { + OUStringBuffer aBuffer; if (!rFormat.IsEmpty()) { - return ScCondFormatHelper::GetExpression(rFormat.GetEntry(0), rPos); + switch (rFormat.GetEntry(0)->GetType()) + { + case ScFormatEntry::Type::Condition: + case ScFormatEntry::Type::ExtCondition: + { + const ScConditionEntry* pEntry + = static_cast(rFormat.GetEntry(0)); + ScConditionMode eMode = pEntry->GetOperation(); + if (eMode == ScConditionMode::Direct) + { + aBuffer.append(getTextForType(FORMULA) + " " + pEntry->GetExpression(rPos, 0)); + } + else + { + aBuffer.append(getTextForType(CONDITION) + " " + + getExpression(static_cast(eMode)) + " "); + if (eMode == ScConditionMode::Between || eMode == ScConditionMode::NotBetween) + { + aBuffer.append(pEntry->GetExpression(rPos, 0) + " " + ScResId(STR_COND_AND) + + " " + pEntry->GetExpression(rPos, 1)); + } + else if (eMode <= ScConditionMode::NotEqual + || eMode >= ScConditionMode::BeginsWith) + { + aBuffer.append(pEntry->GetExpression(rPos, 0)); + } + } + } + + break; + case ScFormatEntry::Type::Databar: + aBuffer.append(getTextForType(DATABAR)); + break; + case ScFormatEntry::Type::Colorscale: + aBuffer.append(getTextForType(COLORSCALE)); + break; + case ScFormatEntry::Type::Iconset: + aBuffer.append(getTextForType(ICONSET)); + break; + case ScFormatEntry::Type::Date: + { + sal_Int32 nDateEntry = static_cast( + static_cast(rFormat.GetEntry(0)) + ->GetDateType()); + aBuffer.append(getTextForType(DATE) + " " + getDateString(nDateEntry)); + } + break; + } } - return ""; + return aBuffer.makeStringAndClear(); } OUString ScCondFormatHelper::GetExpression( ScCondFormatEntryType eType, sal_Int32 nIndex, @@ -230,144 +218,4 @@ OUString ScCondFormatHelper::GetExpression( ScCondFormatEntryType eType, sal_Int return aBuffer.makeStringAndClear(); } -void ScCondFormatHelper::StyleSelect(weld::Window* pDialogParent, weld::ComboBox& rLbStyle, - const ScDocument& rDoc, SvxFontPrevWindow& rWdPreview) -{ - if (rLbStyle.get_active() == 0) - { - // call new style dialog - SfxUInt16Item aFamilyItem(SID_STYLE_FAMILY, sal_uInt16(SfxStyleFamily::Para)); - SfxStringItem aRefItem(SID_STYLE_REFERENCE, ScResId(STR_STYLENAME_STANDARD)); - css::uno::Any aAny(pDialogParent->GetXWindow()); - SfxUnoAnyItem aDialogParent(SID_DIALOG_PARENT, aAny); - - // unlock the dispatcher so SID_STYLE_NEW can be executed - // (SetDispatcherLock would affect all Calc documents) - if (ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell()) - { - if (SfxDispatcher* pDisp = pViewShell->GetDispatcher()) - { - bool bLocked = pDisp->IsLocked(); - if (bLocked) - pDisp->Lock(false); - - // Execute the "new style" slot, complete with undo and all necessary updates. - // The return value (SfxUInt16Item) is ignored, look for new styles instead. - pDisp->ExecuteList(SID_STYLE_NEW, SfxCallMode::SYNCHRON | SfxCallMode::RECORD, - { &aFamilyItem, &aRefItem }, { &aDialogParent }); - - if (bLocked) - pDisp->Lock(true); - - // Find the new style and add it into the style list boxes - SfxStyleSheetIterator aStyleIter(rDoc.GetStyleSheetPool(), SfxStyleFamily::Para); - bool bFound = false; - for (SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle && !bFound; - pStyle = aStyleIter.Next()) - { - const OUString& aName = pStyle->GetName(); - if (rLbStyle.find_text(aName) == -1) // all lists contain the same entries - { - for (sal_Int32 i = 1, n = rLbStyle.get_count(); i <= n && !bFound; ++i) - { - OUString aStyleName - = ScGlobal::getCharClass().uppercase(rLbStyle.get_text(i)); - if (i == n) - { - rLbStyle.append_text(aName); - rLbStyle.set_active_text(aName); - bFound = true; - } - else if (aStyleName > ScGlobal::getCharClass().uppercase(aName)) - { - rLbStyle.insert_text(i, aName); - rLbStyle.set_active_text(aName); - bFound = true; - } - } - } - } - } - } - } - - OUString aStyleName = rLbStyle.get_active_text(); - SfxStyleSheetBase* pStyleSheet - = rDoc.GetStyleSheetPool()->Find(aStyleName, SfxStyleFamily::Para); - if (pStyleSheet) - { - const SfxItemSet& rSet = pStyleSheet->GetItemSet(); - rWdPreview.SetFromItemSet(rSet, false); - } -} - -void ScCondFormatHelper::FillStyleListBox(const ScDocument& rDocument, weld::ComboBox& rCombo) -{ - std::set aStyleNames; - SfxStyleSheetIterator aStyleIter(rDocument.GetStyleSheetPool(), SfxStyleFamily::Para); - for (SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle; pStyle = aStyleIter.Next()) - { - aStyleNames.insert(pStyle->GetName()); - } - for (const auto& rStyleName : aStyleNames) - { - rCombo.append_text(rStyleName); - } -} - -void ScCondFormatHelper::UpdateStyleList(weld::ComboBox& rLbStyle, const ScDocument& rDoc) -{ - OUString aSelectedStyle = rLbStyle.get_active_text(); - for (sal_Int32 i = rLbStyle.get_count(); i > 1; --i) - rLbStyle.remove(i - 1); - ScCondFormatHelper::FillStyleListBox(rDoc, rLbStyle); - rLbStyle.set_active_text(aSelectedStyle); -} - -void ScCondFormatHelper::ValidateInputField(weld::Entry& rEntry, weld::Label& rLabel, ScDocument& rDoc, ScAddress& rPos) -{ - OUString aFormula = rEntry.get_text(); - - if( aFormula.isEmpty() ) - { - rLabel.set_label(ScResId(STR_ENTER_VALUE)); - return; - } - - ScCompiler aComp( rDoc, rPos, rDoc.GetGrammar() ); - aComp.SetExtendedErrorDetection( ScCompiler::ExtendedErrorDetection::EXTENDED_ERROR_DETECTION_NAME_BREAK); - std::unique_ptr ta(aComp.CompileString(aFormula)); - - // Error, warn the user if it is not an unknown name. - if (ta->GetCodeError() != FormulaError::NoName && (ta->GetCodeError() != FormulaError::NONE || ta->GetLen() == 0)) - { - rEntry.set_message_type(weld::EntryMessageType::Error); - rLabel.set_label(ScResId(STR_VALID_DEFERROR)); - return; - } - - // Unrecognized name, warn the user; i.e. happens when starting to type and - // will go away once a valid name is completed. - if (ta->GetCodeError() == FormulaError::NoName) - { - rEntry.set_message_type(weld::EntryMessageType::Warning); - rLabel.set_label(ScResId(STR_UNQUOTED_STRING)); - return; - } - - // Generate RPN to detect further errors. - if (ta->GetLen() > 0) - aComp.CompileTokenArray(); - // Error, warn the user. - if (ta->GetCodeError() != FormulaError::NONE || (ta->GetCodeLen() == 0)) - { - rEntry.set_message_type(weld::EntryMessageType::Error); - rLabel.set_label(ScResId(STR_VALID_DEFERROR)); - return; - } - - rEntry.set_message_type(weld::EntryMessageType::Normal); - rLabel.set_label(u""_ustr); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx index fcb1b8afd3a0..2e5cef3a01a0 100644 --- a/sc/source/ui/condformat/condformatmgr.cxx +++ b/sc/source/ui/condformat/condformatmgr.cxx @@ -8,33 +8,12 @@ */ #include -#include #include #include #include #include -#include #include -#include -#include -#include -#include -#include -#include #include -#include - -namespace -{ -OUString generateEntryId(sal_uInt32 key, sal_uInt32 index) -{ - return OUString::number(key) + "_" + OUString::number(index); -} - -sal_Int32 getKeyFromId(std::u16string_view id) { return o3tl::toInt32(o3tl::getToken(id, 0, '_')); } - -sal_Int32 getEntryIndexFromId(std::u16string_view id) { return o3tl::toInt32(o3tl::getToken(id, 1, '_')); } -} ScCondFormatManagerWindow::ScCondFormatManagerWindow(weld::TreeView& rTreeView, ScDocument& rDoc, ScConditionalFormatList* pFormatList) @@ -63,14 +42,10 @@ void ScCondFormatManagerWindow::Init() { const ScRangeList& aRange = rItem->GetRange(); aRange.Format(sRangeStr, ScRefFlags::VALID, mrDoc, mrDoc.GetAddressConvention()); - for (size_t i = 0; i < rItem->size(); i++) - { - mrTreeView.append(generateEntryId(rItem->GetKey(), i), sRangeStr); - mrTreeView.set_text(nRow++, - ScCondFormatHelper::GetExpression(rItem->GetEntry(i), - aRange.GetTopLeftCorner()), - 1); - } + mrTreeView.append(OUString::number(rItem->GetKey()), sRangeStr); + mrTreeView.set_text( + nRow, ScCondFormatHelper::GetExpression(*rItem, aRange.GetTopLeftCorner()), 1); + ++nRow; } } @@ -98,34 +73,8 @@ ScConditionalFormat* ScCondFormatManagerWindow::GetSelection() if (nEntry == -1) return nullptr; - sal_Int32 nKey = getKeyFromId(mrTreeView.get_id(nEntry)); - return mpFormatList->GetFormat(nKey); -} - -const ScFormatEntry* ScCondFormatManagerWindow::GetSelectedEntry() const -{ - sal_Int32 nKey = GetSelectedFormatKey(); - sal_Int32 nEntryIndex = GetSelectedEntryIndex(); - - if (nKey == -1 || nEntryIndex == -1) - return nullptr; - return mpFormatList->GetFormat(nKey)->GetEntry(nEntryIndex); -} - -sal_Int32 ScCondFormatManagerWindow::GetSelectedFormatKey() const -{ - OUString id = mrTreeView.get_selected_id(); - if (id.isEmpty()) - return -1; - return getKeyFromId(id); -} - -sal_Int32 ScCondFormatManagerWindow::GetSelectedEntryIndex() const -{ - OUString id = mrTreeView.get_selected_id(); - if (id.isEmpty()) - return -1; - return getEntryIndexFromId(id); + sal_Int32 nIndex = mrTreeView.get_id(nEntry).toInt32(); + return mpFormatList->GetFormat(nIndex); } void ScCondFormatManagerWindow::setColSizes() @@ -137,14 +86,12 @@ void ScCondFormatManagerWindow::setColSizes() mrTreeView.set_column_fixed_widths(aWidths); } -ScCondFormatManagerDlg::ScCondFormatManagerDlg(weld::Window* pParent, ScDocument& rDoc, const ScConditionalFormatList* pFormatList) - : GenericDialogController(pParent, u"modules/scalc/ui/condformatmanager.ui"_ustr, u"CondFormatManager"_ustr) +ScCondFormatManagerDlg::ScCondFormatManagerDlg(weld::Window* pParent, ScDocument& rDoc, + const ScConditionalFormatList* pFormatList) + : GenericDialogController(pParent, u"modules/scalc/ui/condformatmanager.ui"_ustr, + u"CondFormatManager"_ustr) , m_bModified(false) - , m_xFormatList( pFormatList ? new ScConditionalFormatList(*pFormatList) : nullptr) - , m_xConditionalType(m_xBuilder->weld_combo_box("type")) - , m_xConditionalCellValue(m_xBuilder->weld_combo_box("typeis")) - , m_xConditionalFormula(new formula::RefEdit(m_xBuilder->weld_entry("formula"))) - , m_xConditionalDate(m_xBuilder->weld_combo_box("datetype")) + , m_xFormatList(pFormatList ? new ScConditionalFormatList(*pFormatList) : nullptr) , m_xBtnAdd(m_xBuilder->weld_button(u"add"_ustr)) , m_xBtnRemove(m_xBuilder->weld_button(u"remove"_ustr)) , m_xBtnEdit(m_xBuilder->weld_button(u"edit"_ustr)) @@ -155,15 +102,12 @@ ScCondFormatManagerDlg::ScCondFormatManagerDlg(weld::Window* pParent, ScDocument m_xBtnEdit->connect_clicked(LINK(this, ScCondFormatManagerDlg, EditBtnClickHdl)); m_xBtnAdd->connect_clicked(LINK(this, ScCondFormatManagerDlg, AddBtnHdl)); m_xTreeView->connect_row_activated(LINK(this, ScCondFormatManagerDlg, EditBtnHdl)); - m_xTreeView->connect_changed(LINK(this, ScCondFormatManagerDlg, EntryFocus)); - m_xConditionalType->connect_changed(LINK(this, ScCondFormatManagerDlg, ComboHdl)); SvtViewOptions aDlgOpt(EViewType::Dialog, u"CondFormatDialog"_ustr); if (aDlgOpt.Exists()) m_xDialog->set_window_state(aDlgOpt.GetWindowState()); UpdateButtonSensitivity(); - EntryFocus(*m_xTreeView); } ScCondFormatManagerDlg::~ScCondFormatManagerDlg() @@ -192,49 +136,6 @@ ScConditionalFormat* ScCondFormatManagerDlg::GetCondFormatSelected() return m_xCtrlManager->GetSelection(); } -void ScCondFormatManagerDlg::ShowEasyConditionalDialog(bool isEdit) -{ - SfxViewShell* pViewShell = SfxViewShell::Current(); - if (!pViewShell) - return; - - auto id = m_xConditionalType->get_active(); - SfxBoolItem IsManaged(FN_PARAM_2, true); - SfxInt32Item FormatKey(FN_PARAM_3, isEdit ? m_xCtrlManager->GetSelectedFormatKey() : -1); - SfxInt32Item EntryIndex(FN_PARAM_4, isEdit ? m_xCtrlManager->GetSelectedEntryIndex() : -1); - switch (id) - { - case 0: // Cell value - { - SfxInt16Item FormatRule(FN_PARAM_1, - m_xConditionalCellValue->get_active_id().toUInt32()); - pViewShell->GetDispatcher()->ExecuteList( - SID_EASY_CONDITIONAL_FORMAT_DIALOG, SfxCallMode::ASYNCHRON, - { &FormatRule, &IsManaged, &FormatKey, &EntryIndex }); - } - break; - case 1: // Formula - { - SfxInt16Item FormatRule(FN_PARAM_1, static_cast(ScConditionMode::Formula)); - SfxStringItem Formula(FN_PARAM_5, m_xConditionalFormula->GetText()); - pViewShell->GetDispatcher()->ExecuteList( - SID_EASY_CONDITIONAL_FORMAT_DIALOG, SfxCallMode::ASYNCHRON, - { &FormatRule, &IsManaged, &FormatKey, &EntryIndex, &Formula }); - } - break; - case 2: // Date - { - SfxInt16Item FormatRule(FN_PARAM_1, m_xConditionalDate->get_active_id().toUInt32()); - pViewShell->GetDispatcher()->ExecuteList( - SID_EASY_CONDITIONAL_FORMAT_DIALOG, SfxCallMode::ASYNCHRON, - { &FormatRule, &IsManaged, &FormatKey, &EntryIndex }); - } - break; - default: - break; - } -} - IMPL_LINK_NOARG(ScCondFormatManagerDlg, RemoveBtnHdl, weld::Button&, void) { m_xCtrlManager->DeleteSelection(); @@ -266,73 +167,6 @@ IMPL_LINK_NOARG(ScCondFormatManagerDlg, AddBtnHdl, weld::Button&, void) m_xDialog->response( DLG_RET_ADD ); } -IMPL_LINK_NOARG(ScCondFormatManagerDlg, ComboHdl, weld::ComboBox&, void) -{ - auto id = m_xConditionalType->get_active(); - switch (id) - { - case 0: - { - m_xConditionalCellValue->set_visible(true); - m_xConditionalFormula->GetWidget()->set_visible(false); - m_xConditionalDate->set_visible(false); - } - break; - case 1: - { - m_xConditionalCellValue->set_visible(false); - m_xConditionalFormula->GetWidget()->set_visible(true); - m_xConditionalDate->set_visible(false); - } - break; - case 2: - { - m_xConditionalCellValue->set_visible(false); - m_xConditionalFormula->GetWidget()->set_visible(false); - m_xConditionalDate->set_visible(true); - } - break; - default: - break; - } -} - -IMPL_LINK_NOARG(ScCondFormatManagerDlg, EntryFocus, weld::TreeView&, void) -{ - const ScFormatEntry* entry = m_xCtrlManager->GetSelectedEntry(); - if (!entry) - return; - auto type = entry->GetType(); - - if (type == ScFormatEntry::Type::Condition) - { - const ScCondFormatEntry* conditionEntry = dynamic_cast(entry); - auto conditionType = conditionEntry->GetOperation(); - - if (conditionType == ScConditionMode::Direct) // Formula conditions - { - m_xConditionalType->set_active(1); - ComboHdl(*m_xConditionalType); - m_xConditionalFormula->SetText( - conditionEntry->GetExpression(conditionEntry->GetSrcPos(), 0)); - } - else - { - m_xConditionalType->set_active(0); - ComboHdl(*m_xConditionalType); - m_xConditionalCellValue->set_active(static_cast(conditionType)); - } - } - else if (type == ScFormatEntry::Type::Date) - { - const ScCondDateFormatEntry* dateEntry = dynamic_cast(entry); - auto dateType = dateEntry->GetDateType(); - m_xConditionalType->set_active(2); - ComboHdl(*m_xConditionalType); - m_xConditionalDate->set_active(dateType); - } -} - void ScCondFormatManagerDlg::SetModified() { m_bModified = true; diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx index b35cf24ba7fb..c44bf2ad222d 100644 --- a/sc/source/ui/dbgui/scuiasciiopt.cxx +++ b/sc/source/ui/dbgui/scuiasciiopt.cxx @@ -43,6 +43,7 @@ #include #include #include +#include //! TODO make dynamic const SCSIZE ASCIIDLG_MAXROWS = MAXROWCOUNT; @@ -373,6 +374,10 @@ ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, std::u16string_view aD , mxAltTitle(m_xBuilder->weld_label(u"textalttitle"_ustr)) , mxTableBox(new ScCsvTableBox(*m_xBuilder)) { + SvtViewOptions aDlgOpt(EViewType::Dialog, "TextImportCsvDialog"); + if (aDlgOpt.Exists()) + m_xDialog->set_window_state(aDlgOpt.GetWindowState()); + OUString aName = m_xDialog->get_title(); switch (meCall) { @@ -591,6 +596,8 @@ IMPL_STATIC_LINK_NOARG(ScImportAsciiDlg, InstallLOKNotifierHdl, void*, vcl::ILib ScImportAsciiDlg::~ScImportAsciiDlg() { + SvtViewOptions aDlgOpt(EViewType::Dialog, "TextImportCsvDialog"); + aDlgOpt.SetWindowState(m_xDialog->get_window_state(vcl::WindowDataMask::PosSize)); } bool ScImportAsciiDlg::GetLine( sal_uLong nLine, OUString &rText, sal_Unicode& rcDetectSep ) diff --git a/sc/source/ui/inc/acctrl.hxx b/sc/source/ui/inc/acctrl.hxx new file mode 100644 index 000000000000..cfc8338286ac --- /dev/null +++ b/sc/source/ui/inc/acctrl.hxx @@ -0,0 +1,41 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#pragma once + +#include + +class ScAutoCalculateControl final : public SfxStatusBarControl +{ +public: + ScAutoCalculateControl(sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar& rStb); + virtual ~ScAutoCalculateControl() override; + + virtual void StateChangedAtStatusBarControl(sal_uInt16 nSID, SfxItemState eState, + const SfxPoolItem* pState) override; + virtual void Paint(const UserDrawEvent& rUsrEvt) override; + virtual void Click() override; + + SFX_DECL_STATUSBAR_CONTROL(); + +private: + bool m_bIsActive; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/condformatdlgentry.hxx b/sc/source/ui/inc/condformatdlgentry.hxx index 05cb252e9b68..33b218b181e6 100644 --- a/sc/source/ui/inc/condformatdlgentry.hxx +++ b/sc/source/ui/inc/condformatdlgentry.hxx @@ -103,7 +103,7 @@ class ScConditionFrmtEntry : public ScCondFrmtEntry, public SfxListener std::unique_ptr mxWdPreview; bool mbIsInStyleCreate; - static const sal_Int32 NUM_COND_ENTRIES = 38; + static const sal_Int32 NUM_COND_ENTRIES = 24; // Lookup table from positions in maLbCondType to the condition mode enum static const ScConditionMode mpEntryToCond[NUM_COND_ENTRIES]; diff --git a/sc/source/ui/inc/condformateasydlg.hxx b/sc/source/ui/inc/condformateasydlg.hxx index 6dfa19c37752..933d2e51e207 100644 --- a/sc/source/ui/inc/condformateasydlg.hxx +++ b/sc/source/ui/inc/condformateasydlg.hxx @@ -12,7 +12,6 @@ #include "anyrefdg.hxx" #include #include -#include class ScViewData; class ScConditionalFormat; @@ -33,32 +32,21 @@ public: virtual void Notify(SfxBroadcaster&, const SfxHint&) override; DECL_LINK(ButtonPressed, weld::Button&, void); - DECL_LINK(StyleSelectHdl, weld::ComboBox&, void); - DECL_LINK(OnEdChanged, weld::Entry&, void); private: void SetDescription(std::u16string_view rCondition); - weld::Window* mpParent; ScViewData* mpViewData; ScDocument& mrDocument; ScConditionMode meMode; - bool mbIsManaged; - OUString msFormula; ScAddress maPosition; - sal_Int32 mnFormatKey; - sal_Int32 mnEntryIndex; - SvxFontPrevWindow maWdPreview; std::unique_ptr mxNumberEntry; std::unique_ptr mxNumberEntry2; std::unique_ptr mxAllInputs; - std::unique_ptr mxWarningLabel; std::unique_ptr mxRangeEntry; std::unique_ptr mxButtonRangeEdit; std::unique_ptr mxStyles; - std::unique_ptr mxWdPreviewWin; - std::unique_ptr mxWdPreview; std::unique_ptr mxDescription; std::unique_ptr mxButtonOk; std::unique_ptr mxButtonCancel; diff --git a/sc/source/ui/inc/condformathelper.hxx b/sc/source/ui/inc/condformathelper.hxx index 1098b56e4663..29baf8d9ec44 100644 --- a/sc/source/ui/inc/condformathelper.hxx +++ b/sc/source/ui/inc/condformathelper.hxx @@ -11,10 +11,8 @@ #include #include -#include class ScConditionalFormat; -class ScFormatEntry; enum ScCondFormatEntryType { @@ -29,16 +27,11 @@ enum ScCondFormatEntryType class ScCondFormatHelper { public: - static SC_DLLPUBLIC OUString GetExpression(const ScFormatEntry* rEntry, const ScAddress& rPos); static SC_DLLPUBLIC OUString GetExpression(const ScConditionalFormat& rFormat, const ScAddress& rPos); - static SC_DLLPUBLIC OUString GetExpression( ScCondFormatEntryType eType, sal_Int32 nIndex, - std::u16string_view aStr1 = std::u16string_view(), std::u16string_view aStr2 = std::u16string_view() ); - static SC_DLLPUBLIC void StyleSelect(weld::Window* pDialogParent, weld::ComboBox& rLbStyle, - const ScDocument& rDoc, SvxFontPrevWindow& rWdPreview); - static SC_DLLPUBLIC void FillStyleListBox(const ScDocument& rDocument, weld::ComboBox& rCombo); - static SC_DLLPUBLIC void UpdateStyleList(weld::ComboBox& rLbStyle, const ScDocument& rDoc); - static SC_DLLPUBLIC void ValidateInputField(weld::Entry& rEntry, weld::Label& label, ScDocument& rDoc, ScAddress& rPos); + static SC_DLLPUBLIC OUString GetExpression(ScCondFormatEntryType eType, sal_Int32 nIndex, + std::u16string_view aStr1 = std::u16string_view(), + std::u16string_view aStr2 = std::u16string_view()); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/condformatmgr.hxx b/sc/source/ui/inc/condformatmgr.hxx index 564415186ac0..ca9f16e8a55f 100644 --- a/sc/source/ui/inc/condformatmgr.hxx +++ b/sc/source/ui/inc/condformatmgr.hxx @@ -10,12 +10,10 @@ #pragma once #include -#include class ScDocument; class ScConditionalFormat; class ScConditionalFormatList; -class ScFormatEntry; class ScCondFormatManagerWindow { @@ -32,9 +30,6 @@ public: void DeleteSelection(); ScConditionalFormat* GetSelection(); - const ScFormatEntry* GetSelectedEntry() const; - sal_Int32 GetSelectedFormatKey() const; - sal_Int32 GetSelectedEntryIndex() const; }; class ScCondFormatManagerDlg : public weld::GenericDialogController @@ -49,16 +44,11 @@ public: void SetModified(); ScConditionalFormat* GetCondFormatSelected(); - void ShowEasyConditionalDialog(bool isEdit = false); private: bool m_bModified; std::unique_ptr m_xFormatList; - std::unique_ptr m_xConditionalType; - std::unique_ptr m_xConditionalCellValue; - std::unique_ptr m_xConditionalFormula; - std::unique_ptr m_xConditionalDate; std::unique_ptr m_xBtnAdd; std::unique_ptr m_xBtnRemove; std::unique_ptr m_xBtnEdit; @@ -71,8 +61,6 @@ private: DECL_LINK(EditBtnClickHdl, weld::Button&, void); DECL_LINK(AddBtnHdl, weld::Button&, void); DECL_LINK(EditBtnHdl, weld::TreeView&, bool); - DECL_LINK(ComboHdl, weld::ComboBox&, void); - DECL_LINK(EntryFocus, weld::TreeView&, void); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/mergecellsdialog.cxx b/sc/source/ui/miscdlgs/mergecellsdialog.cxx index cedcf6777b46..0c365f9bb773 100644 --- a/sc/source/ui/miscdlgs/mergecellsdialog.cxx +++ b/sc/source/ui/miscdlgs/mergecellsdialog.cxx @@ -10,6 +10,8 @@ #include +static ScMergeCellsOption lastUsedMergeCellsOption = KeepContentHiddenCells; + ScMergeCellsDialog::ScMergeCellsDialog(weld::Window* pParent) : GenericDialogController(pParent, u"modules/scalc/ui/mergecellsdialog.ui"_ustr, u"MergeCellsDialog"_ustr) @@ -17,7 +19,18 @@ ScMergeCellsDialog::ScMergeCellsDialog(weld::Window* pParent) , m_xRBKeepContent(m_xBuilder->weld_radio_button(u"keep-content-radio"_ustr)) , m_xRBEmptyContent(m_xBuilder->weld_radio_button(u"empty-cells-radio"_ustr)) { - m_xRBKeepContent->set_active(true); + if (lastUsedMergeCellsOption == MoveContentHiddenCells) + { + m_xRBMoveContent->set_active(true); + } + else if (lastUsedMergeCellsOption == KeepContentHiddenCells) + { + m_xRBKeepContent->set_active(true); + } + else if (lastUsedMergeCellsOption == EmptyContentHiddenCells) + { + m_xRBEmptyContent->set_active(true); + } } ScMergeCellsDialog::~ScMergeCellsDialog() {} @@ -25,11 +38,20 @@ ScMergeCellsDialog::~ScMergeCellsDialog() {} ScMergeCellsOption ScMergeCellsDialog::GetMergeCellsOption() const { if (m_xRBMoveContent->get_active()) + { + lastUsedMergeCellsOption = MoveContentHiddenCells; return MoveContentHiddenCells; - if (m_xRBKeepContent->get_active()) + } + else if (m_xRBKeepContent->get_active()) + { + lastUsedMergeCellsOption = KeepContentHiddenCells; return KeepContentHiddenCells; - if (m_xRBEmptyContent->get_active()) + } + else if (m_xRBEmptyContent->get_active()) + { + lastUsedMergeCellsOption = EmptyContentHiddenCells; return EmptyContentHiddenCells; + } assert(!"Unknown selection for merge cells."); return KeepContentHiddenCells; // default value } diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx index 3452718c61e4..4aabcf03ebe0 100644 --- a/sc/source/ui/unoobj/shapeuno.cxx +++ b/sc/source/ui/unoobj/shapeuno.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -302,8 +303,8 @@ static ScRange lcl_GetAnchorCell( const uno::Reference< drawing::XShape >& xShap rUnoPoint.Y += rCaptionPoint.Y; } aReturn - = pDoc->GetRange(nTab, tools::Rectangle(VCLUnoHelper::ConvertToVCLPoint(rUnoPoint), - VCLUnoHelper::ConvertToVCLPoint(rUnoPoint))); + = pDoc->GetRange(nTab, tools::Rectangle(vcl::unohelper::ConvertToVCLPoint(rUnoPoint), + vcl::unohelper::ConvertToVCLPoint(rUnoPoint))); } else { @@ -315,8 +316,8 @@ static ScRange lcl_GetAnchorCell( const uno::Reference< drawing::XShape >& xShap rUnoPoint.Y += rCaptionPoint.Y; } aReturn - = pDoc->GetRange(nTab, tools::Rectangle(VCLUnoHelper::ConvertToVCLPoint(rUnoPoint), - VCLUnoHelper::ConvertToVCLPoint(rUnoPoint))); + = pDoc->GetRange(nTab, tools::Rectangle(vcl::unohelper::ConvertToVCLPoint(rUnoPoint), + vcl::unohelper::ConvertToVCLPoint(rUnoPoint))); } return aReturn; diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx index 6003c9f7e0ac..02f66358cb25 100644 --- a/sc/source/ui/unoobj/viewuno.cxx +++ b/sc/source/ui/unoobj/viewuno.cxx @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -406,7 +407,7 @@ awt::Rectangle ScViewPaneBase::GetVisArea() const aVisPos.AdjustX( -(aVisSize.Width()) ); } tools::Rectangle aVisRect( aVisPos, aVisSize ); - aVisArea = VCLUnoHelper::ConvertToAWTRect(aVisRect); + aVisArea = vcl::unohelper::ConvertToAWTRect(aVisRect); } } return aVisArea; @@ -1937,7 +1938,7 @@ uno::Any SAL_CALL ScTabViewObj::getPropertyValue( const OUString& aPropertyName if ( pActiveWin ) { AbsoluteScreenPixelRectangle aRect = pActiveWin->GetWindowExtentsAbsolute(); - aRet <<= VCLUnoHelper::ConvertToAWTRect(aRect); + aRet <<= vcl::unohelper::ConvertToAWTRect(aRect); } } } diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 7593b037020c..4b94a67eed1a 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2933,7 +2933,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) pDlg->SetModified(); pDlg->StartExecuteAsync( - [pDlg, &rData, pTabViewShell, rDlgItem, aPos](sal_Int32 nRet) + [this, pDlg, &rData, pTabViewShell, rDlgItem, aPos](sal_Int32 nRet) { std::unique_ptr pCondFormatList = pDlg->GetConditionalFormatList(); @@ -2944,11 +2944,31 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) } else if (nRet == DLG_RET_ADD) { - pDlg->ShowEasyConditionalDialog(); + // Put the xml string parameter to initialize the + // Conditional Format Dialog. ( add new ) + pTabViewShell->setScCondFormatDlgItem( + std::make_shared( + std::shared_ptr( + pCondFormatList.release()), + -1, true)); + // Queue message to open Conditional Format Dialog + GetViewData().GetDispatcher().Execute(SID_OPENDLG_CONDFRMT, + SfxCallMode::ASYNCHRON); } else if (nRet == DLG_RET_EDIT) { - pDlg->ShowEasyConditionalDialog(true); + ScConditionalFormat* pFormat = pDlg->GetCondFormatSelected(); + sal_Int32 nIndex = pFormat ? pFormat->GetKey() : -1; + // Put the xml string parameter to initialize the + // Conditional Format Dialog. ( edit selected conditional format ) + pTabViewShell->setScCondFormatDlgItem( + std::make_shared( + std::shared_ptr( + pCondFormatList.release()), + nIndex, true)); + // Queue message to open Conditional Format Dialog + GetViewData().GetDispatcher().Execute(SID_OPENDLG_CONDFRMT, + SfxCallMode::ASYNCHRON); } else pCondFormatList.reset(); diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx index 2e36d876bf33..033ecf8982cb 100644 --- a/sc/source/ui/view/cellsh3.cxx +++ b/sc/source/ui/view/cellsh3.cxx @@ -456,36 +456,13 @@ void ScCellShell::Execute( SfxRequest& rReq ) const SfxPoolItem* pFormat; if (pReqArgs->HasItem( FN_PARAM_1, &pFormat)) { - ScConditionMode nFormat = static_cast( - static_cast(pFormat)->GetValue()); + sal_Int16 nFormat = static_cast(pFormat)->GetValue(); sal_uInt16 nId = sc::ConditionalFormatEasyDialogWrapper::GetChildWindowId(); SfxViewFrame& rViewFrame = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWindow = rViewFrame.GetChildWindow( nId ); - const SfxPoolItem* pManaged; - bool bManaged = false; - if (pReqArgs->HasItem(FN_PARAM_2, &pManaged)) - { - bManaged = static_cast(pManaged)->GetValue(); - } - - const SfxPoolItem* pFormula; - OUString formula; - if (pReqArgs->HasItem(FN_PARAM_5, &pFormula)) - { - formula = static_cast(pFormula)->GetValue(); - } - const SfxPoolItem *pFormatKey, *pEntryIndex; - sal_Int32 nFormatKey = -1, nEntryIndex = -1; - if (pReqArgs->HasItem(FN_PARAM_3, &pFormatKey) - && pReqArgs->HasItem(FN_PARAM_4, &pEntryIndex)) - { - nFormatKey = static_cast(pFormatKey)->GetValue(); - nEntryIndex = static_cast(pEntryIndex)->GetValue(); - } - + SfxChildWindow* pWindow = rViewFrame.GetChildWindow(nId); GetViewData().GetDocument().SetEasyConditionalFormatDialogData( - ScConditionEasyDialogData(&nFormat, bManaged, nFormatKey, nEntryIndex, - formula)); + std::make_unique( + static_cast(nFormat))); pScMod->SetRefDialog( nId, pWindow == nullptr ); } diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index cdd7d2d7a464..2a73bc1857fa 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -4228,10 +4228,7 @@ sal_Int8 ScGridWindow::AcceptDrop( const AcceptDropEvent& rEvt ) if ( rEvt.mbLeaving ) { DrawMarkDropObj( nullptr ); - if ( rData.pCellTransfer ) - return AcceptPrivateDrop( rEvt, rData ); // hide drop marker for internal D&D - else - return rEvt.mnAction; + return AcceptPrivateDrop( rEvt, rData ); // hide drop marker for internal D&D } if ( mrViewData.GetDocShell()->IsReadOnly() ) diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index 51699f6aa4c7..4a96b4c61d6f 100644 --- a/sc/source/ui/view/preview.cxx +++ b/sc/source/ui/view/preview.cxx @@ -896,6 +896,7 @@ void ScPreview::StaticInvalidate() SfxBindings& rBindings = pViewFrm->GetBindings(); rBindings.Invalidate(SID_STATUS_DOCPOS); + rBindings.Invalidate(FID_AUTO_CALC); rBindings.Invalidate(SID_ROWCOL_SELCOUNT); rBindings.Invalidate(SID_STATUS_PAGESTYLE); rBindings.Invalidate(SID_PREVIEW_PREVIOUS); diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index 4cf74a88295b..8fc9fb1276cf 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -128,7 +128,7 @@ std::shared_ptr ScTabViewShell::CreateRefDialogCont if ( nCurRefDlgId != nSlotId ) { - if (!(comphelper::LibreOfficeKit::isActive() && nSlotId == SID_OPENDLG_FUNCTION)) + if (!comphelper::LibreOfficeKit::isActive()) { // the dialog has been opened in a different view // -> lock the dispatcher for this view (modal mode) diff --git a/sc/uiconfig/scalc/statusbar/statusbar.xml b/sc/uiconfig/scalc/statusbar/statusbar.xml index fe4994249b62..e148b28628d1 100644 --- a/sc/uiconfig/scalc/statusbar/statusbar.xml +++ b/sc/uiconfig/scalc/statusbar/statusbar.xml @@ -25,6 +25,7 @@ + diff --git a/sc/uiconfig/scalc/ui/condformatmanager.ui b/sc/uiconfig/scalc/ui/condformatmanager.ui index 57a8b03ae3c1..c9aead73ba61 100644 --- a/sc/uiconfig/scalc/ui/condformatmanager.ui +++ b/sc/uiconfig/scalc/ui/condformatmanager.ui @@ -139,7 +139,7 @@ True 6 - Condition + First Condition @@ -163,114 +163,11 @@ - + True False 12 - - - True - False - 0 - - Cell value - Formula is - Date is - - - - True - True - 0 - - - - - False - True - True - 0 - - is equal to - is less than - is greater than - is less than or equal to - is greater than or equal to - is not equal to - is between - is not between - is duplicate - is not duplicate - - is in top N elements - is in bottom N elements - is in top N percent - is in bottom N percent - is above average - is below average - is above or equal average - is below or equal average - is error - is not error - begins with - ends with - contains - does not contain - - - - True - True - 1 - - - - - True - True - True - True - - - Here you can add formula for conditional formatting. - - - - - False - True - 2 - - - - - False - False - False - True - 0 - - Today - Yesterday - Tomorrow - Last 7 days - This week - Last week - Next week - This month - Last month - Next month - This year - Last year - Next year - - - - False - True - 3 - - + start Add @@ -286,7 +183,7 @@ False True - 4 + 0 @@ -304,7 +201,7 @@ False True - 5 + 1 @@ -322,7 +219,7 @@ False True - 6 + 2 diff --git a/sc/uiconfig/scalc/ui/conditionaleasydialog.ui b/sc/uiconfig/scalc/ui/conditionaleasydialog.ui index ac5a056eba35..d2a32c99023a 100644 --- a/sc/uiconfig/scalc/ui/conditionaleasydialog.ui +++ b/sc/uiconfig/scalc/ui/conditionaleasydialog.ui @@ -176,9 +176,6 @@ True False - - New Style... - @@ -207,7 +204,7 @@ True False - Highlight cells if %1 + Highlight cells with values %1 @@ -221,17 +218,6 @@ 0 - - - False - False - - - False - True - 1 - - True @@ -301,34 +287,7 @@ False True - 2 - - - - - True - True - never - never - in - - - True - False - - - True - False - Example - - - - - - - False - True - 3 + 1 diff --git a/sc/uiconfig/scalc/ui/pivottablelayoutdialog.ui b/sc/uiconfig/scalc/ui/pivottablelayoutdialog.ui index 293500c868aa..40a929fefd09 100644 --- a/sc/uiconfig/scalc/ui/pivottablelayoutdialog.ui +++ b/sc/uiconfig/scalc/ui/pivottablelayoutdialog.ui @@ -504,6 +504,7 @@ True False + True True vertical 6 diff --git a/sc/uiconfig/scalc/ui/textimportcsv.ui b/sc/uiconfig/scalc/ui/textimportcsv.ui index 0f841c5e4910..943cfcc6415c 100644 --- a/sc/uiconfig/scalc/ui/textimportcsv.ui +++ b/sc/uiconfig/scalc/ui/textimportcsv.ui @@ -238,7 +238,7 @@ True False - True + False 0 none @@ -247,15 +247,16 @@ False 12 6 - True + False vertical 6 True False - True - True + False + False + 12 _Fixed width @@ -332,7 +333,7 @@ True False 12 - True + False 6 12 @@ -341,7 +342,7 @@ True True False - True + False True True @@ -362,7 +363,7 @@ True False start - True + False True True @@ -384,7 +385,7 @@ True False start - True + False True True @@ -405,7 +406,7 @@ True True False - True + False True True @@ -425,7 +426,7 @@ True True False - True + False True True @@ -445,7 +446,7 @@ True True False - True + False True True @@ -464,7 +465,7 @@ True False - True + False 12 @@ -492,7 +493,7 @@ True True - True + False 10 True 3 @@ -523,7 +524,7 @@ True False - True + False 12 @@ -543,7 +544,7 @@ True False - True + False True diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk index 0a85cd6229ca..df3309c6d78d 100644 --- a/sd/Library_sd.mk +++ b/sd/Library_sd.mk @@ -362,7 +362,6 @@ $(eval $(call gb_Library_add_exception_objects,sd,\ sd/source/ui/sidebar/MasterPagesSelector \ sd/source/ui/sidebar/NavigatorWrapper \ sd/source/ui/sidebar/PanelFactory \ - sd/source/ui/sidebar/PreviewValueSet \ sd/source/ui/sidebar/RecentlyUsedMasterPages \ sd/source/ui/sidebar/RecentMasterPagesSelector \ sd/source/ui/sidebar/SlideBackground \ diff --git a/sd/qa/unit/data/pptx/tdf160487.pptx b/sd/qa/unit/data/pptx/tdf160487.pptx new file mode 100644 index 000000000000..ac0f3fb553d1 Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf160487.pptx differ diff --git a/sd/qa/unit/export-tests-ooxml4.cxx b/sd/qa/unit/export-tests-ooxml4.cxx index 9513b3ae5e61..55f1b5d5de2d 100644 --- a/sd/qa/unit/export-tests-ooxml4.cxx +++ b/sd/qa/unit/export-tests-ooxml4.cxx @@ -1263,6 +1263,16 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf163483_export_math_fallback) "id", cNvPr_id); } +CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testPlaceHolderFitHeightToText) +{ + createSdImpressDoc("pptx/tdf160487.pptx"); + saveAndReload(u"Impress Office Open XML"_ustr); + uno::Reference xShape(getShapeFromPage(1, 0)); + bool bTextAutoGrowHeight = false; + xShape->getPropertyValue(u"TextAutoGrowHeight"_ustr) >>= bTextAutoGrowHeight; + CPPUNIT_ASSERT_MESSAGE("PlaceHolder Fit height to text should be true.", bTextAutoGrowHeight); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index 4a17fc480ca7..18b213e99abf 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -2704,7 +2704,7 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testPresentationInfo) CPPUNIT_ASSERT_EQUAL(15875, aTree.get_child("docWidth").get_value()); CPPUNIT_ASSERT_EQUAL(8930, aTree.get_child("docHeight").get_value()); - CPPUNIT_ASSERT_EQUAL(size_t(4), aTree.get_child("slides").size()); + CPPUNIT_ASSERT_EQUAL(size_t(5), aTree.get_child("slides").size()); // Slide Index 0 { @@ -2756,10 +2756,15 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testPresentationInfo) } // Slide Index 3 - Hidden + { + const boost::property_tree::ptree& rChild = child_at(aTree, "slides", 3); + CPPUNIT_ASSERT_EQUAL(3, rChild.get_child("index").get_value()); + CPPUNIT_ASSERT_EQUAL(true, rChild.get_child("hidden").get_value()); + } // Slide Index 4 { - const boost::property_tree::ptree& rChild = child_at(aTree, "slides", 3); + const boost::property_tree::ptree& rChild = child_at(aTree, "slides", 4); CPPUNIT_ASSERT_EQUAL(4, rChild.get_child("index").get_value()); CPPUNIT_ASSERT_EQUAL(false, rChild.get_child("empty").get_value()); // Check only that these exist diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx index d99098edd6fb..a66c008f4db4 100644 --- a/sd/qa/unit/uiimpress.cxx +++ b/sd/qa/unit/uiimpress.cxx @@ -72,9 +72,9 @@ public: } void checkCurrentPageNumber(sal_uInt16 nNum); - void typeString(SdXImpressDocument* rImpressDocument, const std::u16string_view& rStr); + void typeString(SdXImpressDocument* rImpressDocument, std::u16string_view rStr); void typeKey(SdXImpressDocument* rImpressDocument, const sal_uInt16 nKey); - void insertStringToObject(sal_uInt16 nObj, const std::u16string_view& rStr, bool bUseEscape); + void insertStringToObject(sal_uInt16 nObj, std::u16string_view rStr, bool bUseEscape); sd::slidesorter::SlideSorterViewShell* getSlideSorterViewShell(); void lcl_search(const OUString& rKey, bool bFindAll = false, bool bBackwards = false); }; @@ -98,8 +98,7 @@ void SdUiImpressTest::typeKey(SdXImpressDocument* rImpressDocument, const sal_uI Scheduler::ProcessEventsToIdle(); } -void SdUiImpressTest::typeString(SdXImpressDocument* rImpressDocument, - const std::u16string_view& rStr) +void SdUiImpressTest::typeString(SdXImpressDocument* rImpressDocument, std::u16string_view rStr) { for (const char16_t c : rStr) { @@ -109,7 +108,7 @@ void SdUiImpressTest::typeString(SdXImpressDocument* rImpressDocument, } } -void SdUiImpressTest::insertStringToObject(sal_uInt16 nObj, const std::u16string_view& rStr, +void SdUiImpressTest::insertStringToObject(sal_uInt16 nObj, std::u16string_view rStr, bool bUseEscape) { auto pImpressDocument = dynamic_cast(mxComponent.get()); diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 4607a5f3aa65..04d0f020ebbc 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -460,6 +460,9 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const ::t else aTempAttr.Put( makeSdrTextMinFrameHeightItem( rRect.GetSize().Height() ) ); + if (eObjKind == PresObjKind::Notes) + aTempAttr.Put(makeSdrTextAutoGrowHeightItem(false)); + if (mbMaster) { // The size of presentation objects on the master page have to diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx index 78646f8c049e..07a043c0828e 100644 --- a/sd/source/ui/app/sddll.cxx +++ b/sd/source/ui/app/sddll.cxx @@ -172,9 +172,7 @@ void SdDLL::RegisterControllers(SdModule* pMod) SvxBmpMaskChildWindow::RegisterChildWindow(false, pMod); SvxIMapDlgChildWindow::RegisterChildWindow(false, pMod); SvxHlinkDlgWrapper::RegisterChildWindow(false, pMod); - ::sd::SpellDialogChildWindow::RegisterChildWindow( - false, pMod, comphelper::LibreOfficeKit::isActive() ? SfxChildWindowFlags::NEVERCLONE - : SfxChildWindowFlags::NONE); + ::sd::SpellDialogChildWindow::RegisterChildWindow(false, pMod); #if HAVE_FEATURE_AVMEDIA ::avmedia::MediaPlayer::RegisterChildWindow(false, pMod); #endif diff --git a/sd/source/ui/framework/factories/ChildWindowPane.cxx b/sd/source/ui/framework/factories/ChildWindowPane.cxx index 1eaf0f0aeeb2..6e9e237c166f 100644 --- a/sd/source/ui/framework/factories/ChildWindowPane.cxx +++ b/sd/source/ui/framework/factories/ChildWindowPane.cxx @@ -48,7 +48,9 @@ ChildWindowPane::ChildWindowPane ( mpShell(std::move(pShell)), mbHasBeenActivated(false) { - mrViewShellBase.GetViewShellManager()->ActivateShell(mpShell.get()); + // ChildWindowPane shells don't implement dispatch slots, so activate them + // at the bottom of the shellstack. + mrViewShellBase.GetViewShellManager()->ActivateLowPriorityShell(mpShell.get()); SfxViewFrame& rViewFrame = mrViewShellBase.GetViewFrame(); diff --git a/sd/source/ui/inc/ViewShellManager.hxx b/sd/source/ui/inc/ViewShellManager.hxx index 70fe4d548cbe..929877ad1484 100644 --- a/sd/source/ui/inc/ViewShellManager.hxx +++ b/sd/source/ui/inc/ViewShellManager.hxx @@ -88,6 +88,11 @@ public: */ void ActivateShell(SfxShell* pShell); + /** Activate the given shell, putting it at the bottom of the stack instead of + the top. + */ + void ActivateLowPriorityShell(SfxShell* pShell); + /** Deactivate the specified shell, i.e. take it and all of its object bars from the shell stack. @param pShell diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx index 91d4fd87be94..13a2635c781a 100644 --- a/sd/source/ui/inc/unomodel.hxx +++ b/sd/source/ui/inc/unomodel.hxx @@ -405,7 +405,7 @@ public: virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override; private: - virtual css::uno::Reference< ::css::drawing::XDrawPage > insertNewImpl( sal_Int32 nIndex, std::optional oName ); + css::uno::Reference< ::css::drawing::XDrawPage > insertNewImpl( sal_Int32 nIndex, std::optional oName ); }; /*********************************************************************** diff --git a/sd/source/ui/sidebar/AllMasterPagesSelector.cxx b/sd/source/ui/sidebar/AllMasterPagesSelector.cxx index 70251b8cc740..fdd8ea4618f8 100644 --- a/sd/source/ui/sidebar/AllMasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/AllMasterPagesSelector.cxx @@ -97,14 +97,14 @@ std::unique_ptr AllMasterPagesSelector::Create ( return xSelector; } -AllMasterPagesSelector::AllMasterPagesSelector ( - weld::Widget* pParent, - SdDrawDocument& rDocument, - ViewShellBase& rBase, +AllMasterPagesSelector::AllMasterPagesSelector( + weld::Widget* pParent, SdDrawDocument& rDocument, ViewShellBase& rBase, const std::shared_ptr& rpContainer, const css::uno::Reference& rxSidebar) - : MasterPagesSelector(pParent, rDocument, rBase, rpContainer, rxSidebar, u"modules/simpress/ui/masterpagepanelall.ui"_ustr, u"allvalueset"_ustr), - mpSortedMasterPages(new SortedMasterPageDescriptorList()) + : MasterPagesSelector(pParent, rDocument, rBase, rpContainer, rxSidebar, + u"modules/simpress/ui/masterpagepanelall.ui"_ustr, + u"masterpageall_icons"_ustr) + , mpSortedMasterPages(new SortedMasterPageDescriptorList()) { MasterPagesSelector::Fill(); } diff --git a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx index 2e3bd5a4ede7..c1ac330b7314 100644 --- a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx @@ -18,7 +18,6 @@ */ #include "CurrentMasterPagesSelector.hxx" -#include "PreviewValueSet.hxx" #include #include #include @@ -61,15 +60,16 @@ std::unique_ptr CurrentMasterPagesSelector::Create ( return xSelector; } -CurrentMasterPagesSelector::CurrentMasterPagesSelector ( - weld::Widget* pParent, - SdDrawDocument& rDocument, - ViewShellBase& rBase, +CurrentMasterPagesSelector::CurrentMasterPagesSelector( + weld::Widget* pParent, SdDrawDocument& rDocument, ViewShellBase& rBase, const std::shared_ptr& rpContainer, const css::uno::Reference& rxSidebar) - : MasterPagesSelector (pParent, rDocument, rBase, rpContainer, rxSidebar, u"modules/simpress/ui/masterpagepanel.ui"_ustr, u"usedvalueset"_ustr) + : MasterPagesSelector(pParent, rDocument, rBase, rpContainer, rxSidebar, + u"modules/simpress/ui/masterpagepanel.ui"_ustr, + u"masterpagecurrent_icons"_ustr) { - Link aLink (LINK(this,CurrentMasterPagesSelector,EventMultiplexerListener)); + Link aLink( + LINK(this, CurrentMasterPagesSelector, EventMultiplexerListener)); rBase.GetEventMultiplexer()->AddEventListener(aLink); } @@ -176,17 +176,6 @@ void CurrentMasterPagesSelector::UpdateSelection() } } } - - // Find the items for the master pages in the set. - sal_uInt16 nItemCount (mxPreviewValueSet->GetItemCount()); - for (nIndex=1; nIndex<=nItemCount && bLoop; nIndex++) - { - OUString sName (mxPreviewValueSet->GetItemText (nIndex)); - if (aNames.find(sName) != aNames.end()) - { - mxPreviewValueSet->SelectItem (nIndex); - } - } } void CurrentMasterPagesSelector::ExecuteCommand(const OUString &rIdent) diff --git a/sd/source/ui/sidebar/MasterPagesSelector.cxx b/sd/source/ui/sidebar/MasterPagesSelector.cxx index c1417dd538ce..2ee57bca11c3 100644 --- a/sd/source/ui/sidebar/MasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx @@ -32,7 +32,7 @@ #include #include -#include "PreviewValueSet.hxx" +#include #include #include #include @@ -40,6 +40,7 @@ #include #include #include +#include namespace sd::sidebar { @@ -48,35 +49,22 @@ namespace sd::sidebar { */ constexpr OUStringLiteral gsDefaultClickAction = u"applyselect"; -MasterPagesSelector::MasterPagesSelector ( - weld::Widget* pParent, - SdDrawDocument& rDocument, - ViewShellBase& rBase, - std::shared_ptr pContainer, - css::uno::Reference xSidebar, - const OUString& rUIFileName, - const OUString& rValueSetName) - : PanelLayout( pParent, u"MasterPagePanel"_ustr, rUIFileName ), - mpContainer(std::move(pContainer)), - mxPreviewValueSet(new PreviewValueSet), - mxPreviewValueSetWin(new weld::CustomWeld(*m_xBuilder, rValueSetName, *mxPreviewValueSet)), - mrDocument(rDocument), - mrBase(rBase), - mxSidebar(std::move(xSidebar)) +MasterPagesSelector::MasterPagesSelector(weld::Widget* pParent, SdDrawDocument& rDocument, + ViewShellBase& rBase, + std::shared_ptr pContainer, + css::uno::Reference xSidebar, + const OUString& rUIFileName, const OUString& rIconViewId) + : PanelLayout(pParent, u"MasterPagePanel"_ustr, rUIFileName) + , mpContainer(std::move(pContainer)) + , mxPreviewIconView(m_xBuilder->weld_icon_view(rIconViewId)) + , mrDocument(rDocument) + , mrBase(rBase) + , mxSidebar(std::move(xSidebar)) + , maIconViewId(rIconViewId) { - mxPreviewValueSet->SetSelectHdl ( - LINK(this, MasterPagesSelector, ClickHandler)); - mxPreviewValueSet->SetContextMenuHandler ( - LINK(this, MasterPagesSelector, ContextMenuHandler)); - mxPreviewValueSet->SetStyle(mxPreviewValueSet->GetStyle() | WB_NO_DIRECTSELECT); - - if (mxPreviewValueSet->GetDrawingArea()->get_ref_device().GetDPIScaleFactor() > 1) - mpContainer->SetPreviewSize(MasterPageContainer::LARGE); - - mxPreviewValueSet->SetPreviewSize(mpContainer->GetPreviewSizePixel()); - mxPreviewValueSet->Show(); - - mxPreviewValueSet->SetColor(sfx2::sidebar::Theme::GetColor(sfx2::sidebar::Theme::Color_PanelBackground)); + mxPreviewIconView->connect_item_activated(LINK(this, MasterPagesSelector, MasterPageSelected)); + mxPreviewIconView->connect_mouse_press(LINK(this, MasterPagesSelector, MousePressHdl)); + mxPreviewIconView->connect_query_tooltip(LINK(this, MasterPagesSelector, QueryTooltipHdl)); Link aChangeListener (LINK(this,MasterPagesSelector,ContainerChangeListener)); mpContainer->AddChangeListener(aChangeListener); @@ -90,21 +78,13 @@ MasterPagesSelector::~MasterPagesSelector() Link aChangeListener (LINK(this,MasterPagesSelector,ContainerChangeListener)); mpContainer->RemoveChangeListener(aChangeListener); mpContainer.reset(); - mxPreviewValueSetWin.reset(); - mxPreviewValueSet.reset(); + mxPreviewIconView.reset(); } void MasterPagesSelector::LateInit() { } -sal_Int32 MasterPagesSelector::GetPreferredHeight (sal_Int32 nWidth) -{ - const ::osl::MutexGuard aGuard (maMutex); - - return mxPreviewValueSet->GetPreferredHeight (nWidth); -} - void MasterPagesSelector::UpdateLocks (const ItemList& rItemList) { ItemList aNewLockList; @@ -144,61 +124,50 @@ OUString MasterPagesSelector::GetContextMenuUIFile() const return u"modules/simpress/ui/mastermenu.ui"_ustr; } -IMPL_LINK_NOARG(MasterPagesSelector, ClickHandler, ValueSet*, void) +IMPL_LINK_NOARG(MasterPagesSelector, MasterPageSelected, weld::IconView&, bool) { - // We use the framework to assign the clicked-on master page because we - // so use the same mechanism as the context menu does (where we do not - // have the option to call the assignment method directly.) ExecuteCommand(gsDefaultClickAction); + return true; } -IMPL_LINK(MasterPagesSelector, ContextMenuHandler, const Point*, pPos, void) +IMPL_LINK(MasterPagesSelector, MousePressHdl, const MouseEvent&, rMEvet, bool) { - if (pPos) + if (!rMEvet.IsRight()) + return false; + + const Point& pPos = rMEvet.GetPosPixel(); + for (int i = 0; i < mxPreviewIconView->n_children(); i++) { - // Here we only prepare the display of the context menu: on right - // click the item under the mouse is selected. - mxPreviewValueSet->GrabFocus(); - mxPreviewValueSet->ReleaseMouse(); - - sal_uInt16 nIndex = mxPreviewValueSet->GetItemId(*pPos); - if (nIndex > 0) - mxPreviewValueSet->SelectItem(nIndex); + const ::tools::Rectangle aRect = mxPreviewIconView->get_rect(i); + if (aRect.Contains(pPos)) + { + mxPreviewIconView->select(i); + ShowContextMenu(pPos); + break; + } } - - // Now do the actual display of the context menu - ShowContextMenu(pPos); + return false; } -void MasterPagesSelector::ShowContextMenu(const Point* pPos) +IMPL_LINK(MasterPagesSelector, QueryTooltipHdl, const weld::TreeIter&, iter, OUString) { - // Use the currently selected item and show the popup menu in its - // center. - const sal_uInt16 nIndex = mxPreviewValueSet->GetSelectedItemId(); - if (nIndex <= 0) - return; + const OUString sId = mxPreviewIconView->get_id(iter); + if (!sId.isEmpty()) + return mpContainer->GetPageNameForToken(sId.toUInt32()); - // The position of the upper left corner of the context menu is - // taken either from the mouse position (when the command was sent - // as reaction to a right click) or in the center of the selected - // item (when the command was sent as reaction to Shift+F10.) - Point aPosition; - if (!pPos) - { - ::tools::Rectangle aBBox (mxPreviewValueSet->GetItemRect(nIndex)); - aPosition = aBBox.Center(); - } - else - aPosition = *pPos; + return OUString(); +} +void MasterPagesSelector::ShowContextMenu(const Point& pPos) +{ // Setup the menu. - weld::Widget* pParent = mxPreviewValueSet->GetDrawingArea(); - std::unique_ptr xBuilder(Application::CreateBuilder(pParent, GetContextMenuUIFile())); + ::tools::Rectangle aRect(pPos, Size(1, 1)); + std::unique_ptr xBuilder( + Application::CreateBuilder(mxPreviewIconView.get(), GetContextMenuUIFile())); std::unique_ptr xMenu(xBuilder->weld_menu(u"menu"_ustr)); ProcessPopupMenu(*xMenu); - ::tools::Rectangle aRect(aPosition, Size(1,1)); // Show the menu. - ExecuteCommand(xMenu->popup_at_rect(pParent, aRect)); + ExecuteCommand(xMenu->popup_at_rect(mxPreviewIconView.get(), aRect)); } void MasterPagesSelector::ProcessPopupMenu(weld::Menu& rMenu) @@ -254,13 +223,12 @@ void MasterPagesSelector::ExecuteCommand(const OUString &rIdent) SfxDispatcher* pDispatcher = rViewFrame.GetDispatcher(); if (pDispatcher != nullptr) { - sal_uInt16 nIndex = mxPreviewValueSet->GetSelectedItemId(); pDispatcher->Execute(SID_MASTERPAGE, SfxCallMode::SYNCHRON); - mxPreviewValueSet->SelectItem (nIndex); mrBase.GetDrawController()->setCurrentPage(xSelectedMaster); } } } + mxPreviewIconView->unselect_all(); } IMPL_LINK(MasterPagesSelector, ContainerChangeListener, MasterPageContainerChangeEvent&, rEvent, void) @@ -273,11 +241,13 @@ SdPage* MasterPagesSelector::GetSelectedMasterPage() const ::osl::MutexGuard aGuard (maMutex); SdPage* pMasterPage = nullptr; - sal_uInt16 nIndex = mxPreviewValueSet->GetSelectedItemId(); - UserData* pData = GetUserData(nIndex); - if (pData != nullptr) + OUString sSelectedId = mxPreviewIconView->get_selected_id(); + + if (!sSelectedId.isEmpty()) { - pMasterPage = mpContainer->GetPageObjectForToken(pData->second, true); + const MasterPageContainer::Token aToken + = static_cast(sSelectedId.toInt32()); + pMasterPage = mpContainer->GetPageObjectForToken(aToken, true); } return pMasterPage; } @@ -354,7 +324,6 @@ void MasterPagesSelector::NotifyContainerChangeEvent (const MasterPageContainerC switch (rEvent.meEventType) { case MasterPageContainerChangeEvent::EventType::SIZE_CHANGED: - mxPreviewValueSet->SetPreviewSize(mpContainer->GetPreviewSizePixel()); UpdateAllPreviews(); break; @@ -363,10 +332,12 @@ void MasterPagesSelector::NotifyContainerChangeEvent (const MasterPageContainerC int nIndex (GetIndexForToken(rEvent.maChildToken)); if (nIndex >= 0) { - mxPreviewValueSet->SetItemImage ( - static_cast(nIndex), - mpContainer->GetPreviewForToken(rEvent.maChildToken)); - mxPreviewValueSet->Invalidate(mxPreviewValueSet->GetItemRect(static_cast(nIndex))); + Image aPreview(mpContainer->GetPreviewForToken(rEvent.maChildToken)); + if (aPreview.GetSizePixel().Width() > 0) + { + VclPtr aDev = GetVirtualDevice(aPreview); + mxPreviewIconView->set_image(nIndex, aDev); + } } } break; @@ -390,58 +361,50 @@ void MasterPagesSelector::NotifyContainerChangeEvent (const MasterPageContainerC } } -MasterPagesSelector::UserData* MasterPagesSelector::GetUserData (int nIndex) const +std::unique_ptr MasterPagesSelector::GetUserData(int nIndex) const { - const ::osl::MutexGuard aGuard (maMutex); + const ::osl::MutexGuard aGuard(maMutex); - if (nIndex>0 && o3tl::make_unsigned(nIndex)<=mxPreviewValueSet->GetItemCount()) - return static_cast(mxPreviewValueSet->GetItemData(static_cast(nIndex))); + if (nIndex >= 0 && nIndex < mxPreviewIconView->n_children()) + { + const MasterPageContainer::Token aToken + = static_cast(mxPreviewIconView->get_id(nIndex).toInt32()); + return std::make_unique(std::make_pair(nIndex, aToken)); + } else return nullptr; } -void MasterPagesSelector::SetUserData (int nIndex, std::unique_ptr pData) -{ - const ::osl::MutexGuard aGuard (maMutex); - - delete GetUserData(nIndex); - mxPreviewValueSet->SetItemData(static_cast(nIndex), pData.release()); -} - void MasterPagesSelector::SetItem ( sal_uInt16 nIndex, MasterPageContainer::Token aToken) { const ::osl::MutexGuard aGuard (maMutex); - RemoveTokenToIndexEntry(nIndex,aToken); + RemoveTokenToIndexEntry(nIndex, aToken); - if (nIndex <= 0) - return; + mxPreviewIconView->freeze(); if (aToken != MasterPageContainer::NIL_TOKEN) { Image aPreview (mpContainer->GetPreviewForToken(aToken)); MasterPageContainer::PreviewState eState (mpContainer->GetPreviewState(aToken)); - if (aPreview.GetSizePixel().Width()>0) + if (aPreview.GetSizePixel().Width() > 0) { - if (mxPreviewValueSet->GetItemPos(nIndex) != VALUESET_ITEM_NOTFOUND) + VclPtr aVDev = GetVirtualDevice(aPreview); + if (!mxPreviewIconView->get_id(nIndex).isEmpty()) { - mxPreviewValueSet->SetItemImage(nIndex,aPreview); - mxPreviewValueSet->SetItemText(nIndex, mpContainer->GetPageNameForToken(aToken)); + mxPreviewIconView->set_image(nIndex, aVDev); + mxPreviewIconView->set_id(nIndex, OUString::number(aToken)); } else { - mxPreviewValueSet->InsertItem ( - nIndex, - aPreview, - mpContainer->GetPageNameForToken(aToken), - nIndex); + OUString sId = OUString::number(aToken); + mxPreviewIconView->insert(nIndex, nullptr, &sId, aVDev, nullptr); } - SetUserData(nIndex, std::make_unique(nIndex,aToken)); - AddTokenToIndexEntry(nIndex,aToken); + AddTokenToIndexEntry(nIndex, aToken); } if (eState == MasterPageContainer::PS_CREATABLE) @@ -449,9 +412,9 @@ void MasterPagesSelector::SetItem ( } else { - mxPreviewValueSet->RemoveItem(nIndex); + mxPreviewIconView->remove(nIndex); } - + mxPreviewIconView->thaw(); } void MasterPagesSelector::AddTokenToIndexEntry ( @@ -469,7 +432,7 @@ void MasterPagesSelector::RemoveTokenToIndexEntry ( { const ::osl::MutexGuard aGuard (maMutex); - UserData* pData = GetUserData(nIndex); + std::unique_ptr pData = GetUserData(nIndex); if (pData != nullptr) { // Get the token that the index pointed to previously. @@ -478,7 +441,7 @@ void MasterPagesSelector::RemoveTokenToIndexEntry ( if (aNewToken != aOldToken && nIndex == GetIndexForToken(aOldToken)) { - maTokenToValueSetIndex[aOldToken] = 0; + maTokenToValueSetIndex[aOldToken] = -1; } } } @@ -487,9 +450,9 @@ void MasterPagesSelector::InvalidatePreview (const SdPage* pPage) { const ::osl::MutexGuard aGuard (maMutex); - for (size_t nIndex=1; nIndex<=mxPreviewValueSet->GetItemCount(); nIndex++) + for (int nIndex = 0; nIndex < mxPreviewIconView->n_children(); nIndex++) { - UserData* pData = GetUserData(nIndex); + std::unique_ptr pData = GetUserData(nIndex); if (pData != nullptr) { MasterPageContainer::Token aToken (pData->second); @@ -503,43 +466,54 @@ void MasterPagesSelector::InvalidatePreview (const SdPage* pPage) } } +VclPtr MasterPagesSelector::GetVirtualDevice(Image pImage) +{ + BitmapEx aPreviewBitmap = pImage.GetBitmapEx(); + VclPtr pVDev = VclPtr::Create(); + const Point aNull(0, 0); + if (pVDev->GetDPIScaleFactor() > 1) + aPreviewBitmap.Scale(pVDev->GetDPIScaleFactor(), pVDev->GetDPIScaleFactor()); + const Size aSize(aPreviewBitmap.GetSizePixel()); + pVDev->SetOutputSizePixel(aSize); + pVDev->DrawBitmapEx(aNull, aPreviewBitmap); + + return pVDev; +} + void MasterPagesSelector::UpdateAllPreviews() { const ::osl::MutexGuard aGuard (maMutex); - for (size_t nIndex=1; nIndex<=mxPreviewValueSet->GetItemCount(); nIndex++) + mxPreviewIconView->freeze(); + for (int aIndex = 0; aIndex < mxPreviewIconView->n_children(); aIndex++) { - UserData* pData = GetUserData(nIndex); - if (pData != nullptr) + const MasterPageContainer::Token aToken + = static_cast(mxPreviewIconView->get_id(aIndex).toInt32()); + + Image aPreview(mpContainer->GetPreviewForToken(aToken)); + if (aPreview.GetSizePixel().Width() > 0) { - MasterPageContainer::Token aToken (pData->second); - mxPreviewValueSet->SetItemImage( - nIndex, - mpContainer->GetPreviewForToken(aToken)); - if (mpContainer->GetPreviewState(aToken) == MasterPageContainer::PS_CREATABLE) - mpContainer->RequestPreview(aToken); + VclPtr pVDev = GetVirtualDevice(aPreview); + mxPreviewIconView->set_image(aIndex, pVDev); + } + else if (mpContainer->GetPreviewState(aToken) == MasterPageContainer::PS_CREATABLE) + { + mpContainer->RequestPreview(aToken); } } - mxPreviewValueSet->Rearrange(); + mxPreviewIconView->thaw(); } void MasterPagesSelector::ClearPageSet() { const ::osl::MutexGuard aGuard (maMutex); - - for (size_t nIndex=1; nIndex<=mxPreviewValueSet->GetItemCount(); nIndex++) - { - UserData* pData = GetUserData(nIndex); - delete pData; - } - mxPreviewValueSet->Clear(); + mxPreviewIconView->clear(); } void MasterPagesSelector::SetHelpId( const OUString& aId ) { const ::osl::MutexGuard aGuard (maMutex); - - mxPreviewValueSet->SetHelpId( aId ); + mxPreviewIconView->set_help_id(aId); } sal_Int32 MasterPagesSelector::GetIndexForToken (MasterPageContainer::Token aToken) const @@ -577,7 +551,7 @@ void MasterPagesSelector::UpdateItemList (::std::unique_ptr && pNewIte ItemList::const_iterator iCurrentItem (maCurrentItemList.begin()); ItemList::const_iterator iNewEnd (pNewItemList->end()); ItemList::const_iterator iCurrentEnd (maCurrentItemList.end()); - sal_uInt16 nIndex (1); + sal_uInt16 nIndex(0); // Update existing items. for ( ; iNewItem!=iNewEnd && iCurrentItem!=iCurrentEnd; ++iNewItem, ++iCurrentItem,++nIndex) @@ -602,15 +576,22 @@ void MasterPagesSelector::UpdateItemList (::std::unique_ptr && pNewIte maCurrentItemList.swap(*pNewItemList); - mxPreviewValueSet->Rearrange(); if (mxSidebar.is()) mxSidebar->requestLayout(); } -css::ui::LayoutSize MasterPagesSelector::GetHeightForWidth (const sal_Int32 nWidth) +css::ui::LayoutSize MasterPagesSelector::GetHeightForWidth(const sal_Int32 nWidth) { - const sal_Int32 nHeight (GetPreferredHeight(nWidth)); - return css::ui::LayoutSize(nHeight,nHeight,nHeight); + if (maIconViewId == "masterpageall_icons") + return css::ui::LayoutSize(-1, -1, -1); + + const sal_uInt32 nItemWidth = mxPreviewIconView->get_item_width(); + sal_Int32 nMinimumHeight = mxPreviewIconView->get_preferred_size().getHeight(); + const sal_Int32 itemsInRows = floor(nWidth / nItemWidth); + sal_Int32 totalItems = mxPreviewIconView->n_children(); + if (itemsInRows > 0) + nMinimumHeight = ((totalItems / itemsInRows) + 1) * nMinimumHeight; + return css::ui::LayoutSize(nMinimumHeight, nMinimumHeight, nMinimumHeight); } } // end of namespace sd::sidebar diff --git a/sd/source/ui/sidebar/MasterPagesSelector.hxx b/sd/source/ui/sidebar/MasterPagesSelector.hxx index f0a540bade1b..3eaf9851e317 100644 --- a/sd/source/ui/sidebar/MasterPagesSelector.hxx +++ b/sd/source/ui/sidebar/MasterPagesSelector.hxx @@ -22,7 +22,10 @@ #include #include #include "MasterPageContainer.hxx" -#include "PreviewValueSet.hxx" +#include +#include +#include +#include #include #include @@ -46,14 +49,10 @@ class MasterPagesSelector : public PanelLayout , public sfx2::sidebar::ILayoutableWindow { public: - MasterPagesSelector ( - weld::Widget* pParent, - SdDrawDocument& rDocument, - ViewShellBase& rBase, - std::shared_ptr pContainer, - css::uno::Reference xSidebar, - const OUString& rUIFileName, - const OUString& rValueSetName); + MasterPagesSelector(weld::Widget* pParent, SdDrawDocument& rDocument, ViewShellBase& rBase, + std::shared_ptr pContainer, + css::uno::Reference xSidebar, + const OUString& rUIFileName, const OUString& rIconViewId); virtual ~MasterPagesSelector() override; virtual void LateInit(); @@ -80,7 +79,7 @@ public: void UpdateAllPreviews(); - void ShowContextMenu(const Point* pPos); + void ShowContextMenu(const Point& pPos); // ILayoutableWindow virtual css::ui::LayoutSize GetHeightForWidth (const sal_Int32 nWidth) override; @@ -89,8 +88,7 @@ protected: mutable ::osl::Mutex maMutex; std::shared_ptr mpContainer; - std::unique_ptr mxPreviewValueSet; - std::unique_ptr mxPreviewValueSetWin; + std::unique_ptr mxPreviewIconView; SdDrawDocument& mrDocument; ViewShellBase& mrBase; @@ -117,8 +115,7 @@ protected: virtual void NotifyContainerChangeEvent (const MasterPageContainerChangeEvent& rEvent); typedef ::std::pair UserData; - UserData* GetUserData (int nIndex) const; - void SetUserData (int nIndex, std::unique_ptr pData); + std::unique_ptr GetUserData(int nIndex) const; sal_Int32 GetIndexForToken (MasterPageContainer::Token aToken) const; typedef ::std::vector ItemList; @@ -155,14 +152,16 @@ protected: private: css::uno::Reference mxSidebar; + OUString maIconViewId; /** The offset between ValueSet index and MasterPageContainer::Token last seen. This value is used heuristically to speed up the lookup of an index for a token. */ - DECL_LINK(ClickHandler, ValueSet*, void); - DECL_LINK(ContextMenuHandler, const Point*, void); + DECL_LINK(MasterPageSelected, weld::IconView&, bool); + DECL_LINK(MousePressHdl, const MouseEvent&, bool); DECL_LINK(ContainerChangeListener, MasterPageContainerChangeEvent&, void); + DECL_LINK(QueryTooltipHdl, const weld::TreeIter&, OUString); void SetItem ( sal_uInt16 nIndex, @@ -173,6 +172,8 @@ private: void RemoveTokenToIndexEntry ( sal_uInt16 nIndex, MasterPageContainer::Token aToken); + + static VclPtr GetVirtualDevice(Image pPreview); }; } // end of namespace sd::sidebar diff --git a/sd/source/ui/sidebar/PreviewValueSet.cxx b/sd/source/ui/sidebar/PreviewValueSet.cxx deleted file mode 100644 index f752d60eb00d..000000000000 --- a/sd/source/ui/sidebar/PreviewValueSet.cxx +++ /dev/null @@ -1,127 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "PreviewValueSet.hxx" -#include - -namespace sd::sidebar { - -const int gnBorderWidth(3); -const int gnBorderHeight(3); - -PreviewValueSet::PreviewValueSet() - : ValueSet(nullptr) - , maPreviewSize(10,10) -{ - SetStyle ( - GetStyle() - & ~(WB_ITEMBORDER)// | WB_MENUSTYLEVALUESET) - // | WB_FLATVALUESET); - ); -} - -void PreviewValueSet::SetDrawingArea(weld::DrawingArea* pDrawingArea) -{ - ValueSet::SetDrawingArea(pDrawingArea); - - SetColCount(2); - SetExtraSpacing (2); -} - -PreviewValueSet::~PreviewValueSet() -{ -} - -void PreviewValueSet::SetPreviewSize (const Size& rSize) -{ - maPreviewSize = rSize; -} - -void PreviewValueSet::SetContextMenuHandler(const Link& rLink) -{ - maContextMenuHandler = rLink; -} - -bool PreviewValueSet::Command(const CommandEvent& rEvent) -{ - if (rEvent.GetCommand() != CommandEventId::ContextMenu) - return ValueSet::Command(rEvent); - maContextMenuHandler.Call(rEvent.IsMouseEvent() ? &rEvent.GetMousePosPixel() : nullptr); - return true; -} - -void PreviewValueSet::Resize() -{ - ValueSet::Resize(); - - Size aWindowSize (GetOutputSizePixel()); - if (!aWindowSize.IsEmpty()) - { - Rearrange(); - } -} - -void PreviewValueSet::Rearrange() -{ - sal_uInt16 nNewColumnCount (CalculateColumnCount ( - GetOutputSizePixel().Width())); - sal_uInt16 nNewRowCount (CalculateRowCount (nNewColumnCount)); - - SetFormat(); - SetColCount(nNewColumnCount); - SetLineCount(nNewRowCount); -} - -sal_uInt16 PreviewValueSet::CalculateColumnCount (int nWidth) const -{ - int nColumnCount = 0; - if (nWidth > 0) - { - nColumnCount = nWidth / (maPreviewSize.Width() + 2*gnBorderWidth); - if (nColumnCount < 1) - nColumnCount = 1; - } - return static_cast(nColumnCount); -} - -sal_uInt16 PreviewValueSet::CalculateRowCount (sal_uInt16 nColumnCount) const -{ - int nRowCount = 0; - int nItemCount = GetItemCount(); - if (nColumnCount > 0) - { - nRowCount = (nItemCount+nColumnCount-1) / nColumnCount; - if (nRowCount < 1) - nRowCount = 1; - } - - return static_cast(nRowCount); -} - -sal_Int32 PreviewValueSet::GetPreferredHeight (sal_Int32 nWidth) -{ - int nRowCount (CalculateRowCount(CalculateColumnCount(nWidth))); - int nItemHeight (maPreviewSize.Height()); - - return nRowCount * (nItemHeight + 2*gnBorderHeight); -} - -} // end of namespace sd::sidebar - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/sidebar/PreviewValueSet.hxx b/sd/source/ui/sidebar/PreviewValueSet.hxx deleted file mode 100644 index adab3c78ad4d..000000000000 --- a/sd/source/ui/sidebar/PreviewValueSet.hxx +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#pragma once - -#include - -namespace sd::sidebar -{ -/** Adapt the svtools valueset to the needs of the master page controls. -*/ -class PreviewValueSet : public ValueSet -{ -public: - explicit PreviewValueSet(); - virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; - virtual ~PreviewValueSet() override; - - void SetContextMenuHandler(const Link& rLink); - - virtual void Resize() override; - virtual bool Command(const CommandEvent& rEvent) override; - - void SetPreviewSize(const Size& rSize); - - sal_Int32 GetPreferredHeight(sal_Int32 nWidth); - - /** Set the number of rows and columns according to the current number - of items. Call this method when new items have been inserted. - */ - void Rearrange(); - -private: - Link maContextMenuHandler; - Size maPreviewSize; - - sal_uInt16 CalculateColumnCount(int nWidth) const; - sal_uInt16 CalculateRowCount(sal_uInt16 nColumnCount) const; -}; - -} // end of namespace sd::sidebar - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx b/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx index ef8e7fca3353..0917a46712c4 100644 --- a/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx @@ -51,13 +51,13 @@ std::unique_ptr RecentMasterPagesSelector::Create ( return xSelector; } -RecentMasterPagesSelector::RecentMasterPagesSelector ( - weld::Widget* pParent, - SdDrawDocument& rDocument, - ViewShellBase& rBase, +RecentMasterPagesSelector::RecentMasterPagesSelector( + weld::Widget* pParent, SdDrawDocument& rDocument, ViewShellBase& rBase, const std::shared_ptr& rpContainer, const css::uno::Reference& rxSidebar) - : MasterPagesSelector (pParent, rDocument, rBase, rpContainer, rxSidebar, u"modules/simpress/ui/masterpagepanelrecent.ui"_ustr, u"recentvalueset"_ustr) + : MasterPagesSelector(pParent, rDocument, rBase, rpContainer, rxSidebar, + u"modules/simpress/ui/masterpagepanelrecent.ui"_ustr, + u"masterpagerecent_icons"_ustr) { } @@ -115,24 +115,6 @@ void RecentMasterPagesSelector::Fill (ItemList& rItemList) } } -void RecentMasterPagesSelector::AssignMasterPageToPageList ( - SdPage* pMasterPage, - const std::shared_ptr >& rpPageList) -{ - sal_uInt16 nSelectedItemId = mxPreviewValueSet->GetSelectedItemId(); - - MasterPagesSelector::AssignMasterPageToPageList(pMasterPage, rpPageList); - - // Restore the selection. - if (mxPreviewValueSet->GetItemCount() > 0) - { - if (mxPreviewValueSet->GetItemCount() >= nSelectedItemId) - mxPreviewValueSet->SelectItem(nSelectedItemId); - else - mxPreviewValueSet->SelectItem(mxPreviewValueSet->GetItemCount()); - } -} - } // end of namespace sd::sidebar /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/sidebar/RecentMasterPagesSelector.hxx b/sd/source/ui/sidebar/RecentMasterPagesSelector.hxx index 6dbc3a2aae07..bf35ca0adf3b 100644 --- a/sd/source/ui/sidebar/RecentMasterPagesSelector.hxx +++ b/sd/source/ui/sidebar/RecentMasterPagesSelector.hxx @@ -49,20 +49,6 @@ private: using sd::sidebar::MasterPagesSelector::Fill; - /** Forward this call to the base class but save and restore the - currently selected item. - Assign the given master page to the list of pages. - @param pMasterPage - This master page will usually be a member of the list of all - available master pages as provided by the MasterPageContainer. - @param rPageList - The pages to which to assign the master page. These pages may - be slides or master pages themselves. - */ - virtual void AssignMasterPageToPageList ( - SdPage* pMasterPage, - const std::shared_ptr >& rpPageList) override; - virtual void LateInit() override; }; diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 436a0c91211a..12953834614c 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -4376,7 +4376,15 @@ OString SdXImpressDocument::getPresentationInfo() const SdGenericDrawPage* pSlide(xDrawPages->getDrawPageByIndex(i)); bool bIsVisible = true; // default visible pSlide->getPropertyValue("Visible") >>= bIsVisible; - if (bIsVisible) + if (!bIsVisible) + { + auto aSlideNode = aJsonWriter.startStruct(); + std::string sSlideHash = GetInterfaceHash(cppu::getXWeak(pSlide)); + aJsonWriter.put("hash", sSlideHash); + aJsonWriter.put("index", i); + aJsonWriter.put("hidden", true); + } + else { SdrPage* pPage = pSlide->GetSdrPage(); diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index e062b79259f3..467c3fba4bc9 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -44,6 +44,8 @@ #include #include #include +#include +#include #include #include #include @@ -75,6 +77,20 @@ namespace sd { namespace { + void lcl_AdjustPageSize(Size& rPageSize, const Size& rPrintPageSize) + { + bool bOrientationDiff = (rPageSize.Width() < rPageSize.Height() + && rPrintPageSize.Width() > rPrintPageSize.Height()) + || (rPageSize.Width() > rPageSize.Height() + && rPrintPageSize.Width() < rPrintPageSize.Height()); + if (bOrientationDiff) + { + ::tools::Long nTmp = rPageSize.Width(); + rPageSize.setWidth(rPageSize.Height()); + rPageSize.setHeight(nTmp); + } + } + /** Convenience class to extract values from the sequence of properties given to one of the XRenderable methods. */ @@ -781,6 +797,279 @@ namespace { const sal_uInt16 mnPageIndex; }; + /** The NotesPrinterPage is used for printing notes pages onto one or more printer pages + */ + class NotesPrinterPage : public PrinterPage + { + public: + NotesPrinterPage( + const sal_uInt16 nPageIndex, + const sal_Int32 nPageNumb, + const sal_Int32 nPageCount, + const bool bScaled, + const PageKind ePageKind, + const MapMode& rMapMode, + const bool bPrintMarkedOnly, + const OUString& rsPageString, + const Point& rPageStringOffset, + const DrawModeFlags nDrawMode, + const Orientation eOrientation, + const sal_uInt16 nPaperTray) + : PrinterPage(ePageKind, rMapMode, bPrintMarkedOnly, rsPageString, rPageStringOffset, + nDrawMode, eOrientation, nPaperTray), + mnPageIndex(nPageIndex), + mnPageNumb(nPageNumb), + mnPageCount(nPageCount), + mbScaled(bScaled) + { + } + + virtual void Print( + Printer& rPrinter, + SdDrawDocument& rDocument, + ViewShell&, + View* pView, + DrawView& rPrintView, + const SdrLayerIDSet& rVisibleLayers, + const SdrLayerIDSet& rPrintableLayers) const override + { + SdPage* pPageToPrint = rDocument.GetSdPage(mnPageIndex, mePageKind); + rPrinter.SetMapMode(maMap); + + // Clone the current page to create an independent instance for modifications. + // This ensures that changes made to pNotesPage do not affect the original page. + rtl::Reference pNotesPage + = static_cast(pPageToPrint->CloneSdrPage(rDocument).get()); + + Size aPageSize; + if (mbScaled) + { + aPageSize = pNotesPage->GetSize(); + lcl_AdjustPageSize(aPageSize, rPrinter.GetPrintPageSize()); + } + else + aPageSize = rPrinter.GetPrintPageSize(); + + // Adjusts the objects on the notes page to fit the new page size. + ::tools::Rectangle aNewBorderRect(-1, -1, -1, -1); + pNotesPage->ScaleObjects(aPageSize, aNewBorderRect, true); + + SdrObject* pNotesObj = pNotesPage->GetPresObj(PresObjKind::Notes); + if (pNotesObj) + { + // new page(s) margins + sal_Int32 nLeft = 2000; + sal_Int32 nRight = 2000; + sal_Int32 nTop = 2250; + sal_Int32 nBottom = 2250; + + double nRatioX = aPageSize.Width() / 21000.0; + double nRatioY = aPageSize.Height() / 29700.0; + + nLeft *= nRatioX; + nRight *= nRatioX; + nTop *= nRatioY; + nBottom *= nRatioY; + + Point aNotesPt = pNotesObj->GetRelativePos(); + Size aNotesSize = pNotesObj->GetLogicRect().GetSize(); + + Outliner* pOut = rDocument.GetInternalOutliner(); + const OutlinerMode nSaveOutlMode(pOut->GetOutlinerMode()); + const bool bSavedUpdateMode(pOut->IsUpdateLayout()); + pOut->SetPaperSize(aNotesSize); + pOut->SetUpdateLayout(true); + pOut->Clear(); + pOut->SetText(*pNotesObj->GetOutlinerParaObject()); + + bool bAutoGrow = pNotesObj->GetMergedItem(SDRATTR_TEXT_AUTOGROWHEIGHT).GetValue(); + + // If AutoGrowHeight property is enabled and the notes page has a lower border, + // use the lower border but if there is no lower border, use the bottom margin + // to determine the first page break position. + // If AutoGrow is not enabled, the notes object defines the first page break. + ::tools::Long nNotesPageBottom + = bAutoGrow ? (pNotesPage->GetLowerBorder() != 0) + ? aPageSize.Height() - pNotesPage->GetLowerBorder() + : aPageSize.Height() - nBottom + : aNotesPt.Y() + aNotesSize.Height(); + if (mbScaled) + { + sal_Int32 nTextHeight = aNotesPt.Y() + pOut->GetTextHeight(); + if (bAutoGrow && (nTextHeight > nNotesPageBottom)) + { + pNotesObj->SetMergedItem(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, false)); + + ::tools::Long nObjW = aNotesSize.Width(); + ::tools::Long nObjH = aPageSize.Height() - aNotesPt.Y() - nBottom; + + pNotesObj->SetLogicRect(::tools::Rectangle(aNotesPt, Size(nObjW, nObjH))); + } + SdrTextFitToSizeTypeItem eFitToSize = drawing::TextFitToSizeType_AUTOFIT; + pNotesObj->SetMergedItem(eFitToSize); + } + else // original size + { + bool bExit = false; + sal_Int32 nPrevLineLen = 0; + sal_Int32 nPrevParaIdx = 0; + sal_uInt16 nActualPageNumb = 1; + ::tools::Long nCurrentPosY = aNotesPt.Y(); + sal_Int32 nParaCount = pOut->GetParagraphCount(); + std::vector> aPageBreaks; + + for (sal_Int32 i = 0; i < nParaCount && !bExit; ++i) + { + sal_Int32 nActualLineLen = 0; + sal_uInt32 nLineCount = pOut->GetLineCount(i); + for (sal_uInt32 j = 0; j < nLineCount; ++j) + { + nActualLineLen += pOut->GetLineLen(i, j); + sal_Int32 nLineHeight = pOut->GetLineHeight(i, j); + sal_Int32 nNextPosY = nCurrentPosY + nLineHeight; + + if (nNextPosY > nNotesPageBottom) + { + // If the current or the next page matches the print page + // calculate and add a page break, since we only want to add + // a page break if the page is relevant. + if (mnPageNumb == nActualPageNumb + || mnPageNumb == nActualPageNumb + 1) + { + if (!aPageBreaks.empty()) + { + // determine the page break at the bottom of the page + // for pages that have both a previous and a following page + aPageBreaks.emplace_back( + nPrevParaIdx - aPageBreaks[0].first, nPrevLineLen); + } + else + { + if (mnPageNumb == 1 || (nLineCount > 1 && j != 0)) + { + // first page or multi-line paragraphs + aPageBreaks.emplace_back(nPrevParaIdx, nPrevLineLen); + } + else + { // single-line paragraphs + aPageBreaks.emplace_back(nPrevParaIdx + 1, 0); + } + } + + if (mnPageNumb == nActualPageNumb || mnPageNumb == mnPageCount) + { + bExit = true; + break; + } + } + nNotesPageBottom = aPageSize.Height() - nBottom; + nCurrentPosY = nTop; + nActualPageNumb++; + nActualLineLen = 0; + } + nPrevParaIdx = i; + nPrevLineLen = nActualLineLen; + nCurrentPosY += nLineHeight; + } + } + + if (!aPageBreaks.empty()) + { + ESelection aE; + if (mnPageNumb == 1) + { + aE.start.nPara = aPageBreaks[0].first; + aE.start.nIndex = aPageBreaks[0].second; + aE.end.nPara = pOut->GetParagraphCount() - 1; + aE.end.nIndex = pOut->GetText(pOut->GetParagraph(aE.end.nPara)).getLength(); + pOut->QuickDelete(aE); + } + else + { + sal_Int16 nDepth = pOut->GetDepth(aPageBreaks[0].first); + SfxItemSet aItemSet = pOut->GetParaAttribs(aPageBreaks[0].first); + + aE.start.nPara = 0; + aE.start.nIndex = 0; + aE.end.nPara = aPageBreaks[0].first; + aE.end.nIndex = aPageBreaks[0].second; + + if (aPageBreaks[0].second != 0) // Multi-line + { + pOut->QuickInsertLineBreak(ESelection(aE.end.nPara, aE.end.nIndex, + aE.end.nPara, aE.end.nIndex)); + nTop -= pOut->GetLineHeight(0,0); + } + pOut->QuickDelete(aE); + + Paragraph* pFirstPara = pOut->GetParagraph(0); + pOut->SetDepth(pFirstPara, nDepth); + pOut->SetParaAttribs(0, aItemSet); + + if (aPageBreaks.size() > 1) + { + aE.start.nPara = aPageBreaks[1].first; + aE.start.nIndex = aPageBreaks[1].second; + aE.end.nPara = pOut->GetParagraphCount() - 1; + aE.end.nIndex = pOut->GetText(pOut->GetParagraph(aE.end.nPara)).getLength(); + pOut->QuickDelete(aE); + } + } + } + pNotesObj->SetOutlinerParaObject(pOut->CreateParaObject()); + + Size aObjSize; + if (mnPageNumb != 1) // new page(s) + { + SdrObjListIter aShapeIter(pNotesPage.get()); + while (aShapeIter.IsMore()) + { + SdrObject* pObj = aShapeIter.Next(); + if (pObj && pObj->GetObjIdentifier() != SdrObjKind::Text) + pNotesPage->RemoveObject(pObj->GetOrdNum()); + } + + aNotesPt.setX(nLeft); + aNotesPt.setY(nTop); + ::tools::Long nWidth = aPageSize.Width() - nLeft - nRight; + aObjSize = Size(nWidth, pOut->GetTextHeight()); + } + else // first page + { + if (!bAutoGrow) + aObjSize = aNotesSize; + else + aObjSize = Size(aNotesSize.Width(), pOut->GetTextHeight()); + } + pNotesObj->SetLogicRect(::tools::Rectangle(aNotesPt, aObjSize)); + } + pOut->Clear(); + pOut->SetUpdateLayout(bSavedUpdateMode); + pOut->Init(nSaveOutlMode); + } + pNotesPage->SetSize(aPageSize); + + PrintPage( + rPrinter, + rPrintView, + *pNotesPage, + pView, + mbPrintMarkedOnly, + rVisibleLayers, + rPrintableLayers); + PrintMessage( + rPrinter, + msPageString, + maPageStringOffset); + } + + private: + const sal_uInt16 mnPageIndex; + const sal_Int32 mnPageNumb; + const sal_Int32 mnPageCount; + const bool mbScaled; + }; + /** Print one slide multiple times on a printer page so that the whole printer page is covered. */ @@ -1198,7 +1487,11 @@ public: : VclPtr< OutputDevice >(); mpPrinter = dynamic_cast(pOut.get()); Size aPageSizePixel = mpPrinter ? mpPrinter->GetPaperSizePixel() : Size(); - if( aPageSizePixel != maPrinterPageSizePixel ) + Size aPrintPageSize = mpPrinter ? mpPrinter->GetPrintPageSize() : Size(); + + lcl_AdjustPageSize(aPageSizePixel, aPrintPageSize); + + if (aPageSizePixel != maPrinterPageSizePixel) { bIsPaperChanged = true; maPrinterPageSizePixel = aPageSizePixel; @@ -1361,11 +1654,15 @@ private: { aPaperSize.setWidth(rInfo.mpPrinter->GetPaperSize().Width()); aPaperSize.setHeight(rInfo.mpPrinter->GetPaperSize().Height()); + + if (!mpOptions->IsBooklet()) + lcl_AdjustPageSize(aPaperSize, rInfo.mpPrinter->GetPrintPageSize()); } maPrintSize = awt::Size(aPaperSize.Width(), aPaperSize.Height()); - if (mpOptions->IsPrinterPreferred(pDocument->GetDocumentType())) + if (mpOptions->IsPrinterPreferred(pDocument->GetDocumentType()) + && ePageKind == PageKind::Standard && !mpOptions->IsBooklet()) { if( (rInfo.meOrientation == Orientation::Landscape && (aPaperSize.Width() < aPaperSize.Height())) @@ -1863,7 +2160,11 @@ private: if (pDocument->GetSdPageCount(ePageKind) == 0) return; SdPage* pRefPage = pDocument->GetSdPage(0, ePageKind); - rInfo.maPageSize = pRefPage->GetSize(); + + if (!mpOptions->IsPrinterPreferred(pDocument->GetDocumentType()) && mpOptions->IsNotes()) + rInfo.maPageSize = mpPrinter->GetPrintPageSize(); + else + rInfo.maPageSize = pRefPage->GetSize(); SetupPaperOrientation(ePageKind, rInfo); @@ -1898,19 +2199,22 @@ private: continue; MapMode aMap (rInfo.maMap); - // is it possible that the page size changed? - const Size aPageSize = pPage->GetSize(); + + Size aPageSize = pPage->GetSize(); if (mpOptions->IsPageSize()) { - const double fHorz (static_cast(rInfo.maPrintSize.Width()) / aPageSize.Width()); - const double fVert (static_cast(rInfo.maPrintSize.Height()) / aPageSize.Height()); + Size aPrintSize = rInfo.maPrintSize; + lcl_AdjustPageSize(aPageSize, aPrintSize); + + const double fHorz(static_cast(aPrintSize.Width()) / aPageSize.Width()); + const double fVert(static_cast(aPrintSize.Height()) / aPageSize.Height()); Fraction aFract; if (fHorz < fVert) - aFract = Fraction(rInfo.maPrintSize.Width(), aPageSize.Width()); + aFract = Fraction(aPrintSize.Width(), aPageSize.Width()); else - aFract = Fraction(rInfo.maPrintSize.Height(), aPageSize.Height()); + aFract = Fraction(aPrintSize.Height(), aPageSize.Height()); aMap.SetScaleX(aFract); aMap.SetScaleY(aFract); @@ -2136,17 +2440,138 @@ private: // if CutPage is set then do not move it, otherwise move the // scaled page to printable area - maPrinterPages.push_back( - std::make_shared( - sal::static_int_cast(nPageIndex), - ePageKind, - aMap, - rInfo.mbPrintMarkedOnly, - rInfo.msPageString, - aPageOffset, - rInfo.mnDrawMode, - rInfo.meOrientation, - nPaperBin)); + if (ePageKind == PageKind::Standard) + { + maPrinterPages.push_back( + std::make_shared( + sal::static_int_cast(nPageIndex), + ePageKind, + aMap, + rInfo.mbPrintMarkedOnly, + rInfo.msPageString, + aPageOffset, + rInfo.mnDrawMode, + rInfo.meOrientation, + nPaperBin)); + } + else // Notes + { + SdPage* pPage = GetFilteredPage(nPageIndex, PageKind::Notes); + SdDrawDocument* pDocument = mrBase.GetMainViewShell()->GetDoc(); + + // Clone the current page to create an independent instance. + // This ensures that changes made to pNotesPage do not affect the original page. + rtl::Reference pNotesPage + = static_cast(pPage->CloneSdrPage(*pDocument).get()); + + Size aPageSize = bScalePage ? pNotesPage->GetSize() : rInfo.mpPrinter->GetPrintPageSize(); + // Adjusts the objects on the notes page to fit the new page size. + ::tools::Rectangle aNewBorderRect(-1, -1, -1, -1); + pNotesPage->ScaleObjects(aPageSize, aNewBorderRect, true); + + SdrObject* pNotesObj = pNotesPage->GetPresObj(PresObjKind::Notes); + if (pNotesObj && bCutPage) + { + // default margins + sal_Int32 nTopMargin = 2250, nBottomMargin = 2250; + double nRatioY = aPageSize.Height() / 29700.0; + nTopMargin *= nRatioY; + nBottomMargin *= nRatioY; + + Size nNotesObjSize = pNotesObj->GetLogicRect().GetSize(); + + Outliner* pOut = pDocument->GetInternalOutliner(); + const OutlinerMode nSaveOutlMode(pOut->GetOutlinerMode()); + const bool bSavedUpdateMode(pOut->IsUpdateLayout()); + pOut->Init(OutlinerMode::OutlineView); + pOut->SetPaperSize(nNotesObjSize); + pOut->SetUpdateLayout(true); + pOut->Clear(); + pOut->SetText(*pNotesObj->GetOutlinerParaObject()); + + sal_Int32 nFirstPageBottomMargin = 0; + ::tools::Long nNotesHeight = nNotesObjSize.Height(); + bool bAutoGrow = pNotesObj->GetMergedItem(SDRATTR_TEXT_AUTOGROWHEIGHT).GetValue(); + if (bAutoGrow) + { + nNotesHeight += pNotesObj->GetRelativePos().Y(); + nFirstPageBottomMargin = (pNotesPage->GetLowerBorder() != 0) + ? pNotesPage->GetLowerBorder() + : nBottomMargin; + } + double nOverflowedTextHeight = 0; + ::tools::Long nFirstPageBottom = aPageSize.Height() - nFirstPageBottomMargin; + if (nNotesHeight > nFirstPageBottom) + { + // Calculate the height of the overflow text + // when the AutoGrowHeight property of the notes object is enabled + // and the height of the object exceeds the page height. + nOverflowedTextHeight = pNotesObj->GetRelativePos().Y() + + pOut->GetTextHeight() - nFirstPageBottom; + } + else + nOverflowedTextHeight = pOut->GetTextHeight() - nNotesObjSize.Height(); + + sal_Int32 nNotePageCount = 1; + double nNewPageHeight = aPageSize.Height() - nTopMargin - nBottomMargin; + if (nOverflowedTextHeight > 0) + { + nNotePageCount += std::ceil(nOverflowedTextHeight / nNewPageHeight); + } + + for (sal_Int32 i = 1; i <= nNotePageCount; i++) + { + // set page numbers + sal_Int32 nPageNumb = i; + OUString sPageNumb = rInfo.msPageString; + if (!sPageNumb.isEmpty() && nNotePageCount > 1) + { + OUString sTmp; + if (!rInfo.msTimeDate.isEmpty()) + { + sTmp += " "; + } + sTmp += SdResId(STR_PAGE_NAME) + " " + OUString::number(i); + sPageNumb += sTmp; + } + + maPrinterPages.push_back( + std::make_shared( + sal::static_int_cast(nPageIndex), + nPageNumb, + nNotePageCount, + bScalePage, + PageKind::Notes, + aMap, + rInfo.mbPrintMarkedOnly, + sPageNumb, + aPageOffset, + rInfo.mnDrawMode, + rInfo.meOrientation, + nPaperBin)); + } + pOut->Clear(); + pOut->SetUpdateLayout(bSavedUpdateMode); + pOut->Init(nSaveOutlMode); + } + else // scaled page + { + maPrinterPages.push_back( + std::make_shared( + sal::static_int_cast(nPageIndex), + sal_Int32(0), + sal_Int32(0), + bScalePage, + PageKind::Notes, + aMap, + rInfo.mbPrintMarkedOnly, + rInfo.msPageString, + aPageOffset, + rInfo.mnDrawMode, + rInfo.meOrientation, + nPaperBin)); + } + } } else { diff --git a/sd/source/ui/view/ViewShellManager.cxx b/sd/source/ui/view/ViewShellManager.cxx index 7f150b3d4f1c..a82a1be2dc82 100644 --- a/sd/source/ui/view/ViewShellManager.cxx +++ b/sd/source/ui/view/ViewShellManager.cxx @@ -108,8 +108,10 @@ public: ViewShell* pViewShell); void DeactivateViewShell (const ViewShell& rShell); void ActivateShell (SfxShell& rShell); + void ActivateLowPriorityShell (SfxShell& rShell); void DeactivateShell (const SfxShell& rShell); void ActivateShell (const ShellDescriptor& rDescriptor); + void ActivateLowPriorityShell (const ShellDescriptor& rDescriptor); void SetFormShell (const ViewShell* pViewShell, FmFormShell* pFormShell, bool bAbove); void ActivateSubShell (const SfxShell& rParentShell, ShellId nId); void DeactivateSubShell (const SfxShell& rParentShell, ShellId nId); @@ -317,6 +319,12 @@ void ViewShellManager::ActivateShell (SfxShell* pShell) mpImpl->ActivateShell(*pShell); } +void ViewShellManager::ActivateLowPriorityShell (SfxShell* pShell) +{ + if (mbValid && pShell!=nullptr) + mpImpl->ActivateLowPriorityShell(*pShell); +} + void ViewShellManager::DeactivateShell (const SfxShell* pShell) { if (mbValid && pShell!=nullptr) @@ -498,6 +506,17 @@ void ViewShellManager::Implementation::ActivateShell (SfxShell& rShell) ActivateShell(aDescriptor); } +void ViewShellManager::Implementation::ActivateLowPriorityShell (SfxShell& rShell) +{ + ::osl::MutexGuard aGuard (maMutex); + + // Create a new shell or recycle on in the cache. + ShellDescriptor aDescriptor; + aDescriptor.mpShell = &rShell; + + ActivateLowPriorityShell(aDescriptor); +} + void ViewShellManager::Implementation::ActivateShell (const ShellDescriptor& rDescriptor) { // Put shell on top of the active view shells. @@ -507,6 +526,15 @@ void ViewShellManager::Implementation::ActivateShell (const ShellDescriptor& rDe } } +void ViewShellManager::Implementation::ActivateLowPriorityShell (const ShellDescriptor& rDescriptor) +{ + // Put shell on bottom of the active view shells. + if (rDescriptor.mpShell != nullptr) + { + maActiveViewShells.push_back( rDescriptor ); + } +} + void ViewShellManager::Implementation::DeactivateShell (const SfxShell& rShell) { ::osl::MutexGuard aGuard (maMutex); diff --git a/sd/uiconfig/simpress/ui/masterpagepanel.ui b/sd/uiconfig/simpress/ui/masterpagepanel.ui index 429032ed2148..666d30ffacb5 100644 --- a/sd/uiconfig/simpress/ui/masterpagepanel.ui +++ b/sd/uiconfig/simpress/ui/masterpagepanel.ui @@ -3,22 +3,51 @@ - + + + + + + + + + True False - True True + vertical - + True True - GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_STRUCTURE_MASK True True + never + in + + + True + 2 + True + True + True + liststore1 + 0 + 55 + 6 + True + + + Currently selected master slide. + + + + - 0 - 0 + False + True + 0 diff --git a/sd/uiconfig/simpress/ui/masterpagepanelall.ui b/sd/uiconfig/simpress/ui/masterpagepanelall.ui index 979d06990e9e..078c4b7bec09 100644 --- a/sd/uiconfig/simpress/ui/masterpagepanelall.ui +++ b/sd/uiconfig/simpress/ui/masterpagepanelall.ui @@ -3,22 +3,51 @@ - + + + + + + + + + True False - True True + vertical - + True True - GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_STRUCTURE_MASK True True + never + in + + + 2 + True + True + True + True + liststore1 + 0 + True + 55 + 6 + + + Select master slide from available. + + + + - 0 - 0 + False + True + 0 diff --git a/sd/uiconfig/simpress/ui/masterpagepanelrecent.ui b/sd/uiconfig/simpress/ui/masterpagepanelrecent.ui index 4ec8487cfc5c..9be8d5a3ec9e 100644 --- a/sd/uiconfig/simpress/ui/masterpagepanelrecent.ui +++ b/sd/uiconfig/simpress/ui/masterpagepanelrecent.ui @@ -3,22 +3,51 @@ - + + + + + + + + + True False - True True + vertical - + True True - GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_STRUCTURE_MASK True True + never + in + + + 2 + True + True + True + True + liststore1 + 0 + 55 + 6 + True + + + Select recenty used master slide. + + + + - 0 - 0 + False + True + 0 diff --git a/sdext/source/pdfimport/tree/pdfiprocessor.cxx b/sdext/source/pdfimport/tree/pdfiprocessor.cxx index 02efb2f9e3ff..d81967b5e9be 100644 --- a/sdext/source/pdfimport/tree/pdfiprocessor.cxx +++ b/sdext/source/pdfimport/tree/pdfiprocessor.cxx @@ -452,8 +452,15 @@ void PDFIProcessor::tilingPatternFill(int nX0, int nY0, int nX1, int nY1, void PDFIProcessor::strokePath( const uno::Reference< rendering::XPolyPolygon2D >& rPath ) { basegfx::B2DPolyPolygon aPoly=basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(rPath); + basegfx::B2DPolyPolygon aCurClip = getCurrentContext().Clip; aPoly.transform(getCurrentContext().Transformation); + if( aCurClip.count() ) { + aPoly = basegfx::utils::clipPolyPolygonOnPolyPolygon( aPoly, aCurClip, + true, /* bInside, keep parts inside the clip */ + true /* bStroke, stroked */ ); + } + PolyPolyElement* pPoly = ElementFactory::createPolyPolyElement( m_pCurElement, getGCId(getCurrentContext()), diff --git a/sfx2/qa/cppunit/view.cxx b/sfx2/qa/cppunit/view.cxx index d2c81d6e9a6e..8c5be5920a07 100644 --- a/sfx2/qa/cppunit/view.cxx +++ b/sfx2/qa/cppunit/view.cxx @@ -132,8 +132,14 @@ CPPUNIT_TEST_FIXTURE(Sfx2ViewTest, testLokHelperCommandValuesSignature) std::stringstream aStream{ std::string(aJson) }; boost::property_tree::ptree aTree; boost::property_tree::read_json(aStream, aTree); + auto it = aTree.find("commandName"); + CPPUNIT_ASSERT(it != aTree.not_found()); + CPPUNIT_ASSERT_EQUAL(std::string(".uno:Signature"), it->second.get_value()); + it = aTree.find("commandValues"); + CPPUNIT_ASSERT(it != aTree.not_found()); + aTree = it->second; // Non-zero timestamp: - auto it = aTree.find("signatureTime"); + it = aTree.find("signatureTime"); CPPUNIT_ASSERT(it != aTree.not_found()); auto nSignatureTime = it->second.get_value(); CPPUNIT_ASSERT(nSignatureTime != 0); @@ -157,7 +163,10 @@ OUString GetSignatureHash() std::stringstream aStream{ std::string(aJson) }; boost::property_tree::ptree aTree; boost::property_tree::read_json(aStream, aTree); - auto it = aTree.find("digest"); + auto it = aTree.find("commandValues"); + CPPUNIT_ASSERT(it != aTree.not_found()); + aTree = it->second; + it = aTree.find("digest"); CPPUNIT_ASSERT(it != aTree.not_found()); return OUString::fromUtf8(it->second.get_value()); } diff --git a/sfx2/source/control/minfitem.cxx b/sfx2/source/control/minfitem.cxx index 7b5b2d62bc2a..765eada62029 100644 --- a/sfx2/source/control/minfitem.cxx +++ b/sfx2/source/control/minfitem.cxx @@ -63,16 +63,6 @@ SfxMacroInfoItem* SfxMacroInfoItem::Clone( SfxItemPool *) const return new SfxMacroInfoItem(*this); } -OUString SfxMacroInfoItem::GetQualifiedName() const -{ - OUString aMacroName = aLibName + - "." + - aModuleName + - "." + - aMethodName; - return aMacroName; -} - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/statbar/stbitem.cxx b/sfx2/source/statbar/stbitem.cxx index c195af87bb41..049f810a27f3 100644 --- a/sfx2/source/statbar/stbitem.cxx +++ b/sfx2/source/statbar/stbitem.cxx @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -330,7 +331,7 @@ void SAL_CALL SfxStatusBarControl::paint( OutputDevice* pOutDev = VCLUnoHelper::GetOutputDevice( xGraphics ); if ( pOutDev ) { - ::tools::Rectangle aRect = VCLUnoHelper::ConvertToVCLRect(rOutputRectangle); + ::tools::Rectangle aRect = vcl::unohelper::ConvertToVCLRect(rOutputRectangle); UserDrawEvent aUserDrawEvent(pOutDev, aRect, pBar->GetCurItemId()); Paint( aUserDrawEvent ); } diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx index 6ad66b0c9ed2..2215e17469e1 100644 --- a/sfx2/source/view/ipclient.cxx +++ b/sfx2/source/view/ipclient.cxx @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -457,7 +458,7 @@ awt::Rectangle SAL_CALL SfxInPlaceClient_Impl::getPlacement() aRealObjArea = pEditWin->LogicToPixel(aRealObjArea); } - return VCLUnoHelper::ConvertToAWTRect(aRealObjArea); + return vcl::unohelper::ConvertToAWTRect(aRealObjArea); } @@ -487,7 +488,7 @@ awt::Rectangle SAL_CALL SfxInPlaceClient_Impl::getClipRectangle() aRealObjArea = pEditWin->LogicToPixel(aRealObjArea); } - return VCLUnoHelper::ConvertToAWTRect(aRealObjArea); + return vcl::unohelper::ConvertToAWTRect(aRealObjArea); } @@ -515,8 +516,8 @@ void SAL_CALL SfxInPlaceClient_Impl::changedPlacement( const awt::Rectangle& aPo // check if the change is at least one pixel in size awt::Rectangle aOldRect = getPlacement(); - tools::Rectangle aNewPixelRect = VCLUnoHelper::ConvertToVCLRect(aPosRect); - tools::Rectangle aOldPixelRect = VCLUnoHelper::ConvertToVCLRect(aOldRect); + tools::Rectangle aNewPixelRect = vcl::unohelper::ConvertToVCLRect(aPosRect); + tools::Rectangle aOldPixelRect = vcl::unohelper::ConvertToVCLRect(aOldRect); if ( aOldPixelRect == aNewPixelRect ) // nothing has changed return; diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 19891df77ce4..5eec80fba576 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -1030,7 +1030,7 @@ std::map SfxLokHelper::parseCommandParameters(std::u16string void SfxLokHelper::getCommandValues(tools::JsonWriter& rJsonWriter, std::string_view rCommand) { - static constexpr OStringLiteral aSignature(".uno:Signature"); + static constexpr OString aSignature(".uno:Signature"_ostr); if (!o3tl::starts_with(rCommand, aSignature)) { return; @@ -1052,6 +1052,9 @@ void SfxLokHelper::getCommandValues(tools::JsonWriter& rJsonWriter, std::string_ aSigningContext.m_nSignatureTime = it->second.toInt64(); } pObjectShell->SignDocumentContentUsingCertificate(aSigningContext); + // Set commandName, this is a reply to a request. + rJsonWriter.put("commandName", aSignature); + auto aCommandValues = rJsonWriter.startNode("commandValues"); rJsonWriter.put("signatureTime", aSigningContext.m_nSignatureTime); uno::Sequence aDigest(reinterpret_cast(aSigningContext.m_aDigest.data()), diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 30718d1d42e7..c4a255e7722f 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -66,6 +66,7 @@ #include #include #include +#include #include #include @@ -830,9 +831,9 @@ awt::Rectangle SAL_CALL SfxBaseController::queryBorderedArea( const awt::Rectang SolarMutexGuard aGuard; if ( m_pData->m_pViewShell ) { - tools::Rectangle aTmpRect = VCLUnoHelper::ConvertToVCLRect(aPreliminaryRectangle); + tools::Rectangle aTmpRect = vcl::unohelper::ConvertToVCLRect(aPreliminaryRectangle); m_pData->m_pViewShell->QueryObjAreaPixel( aTmpRect ); - return VCLUnoHelper::ConvertToAWTRect(aTmpRect); + return vcl::unohelper::ConvertToAWTRect(aTmpRect); } return aPreliminaryRectangle; diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist index cf05e4de8eb8..74614d7f5a58 100644 --- a/solenv/clang-format/excludelist +++ b/solenv/clang-format/excludelist @@ -46,9 +46,6 @@ accessibility/inc/extended/accessibletablistboxtable.hxx accessibility/inc/extended/textwindowaccessibility.hxx accessibility/inc/helper/IComboListBoxHelper.hxx accessibility/inc/helper/listboxhelper.hxx -accessibility/inc/standard/accessiblemenubasecomponent.hxx -accessibility/inc/standard/accessiblemenucomponent.hxx -accessibility/inc/standard/accessiblemenuitemcomponent.hxx accessibility/inc/standard/vclxaccessiblebox.hxx accessibility/inc/standard/vclxaccessiblebutton.hxx accessibility/inc/standard/vclxaccessiblecheckbox.hxx @@ -56,9 +53,6 @@ accessibility/inc/standard/vclxaccessibleedit.hxx accessibility/inc/standard/vclxaccessibleheaderbaritem.hxx accessibility/inc/standard/vclxaccessiblelist.hxx accessibility/inc/standard/vclxaccessiblelistitem.hxx -accessibility/inc/standard/vclxaccessiblemenu.hxx -accessibility/inc/standard/vclxaccessiblemenubar.hxx -accessibility/inc/standard/vclxaccessiblemenuitem.hxx accessibility/inc/standard/vclxaccessibleradiobutton.hxx accessibility/inc/standard/vclxaccessiblescrollbar.hxx accessibility/inc/standard/vclxaccessiblestatusbar.hxx @@ -70,7 +64,6 @@ accessibility/inc/standard/vclxaccessibletextcomponent.hxx accessibility/inc/standard/vclxaccessibletextfield.hxx accessibility/inc/standard/vclxaccessibletoolbox.hxx accessibility/inc/standard/vclxaccessibletoolboxitem.hxx -accessibility/inc/strings.hxx accessibility/source/extended/AccessibleBrowseBox.cxx accessibility/source/extended/AccessibleBrowseBoxBase.cxx accessibility/source/extended/AccessibleBrowseBoxCheckBoxCell.cxx @@ -100,10 +93,6 @@ accessibility/source/extended/accessibletablistbox.cxx accessibility/source/extended/accessibletablistboxtable.cxx accessibility/source/extended/textwindowaccessibility.cxx accessibility/source/helper/acc_factory.cxx -accessibility/source/helper/characterattributeshelper.cxx -accessibility/source/standard/accessiblemenubasecomponent.cxx -accessibility/source/standard/accessiblemenucomponent.cxx -accessibility/source/standard/accessiblemenuitemcomponent.cxx accessibility/source/standard/floatingwindowaccessible.cxx accessibility/source/standard/vclxaccessiblebox.cxx accessibility/source/standard/vclxaccessiblebutton.cxx @@ -116,10 +105,6 @@ accessibility/source/standard/vclxaccessibleheaderbaritem.cxx accessibility/source/standard/vclxaccessiblelist.cxx accessibility/source/standard/vclxaccessiblelistbox.cxx accessibility/source/standard/vclxaccessiblelistitem.cxx -accessibility/source/standard/vclxaccessiblemenu.cxx -accessibility/source/standard/vclxaccessiblemenubar.cxx -accessibility/source/standard/vclxaccessiblemenuitem.cxx -accessibility/source/standard/vclxaccessiblepopupmenu.cxx accessibility/source/standard/vclxaccessibleradiobutton.cxx accessibility/source/standard/vclxaccessiblescrollbar.cxx accessibility/source/standard/vclxaccessiblestatusbar.cxx @@ -9874,7 +9859,6 @@ sd/source/ui/sidebar/NavigatorWrapper.hxx sd/source/ui/sidebar/PageMarginUtils.hxx sd/source/ui/sidebar/PanelFactory.cxx sd/source/ui/sidebar/PanelFactory.hxx -sd/source/ui/sidebar/PreviewValueSet.cxx sd/source/ui/sidebar/RecentMasterPagesSelector.cxx sd/source/ui/sidebar/RecentMasterPagesSelector.hxx sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx @@ -14176,6 +14160,12 @@ vcl/inc/IPrioritable.hxx vcl/inc/ResampleKernel.hxx vcl/inc/bitmap/bmpfast.hxx vcl/inc/accel.hxx +vcl/inc/accessibility/accessiblemenubasecomponent.hxx +vcl/inc/accessibility/accessiblemenucomponent.hxx +vcl/inc/accessibility/accessiblemenuitemcomponent.hxx +vcl/inc/accessibility/vclxaccessiblemenu.hxx +vcl/inc/accessibility/vclxaccessiblemenubar.hxx +vcl/inc/accessibility/vclxaccessiblemenuitem.hxx vcl/inc/accmgr.hxx vcl/inc/animate/AnimationRenderer.hxx vcl/inc/brdwin.hxx @@ -14524,6 +14514,14 @@ vcl/quartz/salgdi.cxx vcl/quartz/salgdicommon.cxx vcl/quartz/salvd.cxx vcl/quartz/utils.cxx +vcl/source/accessibility/characterattributeshelper.cxx +vcl/source/accessibility/accessiblemenubasecomponent.cxx +vcl/source/accessibility/accessiblemenucomponent.cxx +vcl/source/accessibility/accessiblemenuitemcomponent.cxx +vcl/source/accessibility/vclxaccessiblemenu.cxx +vcl/source/accessibility/vclxaccessiblemenubar.cxx +vcl/source/accessibility/vclxaccessiblemenuitem.cxx +vcl/source/accessibility/vclxaccessiblepopupmenu.cxx vcl/source/animate/AnimationRenderer.cxx vcl/source/app/IconThemeInfo.cxx vcl/source/app/IconThemeScanner.cxx diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx index d84a11e52ceb..7a32c0be86fe 100644 --- a/starmath/source/mathtype.cxx +++ b/starmath/source/mathtype.cxx @@ -3120,6 +3120,7 @@ void MathType::HandleMath(SmNode *pNode) void MathType::HandleAttributes(SmNode *pNode,int nLevel) { + sal_uInt64 nOldInsertion = nInsertion; int nOldPending = 0; SmNode *pTemp = nullptr; SmTextNode *pIsText = nullptr; @@ -3193,8 +3194,7 @@ void MathType::HandleAttributes(SmNode *pNode,int nLevel) if ((nInsertion != 0) && nullptr != (pTemp = pNode->GetSubNode(0))) { auto nPos = pS->Tell(); - nInsertion--; - pS->Seek(nInsertion); + pS->Seek(nInsertion - 1); switch(pTemp->GetToken().eType) { case TACUTE: //Not Exportable @@ -3247,6 +3247,7 @@ void MathType::HandleAttributes(SmNode *pNode,int nLevel) pS->Seek(nPos); } } + nInsertion = nOldInsertion; } void MathType::HandleText(SmNode *pNode) diff --git a/store/source/lockbyte.cxx b/store/source/lockbyte.cxx index a786488ad7f6..a907c0f8ddc3 100644 --- a/store/source/lockbyte.cxx +++ b/store/source/lockbyte.cxx @@ -36,7 +36,11 @@ using namespace store; storeError ILockBytes::initialize (rtl::Reference< PageData::Allocator > & rxAllocator, sal_uInt16 nPageSize) { - OSL_PRECOND((STORE_MINIMUM_PAGESIZE <= nPageSize) && (nPageSize <= STORE_MAXIMUM_PAGESIZE), "invalid PageSize"); + if (nPageSize < STORE_MINIMUM_PAGESIZE || nPageSize > STORE_MAXIMUM_PAGESIZE) + { + SAL_WARN("store", "invalid PageSize"); + return store_E_InvalidParameter; + } return initialize_Impl (rxAllocator, nPageSize); } diff --git a/store/source/storcach.cxx b/store/source/storcach.cxx index 82b5dcea9ef9..5907cfc730e7 100644 --- a/store/source/storcach.cxx +++ b/store/source/storcach.cxx @@ -127,8 +127,8 @@ static constexpr int highbit(std::size_t n) { int k = 1; - if (n == 0) - return 0; + assert(n > 0 && "can never be called with n == 0"); + if constexpr (sizeof(n) == 8) { if (n & 0xffffffff00000000) diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index 9e3a7bc277a7..13cdcb3ca53b 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -2564,6 +2564,20 @@ bool ImpSvNumberInputScan::ScanStartString( const OUString& rString ) } +static bool lcl_isBlanks( const OUString& rStr ) +{ + if (rStr.isEmpty()) + return false; + + for (sal_Int32 i = rStr.getLength(); i-- > 0; ) + { + if (rStr[i] != ' ') + return false; + } + return true; +} + + /** * Analyze string in the middle * All gone => true @@ -2665,8 +2679,9 @@ bool ImpSvNumberInputScan::ScanMidString( const OUString& rString, sal_uInt16 nS (nNumericsCnt == 3 && // or 3 numbers (nStringPos == 3 || // and 4th string particle (nStringPos == 4 && nSign)) && // or 5th if signed - sStrArray[nStringPos-2].indexOf('/') == -1))) // and not 23/11/1999 - // that was not accepted as date yet + lcl_isBlanks(sStrArray[nStringPos-2])))) // and not 23/11/1999 + // that was not accepted as date yet, + // nor anything else than blanks after integer. { SkipBlanks(rString, nPos); if (nPos == rString.getLength()) diff --git a/svtools/source/control/accessibleruler.cxx b/svtools/source/control/accessibleruler.cxx index c188895444f3..75df0c84c086 100644 --- a/svtools/source/control/accessibleruler.cxx +++ b/svtools/source/control/accessibleruler.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -70,9 +71,9 @@ uno::Reference< XAccessibleContext > SAL_CALL SvtRulerAccessible::getAccessibleC sal_Bool SAL_CALL SvtRulerAccessible::containsPoint( const awt::Point& rPoint ) { // no guard -> done in getBounds() -// return GetBoundingBox().IsInside( VCLUnoHelper::ConvertToVCLPoint( rPoint ) ); +// return GetBoundingBox().IsInside( vcl::unohelper::ConvertToVCLPoint( rPoint ) ); return tools::Rectangle(Point(0, 0), GetBoundingBox().GetSize()) - .Contains(VCLUnoHelper::ConvertToVCLPoint(rPoint)); + .Contains(vcl::unohelper::ConvertToVCLPoint(rPoint)); } uno::Reference< XAccessible > SAL_CALL SvtRulerAccessible::getAccessibleAtPoint( const awt::Point& ) @@ -86,25 +87,25 @@ uno::Reference< XAccessible > SAL_CALL SvtRulerAccessible::getAccessibleAtPoint( awt::Rectangle SAL_CALL SvtRulerAccessible::getBounds() { // no guard -> done in GetBoundingBox() - return VCLUnoHelper::ConvertToAWTRect(GetBoundingBox()); + return vcl::unohelper::ConvertToAWTRect(GetBoundingBox()); } awt::Point SAL_CALL SvtRulerAccessible::getLocation() { // no guard -> done in GetBoundingBox() - return VCLUnoHelper::ConvertToAWTPoint(GetBoundingBox().TopLeft()); + return vcl::unohelper::ConvertToAWTPoint(GetBoundingBox().TopLeft()); } awt::Point SAL_CALL SvtRulerAccessible::getLocationOnScreen() { // no guard -> done in GetBoundingBoxOnScreen() - return VCLUnoHelper::ConvertToAWTPoint(GetBoundingBoxOnScreen().TopLeft()); + return vcl::unohelper::ConvertToAWTPoint(GetBoundingBoxOnScreen().TopLeft()); } awt::Size SAL_CALL SvtRulerAccessible::getSize() { // no guard -> done in GetBoundingBox() - return VCLUnoHelper::ConvertToAWTSize(GetBoundingBox().GetSize()); + return vcl::unohelper::ConvertToAWTSize(GetBoundingBox().GetSize()); } //===== XAccessibleContext ================================================== diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index 5a056751b105..a3dcb17d9a77 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -1487,8 +1487,8 @@ void ValueSet::ImplFormatItem(vcl::RenderContext const & rRenderContext, ValueSe { const Color& rTopLeft(rStyleSettings.GetEdgeBlendingTopLeftColor()); const Color& rBottomRight(rStyleSettings.GetEdgeBlendingBottomRightColor()); - const sal_uInt8 nAlpha((nEdgeBlendingPercent * 255) / 100); - const BitmapEx aBlendFrame(createBlendFrame(aRect.GetSize(), nAlpha, rTopLeft, rBottomRight)); + const sal_uInt8 nAlpha(255 - ((nEdgeBlendingPercent * 255) / 100)); + const BitmapEx aBlendFrame(createAlphaBlendFrame(aRect.GetSize(), nAlpha, rTopLeft, rBottomRight)); if (!aBlendFrame.IsEmpty()) { diff --git a/svx/inc/shapecollection.hxx b/svx/inc/shapecollection.hxx index 44988281bb75..47eaec2e2e6d 100644 --- a/svx/inc/shapecollection.hxx +++ b/svx/inc/shapecollection.hxx @@ -31,7 +31,7 @@ class SvxShapeCollection final css::lang::XComponent> { private: - std::mutex m_aMutex; + mutable std::mutex m_aMutex; std::vector> maShapeContainer; comphelper::OInterfaceContainerHelper4 maEventListeners; bool bDisposed = false; @@ -67,7 +67,7 @@ public: virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() override; - void getAllShapes(std::vector>& rShapes) const; + std::vector> getAllShapes() const; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/accessibility/ChildrenManagerImpl.cxx b/svx/source/accessibility/ChildrenManagerImpl.cxx index 70c9e4e37b2b..29b3f76bf891 100644 --- a/svx/source/accessibility/ChildrenManagerImpl.cxx +++ b/svx/source/accessibility/ChildrenManagerImpl.cxx @@ -871,17 +871,19 @@ void ChildrenManagerImpl::UpdateSelection() if (!xSelectedShape.is() && xSelectedShapeAccess.is()) { sal_Int32 nCount = xSelectedShapeAccess->getCount(); - aSortedSelectedShapes.reserve(nCount); if (auto pSvxShape = dynamic_cast(xSelectedShapeAccess.get())) { - pSvxShape->getAllShapes(aSortedSelectedShapes); + aSortedSelectedShapes = pSvxShape->getAllShapes(); } else + { + aSortedSelectedShapes.reserve(nCount); for (sal_Int32 i = 0; i < nCount; ++i) { css::uno::Reference xShape(xSelectedShapeAccess->getByIndex(i), uno::UNO_QUERY); aSortedSelectedShapes.push_back(xShape); } + } std::sort(aSortedSelectedShapes.begin(), aSortedSelectedShapes.end()); } diff --git a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx index 667fe8c76849..38a643a2b1f4 100644 --- a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx +++ b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -425,7 +426,7 @@ void SAL_CALL SvxPixelCtlAccessibleChild::disposing() awt::Rectangle SvxPixelCtlAccessibleChild::implGetBounds() { // no guard necessary, because no one changes maBoundingBox after creating it - return VCLUnoHelper::ConvertToAWTRect(maBoundingBox); + return vcl::unohelper::ConvertToAWTRect(maBoundingBox); } OUString SvxPixelCtlAccessibleChild::GetName() const diff --git a/svx/source/accessibility/svxrectctaccessiblecontext.cxx b/svx/source/accessibility/svxrectctaccessiblecontext.cxx index b081c03a1e08..e3d736e45510 100644 --- a/svx/source/accessibility/svxrectctaccessiblecontext.cxx +++ b/svx/source/accessibility/svxrectctaccessiblecontext.cxx @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -30,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -601,7 +601,7 @@ void SAL_CALL SvxRectCtlChildAccessibleContext::disposing() awt::Rectangle SvxRectCtlChildAccessibleContext::implGetBounds( ) { // no guard necessary, because no one changes maBoundingBox after creating it - return VCLUnoHelper::ConvertToAWTRect(maBoundingBox); + return vcl::unohelper::ConvertToAWTRect(maBoundingBox); } void SvxRectCtlChildAccessibleContext::setStateChecked( bool bChecked ) diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx index b6f8a92bbae3..67a30926a630 100644 --- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx @@ -45,6 +45,7 @@ #include #include +#include #include #include #include @@ -230,7 +231,7 @@ namespace sdr::contact { ::tools::Rectangle ControlHolder::getPosSize() const { // no check whether we're valid, this is the responsibility of the caller - return VCLUnoHelper::ConvertToVCLRect( m_xControlWindow->getPosSize() ); + return vcl::unohelper::ConvertToVCLRect( m_xControlWindow->getPosSize() ); } diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx index 9e87d9be3b74..dbcb73b2cbe3 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -59,6 +59,7 @@ #include #include +#include #include #include @@ -453,7 +454,7 @@ awt::Rectangle SAL_CALL SdrLightEmbeddedClient_Impl::getPlacement() aContainerMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xParentVis->getMapUnit( mpObj->GetAspect() ) ); aLogicRect = Application::GetDefaultDevice()->LogicToPixel(aLogicRect, MapMode(aContainerMapUnit)); - return VCLUnoHelper::ConvertToAWTRect(aLogicRect); + return vcl::unohelper::ConvertToAWTRect(aLogicRect); } awt::Rectangle SAL_CALL SdrLightEmbeddedClient_Impl::getClipRectangle() @@ -479,8 +480,8 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::changedPlacement( const awt::Rectangl // check if the change is at least one pixel in size awt::Rectangle aOldRect = getPlacement(); - tools::Rectangle aNewPixelRect = VCLUnoHelper::ConvertToVCLRect(aPosRect); - tools::Rectangle aOldPixelRect = VCLUnoHelper::ConvertToVCLRect(aOldRect); + tools::Rectangle aNewPixelRect = vcl::unohelper::ConvertToVCLRect(aPosRect); + tools::Rectangle aOldPixelRect = vcl::unohelper::ConvertToVCLRect(aOldRect); if ( aOldPixelRect == aNewPixelRect ) // nothing has changed return; diff --git a/svx/source/table/accessiblecell.cxx b/svx/source/table/accessiblecell.cxx index e74674d9ba26..65b74d4ae6de 100644 --- a/svx/source/table/accessiblecell.cxx +++ b/svx/source/table/accessiblecell.cxx @@ -385,14 +385,6 @@ sal_Int32 SAL_CALL AccessibleCell::getBackground() // XAccessibleExtendedComponent - -css::uno::Reference< css::awt::XFont > SAL_CALL AccessibleCell::getFont() -{ -//todo - return AccessibleComponentBase::getFont(); -} - - OUString SAL_CALL AccessibleCell::getTitledBorderText() { return AccessibleComponentBase::getTitledBorderText(); diff --git a/svx/source/table/accessiblecell.hxx b/svx/source/table/accessiblecell.hxx index 39c45da3d890..4218225cc064 100644 --- a/svx/source/table/accessiblecell.hxx +++ b/svx/source/table/accessiblecell.hxx @@ -84,7 +84,6 @@ public: virtual sal_Int32 SAL_CALL getBackground() override; // XAccessibleExtendedComponent - virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont() override; virtual OUString SAL_CALL getTitledBorderText() override; virtual OUString SAL_CALL getToolTipText() override; diff --git a/svx/source/uitest/uiobject.cxx b/svx/source/uitest/uiobject.cxx index 0901a86dd933..2c15932a65f0 100644 --- a/svx/source/uitest/uiobject.cxx +++ b/svx/source/uitest/uiobject.cxx @@ -24,24 +24,29 @@ void SvxShowCharSetUIObject::execute(const OUString& rAction, { if (rAction == "SELECT") { - if (rParameters.find(u"INDEX"_ustr) != rParameters.end()) + auto itIndex = rParameters.find(u"INDEX"_ustr); + if (itIndex != rParameters.end()) { - OUString aIndexStr = rParameters.find(u"INDEX"_ustr)->second; + OUString aIndexStr = itIndex->second; sal_Int32 nIndex = aIndexStr.toInt32(); mpCharSet->OutputIndex(nIndex); } - else if (rParameters.find(u"COLUMN"_ustr) != rParameters.end() && - rParameters.find(u"ROW"_ustr) != rParameters.end()) + else { - OUString aColStr = rParameters.find(u"COLUMN"_ustr)->second; - OUString aRowStr = rParameters.find(u"ROW"_ustr)->second; + auto itColumn = rParameters.find(u"COLUMN"_ustr); + auto itRow = rParameters.find(u"ROW"_ustr); + if (itColumn != rParameters.end() && itRow != rParameters.end()) + { + OUString aColStr = itColumn->second; + OUString aRowStr = itRow->second; - sal_Int32 nColumn = aColStr.toInt32(); - sal_Int32 nRow = aRowStr.toInt32(); + sal_Int32 nColumn = aColStr.toInt32(); + sal_Int32 nRow = aRowStr.toInt32(); - sal_Int32 nIndex = nColumn * COLUMN_COUNT + nRow; - mpCharSet->OutputIndex(nIndex); + sal_Int32 nIndex = nColumn * COLUMN_COUNT + nRow; + mpCharSet->OutputIndex(nIndex); + } } } else @@ -70,9 +75,10 @@ void SvxNumValueSetUIObject::execute(const OUString& rAction, { if (rAction == "CHOOSE") { - if (rParameters.find(u"POS"_ustr) != rParameters.end()) + auto itPos = rParameters.find(u"POS"_ustr); + if (itPos != rParameters.end()) { - OUString aIndexStr = rParameters.find(u"POS"_ustr)->second; + OUString aIndexStr = itPos->second; sal_Int32 nIndex = aIndexStr.toInt32(); mpNumValueSet->SelectItem(nIndex); mpNumValueSet->Select(); diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index 0ea662b61a1c..e2b6f7ad029b 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -1004,23 +1004,26 @@ sal_Bool SAL_CALL GraphicExporter::filter( const Sequence< PropertyValue >& aDes AllSettings aAllSettings = Application::GetSettings(); StyleSettings aStyleSettings = aAllSettings.GetStyleSettings(); bool bUseFontAAFromSystem = aStyleSettings.GetUseFontAAFromSystem(); + bool bUseSubpixelAA = aStyleSettings.GetUseSubpixelAA(); + aStyleSettings.SetUseSubpixelAA(false); if (aSettings.meAntiAliasing != TRISTATE_INDET) { // This is safe to do globally as we own the solar mutex. SvtOptionsDrawinglayer::SetAntiAliasing(aSettings.meAntiAliasing == TRISTATE_TRUE, /*bTemporary*/true); // Opt in to have AA affect font rendering as well. aStyleSettings.SetUseFontAAFromSystem(false); - aAllSettings.SetStyleSettings(aStyleSettings); - Application::SetSettings(aAllSettings); } + aAllSettings.SetStyleSettings(aStyleSettings); + Application::SetSettings(aAllSettings); nStatus = GetGraphic( aSettings, aGraphic, bVectorType ) ? ERRCODE_NONE : ERRCODE_GRFILTER_FILTERERROR; if (aSettings.meAntiAliasing != TRISTATE_INDET) { SvtOptionsDrawinglayer::SetAntiAliasing(bAntiAliasing, /*bTemporary*/true); aStyleSettings.SetUseFontAAFromSystem(bUseFontAAFromSystem); - aAllSettings.SetStyleSettings(aStyleSettings); - Application::SetSettings(aAllSettings); } + aStyleSettings.SetUseSubpixelAA(bUseSubpixelAA); + aAllSettings.SetStyleSettings(aStyleSettings); + Application::SetSettings(aAllSettings); } if( nStatus == ERRCODE_NONE ) diff --git a/svx/source/unodraw/unoshcol.cxx b/svx/source/unodraw/unoshcol.cxx index b99f6674a371..116247e1916b 100644 --- a/svx/source/unodraw/unoshcol.cxx +++ b/svx/source/unodraw/unoshcol.cxx @@ -147,7 +147,6 @@ sal_Int32 SAL_CALL SvxShapeCollection::getCount() return maShapeContainer.size(); } - uno::Any SAL_CALL SvxShapeCollection::getByIndex( sal_Int32 Index ) { if( Index < 0 || Index >= getCount() ) @@ -158,6 +157,12 @@ uno::Any SAL_CALL SvxShapeCollection::getByIndex( sal_Int32 Index ) return uno::Any( xShape ); } +std::vector> SvxShapeCollection::getAllShapes() const +{ + std::unique_lock g(m_aMutex); + return maShapeContainer; +} + // XElementAccess uno::Type SAL_CALL SvxShapeCollection::getElementType() { @@ -185,11 +190,6 @@ uno::Sequence< OUString > SAL_CALL SvxShapeCollection::getSupportedServiceNames( return { u"com.sun.star.drawing.Shapes"_ustr, u"com.sun.star.drawing.ShapeCollection"_ustr }; } -void SvxShapeCollection::getAllShapes(std::vector>& rShapes) const -{ - rShapes = maShapeContainer; -} - extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_drawing_SvxShapeCollection_get_implementation( css::uno::XComponentContext *, diff --git a/sw/inc/AccessibilityCheckStrings.hrc b/sw/inc/AccessibilityCheckStrings.hrc index 11a5b5299ab1..6acfa0761157 100644 --- a/sw/inc/AccessibilityCheckStrings.hrc +++ b/sw/inc/AccessibilityCheckStrings.hrc @@ -30,6 +30,7 @@ #define STR_AVOID_NEWLINES_SPACE NC_("STR_AVOID_NEWLINES_SPACE", "Avoid newlines to create space.") #define STR_AVOID_SPACES_SPACE NC_("STR_AVOID_SPACES_SPACE", "Avoid spaces to create space.") #define STR_AVOID_TABS_FORMATTING NC_("STR_AVOID_TABS_FORMATTING", "Avoid using tabs for formatting.") +#define STR_AVOID_EMPTY_NUM_PARA NC_("STR_AVOID_EMPTY_NUM_PARA", "Avoid new empty lines between numbered paragraphs.") #define STR_HEADINGS_NOT_IN_ORDER NC_("STR_HEADINGS_NOT_IN_ORDER", "Outline levels of headings not in sequential order.") #define STR_TEXT_FORMATTING_CONVEYS_MEANING NC_("STR_TEXT_FORMATTING_CONVEYS_MEANING", "The text formatting conveys additional meaning.") #define STR_NON_INTERACTIVE_FORMS NC_("STR_NON_INTERACTIVE_FORMS", "Use interactive input fields.") diff --git a/sw/inc/edglbldc.hxx b/sw/inc/edglbldc.hxx index ede49d8e894e..e585fbe5cd49 100644 --- a/sw/inc/edglbldc.hxx +++ b/sw/inc/edglbldc.hxx @@ -16,8 +16,7 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_SW_INC_EDGLBLDC_HXX -#define INCLUDED_SW_INC_EDGLBLDC_HXX +#pragma once #include @@ -64,6 +63,4 @@ public: class SwGlblDocContents : public o3tl::sorted_vector, o3tl::less_ptr_to > {}; -#endif - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx index 5c423e11378c..fdf0eec7849b 100644 --- a/sw/inc/ndarr.hxx +++ b/sw/inc/ndarr.hxx @@ -81,7 +81,7 @@ public: static constexpr auto npos = std::numeric_limits::max(); bool Seek_Entry(const SwNode* rP, size_type* pnPos) const; - static const SwNode* GetRootNode(const SwNode* pNode); + static const SwNode* GetRootNode(const SwNode* pNode, bool bCheckInlineHeading = true); }; struct CompareSwOutlineNodesInline diff --git a/sw/inc/reffld.hxx b/sw/inc/reffld.hxx index a6d51679f101..2adc2f3a3244 100644 --- a/sw/inc/reffld.hxx +++ b/sw/inc/reffld.hxx @@ -101,6 +101,22 @@ public: SwTextNode* pSelf = nullptr, SwFrame* pFrame = nullptr); void UpdateGetReferences(); void UpdateStyleReferences(); + +private: + static SwTextNode* FindAnchorRefStyle( SwDoc* pDoc, const OUString& rRefMark, + sal_uInt16 nFlags, + sal_Int32* pStt, sal_Int32* pEnd, + SwRootFrame const* pLayout, + SwTextNode* pSelf, SwFrame* pFrame); + static SwTextNode* FindAnchorRefStyleMarginal( SwDoc* pDoc, + sal_uInt16 nFlags, + sal_Int32* pStt, sal_Int32* pEnd, + SwTextNode* pSelf, SwFrame* pFrame, + const SwTextNode* pReference, std::u16string_view styleName); + static SwTextNode* FindAnchorRefStyleOther( SwDoc* pDoc, + sal_Int32* pStt, sal_Int32* pEnd, + SwTextNode* pSelf, + const SwTextNode* pReference, std::u16string_view styleName); }; class SAL_DLLPUBLIC_RTTI SwGetRefField final : public SwField diff --git a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx index 6bdba45e753c..1f820b47ed02 100644 --- a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx +++ b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx @@ -106,12 +106,24 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckNewlineSpace) auto& aIssues = aCheck.getIssueCollection().getIssues(); CPPUNIT_ASSERT_EQUAL(size_t(4), aIssues.size()); CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::DIRECT_FORMATTING, aIssues[0]->m_eIssueID); - CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_FORMATTING, aIssues[1]->m_eIssueID); + CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_NEW_LINES, aIssues[1]->m_eIssueID); CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::DIRECT_FORMATTING, aIssues[2]->m_eIssueID); - CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_FORMATTING, aIssues[3]->m_eIssueID); + CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_NEW_LINES, aIssues[3]->m_eIssueID); CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueLevel::WARNLEV, aIssues[3]->m_eIssueLvl); } +CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testEmptyLineBetweenNumberings) +{ + createSwDoc("EmptyNumSpace.odt"); + SwDoc* pDoc = getSwDoc(); + sw::AccessibilityCheck aCheck(pDoc); + aCheck.check(); + auto& aIssues = aCheck.getIssueCollection().getIssues(); + CPPUNIT_ASSERT_EQUAL(size_t(1), aIssues.size()); + CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_EMPTY_NUM_PARA, aIssues[0]->m_eIssueID); + CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueLevel::WARNLEV, aIssues[0]->m_eIssueLvl); +} + CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckSpacebarSpace) { createSwDoc("SpaceTest.odt"); @@ -121,7 +133,7 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckSpacebarSpace) auto& aIssues = aCheck.getIssueCollection().getIssues(); CPPUNIT_ASSERT_EQUAL(size_t(3), aIssues.size()); CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::DIRECT_FORMATTING, aIssues[0]->m_eIssueID); - CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_FORMATTING, aIssues[1]->m_eIssueID); + CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_SPACES, aIssues[1]->m_eIssueID); CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::DIRECT_FORMATTING, aIssues[2]->m_eIssueID); } @@ -223,15 +235,15 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckTabsFormatting) aCheck.check(); auto& aIssues = aCheck.getIssueCollection().getIssues(); CPPUNIT_ASSERT_EQUAL(size_t(10), aIssues.size()); - CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_FORMATTING, aIssues[0]->m_eIssueID); + CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_TABS, aIssues[0]->m_eIssueID); CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::DIRECT_FORMATTING, aIssues[1]->m_eIssueID); - CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_FORMATTING, aIssues[2]->m_eIssueID); + CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_TABS, aIssues[2]->m_eIssueID); CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::DIRECT_FORMATTING, aIssues[3]->m_eIssueID); - CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_FORMATTING, aIssues[4]->m_eIssueID); + CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_TABS, aIssues[4]->m_eIssueID); CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::DIRECT_FORMATTING, aIssues[5]->m_eIssueID); - CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_FORMATTING, aIssues[6]->m_eIssueID); + CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_TABS, aIssues[6]->m_eIssueID); CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::DIRECT_FORMATTING, aIssues[7]->m_eIssueID); - CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_FORMATTING, aIssues[8]->m_eIssueID); + CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_TABS, aIssues[8]->m_eIssueID); CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::DIRECT_FORMATTING, aIssues[9]->m_eIssueID); } @@ -261,13 +273,13 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testDeleteHeader) CPPUNIT_ASSERT_EQUAL(size_t(8), aIssues.size()); CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::DOCUMENT_TITLE, aIssues[0]->m_eIssueID); CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueLevel::ERRORLEV, aIssues[0]->m_eIssueLvl); - CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_FORMATTING, aIssues[1]->m_eIssueID); - CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_FORMATTING, aIssues[2]->m_eIssueID); - CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_FORMATTING, aIssues[3]->m_eIssueID); - CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_FORMATTING, aIssues[4]->m_eIssueID); - CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_FORMATTING, aIssues[5]->m_eIssueID); - CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_FORMATTING, aIssues[6]->m_eIssueID); - CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_FORMATTING, aIssues[7]->m_eIssueID); + CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_NEW_LINES, aIssues[1]->m_eIssueID); + CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_NEW_LINES, aIssues[2]->m_eIssueID); + CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_NEW_LINES, aIssues[3]->m_eIssueID); + CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_NEW_LINES, aIssues[4]->m_eIssueID); + CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_NEW_LINES, aIssues[5]->m_eIssueID); + CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_NEW_LINES, aIssues[6]->m_eIssueID); + CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_NEW_LINES, aIssues[7]->m_eIssueID); SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); CPPUNIT_ASSERT(pWrtShell); @@ -285,8 +297,8 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testDeleteHeader) aResultIssues = aReCheck.getIssueCollection().getIssues(); CPPUNIT_ASSERT_EQUAL(size_t(3), aResultIssues.size()); CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::DOCUMENT_TITLE, aResultIssues[0]->m_eIssueID); - CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_FORMATTING, aResultIssues[1]->m_eIssueID); - CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_FORMATTING, aResultIssues[2]->m_eIssueID); + CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_NEW_LINES, aResultIssues[1]->m_eIssueID); + CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_NEW_LINES, aResultIssues[2]->m_eIssueID); } CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testStylesWithHeader) diff --git a/sw/qa/core/accessibilitycheck/data/EmptyNumSpace.odt b/sw/qa/core/accessibilitycheck/data/EmptyNumSpace.odt new file mode 100644 index 000000000000..8f55e6700753 Binary files /dev/null and b/sw/qa/core/accessibilitycheck/data/EmptyNumSpace.odt differ diff --git a/sw/qa/extras/layout/data/tdf164098.fodt b/sw/qa/extras/layout/data/tdf164098.fodt new file mode 100644 index 000000000000..2ce8c7dff3c2 --- /dev/null +++ b/sw/qa/extras/layout/data/tdf164098.fodt @@ -0,0 +1,116 @@ + + + 2024-11-29T22:06:13.3429325682024-12-02T12:01:13.042657312PT22M9S16LibreOfficeDev/25.2.0.0.alpha1$Linux_X86_64 LibreOffice_project/654e3134adbf48c61aaa29dcd9f52ce236694535 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + متن مـــــــــتــــــــن متن + + + \ No newline at end of file diff --git a/sw/qa/extras/layout/layout3.cxx b/sw/qa/extras/layout/layout3.cxx index b7dfcd739d61..ef5e948d5abf 100644 --- a/sw/qa/extras/layout/layout3.cxx +++ b/sw/qa/extras/layout/layout3.cxx @@ -1833,6 +1833,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testHiddenParagraphFollowFrame) { createSwDoc("hidden-para-follow-frame.fodt"); + uno::Any aOldValue{ queryDispatchStatus(mxComponent, m_xContext, ".uno:ShowHiddenParagraphs") }; + + Resetter g([this, aOldValue] { + uno::Sequence argsSH( + comphelper::InitPropertySequence({ { "ShowHiddenParagraphs", aOldValue } })); + dispatchCommand(mxComponent, ".uno:ShowHiddenParagraphs", argsSH); + }); + uno::Sequence argsSH( comphelper::InitPropertySequence({ { "ShowHiddenParagraphs", uno::Any(true) } })); dispatchCommand(mxComponent, ".uno:ShowHiddenParagraphs", argsSH); @@ -1871,6 +1879,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testHiddenParagraphFlys) { createSwDoc("hidden-para-as-char-fly.fodt"); + uno::Any aOldValue{ queryDispatchStatus(mxComponent, m_xContext, ".uno:ShowHiddenParagraphs") }; + + Resetter g([this, aOldValue] { + uno::Sequence argsSH( + comphelper::InitPropertySequence({ { "ShowHiddenParagraphs", aOldValue } })); + dispatchCommand(mxComponent, ".uno:ShowHiddenParagraphs", argsSH); + }); + uno::Sequence argsSH( comphelper::InitPropertySequence({ { "ShowHiddenParagraphs", uno::Any(true) } })); dispatchCommand(mxComponent, ".uno:ShowHiddenParagraphs", argsSH); diff --git a/sw/qa/extras/layout/layout4.cxx b/sw/qa/extras/layout/layout4.cxx index d1527e503961..36af7e749aae 100644 --- a/sw/qa/extras/layout/layout4.cxx +++ b/sw/qa/extras/layout/layout4.cxx @@ -1886,6 +1886,18 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter4, TestTdf152839_firstRows) CPPUNIT_ASSERT_EQUAL(sal_Int32(223), nHeight); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter4, TestTdf164098) +{ + createSwDoc("tdf164098.fodt"); + SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); + + pWrtShell->StartOfSection(false); + pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect*/ false, 6, /*bBasicCall*/ false); + + // Without the fix, this line will cause a freeze: + pWrtShell->Insert(u"ـ"_ustr); +} + } // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/qa/extras/uiwriter/data/placeholder-bold-cs.fodt b/sw/qa/extras/uiwriter/data/placeholder-bold-cs.fodt new file mode 100644 index 000000000000..25f610ad92e0 --- /dev/null +++ b/sw/qa/extras/uiwriter/data/placeholder-bold-cs.fodt @@ -0,0 +1,115 @@ + + + 2024-08-08T18:32:28.4200828172024-08-08T18:33:51.021911316PT1M27S1ZetaOffice/7.4.8.0.0$Linux_X86_64 LibreOffice_project/ab7057b1137e2241f51e62b58a0c605ec9a4b29c + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Test <replaceme>test + + + diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx index a030ad9c10f8..d169f76dbe09 100644 --- a/sw/qa/extras/uiwriter/uiwriter3.cxx +++ b/sw/qa/extras/uiwriter/uiwriter3.cxx @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -18,6 +19,7 @@ #include #include #include +#include #include #include @@ -86,6 +88,48 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testPlaceholderHTMLPaste) getProperty(getRun(getParagraph(4), 1, u" test"_ustr), u"CharWeight"_ustr)); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testPlaceholderHTMLInsert) +{ + createSwDoc("placeholder-bold-cs.fodt"); + + // select placeholder field + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xCursor{ xTextDocument->getText()->createTextCursor() }; + xCursor->gotoStart(false); + xCursor->goRight(5, false); + xCursor->goRight(1, true); + + sal_Int8 const html[] = "

    AAA

    BBB

    CCC

    "; + uno::Reference xStream{ new comphelper::MemoryInputStream{ html, + sizeof(html) } }; + + // insert HTML file + uno::Sequence aPropertyValues = comphelper::InitPropertySequence( + { { "InputStream", uno::Any(xStream) }, + { "Hidden", uno::Any(true) }, + { "FilterName", uno::Any(u"HTML (StarWriter)"_ustr) } }); + + uno::Reference xDocInsert{ xCursor, uno::UNO_QUERY }; + xDocInsert->insertDocumentFromURL("private:stream", aPropertyValues); + + CPPUNIT_ASSERT_EQUAL(int(4), getParagraphs()); + + CPPUNIT_ASSERT_EQUAL( + awt::FontWeight::NORMAL, + getProperty(getRun(getParagraph(1), 1, u"Test "_ustr), u"CharWeight"_ustr)); + CPPUNIT_ASSERT_EQUAL( + awt::FontWeight::BOLD, + getProperty(getRun(getParagraph(1), 2, u"AAA"_ustr), u"CharWeight"_ustr)); + CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, + getProperty(getParagraph(2), u"CharWeight"_ustr)); + CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, + getProperty(getParagraph(3), u"CharWeight"_ustr)); + CPPUNIT_ASSERT_EQUAL( + awt::FontWeight::NORMAL, + getProperty(getRun(getParagraph(4), 1, u" test"_ustr), u"CharWeight"_ustr)); +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf151974) { createSwDoc("tdf151974.odt"); diff --git a/sw/qa/inc/swmodeltestbase.hxx b/sw/qa/inc/swmodeltestbase.hxx index 3ff243c2c11c..e3d1a895a8b4 100644 --- a/sw/qa/inc/swmodeltestbase.hxx +++ b/sw/qa/inc/swmodeltestbase.hxx @@ -251,7 +251,7 @@ protected: */ xmlDocUniquePtr WrapReqifFromTempFile(); - void emulateTyping(const std::u16string_view& rStr); + void emulateTyping(std::u16string_view rStr); private: void loadURL(OUString const& rURL, const char* pPassword = nullptr); diff --git a/sw/qa/unit/swmodeltestbase.cxx b/sw/qa/unit/swmodeltestbase.cxx index 88156bb58eb0..69aab12a38ba 100644 --- a/sw/qa/unit/swmodeltestbase.cxx +++ b/sw/qa/unit/swmodeltestbase.cxx @@ -488,7 +488,7 @@ xmlDocUniquePtr SwModelTestBase::WrapReqifFromTempFile() return pXmlDoc; } -void SwModelTestBase::emulateTyping(const std::u16string_view& rStr) +void SwModelTestBase::emulateTyping(std::u16string_view rStr) { SwXTextDocument* pTextDoc = getSwTextDoc(); for (const char16_t c : rStr) diff --git a/sw/source/core/access/AccessibilityCheck.cxx b/sw/source/core/access/AccessibilityCheck.cxx index 39a4999f1965..42936d33bc4b 100644 --- a/sw/source/core/access/AccessibilityCheck.cxx +++ b/sw/source/core/access/AccessibilityCheck.cxx @@ -134,9 +134,27 @@ void lcl_SetHiddenIssues(std::shared_ptr& pIssue) pIssue->setHidden(true); } break; - case sfx::AccessibilityIssueID::TEXT_FORMATTING: + case sfx::AccessibilityIssueID::TEXT_NEW_LINES: { - if (!officecfg::Office::Common::AccessibilityIssues::TextFormattings::get()) + if (!officecfg::Office::Common::AccessibilityIssues::TextNewLines::get()) + pIssue->setHidden(true); + } + break; + case sfx::AccessibilityIssueID::TEXT_SPACES: + { + if (!officecfg::Office::Common::AccessibilityIssues::TextSpaces::get()) + pIssue->setHidden(true); + } + break; + case sfx::AccessibilityIssueID::TEXT_TABS: + { + if (!officecfg::Office::Common::AccessibilityIssues::TextTabs::get()) + pIssue->setHidden(true); + } + break; + case sfx::AccessibilityIssueID::TEXT_EMPTY_NUM_PARA: + { + if (!officecfg::Office::Common::AccessibilityIssues::TextEmptyNums::get()) pIssue->setHidden(true); } break; @@ -1699,7 +1717,7 @@ public: if (pPrevTextNode->GetText().getLength() == 0) { auto pIssue = lclAddIssue(m_rIssueCollection, SwResId(STR_AVOID_NEWLINES_SPACE), - sfx::AccessibilityIssueID::TEXT_FORMATTING, + sfx::AccessibilityIssueID::TEXT_NEW_LINES, sfx::AccessibilityIssueLevel::WARNLEV); pIssue->setIssueObject(IssueObject::TEXT); pIssue->setNode(pTextNode); @@ -1726,7 +1744,7 @@ public: { auto pIssue = lclAddIssue(m_rIssueCollection, SwResId(STR_AVOID_NEWLINES_SPACE), - sfx::AccessibilityIssueID::TEXT_FORMATTING, + sfx::AccessibilityIssueID::TEXT_NEW_LINES, sfx::AccessibilityIssueLevel::WARNLEV); pIssue->setIssueObject(IssueObject::TEXT); pIssue->setNode(pTextNode); @@ -1800,7 +1818,7 @@ public: { auto pIssue = lclAddIssue(m_rIssueCollection, SwResId(STR_AVOID_TABS_FORMATTING), - sfx::AccessibilityIssueID::TEXT_FORMATTING, + sfx::AccessibilityIssueID::TEXT_TABS, sfx::AccessibilityIssueLevel::WARNLEV); pIssue->setIssueObject(IssueObject::TEXT); pIssue->setNode(pTextNode); @@ -1818,7 +1836,7 @@ public: { auto pIssue = lclAddIssue(m_rIssueCollection, SwResId(STR_AVOID_SPACES_SPACE), - sfx::AccessibilityIssueID::TEXT_FORMATTING, + sfx::AccessibilityIssueID::TEXT_SPACES, sfx::AccessibilityIssueLevel::WARNLEV); pIssue->setIssueObject(IssueObject::TEXT); pIssue->setNode(pTextNode); @@ -2310,6 +2328,101 @@ public: } }; +class EmptyLineBetweenNumberingCheck : public NodeCheck +{ +private: + static SwTextNode* getPrevTextNode(SwNode* pCurrent) + { + SwTextNode* pTextNode = nullptr; + + auto nIndex = pCurrent->GetIndex(); + + nIndex--; // go to previous node + + while (pTextNode == nullptr && nIndex >= SwNodeOffset(0)) + { + auto pNode = pCurrent->GetNodes()[nIndex]; + if (pNode->IsTextNode()) + pTextNode = pNode->GetTextNode(); + nIndex--; + } + + return pTextNode; + } + + static SwTextNode* getNextTextNode(SwNode* pCurrent) + { + SwTextNode* pTextNode = nullptr; + + auto nIndex = pCurrent->GetIndex(); + + nIndex++; // go to next node + + while (pTextNode == nullptr && nIndex < pCurrent->GetNodes().Count()) + { + auto pNode = pCurrent->GetNodes()[nIndex]; + if (pNode->IsTextNode()) + pTextNode = pNode->GetTextNode(); + nIndex++; + } + + return pTextNode; + } + +public: + EmptyLineBetweenNumberingCheck(sfx::AccessibilityIssueCollection& rIssueCollection) + : NodeCheck(rIssueCollection) + { + } + void check(SwNode* pCurrent) override + { + if (!pCurrent->IsTextNode()) + return; + + // Don't count empty table box text nodes + if (pCurrent->GetTableBox()) + return; + + SwTextNode* pTextNode = pCurrent->GetTextNode(); + SwDoc& rDocument = pTextNode->GetDoc(); + SwDocShell* pDocShell = rDocument.GetDocShell(); + if (!pDocShell) + return; + + SwWrtShell* pWrtShell = pDocShell->GetWrtShell(); + if (!pWrtShell) + return; + + auto nParagraphLength = pTextNode->GetText().getLength(); + if (nParagraphLength == 0 && !pTextNode->GetNumRule()) + { + SwTextNode* pPrevTextNode = getPrevTextNode(pCurrent); + if (!pPrevTextNode) + return; + + SwTextNode* pNextTextNode = getNextTextNode(pCurrent); + if (!pNextTextNode) + return; + + if (pPrevTextNode->getLayoutFrame(pWrtShell->GetLayout()) + && pNextTextNode->getLayoutFrame(pWrtShell->GetLayout())) + { + const SwNumRule* pPrevRule = pPrevTextNode->GetNumRule(); + const SwNumRule* pNextRule = pNextTextNode->GetNumRule(); + if (pPrevRule && pNextRule) + { + auto pIssue = lclAddIssue(m_rIssueCollection, SwResId(STR_AVOID_EMPTY_NUM_PARA), + sfx::AccessibilityIssueID::TEXT_EMPTY_NUM_PARA, + sfx::AccessibilityIssueLevel::WARNLEV); + pIssue->setIssueObject(IssueObject::TEXT); + pIssue->setNode(pTextNode); + pIssue->setDoc(rDocument); + } + } + } + } +}; + class DocumentCheck : public BaseCheck { public: @@ -2564,6 +2677,7 @@ void AccessibilityCheck::init() m_aNodeChecks.emplace_back(new FakeFootnoteCheck(m_aIssueCollection)); m_aNodeChecks.emplace_back(new FakeCaptionCheck(m_aIssueCollection)); m_aNodeChecks.emplace_back(new ContentControlCheck(m_aIssueCollection)); + m_aNodeChecks.emplace_back(new EmptyLineBetweenNumberingCheck(m_aIssueCollection)); } } diff --git a/sw/source/core/docnode/ndnum.cxx b/sw/source/core/docnode/ndnum.cxx index 89e8cc186311..095bfaa60b56 100644 --- a/sw/source/core/docnode/ndnum.cxx +++ b/sw/source/core/docnode/ndnum.cxx @@ -27,18 +27,20 @@ #include #include -static const SwNode* getNodeOrAnchorNode(const SwNode* pNode) +static const SwNode* getNodeOrAnchorNode(const SwNode* pNode, bool bCheckInlineHeading = true) { // if pNode is an inline heading in an Inline Heading // text frame, return its anchor node instead of pNode + // if bCheckInlineHeading == false, it's enough to be in an + // arbitrary text frame to return its anchor node if (const auto pFlyFormat = pNode->GetFlyFormat()) { SwFormatAnchor const*const pAnchor = &pFlyFormat->GetAnchor(); SwNode const*const pAnchorNode = pAnchor->GetAnchorNode(); const SwFormat* pParent = pFlyFormat->DerivedFrom(); - if ( pAnchorNode && pParent && + if ( pAnchorNode && pParent && ( !bCheckInlineHeading || ( RndStdIds::FLY_AS_CHAR == pAnchor->GetAnchorId() && - pParent->GetPoolFormatId() == RES_POOLFRM_INLINE_HEADING ) + pParent->GetPoolFormatId() == RES_POOLFRM_INLINE_HEADING ) ) ) { return pAnchorNode; } @@ -58,9 +60,9 @@ bool SwOutlineNodes::Seek_Entry(const SwNode* rP, size_type* pnPos) const return it != end() && rP->GetIndex() == (*it)->GetIndex(); } -const SwNode* SwOutlineNodes::GetRootNode(const SwNode* pNode) +const SwNode* SwOutlineNodes::GetRootNode(const SwNode* pNode, bool bCheckInlineHeading) { - return getNodeOrAnchorNode(pNode); + return getNodeOrAnchorNode(pNode, bCheckInlineHeading); } bool CompareSwOutlineNodesInline::operator()(const SwNode* lhs, const SwNode* rhs) const diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index 29a818a52847..9b6ffb4b2939 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -509,12 +509,12 @@ void SwVirtFlyDrawObj::wrap_DoPaintObject( // but no paints. IsPaintInProgress() depends on SW repaint, so, as long // as SW paints self and calls DrawLayer() for Heaven and Hell, this will // be correct - if ( !(pShell && pShell->IsDrawingLayerPaintInProgress()) ) + if (!pShell || !pShell->IsDrawingLayerPaintInProgress()) return; bool bDrawObject(true); - if ( !SwFlyFrame::IsPaint( const_cast(this), pShell ) ) + if ( !SwFlyFrame::IsPaint( const_cast(this), *pShell ) ) { bDrawObject = false; } diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx index e994dabfab17..99ef95713e1a 100644 --- a/sw/source/core/fields/reffld.cxx +++ b/sw/source/core/fields/reffld.cxx @@ -1212,56 +1212,47 @@ namespace Marginal, /* headers, footers */ }; - /// Picks the first text node with a matching style from a double ended queue, starting at the front - /// This allows us to use the deque either as a stack or as a queue depending on whether we want to search up or down - SwTextNode* SearchForStyleAnchor(SwTextNode* pSelf, const std::deque& pToSearch, + SwTextNode* SearchForStyleAnchor(SwTextNode* pSelf, SwNode* pCurrent, std::u16string_view rStyleName, sal_Int32 *const pStart, sal_Int32 *const pEnd, bool bCaseSensitive = true) { - std::deque pSearching(pToSearch); - while (!pSearching.empty()) + if (*pCurrent == *pSelf) + return nullptr; + + SwTextNode* pTextNode = pCurrent->GetTextNode(); + if (!pTextNode) + return nullptr; + + if (bCaseSensitive + ? pTextNode->GetFormatColl()->GetName() == rStyleName + : pTextNode->GetFormatColl()->GetName().equalsIgnoreAsciiCase(rStyleName)) { - SwNode* pCurrent = pSearching.front(); - pSearching.pop_front(); - - if (*pCurrent == *pSelf) - continue; - - SwTextNode* pTextNode = pCurrent->GetTextNode(); - if (!pTextNode) - continue; - - if (bCaseSensitive - ? pTextNode->GetFormatColl()->GetName() == rStyleName - : pTextNode->GetFormatColl()->GetName().equalsIgnoreAsciiCase(rStyleName)) + *pStart = 0; + if (pEnd) { - *pStart = 0; - if (pEnd) - { - *pEnd = pTextNode->GetText().getLength(); - } - return pTextNode; + *pEnd = pTextNode->GetText().getLength(); } + return pTextNode; + } - if (auto const pHints = pTextNode->GetpSwpHints()) + if (auto const pHints = pTextNode->GetpSwpHints()) + { + for (size_t i = 0; i < pHints->Count(); ++i) { - for (size_t i = 0; i < pHints->Count(); ++i) + auto const*const pHint(pHints->Get(i)); + if (pHint->Which() == RES_TXTATR_CHARFMT) { - auto const*const pHint(pHints->Get(i)); - if (pHint->Which() == RES_TXTATR_CHARFMT) + if (bCaseSensitive + ? pHint->GetCharFormat().GetCharFormat()->HasName(rStyleName) + : pHint->GetCharFormat().GetCharFormat()->GetName().equalsIgnoreAsciiCase(rStyleName)) { - if (bCaseSensitive - ? pHint->GetCharFormat().GetCharFormat()->HasName(rStyleName) - : pHint->GetCharFormat().GetCharFormat()->GetName().equalsIgnoreAsciiCase(rStyleName)) + *pStart = pHint->GetStart(); + if (pEnd) { - *pStart = pHint->GetStart(); - if (pEnd) - { - *pEnd = *pHint->End(); - } - return pTextNode; + *pEnd = *pHint->End(); } + return pTextNode; } } } @@ -1269,6 +1260,34 @@ namespace return nullptr; } + /// Picks the first text node with a matching style from the specified node range + SwTextNode* SearchForStyleAnchor(SwTextNode* pSelf, const SwNodes& rNodes, SwNodeOffset nNodeStart, SwNodeOffset nNodeEnd, bool bSearchBackward, + std::u16string_view rStyleName, + sal_Int32 *const pStart, sal_Int32 *const pEnd, + bool bCaseSensitive = true) + { + if (!bSearchBackward) + { + for (SwNodeOffset nCurrent = nNodeStart; nCurrent <= nNodeEnd; ++nCurrent) + { + SwNode* pCurrent = rNodes[nCurrent]; + SwTextNode* pFound = SearchForStyleAnchor(pSelf, pCurrent, rStyleName, pStart, pEnd, bCaseSensitive); + if (pFound) + return pFound; + } + } + else + { + for (SwNodeOffset nCurrent = nNodeEnd; nCurrent >= nNodeStart; --nCurrent) + { + SwNode* pCurrent = rNodes[nCurrent]; + SwTextNode* pFound = SearchForStyleAnchor(pSelf, pCurrent, rStyleName, pStart, pEnd, bCaseSensitive); + if (pFound) + return pFound; + } + } + return nullptr; + } } SwTextNode* SwGetRefFieldType::FindAnchor(SwDoc* pDoc, const OUString& rRefMark, @@ -1390,252 +1409,222 @@ SwTextNode* SwGetRefFieldType::FindAnchor(SwDoc* pDoc, const OUString& rRefMark, } break; case REF_STYLE: - if (!pSelf) break; - - const SwNodes& nodes = pDoc->GetNodes(); - - StyleRefElementType elementType = StyleRefElementType::Default; - const SwTextNode* pReference = nullptr; - - { /* Check if we're a footnote/endnote */ - for (SwTextFootnote* pFootnoteIdx : pDoc->GetFootnoteIdxs()) - { - if (pLayout && pLayout->IsHideRedlines() - && sw::IsFootnoteDeleted(rIDRA, *pFootnoteIdx)) - { - continue; - } - const SwNodeIndex* pIdx = pFootnoteIdx->GetStartNode(); - if (pIdx) - { - SwNodeIndex aIdx(*pIdx, 1); - SwTextNode* pFootnoteNode = aIdx.GetNode().GetTextNode(); - if (nullptr == pFootnoteNode) - pFootnoteNode = static_cast(SwNodes::GoNext(&aIdx)); - - if (*pSelf == *pFootnoteNode) - { - elementType = StyleRefElementType::Reference; - pReference = &pFootnoteIdx->GetTextNode(); - } - } - } - } - - if (pDoc->IsInHeaderFooter(*pSelf)) - { - elementType = StyleRefElementType::Marginal; - } - - if (pReference == nullptr) - { - pReference = pSelf; - } - - // undocumented Word feature: 1 = "Heading 1" etc. - OUString const styleName( - (rRefMark.getLength() == 1 && '1' <= rRefMark[0] && rRefMark[0] <= '9') - ? SwStyleNameMapper::GetProgName(RES_POOLCOLL_HEADLINE1 + rRefMark[0] - '1', rRefMark) - : rRefMark); - - switch (elementType) - { - case Marginal: - { - // For marginals, styleref tries to act on the current page first - // 1. Get the page we're on, search it from top to bottom - - bool bFlagFromBottom = (nFlags & REFFLDFLAG_STYLE_FROM_BOTTOM) == REFFLDFLAG_STYLE_FROM_BOTTOM; - - Point aPt; - std::pair const tmp(aPt, false); - - if (!pContentFrame) SAL_WARN("xmloff.text", ": Missing content frame for marginal styleref"); - const SwPageFrame* pPageFrame = nullptr; - - if (pContentFrame) - pPageFrame = pContentFrame->FindPageFrame(); - - const SwNode* pPageStart(nullptr); - const SwNode* pPageEnd(nullptr); - - if (pPageFrame) - { - const SwContentFrame* pPageStartFrame = pPageFrame->FindFirstBodyContent(); - const SwContentFrame* pPageEndFrame = pPageFrame->FindLastBodyContent(); - - if (pPageStartFrame) { - if (pPageStartFrame->IsTextFrame()) - { - pPageStart = static_cast(pPageStartFrame) - ->GetTextNodeFirst(); - } - else - { - pPageStart - = static_cast(pPageStartFrame)->GetNode(); - } - } - - if (pPageEndFrame) { - if (pPageEndFrame->IsTextFrame()) - { - pPageEnd = static_cast(pPageEndFrame) - ->GetTextNodeFirst(); - } - else - { - pPageEnd = static_cast(pPageEndFrame)->GetNode(); - } - } - } - - if (!pPageStart || !pPageEnd) - { - pPageStart = pReference; - pPageEnd = pReference; - } - - std::deque pSearchSecond; - std::deque pInPage; /* or pSearchFirst */ - std::deque pSearchThird; - - bool beforeStart = true; - bool beforeEnd = true; - - for (SwNodeOffset n(0); n < nodes.Count(); n++) - { - if (beforeStart && *pPageStart == *nodes[n]) - { - beforeStart = false; - } - - if (beforeStart) - { - pSearchSecond.push_front(nodes[n]); - } - else if (beforeEnd) - { - if (bFlagFromBottom) - pInPage.push_front(nodes[n]); - else - pInPage.push_back(nodes[n]); - - if (*pPageEnd == *nodes[n]) - { - beforeEnd = false; - } - } - else - pSearchThird.push_back(nodes[n]); - } - - pTextNd = SearchForStyleAnchor(pSelf, pInPage, styleName, pStt, pEnd); - if (pTextNd) - { - break; - } - - // 2. Search up from the top of the page - pTextNd = SearchForStyleAnchor(pSelf, pSearchSecond, styleName, pStt, pEnd); - if (pTextNd) - { - break; - } - - // 3. Search down from the bottom of the page - pTextNd = SearchForStyleAnchor(pSelf, pSearchThird, styleName, pStt, pEnd); - if (pTextNd) - { - break; - } - - // Word has case insensitive styles. LO has case sensitive styles. If we didn't find - // it yet, maybe we could with a case insensitive search. Let's do that - - pTextNd = SearchForStyleAnchor(pSelf, pInPage, styleName, pStt, pEnd, - false /* bCaseSensitive */); - if (pTextNd) - { - break; - } - - pTextNd = SearchForStyleAnchor(pSelf, pSearchSecond, styleName, pStt, pEnd, - false /* bCaseSensitive */); - if (pTextNd) - { - break; - } - - pTextNd = SearchForStyleAnchor(pSelf, pSearchThird, styleName, pStt, pEnd, - false /* bCaseSensitive */); - break; - } - case Reference: - case Default: - { - // Normally, styleref does searches around the field position - // For references, styleref acts from the position of the reference not the field - // Happily, the previous code saves either one into pReference, so the following is generic for both - - std::deque pSearchFirst; - std::deque pSearchSecond; - - bool beforeElement = true; - - for (SwNodeOffset n(0); n < nodes.Count(); n++) - { - if (beforeElement) - { - pSearchFirst.push_front(nodes[n]); - - if (*pReference == *nodes[n]) - { - beforeElement = false; - } - } - pSearchSecond.push_back(nodes[n]); - } - - // 1. Search up until we hit the top of the document - - pTextNd = SearchForStyleAnchor(pSelf, pSearchFirst, styleName, pStt, pEnd); - if (pTextNd) - { - break; - } - - // 2. Search down until we hit the bottom of the document - - pTextNd = SearchForStyleAnchor(pSelf, pSearchSecond, styleName, pStt, pEnd); - if (pTextNd) - { - break; - } - - // Again, we need to remember that Word styles are not case sensitive - - pTextNd = SearchForStyleAnchor(pSelf, pSearchFirst, styleName, pStt, pEnd, - false /* bCaseSensitive */); - if (pTextNd) - { - break; - } - - pTextNd = SearchForStyleAnchor(pSelf, pSearchSecond, styleName, pStt, pEnd, - false /* bCaseSensitive */); - break; - } - default: - OSL_FAIL(" - unknown getref element type"); - } - + pTextNd = FindAnchorRefStyle(pDoc, rRefMark, nFlags, + pStt, pEnd, pLayout, pSelf, pContentFrame); break; } return pTextNd; } +SwTextNode* SwGetRefFieldType::FindAnchorRefStyle(SwDoc* pDoc, const OUString& rRefMark, + sal_uInt16 nFlags, + sal_Int32* pStt, sal_Int32* pEnd, SwRootFrame const* const pLayout, + SwTextNode* pSelf, SwFrame* pContentFrame) +{ + if (!pSelf) + return nullptr; + + SwTextNode* pTextNd = nullptr; + + StyleRefElementType elementType = StyleRefElementType::Default; + const SwTextNode* pReference = nullptr; + IDocumentRedlineAccess & rIDRA(pDoc->getIDocumentRedlineAccess()); + + /* Check if we're a footnote/endnote */ + for (SwTextFootnote* pFootnoteIdx : pDoc->GetFootnoteIdxs()) + { + if (pLayout && pLayout->IsHideRedlines() + && sw::IsFootnoteDeleted(rIDRA, *pFootnoteIdx)) + { + continue; + } + const SwNodeIndex* pIdx = pFootnoteIdx->GetStartNode(); + if (pIdx) + { + SwNodeIndex aIdx(*pIdx, 1); + SwTextNode* pFootnoteNode = aIdx.GetNode().GetTextNode(); + if (nullptr == pFootnoteNode) + pFootnoteNode = static_cast(SwNodes::GoNext(&aIdx)); + + if (*pSelf == *pFootnoteNode) + { + elementType = StyleRefElementType::Reference; + pReference = &pFootnoteIdx->GetTextNode(); + } + } + } + + if (pDoc->IsInHeaderFooter(*pSelf)) + { + elementType = StyleRefElementType::Marginal; + } + + if (pReference == nullptr) + { + pReference = pSelf; + } + + // undocumented Word feature: 1 = "Heading 1" etc. + OUString const styleName( + (rRefMark.getLength() == 1 && '1' <= rRefMark[0] && rRefMark[0] <= '9') + ? SwStyleNameMapper::GetProgName(RES_POOLCOLL_HEADLINE1 + rRefMark[0] - '1', rRefMark) + : rRefMark); + + switch (elementType) + { + case Marginal: + pTextNd = FindAnchorRefStyleMarginal(pDoc, nFlags, + pStt, pEnd, pSelf, pContentFrame, pReference, styleName); + break; + case Reference: + case Default: + pTextNd = FindAnchorRefStyleOther(pDoc, + pStt, pEnd, pSelf, pReference, styleName); + break; + default: + OSL_FAIL(" - unknown getref element type"); + } + return pTextNd; +} + +SwTextNode* SwGetRefFieldType::FindAnchorRefStyleMarginal(SwDoc* pDoc, + sal_uInt16 nFlags, + sal_Int32* pStt, sal_Int32* pEnd, + SwTextNode* pSelf, SwFrame* pContentFrame, + const SwTextNode* pReference, std::u16string_view styleName) +{ + // For marginals, styleref tries to act on the current page first + // 1. Get the page we're on, search it from top to bottom + + SwTextNode* pTextNd = nullptr; + + bool bFlagFromBottom = (nFlags & REFFLDFLAG_STYLE_FROM_BOTTOM) == REFFLDFLAG_STYLE_FROM_BOTTOM; + + Point aPt; + std::pair const tmp(aPt, false); + + if (!pContentFrame) SAL_WARN("xmloff.text", ": Missing content frame for marginal styleref"); + const SwPageFrame* pPageFrame = nullptr; + + if (pContentFrame) + pPageFrame = pContentFrame->FindPageFrame(); + + const SwNode* pPageStart(nullptr); + const SwNode* pPageEnd(nullptr); + + if (pPageFrame) + { + const SwContentFrame* pPageStartFrame = pPageFrame->FindFirstBodyContent(); + const SwContentFrame* pPageEndFrame = pPageFrame->FindLastBodyContent(); + + if (pPageStartFrame) + { + if (pPageStartFrame->IsTextFrame()) + { + pPageStart = static_cast(pPageStartFrame) + ->GetTextNodeFirst(); + } + else + { + pPageStart + = static_cast(pPageStartFrame)->GetNode(); + } + } + + if (pPageEndFrame) + { + if (pPageEndFrame->IsTextFrame()) + { + pPageEnd = static_cast(pPageEndFrame) + ->GetTextNodeFirst(); + } + else + { + pPageEnd = static_cast(pPageEndFrame)->GetNode(); + } + } + } + + if (!pPageStart || !pPageEnd) + { + pPageStart = pReference; + pPageEnd = pReference; + } + + SwNodeOffset nPageStart = pPageStart->GetIndex(); + SwNodeOffset nPageEnd = pPageEnd->GetIndex(); + const SwNodes& nodes = pDoc->GetNodes(); + + pTextNd = SearchForStyleAnchor(pSelf, nodes, nPageStart, nPageEnd, bFlagFromBottom, styleName, pStt, pEnd); + if (pTextNd) + return pTextNd; + + // 2. Search up from the top of the page + pTextNd = SearchForStyleAnchor(pSelf, nodes, SwNodeOffset(0), nPageStart - 1, /*bBackwards*/true, styleName, pStt, pEnd); + if (pTextNd) + return pTextNd; + + // 3. Search down from the bottom of the page + pTextNd = SearchForStyleAnchor(pSelf, nodes, nPageEnd + 1, nodes.Count() - 1, /*bBackwards*/false, styleName, pStt, pEnd); + if (pTextNd) + return pTextNd; + + // Word has case insensitive styles. LO has case sensitive styles. If we didn't find + // it yet, maybe we could with a case insensitive search. Let's do that + + pTextNd = SearchForStyleAnchor(pSelf, nodes, nPageStart, nPageEnd, bFlagFromBottom, styleName, pStt, pEnd, + false /* bCaseSensitive */); + if (pTextNd) + return pTextNd; + + pTextNd = SearchForStyleAnchor(pSelf, nodes, SwNodeOffset(0), nPageStart - 1, /*bBackwards*/true, styleName, pStt, pEnd, + false /* bCaseSensitive */); + if (pTextNd) + return pTextNd; + + pTextNd = SearchForStyleAnchor(pSelf, nodes, nPageEnd + 1, nodes.Count() - 1, /*bBackwards*/false, styleName, pStt, pEnd, + false /* bCaseSensitive */); + return pTextNd; +} + +SwTextNode* SwGetRefFieldType::FindAnchorRefStyleOther(SwDoc* pDoc, + sal_Int32* pStt, sal_Int32* pEnd, + SwTextNode* pSelf, + const SwTextNode* pReference, std::u16string_view styleName) +{ + // Normally, styleref does searches around the field position + // For references, styleref acts from the position of the reference not the field + // Happily, the previous code saves either one into pReference, so the following is generic for both + + SwNodeOffset nReference = pReference->GetIndex(); + const SwNodes& nodes = pDoc->GetNodes(); + SwTextNode* pTextNd = nullptr; + + // 1. Search up until we hit the top of the document + + pTextNd = SearchForStyleAnchor(pSelf, nodes, SwNodeOffset(0), nReference, /*bBackwards*/true, styleName, pStt, pEnd); + if (pTextNd) + return pTextNd; + + // 2. Search down until we hit the bottom of the document + + pTextNd = SearchForStyleAnchor(pSelf, nodes, nReference + 1, nodes.Count() - 1, /*bBackwards*/false, styleName, pStt, pEnd); + if (pTextNd) + return pTextNd; + + // Again, we need to remember that Word styles are not case sensitive + + pTextNd = SearchForStyleAnchor(pSelf, nodes, SwNodeOffset(0), nReference, /*bBackwards*/true, styleName, pStt, pEnd, + false /* bCaseSensitive */); + if (pTextNd) + return pTextNd; + + pTextNd = SearchForStyleAnchor(pSelf, nodes, nReference + 1, nodes.Count() - 1, /*bBackwards*/false, styleName, pStt, pEnd, + false /* bCaseSensitive */); + return pTextNd; +} + namespace { struct RefIdsMap diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx index 31821741c85b..bbad4462bee2 100644 --- a/sw/source/core/inc/flyfrm.hxx +++ b/sw/source/core/inc/flyfrm.hxx @@ -242,7 +242,7 @@ public: const bool _bForPaint = false ) const; // Paint on this shell (consider Preview, print flag, etc. recursively)? - static bool IsPaint( SdrObject *pObj, const SwViewShell *pSh ); + static bool IsPaint(SdrObject *pObj, const SwViewShell& rSh); /** SwFlyFrame::IsBackgroundTransparent diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index cee12b59818b..8178a7e9e71d 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -2530,19 +2530,21 @@ Size SwFlyFrame::ChgSize( const Size& aNewSize ) // of the fly frame Size aAdjustedNewSize( aNewSize ); { - if ( dynamic_cast(this) && - Lower() && dynamic_cast(Lower()) && - static_cast(Lower())->GetNode()->GetOLENode() ) + if (dynamic_cast(this)) { - SwRect aClipRect; - ::CalcClipRect( GetVirtDrawObj(), aClipRect, false ); - if ( aAdjustedNewSize.Width() > aClipRect.Width() ) + auto pLower = dynamic_cast(Lower()); + if ( pLower && pLower->GetNode()->GetOLENode() ) { - aAdjustedNewSize.setWidth( aClipRect.Width() ); - } - if ( aAdjustedNewSize.Height() > aClipRect.Height() ) - { - aAdjustedNewSize.setWidth( aClipRect.Height() ); + SwRect aClipRect; + ::CalcClipRect( GetVirtDrawObj(), aClipRect, false ); + if ( aAdjustedNewSize.Width() > aClipRect.Width() ) + { + aAdjustedNewSize.setWidth( aClipRect.Width() ); + } + if ( aAdjustedNewSize.Height() > aClipRect.Height() ) + { + aAdjustedNewSize.setWidth( aClipRect.Height() ); + } } } } diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index e8188f77f7f5..68486df83780 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -4101,20 +4101,19 @@ static void lcl_PaintReplacement( const SwRect &rRect, const SwViewShell &rSh ) Graphic::DrawEx(*rSh.GetOut(), OUString(), aFont, rBmp, rRect.Pos(), rRect.SSize()); } -bool SwFlyFrame::IsPaint( SdrObject *pObj, const SwViewShell *pSh ) +bool SwFlyFrame::IsPaint(SdrObject *pObj, const SwViewShell& rSh) { SdrObjUserCall *pUserCall = GetUserCall(pObj); if ( nullptr == pUserCall ) return true; - if ( pSh && ((!pSh->GetViewOptions()->IsDraw() + if ( (!rSh.GetViewOptions()->IsDraw() && (dynamic_cast(pObj) || dynamic_cast(pObj) || dynamic_cast(pObj))) - || (!pSh->GetViewOptions()->IsGraphic() && dynamic_cast(pObj)) ) - ) + || (!rSh.GetViewOptions()->IsGraphic() && dynamic_cast(pObj)) ) { SwRect rBoundRect = GetBoundRectOfAnchoredObj( pObj ); - lcl_PaintReplacement( rBoundRect, *pSh ); + lcl_PaintReplacement(rBoundRect, rSh); return false; } assert(pObj); @@ -4123,7 +4122,7 @@ bool SwFlyFrame::IsPaint( SdrObject *pObj, const SwViewShell *pSh ) bool bPaint = gProp.pSFlyOnlyDraw || static_cast(pUserCall)->GetFormat()->GetPrint().GetValue(); if ( !bPaint ) - bPaint = pSh->GetWin() && !pSh->IsPreview(); + bPaint = rSh.GetWin() && !rSh.IsPreview(); if ( bPaint ) { @@ -4160,7 +4159,7 @@ bool SwFlyFrame::IsPaint( SdrObject *pObj, const SwViewShell *pSh ) { if ( !pAnch->isFrameAreaPositionValid() ) pAnch = nullptr; - else if ( pSh->GetOut() == pSh->getIDocumentDeviceAccess().getPrinter( false )) + else if ( rSh.GetOut() == rSh.getIDocumentDeviceAccess().getPrinter( false )) { //HACK: we have to omit some of the objects for printing, //otherwise they would be printed twice. @@ -4183,8 +4182,7 @@ bool SwFlyFrame::IsPaint( SdrObject *pObj, const SwViewShell *pSh ) if ( pAnch ) { if ( pAnch->IsInFly() ) - bPaint = SwFlyFrame::IsPaint( pAnch->FindFlyFrame()->GetVirtDrawObj(), - pSh ); + bPaint = SwFlyFrame::IsPaint(pAnch->FindFlyFrame()->GetVirtDrawObj(), rSh); else if ( gProp.pSFlyOnlyDraw ) bPaint = false; } diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx index df41204ecac8..a2545c300abf 100644 --- a/sw/source/core/text/frmcrsr.cxx +++ b/sw/source/core/text/frmcrsr.cxx @@ -637,12 +637,12 @@ bool SwTextFrame::GetModelPositionForViewPoint_(SwPosition* pPos, const Point& r if ( IsVertical() ) { - if ( bChgFillData && pFillData ) + if ( bChgFillData ) SwitchHorizontalToVertical( pFillData->Fill().aCursor.Pos() ); const_cast(this)->SwapWidthAndHeight(); } - if ( IsRightToLeft() && bChgFillData && pFillData) + if ( IsRightToLeft() && bChgFillData ) { SwitchLTRtoRTL( pFillData->Fill().aCursor.Pos() ); const sal_Int16 eOrient = pFillData->pCMS->m_pFill->eOrient; diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx index 893f08392ef9..05f62d9ebefa 100644 --- a/sw/source/core/text/itradj.cxx +++ b/sw/source/core/text/itradj.cxx @@ -185,7 +185,14 @@ static bool lcl_CheckKashidaPositions(SwScriptInfo& rSI, SwTextSizeInfo& rInf, S if (stKashidaPos.has_value()) { TextFrameIndex nNewKashidaPos{ aScanner.GetBegin() + stKashidaPos->nIndex }; - aNewKashidaPositions.push_back(nNewKashidaPos); + + // tdf#164098: The above algorithm can return out-of-range kashida positions. This + // can happen if, for example, a single word is split across multiple lines, and + // the best kashida candidate position is on the first line. + if (nNewKashidaPos >= nIdx && nNewKashidaPos < nEnd) + { + aNewKashidaPositions.push_back(nNewKashidaPos); + } } } } diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx index fe94ad999ef5..bccc7377072d 100644 --- a/sw/source/core/text/itratr.cxx +++ b/sw/source/core/text/itratr.cxx @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -838,6 +839,93 @@ TextFrameIndex SwAttrIter::GetNextAttr() const } } +namespace +{ +class FormatBreakTracker +{ +private: + std::optional m_nCaseMap; + + bool m_bNeedsBreak = false; + + void SetCaseMap(SvxCaseMap nValue) + { + if (m_nCaseMap != nValue) + m_bNeedsBreak = true; + + m_nCaseMap = nValue; + } + +public: + void HandleItemSet(const SfxItemSet& rSet) + { + if (const SvxCaseMapItem* pItem = rSet.GetItem(RES_CHRATR_CASEMAP)) + SetCaseMap(pItem->GetCaseMap()); + } + + void Reset() { m_bNeedsBreak = false; } + + bool NeedsBreak() const { return m_bNeedsBreak; } +}; + +bool HasFormatBreakAttribute(FormatBreakTracker* pTracker, const SwTextAttr* pAttr) +{ + pTracker->Reset(); + + switch (pAttr->Which()) + { + case RES_TXTATR_AUTOFMT: + case RES_TXTATR_CHARFMT: + { + const SfxItemSet& rSet((pAttr->Which() == RES_TXTATR_CHARFMT) + ? static_cast( + pAttr->GetCharFormat().GetCharFormat()->GetAttrSet()) + : *pAttr->GetAutoFormat().GetStyleHandle()); + + pTracker->HandleItemSet(rSet); + } + break; + } + + if (pAttr->IsFormatIgnoreStart() || pAttr->IsFormatIgnoreEnd()) + pTracker->Reset(); + + return pTracker->NeedsBreak(); +} +} + +TextFrameIndex SwAttrIter::GetNextLayoutBreakAttr() const +{ + size_t nStartIndex(m_nStartIndex); + SwTextNode const* pTextNode(m_pTextNode); + + sal_Int32 nNext = std::numeric_limits::max(); + + auto* pHints = pTextNode->GetpSwpHints(); + if (!pHints) + { + return TextFrameIndex{ nNext }; + } + + FormatBreakTracker stTracker; + stTracker.HandleItemSet(pTextNode->GetSwAttrSet()); + + for (size_t i = 0; i < pHints->Count(); ++i) + { + SwTextAttr* const pAttr(pHints->Get(i)); + if (HasFormatBreakAttribute(&stTracker, pAttr)) + { + if (i >= nStartIndex) + { + nNext = pAttr->GetStart(); + break; + } + } + } + + return TextFrameIndex{ nNext }; +} + namespace { class SwMinMaxArgs diff --git a/sw/source/core/text/itratr.hxx b/sw/source/core/text/itratr.hxx index 91b3d4f9200c..d61d112404eb 100644 --- a/sw/source/core/text/itratr.hxx +++ b/sw/source/core/text/itratr.hxx @@ -87,6 +87,7 @@ public: // The parameter returns the position of the next change before or at the // char position. TextFrameIndex GetNextAttr() const; + TextFrameIndex GetNextLayoutBreakAttr() const; /// Enables the attributes used at char pos nPos in the logical font bool Seek(TextFrameIndex nPos); // Creates the font at the specified position via Seek() and checks diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index dd068364292a..8fc8764470b5 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -1392,6 +1392,8 @@ SwTextPortion *SwTextFormatter::NewTextPortion( SwTextFormatInfo &rInf ) // until next attribute change: const TextFrameIndex nNextAttr = GetNextAttr(); + // until next layout-breaking attribute change: + const TextFrameIndex nNextLayoutBreakAttr = GetNextLayoutBreakAttr(); // end of script type: const TextFrameIndex nNextScript = m_pScriptInfo->NextScriptChg(rInf.GetIdx()); // end of direction: @@ -1401,7 +1403,7 @@ SwTextPortion *SwTextFormatter::NewTextPortion( SwTextFormatInfo &rInf ) // bookmarks const TextFrameIndex nNextBookmark = m_pScriptInfo->NextBookmark(rInf.GetIdx()); - auto nNextContext = std::min({ nNextChg, nNextScript, nNextDir }); + auto nNextContext = std::min({ nNextChg, nNextLayoutBreakAttr, nNextScript, nNextDir }); nNextChg = std::min({ nNextChg, nNextAttr, nNextScript, nNextDir, nNextHidden, nNextBookmark }); // Turbo boost: diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx index ac0c96590f93..d4612cbd26d0 100644 --- a/sw/source/core/text/porfly.cxx +++ b/sw/source/core/text/porfly.cxx @@ -225,7 +225,7 @@ void sw::FlyContentPortion::Paint(const SwTextPaintInfo& rInf) const if(!((m_pFly->IsCompletePaint() || m_pFly->getFrameArea().Overlaps(aRepaintRect)) && - SwFlyFrame::IsPaint(m_pFly->GetVirtDrawObj(), m_pFly->getRootFrame()->GetCurrShell()))) + SwFlyFrame::IsPaint(m_pFly->GetVirtDrawObj(), *m_pFly->getRootFrame()->GetCurrShell()))) return; SwRect aRect(m_pFly->getFrameArea()); diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx index 7155248d793f..9974c4db6ec3 100644 --- a/sw/source/core/txtnode/atrfld.cxx +++ b/sw/source/core/txtnode/atrfld.cxx @@ -133,12 +133,12 @@ SwFormatField::SwFormatField( const SwFormatField& rAttr ) SwFormatField::~SwFormatField() { - SwFieldType* pType = mpField ? mpField->GetTyp() : nullptr; + Broadcast( SwFormatFieldHint( this, SwFormatFieldHintWhich::REMOVED ) ); + SwFieldType* pType = mpField ? mpField->GetTyp() : nullptr; if (pType && pType->Which() == SwFieldIds::Database) pType = nullptr; // DB field types destroy themselves - Broadcast( SwFormatFieldHint( this, SwFormatFieldHintWhich::REMOVED ) ); mpField.reset(); // some fields need to delete their field type diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx index 73ddbac03b84..dd3aeb3d86a3 100644 --- a/sw/source/core/view/viewimp.cxx +++ b/sw/source/core/view/viewimp.cxx @@ -537,7 +537,7 @@ void SwViewObjectContactRedirector::createRedirectedPrimitive2DSequence( SdrObject* pObj = rOriginal.GetViewContact().TryToGetSdrObject(); if ( pObj ) { - bPaint = SwFlyFrame::IsPaint( pObj, &mrViewShell ); + bPaint = SwFlyFrame::IsPaint(pObj, mrViewShell); } if ( !bPaint ) diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index e838e2868fa8..fb0ed452336f 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -580,11 +580,11 @@ SvParserState SwHTMLParser::CallParser() aInsertionRangePam.Move( fnMoveBackward ); m_xDoc->getIDocumentRedlineAccess().SplitRedline( aInsertionRangePam ); - if (SwAttrSet const*const pAttrs = pPos->GetNode().GetTextNode()->GetpSwAttrSet()) + ::std::unique_ptr pSet{new SfxItemSet(m_xDoc->GetAttrPool(), + svl::Items)}; + if (pPos->GetNode().GetTextNode()->GetParaAttr(*pSet, 0, 0, false, false)) { - m_pTargetCharAttrs.reset(new SfxItemSet(*pAttrs->GetPool(), - svl::Items)); - m_pTargetCharAttrs->Put(*pAttrs); + m_pTargetCharAttrs = std::move(pSet); } m_xDoc->SetTextFormatColl( *m_pPam, diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 228fcd65ce97..d2484c941825 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -2434,7 +2434,8 @@ void RtfAttributeOutput::OutputFlyFrame_Impl(const ww8::Frame& rFrame, const Poi m_aRun->append('}'); m_aRun->append("}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " "); xPropSet->getPropertyValue(u"Text"_ustr) >>= aTmp; - m_aRun->append(OUStringToOString(aTmp, m_rExport.GetCurrentEncoding())); + m_aRun->append( + msfilter::rtfutil::OutString(aTmp, m_rExport.GetCurrentEncoding())); m_aRun->append('}'); m_aRun->append( "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FORMFIELD @@ -2446,8 +2447,8 @@ void RtfAttributeOutput::OutputFlyFrame_Impl(const ww8::Frame& rFrame, const Poi m_aRun->append(OOO_STRING_SVTOOLS_RTF_FFOWNHELP); m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFHELPTEXT " "); - m_aRun->append( - OUStringToOString(aTmp, m_rExport.GetCurrentEncoding())); + m_aRun->append(msfilter::rtfutil::OutString( + aTmp, m_rExport.GetCurrentEncoding())); m_aRun->append('}'); } @@ -2458,8 +2459,8 @@ void RtfAttributeOutput::OutputFlyFrame_Impl(const ww8::Frame& rFrame, const Poi m_aRun->append(OOO_STRING_SVTOOLS_RTF_FFOWNSTAT); m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFSTATTEXT " "); - m_aRun->append( - OUStringToOString(aTmp, m_rExport.GetCurrentEncoding())); + m_aRun->append(msfilter::rtfutil::OutString( + aTmp, m_rExport.GetCurrentEncoding())); m_aRun->append('}'); } m_aRun->append("}"); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 0ed8fcac0ca7..d2f67900b412 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -217,6 +217,15 @@ namespace } } +// returns true if an embedded null was found +static bool clipToFirstNull(OUString& rStr) +{ + sal_Int32 nEmbeddedNullIdx = rStr.indexOf(0); + if (nEmbeddedNullIdx != -1) + rStr = rStr.copy(0, nEmbeddedNullIdx); + return nEmbeddedNullIdx != -1; +} + void SwWW8ImplReader::ReadEmbeddedData(SvStream& rStrm, SwDocShell const * pDocShell, struct HyperLinksTable& hlStr) { // (0x01B8) HLINK @@ -339,6 +348,8 @@ void SwWW8ImplReader::ReadEmbeddedData(SvStream& rStrm, SwDocShell const * pDocS if( ::get_flag( nFlags, WW8_HLINK_MARK ) ) { xTextMark.reset(new OUString(read_uInt32_lenPrefixed_uInt16s_ToOUString(rStrm))); + if (clipToFirstNull(*xTextMark)) + SAL_WARN("sw.ww8", "HLINK_MARK with embedded null, truncating to: " << *xTextMark); } if (!xLongName && xShortName) @@ -348,6 +359,8 @@ void SwWW8ImplReader::ReadEmbeddedData(SvStream& rStrm, SwDocShell const * pDocS if (xLongName) { + if (clipToFirstNull(*xLongName)) + SAL_WARN("sw.ww8", "HLINK with embedded null, truncating to: " << *xLongName); if (xTextMark) { if (xLongName->isEmpty()) diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx index af8e30c19a5e..59678acf33ef 100644 --- a/sw/source/filter/xml/xmlimpit.cxx +++ b/sw/source/filter/xml/xmlimpit.cxx @@ -227,7 +227,7 @@ void SvXMLImportItemMapper::importXMLUnknownAttributes( SfxItemSet& rSet, int i = sName.indexOf(':'); if (i != -1) { - sPrefix = sName.copy(0, i-1); + sPrefix = sName.copy(0, i); sName = sName.copy(i+1); } // the sax parser doesn't reject these, strangely diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx index ecdb14726e37..c9b9a74d730c 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -1174,7 +1174,7 @@ void SwDocShell::Hide(const OUString &rName, SfxStyleFamily nFamily, bool bHidde } } -#define MAX_CHAR_IN_INLINE_HEADING 75 +#define MAX_CHAR_IN_INLINE_HEADING 120 bool SwDocShell::MakeInlineHeading(SwWrtShell *pSh, SwTextFormatColl* pColl, const sal_uInt16 nMode) { // insert an inline heading frame, if only MAX_CHAR_IN_INLINE_HEADING or less @@ -1185,6 +1185,15 @@ bool SwDocShell::MakeInlineHeading(SwWrtShell *pSh, SwTextFormatColl* pColl, con 0 < GetView()->GetSelectionText().getLength() ) { SwTextFormatColl *pLocal = pColl? pColl: (*GetDoc()->GetTextFormatColls())[0]; + // don't put inline heading in a frame (it would be enough to limit for inline heading + // frames, but the recent FN_INSERT_FRAME cannot handle the insertion inside a frame + // correctly) + // TODO: allow to insert inline headings in a (not an Inline Heading) text frame + if ( pSh->GetCursor()->GetPointNode() != + *SwOutlineNodes::GetRootNode( &pSh->GetCursor()->GetPointNode(), /*bInlineHeading=*/false ) ) + { + return false; + } // put inside a single Undo SwRewriter aRewriter; @@ -1271,7 +1280,7 @@ SfxStyleFamily SwDocShell::ApplyStyles(const OUString &rName, SfxStyleFamily nFa // outline node's content is folded. MakeAllOutlineContentTemporarilyVisible a(GetDoc()); - // if the first 75 or less characters are selected, but not the full paragraph, + // if the first 120 or less characters are selected, but not the full paragraph, // create an inline heading from the selected text SwTextFormatColl* pColl = pStyle->GetCollection(); if ( MakeInlineHeading( pSh, pColl, nMode ) ) diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx index 98d4364fcdd9..ef814781bdd8 100644 --- a/sw/source/uibase/app/swmodule.cxx +++ b/sw/source/uibase/app/swmodule.cxx @@ -312,9 +312,7 @@ void SwDLL::RegisterControls() SwInsertAuthMarkWrapper::RegisterChildWindow( false, pMod ); SwWordCountWrapper::RegisterChildWindow( false, pMod ); SvxRubyChildWindow::RegisterChildWindow( false, pMod); - SwSpellDialogChildWindow::RegisterChildWindow( - false, pMod, comphelper::LibreOfficeKit::isActive() ? SfxChildWindowFlags::NEVERCLONE - : SfxChildWindowFlags::NONE); + SwSpellDialogChildWindow::RegisterChildWindow(false, pMod); DevelopmentToolChildWindow::RegisterChildWindow(false, pMod); SvxGrafRedToolBoxControl::RegisterControl( SID_ATTR_GRAF_RED, pMod ); diff --git a/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx b/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx index d5f5f264d657..a898f9c5384d 100644 --- a/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx +++ b/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx @@ -307,7 +307,7 @@ void A11yCheckIssuesPanel::addEntryForGroup(AccessibilityCheckGroups eGroup, void A11yCheckIssuesPanel::populateIssues() { - if (!mpDoc || !(m_xLevelExpanders[0]->is_visible() || m_xLevelExpanders[1]->is_visible())) + if (!mpDoc || mxUpdateBox->is_visible()) return; SfxViewShell* pViewShell = SfxViewShell::Current(); @@ -363,7 +363,10 @@ void A11yCheckIssuesPanel::populateIssues() addEntryForGroup(AccessibilityCheckGroups::Table, nIndices, pIssue); } break; - case sfx::AccessibilityIssueID::TEXT_FORMATTING: + case sfx::AccessibilityIssueID::TEXT_NEW_LINES: + case sfx::AccessibilityIssueID::TEXT_SPACES: + case sfx::AccessibilityIssueID::TEXT_TABS: + case sfx::AccessibilityIssueID::TEXT_EMPTY_NUM_PARA: case sfx::AccessibilityIssueID::TABLE_FORMATTING: { if (!pIssue->getHidden()) diff --git a/sw/source/uibase/sidebar/PageSizeControl.cxx b/sw/source/uibase/sidebar/PageSizeControl.cxx index 33785c007832..c8be134350bb 100644 --- a/sw/source/uibase/sidebar/PageSizeControl.cxx +++ b/sw/source/uibase/sidebar/PageSizeControl.cxx @@ -90,7 +90,7 @@ PageSizeControl::PageSizeControl(PageSizePopup* pControl, weld::Widget* pParent) maPaperList.push_back( PAPER_LETTER ); maPaperList.push_back( PAPER_LEGAL ); - mxSizeValueSet->SetStyle( mxSizeValueSet->GetStyle() | WB_3DLOOK | WB_NO_DIRECTSELECT ); + mxSizeValueSet->SetStyle( mxSizeValueSet->GetStyle() | WB_3DLOOK | WB_NO_DIRECTSELECT | WB_FLATVALUESET ); mxSizeValueSet->SetColor( Application::GetSettings().GetStyleSettings().GetMenuColor() ); sal_uInt16 nSelectedItem = 0; diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx index b3ec59e5768f..0a237988fed0 100644 --- a/sw/source/uibase/uiview/viewling.cxx +++ b/sw/source/uibase/uiview/viewling.cxx @@ -73,6 +73,7 @@ #include #include +#include #include #include @@ -839,7 +840,7 @@ void SwView::ExecSmartTagPopup( const Point& rPt ) if ( aToFill.HasArea() ) xPopupMenu->execute( m_pEditWin->GetComponentInterface(), - VCLUnoHelper::ConvertToAWTRect( m_pEditWin->LogicToPixel( aToFill.SVRect() ) ), css::awt::PopupMenuDirection::EXECUTE_DOWN ); + vcl::unohelper::ConvertToAWTRect( m_pEditWin->LogicToPixel( aToFill.SVRect() ) ), css::awt::PopupMenuDirection::EXECUTE_DOWN ); css::uno::Reference< css::lang::XComponent > xComponent( xPopupController, css::uno::UNO_QUERY ); if ( xComponent.is() ) diff --git a/sw/source/writerfilter/ooxml/OOXMLPropertySet.hxx b/sw/source/writerfilter/ooxml/OOXMLPropertySet.hxx index 3fc77dc5bc20..c23d57ed8c71 100644 --- a/sw/source/writerfilter/ooxml/OOXMLPropertySet.hxx +++ b/sw/source/writerfilter/ooxml/OOXMLPropertySet.hxx @@ -67,7 +67,7 @@ public: #ifdef DBG_UTIL virtual std::string toString() const override; #endif - virtual OOXMLValue* clone() const; + OOXMLValue* clone() const; private: typedef std::variant - 10 True False 5 diff --git a/sw/uiconfig/swriter/ui/optformataidspage.ui b/sw/uiconfig/swriter/ui/optformataidspage.ui index c461544ca92e..f9d0cce2b0b8 100644 --- a/sw/uiconfig/swriter/ui/optformataidspage.ui +++ b/sw/uiconfig/swriter/ui/optformataidspage.ui @@ -88,7 +88,7 @@ - Non-breaking s_paces + Non-breaking s_paces and hyphen True True False @@ -102,7 +102,8 @@ 1 - 3 + 7 + 2 @@ -121,7 +122,7 @@ 1 - 4 + 3
    @@ -140,7 +141,7 @@
    1 - 5 + 4 @@ -160,6 +161,7 @@ 1 6 + 2 @@ -178,13 +180,14 @@
    1 - 7 + 5
    True False + start @@ -196,6 +199,7 @@ True False + start - @@ -207,6 +211,7 @@ True False + start · @@ -218,22 +223,24 @@ True False + start 2 - 4 + 3 True False + start 2 - 5 + 4 @@ -242,11 +249,12 @@ False ⌶ indicates a point bookmark, [ and ] indicate the start and end of a bookmark on a text range + start ⌶ […]
    2 - 7 + 5 @@ -393,12 +401,6 @@ 7 - - - - - -
    diff --git a/test/source/a11y/accessibletestbase.cxx b/test/source/a11y/accessibletestbase.cxx index dc34855a3935..692f72a474fc 100644 --- a/test/source/a11y/accessibletestbase.cxx +++ b/test/source/a11y/accessibletestbase.cxx @@ -530,7 +530,7 @@ test::AccessibleTestBase::awaitDialog(const std::u16string_view name, maIdleHandler.Stop(); } - ListenerHelper(const std::u16string_view& name, std::function callback, + ListenerHelper(std::u16string_view name, std::function callback, bool bAutoClose) : mbWaitingForDialog(true) , msName(name) diff --git a/test/source/lokcallback.cxx b/test/source/lokcallback.cxx index 0914ea4db73c..0fb3cefef214 100644 --- a/test/source/lokcallback.cxx +++ b/test/source/lokcallback.cxx @@ -197,6 +197,7 @@ SfxChildWindow* TestLokCallbackWrapper::InitializeSidebar() assert(pViewShell); SfxViewFrame& rViewFrame = pViewShell->GetViewFrame(); + rViewFrame.ShowChildWindow(SID_SIDEBAR); SfxChildWindow* pSideBar = rViewFrame.GetChildWindow(SID_SIDEBAR); assert(pSideBar); diff --git a/toolkit/inc/helper/unowrapper.hxx b/toolkit/inc/helper/unowrapper.hxx index dfed1b1215f1..274e60beb2c3 100644 --- a/toolkit/inc/helper/unowrapper.hxx +++ b/toolkit/inc/helper/unowrapper.hxx @@ -60,10 +60,6 @@ public: void WindowDestroyed( vcl::Window* pWindow ) override; - // Accessibility - virtual css::uno::Reference< css::accessibility::XAccessible > - CreateAccessible( Menu* pMenu, bool bIsMenuBar ) override; - private: virtual ~UnoWrapper(); }; diff --git a/toolkit/qa/complex/toolkit/AccessibleStatusBarItem.java b/toolkit/qa/complex/toolkit/AccessibleStatusBarItem.java index d2c9b0f68a43..153bdd494aaf 100644 --- a/toolkit/qa/complex/toolkit/AccessibleStatusBarItem.java +++ b/toolkit/qa/complex/toolkit/AccessibleStatusBarItem.java @@ -305,7 +305,6 @@ public class AccessibleStatusBarItem { System.out.println("*** Now testing XAccessibleExtendedComponent ***"); _XAccessibleExtendedComponent _xAccExtComp = new _XAccessibleExtendedComponent(object); - assertTrue("failed: "+accName+" - XAccessibleExtendedComponent::getFont", _xAccExtComp._getFont()); assertTrue("failed: "+accName+" - XAccessibleExtendedComponent::getTitledBorderText", _xAccExtComp._getTitledBorderText()); assertTrue("failed: "+accName+" - XAccessibleExtendedComponent::getToolTipText", _xAccExtComp._getToolTipText()); diff --git a/toolkit/qa/complex/toolkit/accessibility/_XAccessibleExtendedComponent.java b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleExtendedComponent.java index 64dd66fcb71f..c26dd83403f0 100644 --- a/toolkit/qa/complex/toolkit/accessibility/_XAccessibleExtendedComponent.java +++ b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleExtendedComponent.java @@ -29,7 +29,6 @@ import com.sun.star.uno.UnoRuntime; *
      *
    • getForeground()
    • *
    • getBackground()
    • - *
    • getFont()
    • *
    • isEnabled()
    • *
    • getTitledBorderText()
    • *
    • getToolTipText()
    • @@ -44,15 +43,6 @@ public class _XAccessibleExtendedComponent { oObj = UnoRuntime.queryInterface(XAccessibleExtendedComponent.class, object); } - /** - * Just calls the method. - */ - public boolean _getFont() { - XFont font = oObj.getFont(); - System.out.println("getFont(): " + font); - return true; - } - /** * Calls the method and checks returned value. * Has OK status if returned value isn't null. diff --git a/toolkit/qa/cppunit/a11y/XAccessibleExtendedComponentTester.cxx b/toolkit/qa/cppunit/a11y/XAccessibleExtendedComponentTester.cxx index a7137c4ba5ac..ec192bdf0f47 100644 --- a/toolkit/qa/cppunit/a11y/XAccessibleExtendedComponentTester.cxx +++ b/toolkit/qa/cppunit/a11y/XAccessibleExtendedComponentTester.cxx @@ -23,15 +23,6 @@ #include -/** - * @brief Just calls the method. - */ -void XAccessibleExtendedComponentTester::testGetFont() -{ - auto font = mxExtendedComponent->getFont(); - std::cout << "font: " << font << std::endl; -} - /** * @brief Just calls the method. */ diff --git a/toolkit/qa/cppunit/a11y/XAccessibleExtendedComponentTester.hxx b/toolkit/qa/cppunit/a11y/XAccessibleExtendedComponentTester.hxx index 12970528229e..353fd663b1a9 100644 --- a/toolkit/qa/cppunit/a11y/XAccessibleExtendedComponentTester.hxx +++ b/toolkit/qa/cppunit/a11y/XAccessibleExtendedComponentTester.hxx @@ -35,13 +35,11 @@ public: { } - void testGetFont(); void testGetTitledBorderText(); void testGetToolTipText(); void testAll() { - testGetFont(); testGetTitledBorderText(); testGetToolTipText(); } diff --git a/toolkit/source/awt/vclxaccessiblecomponent.cxx b/toolkit/source/awt/vclxaccessiblecomponent.cxx index b53e56bf5921..33f86114bdca 100644 --- a/toolkit/source/awt/vclxaccessiblecomponent.cxx +++ b/toolkit/source/awt/vclxaccessiblecomponent.cxx @@ -28,12 +28,12 @@ #include #include #include -#include #include #include #include #include #include +#include #include #include #include @@ -697,8 +697,8 @@ uno::Reference< accessibility::XAccessible > VCLXAccessibleComponent::getAccessi uno::Reference< accessibility::XAccessibleComponent > xComp( xAcc->getAccessibleContext(), uno::UNO_QUERY ); if ( xComp.is() ) { - tools::Rectangle aRect = VCLUnoHelper::ConvertToVCLRect(xComp->getBounds()); - Point aPos = VCLUnoHelper::ConvertToVCLPoint(rPoint); + tools::Rectangle aRect = vcl::unohelper::ConvertToVCLRect(xComp->getBounds()); + Point aPos = vcl::unohelper::ConvertToVCLPoint(rPoint); if ( aRect.Contains( aPos ) ) { xChild = std::move(xAcc); @@ -720,12 +720,12 @@ awt::Rectangle VCLXAccessibleComponent::implGetBounds() if ( pWindow ) { AbsoluteScreenPixelRectangle aRect = pWindow->GetWindowExtentsAbsolute(); - aBounds = VCLUnoHelper::ConvertToAWTRect(aRect); + aBounds = vcl::unohelper::ConvertToAWTRect(aRect); vcl::Window* pParent = pWindow->GetAccessibleParentWindow(); if ( pParent ) { AbsoluteScreenPixelRectangle aParentRect = pParent->GetWindowExtentsAbsolute(); - awt::Point aParentScreenLoc = VCLUnoHelper::ConvertToAWTPoint(aParentRect.TopLeft()); + awt::Point aParentScreenLoc = vcl::unohelper::ConvertToAWTPoint(aParentRect.TopLeft()); aBounds.X -= aParentScreenLoc.X; aBounds.Y -= aParentScreenLoc.Y; } @@ -804,31 +804,6 @@ sal_Int32 SAL_CALL VCLXAccessibleComponent::getBackground( ) // XAccessibleExtendedComponent -uno::Reference< awt::XFont > SAL_CALL VCLXAccessibleComponent::getFont( ) -{ - OExternalLockGuard aGuard( this ); - - uno::Reference< awt::XFont > xFont; - VclPtr pWindow = GetWindow(); - if ( pWindow ) - { - uno::Reference< awt::XDevice > xDev( pWindow->GetComponentInterface(), uno::UNO_QUERY ); - if ( xDev.is() ) - { - vcl::Font aFont; - if ( pWindow->IsControlFont() ) - aFont = pWindow->GetControlFont(); - else - aFont = pWindow->GetFont(); - rtl::Reference pVCLXFont = new VCLXFont; - pVCLXFont->Init( *xDev, aFont ); - xFont = pVCLXFont; - } - } - - return xFont; -} - OUString SAL_CALL VCLXAccessibleComponent::getTitledBorderText( ) { OExternalLockGuard aGuard( this ); diff --git a/toolkit/source/awt/vclxdevice.cxx b/toolkit/source/awt/vclxdevice.cxx index c4ed98146713..96f2967b4a1e 100644 --- a/toolkit/source/awt/vclxdevice.cxx +++ b/toolkit/source/awt/vclxdevice.cxx @@ -32,6 +32,7 @@ #include #include #include +#include VCLXDevice::VCLXDevice() @@ -112,8 +113,8 @@ css::uno::Reference< css::awt::XFont > VCLXDevice::getFont( const css::awt::Font css::uno::Reference< css::awt::XFont > xRef; if( mpOutputDevice ) { - rtl::Reference pMetric = new VCLXFont; - pMetric->Init( *this, VCLUnoHelper::CreateFont( rDescriptor, mpOutputDevice->GetFont() ) ); + rtl::Reference pMetric + = new VCLXFont(*this, VCLUnoHelper::CreateFont(rDescriptor, mpOutputDevice->GetFont())); xRef = pMetric; } return xRef; @@ -169,9 +170,9 @@ css::awt::Point SAL_CALL VCLXDevice::convertPointToLogic( const css::awt::Point& if( mpOutputDevice ) { MapMode aMode(VCLUnoHelper::ConvertToMapModeUnit(TargetUnit)); - ::Point aVCLPoint = VCLUnoHelper::ConvertToVCLPoint(aPoint); + ::Point aVCLPoint = vcl::unohelper::ConvertToVCLPoint(aPoint); ::Point aDevPoint = mpOutputDevice->PixelToLogic(aVCLPoint, aMode ); - aAWTPoint = VCLUnoHelper::ConvertToAWTPoint(aDevPoint); + aAWTPoint = vcl::unohelper::ConvertToAWTPoint(aDevPoint); } return aAWTPoint; @@ -193,9 +194,9 @@ css::awt::Point SAL_CALL VCLXDevice::convertPointToPixel( const css::awt::Point& if( mpOutputDevice ) { MapMode aMode(VCLUnoHelper::ConvertToMapModeUnit(SourceUnit)); - ::Point aVCLPoint = VCLUnoHelper::ConvertToVCLPoint(aPoint); + ::Point aVCLPoint = vcl::unohelper::ConvertToVCLPoint(aPoint); ::Point aDevPoint = mpOutputDevice->LogicToPixel(aVCLPoint, aMode ); - aAWTPoint = VCLUnoHelper::ConvertToAWTPoint(aDevPoint); + aAWTPoint = vcl::unohelper::ConvertToAWTPoint(aDevPoint); } return aAWTPoint; @@ -217,9 +218,9 @@ css::awt::Size SAL_CALL VCLXDevice::convertSizeToLogic( const css::awt::Size& aS if( mpOutputDevice ) { MapMode aMode(VCLUnoHelper::ConvertToMapModeUnit(TargetUnit)); - ::Size aVCLSize = VCLUnoHelper::ConvertToVCLSize(aSize); + ::Size aVCLSize = vcl::unohelper::ConvertToVCLSize(aSize); ::Size aDevSz = mpOutputDevice->PixelToLogic(aVCLSize, aMode ); - aAWTSize = VCLUnoHelper::ConvertToAWTSize(aDevSz); + aAWTSize = vcl::unohelper::ConvertToAWTSize(aDevSz); } return aAWTSize; @@ -240,9 +241,9 @@ css::awt::Size SAL_CALL VCLXDevice::convertSizeToPixel( const css::awt::Size& aS if( mpOutputDevice ) { MapMode aMode(VCLUnoHelper::ConvertToMapModeUnit(SourceUnit)); - ::Size aVCLSize = VCLUnoHelper::ConvertToVCLSize(aSize); + ::Size aVCLSize = vcl::unohelper::ConvertToVCLSize(aSize); ::Size aDevSz = mpOutputDevice->LogicToPixel(aVCLSize, aMode ); - aAWTSize = VCLUnoHelper::ConvertToAWTSize(aDevSz); + aAWTSize = vcl::unohelper::ConvertToAWTSize(aDevSz); } return aAWTSize; diff --git a/toolkit/source/awt/vclxfont.cxx b/toolkit/source/awt/vclxfont.cxx index 32a42dec7579..d95ec480191b 100644 --- a/toolkit/source/awt/vclxfont.cxx +++ b/toolkit/source/awt/vclxfont.cxx @@ -30,24 +30,16 @@ #include #include -VCLXFont::VCLXFont() +VCLXFont::VCLXFont(css::awt::XDevice& rxDev, const vcl::Font& rFont) { - mpFontMetric = nullptr; + mxDevice = &rxDev; + maFont = rFont; } VCLXFont::~VCLXFont() { } -void VCLXFont::Init( css::awt::XDevice& rxDev, const vcl::Font& rFont ) -{ - mxDevice = &rxDev; - - mpFontMetric.reset(); - - maFont = rFont; -} - bool VCLXFont::ImplAssertValidFontMetric() { if ( !mpFontMetric && mxDevice.is() ) diff --git a/toolkit/source/awt/vclxgraphics.cxx b/toolkit/source/awt/vclxgraphics.cxx index 6925fccb9fa5..2c0987e818d8 100644 --- a/toolkit/source/awt/vclxgraphics.cxx +++ b/toolkit/source/awt/vclxgraphics.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include using namespace com::sun::star; @@ -244,7 +245,7 @@ void VCLXGraphics::clear( if( mpOutputDevice ) { - const ::tools::Rectangle aVCLRect = VCLUnoHelper::ConvertToVCLRect( aRect ); + const ::tools::Rectangle aVCLRect = vcl::unohelper::ConvertToVCLRect( aRect ); mpOutputDevice->Erase( aVCLRect ); } } diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx index 14cd09d60514..fb12c14180b6 100644 --- a/toolkit/source/awt/vclxmenu.cxx +++ b/toolkit/source/awt/vclxmenu.cxx @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -506,7 +507,7 @@ sal_Int16 VCLXMenu::execute( pPopupMenu->SetMenuFlags(nMenuFlags); // cannot call this with mutex locked because it will call back into us return pPopupMenu->Execute( - VCLUnoHelper::GetWindow(rxWindowPeer), VCLUnoHelper::ConvertToVCLRect(rPos), + VCLUnoHelper::GetWindow(rxWindowPeer), vcl::unohelper::ConvertToVCLRect(rPos), static_cast(nFlags) | PopupMenuFlags::NoMouseUpClose); } diff --git a/toolkit/source/awt/vclxregion.cxx b/toolkit/source/awt/vclxregion.cxx index 1d9eec4785dc..c30538b27695 100644 --- a/toolkit/source/awt/vclxregion.cxx +++ b/toolkit/source/awt/vclxregion.cxx @@ -19,6 +19,7 @@ #include #include +#include VCLXRegion::VCLXRegion() @@ -33,7 +34,7 @@ css::awt::Rectangle VCLXRegion::getBounds() { std::scoped_lock aGuard( maMutex ); - return VCLUnoHelper::ConvertToAWTRect(maRegion.GetBoundRect()); + return vcl::unohelper::ConvertToAWTRect(maRegion.GetBoundRect()); } void VCLXRegion::clear() @@ -54,28 +55,28 @@ void VCLXRegion::unionRectangle( const css::awt::Rectangle& rRect ) { std::scoped_lock aGuard( maMutex ); - maRegion.Union(VCLUnoHelper::ConvertToVCLRect(rRect)); + maRegion.Union(vcl::unohelper::ConvertToVCLRect(rRect)); } void VCLXRegion::intersectRectangle( const css::awt::Rectangle& rRect ) { std::scoped_lock aGuard( maMutex ); - maRegion.Intersect(VCLUnoHelper::ConvertToVCLRect(rRect)); + maRegion.Intersect(vcl::unohelper::ConvertToVCLRect(rRect)); } void VCLXRegion::excludeRectangle( const css::awt::Rectangle& rRect ) { std::scoped_lock aGuard( maMutex ); - maRegion.Exclude(VCLUnoHelper::ConvertToVCLRect(rRect)); + maRegion.Exclude(vcl::unohelper::ConvertToVCLRect(rRect)); } void VCLXRegion::xOrRectangle( const css::awt::Rectangle& rRect ) { std::scoped_lock aGuard( maMutex ); - maRegion.XOr(VCLUnoHelper::ConvertToVCLRect(rRect)); + maRegion.XOr(vcl::unohelper::ConvertToVCLRect(rRect)); } void VCLXRegion::unionRegion( const css::uno::Reference< css::awt::XRegion >& rxRegion ) @@ -123,14 +124,14 @@ css::uno::Sequence< css::awt::Rectangle > VCLXRegion::getRectangles() for(const auto& rRect : aRectangles) { - aRects.getArray()[a++] = VCLUnoHelper::ConvertToAWTRect(rRect); + aRects.getArray()[a++] = vcl::unohelper::ConvertToAWTRect(rRect); } //Rectangle aRect; //sal_uInt32 nR = 0; //RegionHandle h = maRegion.BeginEnumRects(); //while ( maRegion.GetEnumRects( h, aRect ) ) - // aRects.getArray()[nR++] = VCLUnoHelper::ConvertToAWTRect( aRect ); + // aRects.getArray()[nR++] = vcl::unohelper::ConvertToAWTRect( aRect ); //maRegion.EndEnumRects( h ); return aRects; diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index c13d6c3fc8bb..46367dc8fffb 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -62,6 +62,7 @@ #include #include #include +#include #include #ifdef MACOSX @@ -1874,7 +1875,7 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow( } else if ( !VCLUnoHelper::IsZero( rDescriptor.Bounds ) ) { - tools::Rectangle aRect = VCLUnoHelper::ConvertToVCLRect(rDescriptor.Bounds); + tools::Rectangle aRect = vcl::unohelper::ConvertToVCLRect(rDescriptor.Bounds); pNewWindow->SetPosSizePixel( aRect.TopLeft(), aRect.GetSize() ); } diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index 79b21ebfa4d3..ed9e80e506fe 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -448,7 +449,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) { css::awt::PaintEvent aEvent; aEvent.Source = getXWeak(); - aEvent.UpdateRect = VCLUnoHelper::ConvertToAWTRect( + aEvent.UpdateRect = vcl::unohelper::ConvertToAWTRect( *static_cast(rVclWindowEvent.GetData())); aEvent.Count = 0; mpImpl->getPaintListeners().windowPaint( aEvent ); @@ -757,7 +758,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) { css::awt::DockingEvent aEvent; aEvent.Source = getXWeak(); - aEvent.TrackingRectangle = VCLUnoHelper::ConvertToAWTRect(pData->maTrackRect); + aEvent.TrackingRectangle = vcl::unohelper::ConvertToAWTRect(pData->maTrackRect); aEvent.MousePos.X = pData->maMousePos.X(); aEvent.MousePos.Y = pData->maMousePos.Y(); aEvent.bLiveMode = false; @@ -778,7 +779,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) { css::awt::DockingEvent aEvent; aEvent.Source = getXWeak(); - aEvent.TrackingRectangle = VCLUnoHelper::ConvertToAWTRect(pData->maTrackRect); + aEvent.TrackingRectangle = vcl::unohelper::ConvertToAWTRect(pData->maTrackRect); aEvent.MousePos.X = pData->maMousePos.X(); aEvent.MousePos.Y = pData->maMousePos.Y(); aEvent.bLiveMode = false; @@ -794,7 +795,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) css::awt::DockingData aDockingData = xFirstListener->docking( aEvent ); pData->maTrackRect - = VCLUnoHelper::ConvertToVCLRect(aDockingData.TrackingRectangle); + = vcl::unohelper::ConvertToVCLRect(aDockingData.TrackingRectangle); pData->mbFloating = aDockingData.bFloating; } } @@ -810,7 +811,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) { css::awt::EndDockingEvent aEvent; aEvent.Source = getXWeak(); - aEvent.WindowRectangle = VCLUnoHelper::ConvertToAWTRect(pData->maWindowRect); + aEvent.WindowRectangle = vcl::unohelper::ConvertToAWTRect(pData->maWindowRect); aEvent.bFloating = pData->mbFloating; aEvent.bCancelled = pData->mbCancelled; mpImpl->getDockableWindowListeners().notifyEach( &XDockableWindowListener::endDocking, aEvent ); @@ -983,10 +984,10 @@ css::awt::Rectangle VCLXWindow::getPosSize( ) if ( GetWindow() ) { if( vcl::Window::GetDockingManager()->IsDockable( GetWindow() ) ) - aBounds = VCLUnoHelper::ConvertToAWTRect( + aBounds = vcl::unohelper::ConvertToAWTRect( vcl::Window::GetDockingManager()->GetPosSizePixel(GetWindow())); else - aBounds = VCLUnoHelper::ConvertToAWTRect( + aBounds = vcl::unohelper::ConvertToAWTRect( tools::Rectangle(GetWindow()->GetPosPixel(), GetWindow()->GetSizePixel())); } @@ -1186,7 +1187,7 @@ void VCLXWindow::invalidateRect( const css::awt::Rectangle& rRect, sal_Int16 nIn SolarMutexGuard aGuard; if ( GetWindow() ) - GetWindow()->Invalidate(VCLUnoHelper::ConvertToVCLRect(rRect), + GetWindow()->Invalidate(vcl::unohelper::ConvertToVCLRect(rRect), static_cast(nInvalidateFlags)); } @@ -2417,8 +2418,7 @@ css::uno::Reference< css::accessibility::XAccessibleContext > VCLXWindow::getAcc mpImpl->mxAccessibleContext = CreateAccessibleContext(); // add as event listener to this component - // in case somebody disposes it, we do not want to have a (though weak) reference to a dead - // object + // in case somebody disposes it, we do not want to have a reference to a dead object uno::Reference< lang::XComponent > xComp( mpImpl->mxAccessibleContext, uno::UNO_QUERY ); if ( xComp.is() ) xComp->addEventListener( this ); @@ -2521,14 +2521,14 @@ void SAL_CALL VCLXWindow::setOutputSize( const css::awt::Size& aSize ) { SolarMutexGuard aGuard; if( VclPtr pWindow = GetWindow() ) - pWindow->SetOutputSizePixel(VCLUnoHelper::ConvertToVCLSize(aSize)); + pWindow->SetOutputSizePixel(vcl::unohelper::ConvertToVCLSize(aSize)); } css::awt::Size SAL_CALL VCLXWindow::getOutputSize( ) { SolarMutexGuard aGuard; if( VclPtr pWindow = GetWindow() ) - return VCLUnoHelper::ConvertToAWTSize(pWindow->GetOutputSizePixel()); + return vcl::unohelper::ConvertToAWTSize(pWindow->GetOutputSizePixel()); else return css::awt::Size(); } diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index ab98b6f52592..b64b326a7576 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -442,7 +443,7 @@ css::awt::Size VCLXButton::getMinimumSize( ) VclPtr< PushButton > pButton = GetAs< PushButton >(); if ( pButton ) aSz = pButton->CalcMinimumSize(); - return VCLUnoHelper::ConvertToAWTSize(aSz); + return vcl::unohelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXButton::getPreferredSize( ) @@ -457,7 +458,7 @@ css::awt::Size VCLXButton::calcAdjustedSize( const css::awt::Size& rNewSize ) { SolarMutexGuard aGuard; - Size aSz = VCLUnoHelper::ConvertToVCLSize(rNewSize); + Size aSz = vcl::unohelper::ConvertToVCLSize(rNewSize); VclPtr< PushButton > pButton = GetAs< PushButton >(); if ( pButton ) { @@ -478,7 +479,7 @@ css::awt::Size VCLXButton::calcAdjustedSize( const css::awt::Size& rNewSize ) aSz = aMinSz; } } - return VCLUnoHelper::ConvertToAWTSize(aSz); + return vcl::unohelper::ConvertToAWTSize(aSz); } void VCLXButton::setProperty( const OUString& PropertyName, const css::uno::Any& Value) @@ -661,7 +662,7 @@ css::awt::Size VCLXImageControl::getMinimumSize( ) Size aSz = GetImage().GetSizePixel(); aSz = ImplCalcWindowSize( aSz ); - return VCLUnoHelper::ConvertToAWTSize(aSz); + return vcl::unohelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXImageControl::getPreferredSize( ) @@ -898,7 +899,7 @@ css::awt::Size VCLXCheckBox::getMinimumSize() VclPtr< CheckBox > pCheckBox = GetAs< CheckBox >(); if ( pCheckBox ) aSz = pCheckBox->CalcMinimumSize(); - return VCLUnoHelper::ConvertToAWTSize(aSz); + return vcl::unohelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXCheckBox::getPreferredSize() @@ -910,7 +911,7 @@ css::awt::Size VCLXCheckBox::calcAdjustedSize( const css::awt::Size& rNewSize ) { SolarMutexGuard aGuard; - Size aSz = VCLUnoHelper::ConvertToVCLSize(rNewSize); + Size aSz = vcl::unohelper::ConvertToVCLSize(rNewSize); VclPtr< CheckBox > pCheckBox = GetAs< CheckBox >(); if ( pCheckBox ) { @@ -920,7 +921,7 @@ css::awt::Size VCLXCheckBox::calcAdjustedSize( const css::awt::Size& rNewSize ) else aSz = aMinSz; } - return VCLUnoHelper::ConvertToAWTSize(aSz); + return vcl::unohelper::ConvertToAWTSize(aSz); } void VCLXCheckBox::setProperty( const OUString& PropertyName, const css::uno::Any& Value) @@ -1223,7 +1224,7 @@ css::awt::Size VCLXRadioButton::getMinimumSize( ) VclPtr< RadioButton > pRadioButton = GetAs< RadioButton >(); if ( pRadioButton ) aSz = pRadioButton->CalcMinimumSize(); - return VCLUnoHelper::ConvertToAWTSize(aSz); + return vcl::unohelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXRadioButton::getPreferredSize( ) @@ -1235,7 +1236,7 @@ css::awt::Size VCLXRadioButton::calcAdjustedSize( const css::awt::Size& rNewSize { SolarMutexGuard aGuard; - Size aSz = VCLUnoHelper::ConvertToVCLSize(rNewSize); + Size aSz = vcl::unohelper::ConvertToVCLSize(rNewSize); VclPtr< RadioButton > pRadioButton = GetAs< RadioButton >(); if ( pRadioButton ) { @@ -1245,7 +1246,7 @@ css::awt::Size VCLXRadioButton::calcAdjustedSize( const css::awt::Size& rNewSize else aSz = aMinSz; } - return VCLUnoHelper::ConvertToAWTSize(aSz); + return vcl::unohelper::ConvertToAWTSize(aSz); } void VCLXRadioButton::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) @@ -1963,7 +1964,7 @@ css::awt::Size VCLXListBox::getMinimumSize( ) VclPtr< ListBox > pListBox = GetAs< ListBox >(); if ( pListBox ) aSz = pListBox->CalcMinimumSize(); - return VCLUnoHelper::ConvertToAWTSize(aSz); + return vcl::unohelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXListBox::getPreferredSize( ) @@ -1977,17 +1978,17 @@ css::awt::Size VCLXListBox::getPreferredSize( ) if ( pListBox->GetStyle() & WB_DROPDOWN ) aSz.AdjustHeight(4 ); } - return VCLUnoHelper::ConvertToAWTSize(aSz); + return vcl::unohelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXListBox::calcAdjustedSize( const css::awt::Size& rNewSize ) { SolarMutexGuard aGuard; - Size aSz = VCLUnoHelper::ConvertToVCLSize(rNewSize); + Size aSz = vcl::unohelper::ConvertToVCLSize(rNewSize); VclPtr< ListBox > pListBox = GetAs< ListBox >(); if ( pListBox ) aSz = pListBox->CalcAdjustedSize( aSz ); - return VCLUnoHelper::ConvertToAWTSize(aSz); + return vcl::unohelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXListBox::getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) @@ -1997,7 +1998,7 @@ css::awt::Size VCLXListBox::getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) VclPtr< ListBox > pListBox = GetAs< ListBox >(); if ( pListBox ) aSz = pListBox->CalcBlockSize( nCols, nLines ); - return VCLUnoHelper::ConvertToAWTSize(aSz); + return vcl::unohelper::ConvertToAWTSize(aSz); } void VCLXListBox::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) @@ -2880,7 +2881,7 @@ css::awt::Size VCLXFixedHyperlink::getMinimumSize( ) VclPtr< FixedText > pFixedText = GetAs< FixedText >(); if ( pFixedText ) aSz = pFixedText->CalcMinimumSize(); - return VCLUnoHelper::ConvertToAWTSize(aSz); + return vcl::unohelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXFixedHyperlink::getPreferredSize( ) @@ -2891,7 +2892,7 @@ css::awt::Size VCLXFixedHyperlink::getPreferredSize( ) css::awt::Size VCLXFixedHyperlink::calcAdjustedSize( const css::awt::Size& rNewSize ) { SolarMutexGuard aGuard; - Size aSz( VCLUnoHelper::ConvertToVCLSize( rNewSize )); + Size aSz( vcl::unohelper::ConvertToVCLSize( rNewSize )); VclPtr< FixedText > pFixedText = GetAs< FixedText >(); if (pFixedText) { @@ -2902,7 +2903,7 @@ css::awt::Size VCLXFixedHyperlink::calcAdjustedSize( const css::awt::Size& rNewS aSz = aMinSz; } - return VCLUnoHelper::ConvertToAWTSize(aSz); + return vcl::unohelper::ConvertToAWTSize(aSz); } void VCLXFixedHyperlink::setProperty( const OUString& PropertyName, const css::uno::Any& Value) @@ -3102,7 +3103,7 @@ css::awt::Size VCLXFixedText::getMinimumSize( ) VclPtr< FixedText > pFixedText = GetAs< FixedText >(); if ( pFixedText ) aSz = pFixedText->CalcMinimumSize(); - return VCLUnoHelper::ConvertToAWTSize(aSz); + return vcl::unohelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXFixedText::getPreferredSize( ) @@ -3114,11 +3115,11 @@ css::awt::Size VCLXFixedText::calcAdjustedSize( const css::awt::Size& rMaxSize ) { SolarMutexGuard aGuard; - Size aAdjustedSize( VCLUnoHelper::ConvertToVCLSize( rMaxSize ) ); + Size aAdjustedSize( vcl::unohelper::ConvertToVCLSize( rMaxSize ) ); VclPtr< FixedText > pFixedText = GetAs< FixedText >(); if ( pFixedText ) aAdjustedSize = pFixedText->CalcMinimumSize( rMaxSize.Width ); - return VCLUnoHelper::ConvertToAWTSize( aAdjustedSize ); + return vcl::unohelper::ConvertToAWTSize( aAdjustedSize ); } @@ -3860,7 +3861,7 @@ css::awt::Size VCLXEdit::getMinimumSize( ) VclPtr< Edit > pEdit = GetAs< Edit >(); if ( pEdit ) aSz = pEdit->CalcMinimumSize(); - return VCLUnoHelper::ConvertToAWTSize(aSz); + return vcl::unohelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXEdit::getPreferredSize( ) @@ -3874,7 +3875,7 @@ css::awt::Size VCLXEdit::getPreferredSize( ) aSz = pEdit->CalcMinimumSize(); aSz.AdjustHeight(4 ); } - return VCLUnoHelper::ConvertToAWTSize(aSz); + return vcl::unohelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXEdit::calcAdjustedSize( const css::awt::Size& rNewSize ) @@ -3902,7 +3903,7 @@ css::awt::Size VCLXEdit::getMinimumSize( sal_Int16 nCols, sal_Int16 ) else aSz = pEdit->CalcMinimumSize(); } - return VCLUnoHelper::ConvertToAWTSize(aSz); + return vcl::unohelper::ConvertToAWTSize(aSz); } void VCLXEdit::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) @@ -4317,7 +4318,7 @@ css::awt::Size VCLXComboBox::getMinimumSize( ) VclPtr< ComboBox > pComboBox = GetAs< ComboBox >(); if ( pComboBox ) aSz = pComboBox->CalcMinimumSize(); - return VCLUnoHelper::ConvertToAWTSize(aSz); + return vcl::unohelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXComboBox::getPreferredSize( ) @@ -4332,18 +4333,18 @@ css::awt::Size VCLXComboBox::getPreferredSize( ) if ( pComboBox->GetStyle() & WB_DROPDOWN ) aSz.AdjustHeight(4 ); } - return VCLUnoHelper::ConvertToAWTSize(aSz); + return vcl::unohelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXComboBox::calcAdjustedSize( const css::awt::Size& rNewSize ) { SolarMutexGuard aGuard; - Size aSz = VCLUnoHelper::ConvertToVCLSize(rNewSize); + Size aSz = vcl::unohelper::ConvertToVCLSize(rNewSize); VclPtr< ComboBox > pComboBox = GetAs< ComboBox >(); if ( pComboBox ) aSz = pComboBox->CalcAdjustedSize( aSz ); - return VCLUnoHelper::ConvertToAWTSize(aSz); + return vcl::unohelper::ConvertToAWTSize(aSz); } css::awt::Size VCLXComboBox::getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) @@ -4354,7 +4355,7 @@ css::awt::Size VCLXComboBox::getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) VclPtr< ComboBox > pComboBox = GetAs< ComboBox >(); if ( pComboBox ) aSz = pComboBox->CalcBlockSize( nCols, nLines ); - return VCLUnoHelper::ConvertToAWTSize(aSz); + return vcl::unohelper::ConvertToAWTSize(aSz); } void VCLXComboBox::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) @@ -6455,7 +6456,7 @@ css::awt::Size VCLXFileControl::getMinimumSize() { Size aTmpSize = pControl->GetEdit().CalcMinimumSize(); aTmpSize.AdjustWidth(pControl->GetButton().CalcMinimumSize().Width() ); - aSz = VCLUnoHelper::ConvertToAWTSize(pControl->CalcWindowSize(aTmpSize)); + aSz = vcl::unohelper::ConvertToAWTSize(pControl->CalcWindowSize(aTmpSize)); } return aSz; } @@ -6490,7 +6491,7 @@ css::awt::Size VCLXFileControl::getMinimumSize( sal_Int16 nCols, sal_Int16 ) VclPtr< FileControl > pControl = GetAs< FileControl >(); if ( pControl ) { - aSz = VCLUnoHelper::ConvertToAWTSize(pControl->GetEdit().CalcSize(nCols)); + aSz = vcl::unohelper::ConvertToAWTSize(pControl->GetEdit().CalcSize(nCols)); aSz.Width += pControl->GetButton().CalcMinimumSize().Width(); } return aSz; @@ -7682,7 +7683,7 @@ css::awt::Size VCLXMultiLineEdit::getMinimumSize() css::awt::Size aSz; VclPtr< MultiLineEdit > pEdit = GetAs< MultiLineEdit >(); if ( pEdit ) - aSz = VCLUnoHelper::ConvertToAWTSize(pEdit->CalcMinimumSize()); + aSz = vcl::unohelper::ConvertToAWTSize(pEdit->CalcMinimumSize()); return aSz; } @@ -7698,8 +7699,8 @@ css::awt::Size VCLXMultiLineEdit::calcAdjustedSize( const css::awt::Size& rNewSi css::awt::Size aSz = rNewSize; VclPtr< MultiLineEdit > pEdit = GetAs< MultiLineEdit >(); if ( pEdit ) - aSz = VCLUnoHelper::ConvertToAWTSize( - pEdit->CalcAdjustedSize(VCLUnoHelper::ConvertToVCLSize(rNewSize))); + aSz = vcl::unohelper::ConvertToAWTSize( + pEdit->CalcAdjustedSize(vcl::unohelper::ConvertToVCLSize(rNewSize))); return aSz; } @@ -7710,7 +7711,7 @@ css::awt::Size VCLXMultiLineEdit::getMinimumSize( sal_Int16 nCols, sal_Int16 nLi css::awt::Size aSz; VclPtr< MultiLineEdit > pEdit = GetAs< MultiLineEdit >(); if ( pEdit ) - aSz = VCLUnoHelper::ConvertToAWTSize(pEdit->CalcBlockSize(nCols, nLines)); + aSz = vcl::unohelper::ConvertToAWTSize(pEdit->CalcBlockSize(nCols, nLines)); return aSz; } diff --git a/toolkit/source/controls/tree/treecontrolpeer.cxx b/toolkit/source/controls/tree/treecontrolpeer.cxx index 4ad836db314a..ef2779f118a4 100644 --- a/toolkit/source/controls/tree/treecontrolpeer.cxx +++ b/toolkit/source/controls/tree/treecontrolpeer.cxx @@ -24,7 +24,6 @@ #include #include #include -#include #include #include @@ -39,6 +38,7 @@ #include #include #include +#include #include #include @@ -843,7 +843,7 @@ awt::Rectangle SAL_CALL TreeControlPeer::getNodeRect( const Reference< XTreeNode UnoTreeListEntry* pEntry = getEntry( i_Node ); ::tools::Rectangle aEntryRect( rTree.GetFocusRect( pEntry, rTree.GetEntryPosition( pEntry ).Y() ) ); - return VCLUnoHelper::ConvertToAWTRect( aEntryRect ); + return vcl::unohelper::ConvertToAWTRect( aEntryRect ); } @@ -1188,7 +1188,7 @@ css::awt::Size TreeControlPeer::getMinimumSize() /* todo MultiLineEdit* pEdit = (MultiLineEdit*) GetWindow(); if ( pEdit ) - aSz = VCLUnoHelper::ConvertToAWTSize(pEdit->CalcMinimumSize()); + aSz = vcl::unohelper::ConvertToAWTSize(pEdit->CalcMinimumSize()); */ return aSz; } @@ -1206,7 +1206,7 @@ css::awt::Size TreeControlPeer::calcAdjustedSize( const css::awt::Size& rNewSize /* todo MultiLineEdit* pEdit = (MultiLineEdit*) GetWindow(); if ( pEdit ) - aSz = VCLUnoHelper::ConvertToAWTSize(pEdit->CalcAdjustedSize(VCLUnoHelper::ConvertToVCLSize(rNewSize))); + aSz = vcl::unohelper::ConvertToAWTSize(pEdit->CalcAdjustedSize(vcl::unohelper::ConvertToVCLSize(rNewSize))); */ return aSz; } diff --git a/toolkit/source/hatchwindow/hatchwindow.cxx b/toolkit/source/hatchwindow/hatchwindow.cxx index ba7add58485f..b4ccadc84a10 100644 --- a/toolkit/source/hatchwindow/hatchwindow.cxx +++ b/toolkit/source/hatchwindow/hatchwindow.cxx @@ -23,11 +23,11 @@ #include "hatchwindow.hxx" #include "ipwin.hxx" -#include #include #include #include #include +#include using namespace ::com::sun::star; @@ -72,11 +72,11 @@ void VCLXHatchWindow::QueryObjAreaPixel( tools::Rectangle & aRect ) if ( !m_xController.is() ) return; - awt::Rectangle aUnoRequestRect = VCLUnoHelper::ConvertToAWTRect(aRect); + awt::Rectangle aUnoRequestRect = vcl::unohelper::ConvertToAWTRect(aRect); try { awt::Rectangle aUnoResultRect = m_xController->calcAdjustedRectangle( aUnoRequestRect ); - aRect = VCLUnoHelper::ConvertToVCLRect(aUnoResultRect); + aRect = vcl::unohelper::ConvertToVCLRect(aUnoResultRect); } catch( uno::Exception& ) { @@ -88,7 +88,7 @@ void VCLXHatchWindow::RequestObjAreaPixel( const tools::Rectangle & aRect ) { if ( m_xController.is() ) { - awt::Rectangle aUnoRequestRect = VCLUnoHelper::ConvertToAWTRect(aRect); + awt::Rectangle aUnoRequestRect = vcl::unohelper::ConvertToAWTRect(aRect); try { m_xController->requestPositioning( aUnoRequestRect ); diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx index 50e1c8e74d90..3c2b7dbaff7f 100644 --- a/toolkit/source/helper/unowrapper.cxx +++ b/toolkit/source/helper/unowrapper.cxx @@ -312,9 +312,4 @@ void UnoWrapper::WindowDestroyed( vcl::Window* pWindow ) } } -css::uno::Reference< css::accessibility::XAccessible > UnoWrapper::CreateAccessible( Menu* pMenu, bool bIsMenuBar ) -{ - return maAccessibleFactoryAccess.getFactory().createAccessible( pMenu, bIsMenuBar ); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/source/helper/vclunohelper.cxx b/toolkit/source/helper/vclunohelper.cxx index 6976b8c0db5a..8e70456b1386 100644 --- a/toolkit/source/helper/vclunohelper.cxx +++ b/toolkit/source/helper/vclunohelper.cxx @@ -102,7 +102,7 @@ vcl::Region VCLUnoHelper::GetRegion( const css::uno::Reference< css::awt::XRegio { const css::uno::Sequence< css::awt::Rectangle > aRects = rxRegion->getRectangles(); for ( const auto& rRect : aRects ) - aRegion.Union(VCLUnoHelper::ConvertToVCLRect(rRect)); + aRegion.Union(vcl::unohelper::ConvertToVCLRect(rRect)); } return aRegion; } diff --git a/translations b/translations index 685db476dad2..6eca39581073 160000 --- a/translations +++ b/translations @@ -1 +1 @@ -Subproject commit 685db476dad288f6635917ae0ca05d5369c64c15 +Subproject commit 6eca395810730a005bd24fcafa92eba4860350b9 diff --git a/unotest/source/cpp/macros_test.cxx b/unotest/source/cpp/macros_test.cxx index 83df09259d45..f353eba782e5 100644 --- a/unotest/source/cpp/macros_test.cxx +++ b/unotest/source/cpp/macros_test.cxx @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -98,6 +99,62 @@ MacrosTest::dispatchCommand(const uno::Reference& xComponent, return ret; } +namespace +{ +class StateGetter : public ::cppu::WeakImplHelper +{ +public: + uno::Any& m_rOldValue; + bool m_Received{ false }; + StateGetter(uno::Any& rOldValue) + : m_rOldValue(rOldValue) + { + } + + virtual void SAL_CALL disposing(lang::EventObject const&) override + { + CPPUNIT_ASSERT(m_Received); + } + virtual void SAL_CALL statusChanged(frame::FeatureStateEvent const& rEvent) override + { + if (!m_Received) + { + m_rOldValue = rEvent.State; + m_Received = true; + } + } +}; + +} // namespace + +uno::Any MacrosTest::queryDispatchStatus(uno::Reference const& xComponent, + uno::Reference const& xContext, + OUString const& rURL) +{ + uno::Any ret; + + util::URL url; + url.Complete = rURL; + { + uno::Reference const xParser( + css::util::URLTransformer::create(xContext)); + CPPUNIT_ASSERT(xParser.is()); + xParser->parseStrict(url); + } + + uno::Reference const xController + = uno::Reference(xComponent, uno::UNO_QUERY_THROW)->getCurrentController(); + uno::Reference const xFrame(xController->getFrame(), uno::UNO_QUERY); + CPPUNIT_ASSERT(xFrame.is()); + uno::Reference const xDisp(xFrame->queryDispatch(url, "", 0)); + CPPUNIT_ASSERT(xDisp.is()); + + uno::Reference const xListener{ new StateGetter(ret) }; + xDisp->addStatusListener(xListener, url); + + return ret; +} + std::unique_ptr MacrosTest::parseExportStream(const OUString& url, const OUString& rStreamName) { diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx index 04ee85e3c2bf..5a39f691eeea 100644 --- a/vbahelper/source/vbahelper/vbahelper.cxx +++ b/vbahelper/source/vbahelper/vbahelper.cxx @@ -747,7 +747,7 @@ void setOrAppendPropertyValue( uno::Sequence< beans::PropertyValue >& aProp, con pProp[ nLength ].Value = aValue; } -bool executeRunTimeLibrary(const std::u16string_view& rSbRtl_command, SbxArray* pParameters) +bool executeRunTimeLibrary(std::u16string_view rSbRtl_command, SbxArray* pParameters) { StarBASIC* pBasic = dynamic_cast< StarBASIC* >(StarBASIC::GetActiveModule()->GetParent()); if (!pBasic) diff --git a/vcl/CustomTarget_qt5_moc.mk b/vcl/CustomTarget_qt5_moc.mk index 3b7c6165e5ae..6e3d7dda89fd 100644 --- a/vcl/CustomTarget_qt5_moc.mk +++ b/vcl/CustomTarget_qt5_moc.mk @@ -23,6 +23,8 @@ $(call gb_CustomTarget_get_target,vcl/qt5) : \ $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceDrawingArea.moc \ $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceEntry.moc \ $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceExpander.moc \ + $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceImage.moc \ + $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceLabel.moc \ $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceLevelBar.moc \ $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceLinkButton.moc \ $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceMessageDialog.moc \ @@ -30,7 +32,9 @@ $(call gb_CustomTarget_get_target,vcl/qt5) : \ $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceProgressBar.moc \ $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceRadioButton.moc \ $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceSpinButton.moc \ + $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceTextView.moc \ $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceTreeView.moc \ + $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceWidget.moc \ $(gb_CustomTarget_workdir)/vcl/qt5/QtInstanceWindow.moc \ $(gb_CustomTarget_workdir)/vcl/qt5/QtMainWindow.moc \ $(gb_CustomTarget_workdir)/vcl/qt5/QtMenu.moc \ diff --git a/vcl/CustomTarget_qt6_moc.mk b/vcl/CustomTarget_qt6_moc.mk index 63d90a3905e0..a45846b37ea5 100644 --- a/vcl/CustomTarget_qt6_moc.mk +++ b/vcl/CustomTarget_qt6_moc.mk @@ -23,6 +23,8 @@ $(call gb_CustomTarget_get_target,vcl/qt6) : \ $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceDrawingArea.moc \ $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceEntry.moc \ $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceExpander.moc \ + $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceImage.moc \ + $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceLabel.moc \ $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceLevelBar.moc \ $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceLinkButton.moc \ $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceMessageDialog.moc \ @@ -30,7 +32,9 @@ $(call gb_CustomTarget_get_target,vcl/qt6) : \ $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceProgressBar.moc \ $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceRadioButton.moc \ $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceSpinButton.moc \ + $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceTextView.moc \ $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceTreeView.moc \ + $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceWidget.moc \ $(gb_CustomTarget_workdir)/vcl/qt6/QtInstanceWindow.moc \ $(gb_CustomTarget_workdir)/vcl/qt6/QtMainWindow.moc \ $(gb_CustomTarget_workdir)/vcl/qt6/QtMenu.moc \ diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 8f2e7ccf35df..420024cc2ab2 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -98,6 +98,15 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/rendercontext/drawmode \ vcl/skia/SkiaHelper \ vcl/source/accessibility/AccessibleTextAttributeHelper \ + vcl/source/accessibility/characterattributeshelper \ + vcl/source/accessibility/accessiblemenubasecomponent \ + vcl/source/accessibility/accessiblemenucomponent \ + vcl/source/accessibility/accessiblemenuitemcomponent \ + vcl/source/accessibility/vclxaccessiblemenu \ + vcl/source/accessibility/vclxaccessiblemenubar \ + vcl/source/accessibility/vclxaccessiblemenuitem \ + vcl/source/accessibility/vclxaccessiblemenuseparator \ + vcl/source/accessibility/vclxaccessiblepopupmenu \ vcl/source/animate/Animation \ vcl/source/animate/AnimationFrame \ vcl/source/animate/AnimationRenderer \ diff --git a/vcl/headless/svpdummies.cxx b/vcl/headless/svpdummies.cxx index b0dd9c9438d4..cc12639d61fa 100644 --- a/vcl/headless/svpdummies.cxx +++ b/vcl/headless/svpdummies.cxx @@ -29,7 +29,7 @@ void SvpSalObject::UnionClipRegion( tools::Long, tools::Long, tools::Long, tools void SvpSalObject::EndSetClipRegion() {} void SvpSalObject::SetPosSize( tools::Long, tools::Long, tools::Long, tools::Long ) {} void SvpSalObject::Show( bool ) {} -const SystemEnvData* SvpSalObject::GetSystemData() const { return &m_aSystemChildData; } +const SystemEnvData& SvpSalObject::GetSystemData() const { return m_aSystemChildData; } // SalSystem SvpSalSystem::~SvpSalSystem() {} diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx index bae2312f2478..00672935d256 100644 --- a/vcl/headless/svpframe.cxx +++ b/vcl/headless/svpframe.cxx @@ -449,9 +449,9 @@ void SvpSalFrame::Beep() { } -const SystemEnvData* SvpSalFrame::GetSystemData() const +const SystemEnvData& SvpSalFrame::GetSystemData() const { - return &m_aSystemChildData; + return m_aSystemChildData; } SalFrame::SalPointerState SvpSalFrame::GetPointerState() diff --git a/vcl/inc/IconThemeScanner.hxx b/vcl/inc/IconThemeScanner.hxx index e95adf417fdd..60841eeddaab 100644 --- a/vcl/inc/IconThemeScanner.hxx +++ b/vcl/inc/IconThemeScanner.hxx @@ -27,10 +27,13 @@ namespace vcl class VCL_DLLPUBLIC IconThemeScanner { public: - /** Factory method to create the object. - * Provide a path to search for IconThemes. + /** Provide a semicolon-separated list of paths to search for IconThemes. + * + * There are several cases when scan will fail: + * - The directory does not exist + * - There are no files which match the pattern images_xxx.zip */ - static std::shared_ptr Create(std::u16string_view path); + explicit IconThemeScanner(std::u16string_view paths); /** This method will return the standard path where icon themes are located. */ @@ -52,15 +55,6 @@ public: private: IconThemeScanner(); - /** Scan a directory for icon themes. - * - * @return - * There are several cases when this method will fail: - * - The directory does not exist - * - There are no files which match the pattern images_xxx.zip - */ - void ScanDirectoryForIconThemes(std::u16string_view path); - /** Adds the provided icon theme by path. */ bool AddIconThemeByPath(const OUString& path); diff --git a/vcl/inc/IconThemeSelector.hxx b/vcl/inc/IconThemeSelector.hxx index 9f2fbb0c3dce..3f25beba27a2 100644 --- a/vcl/inc/IconThemeSelector.hxx +++ b/vcl/inc/IconThemeSelector.hxx @@ -66,10 +66,7 @@ public: SetPreferredIconTheme(const OUString&, bool bDarkIconTheme); bool - operator==(const vcl::IconThemeSelector&) const; - - bool - operator!=(const vcl::IconThemeSelector&) const; + operator==(const vcl::IconThemeSelector&) const = default; static OUString GetIconThemeForDesktopEnvironment(const OUString& desktopEnvironment, bool bPreferDarkIconTheme); diff --git a/accessibility/inc/standard/accessiblemenubasecomponent.hxx b/vcl/inc/accessibility/accessiblemenubasecomponent.hxx similarity index 100% rename from accessibility/inc/standard/accessiblemenubasecomponent.hxx rename to vcl/inc/accessibility/accessiblemenubasecomponent.hxx diff --git a/accessibility/inc/standard/accessiblemenucomponent.hxx b/vcl/inc/accessibility/accessiblemenucomponent.hxx similarity index 96% rename from accessibility/inc/standard/accessiblemenucomponent.hxx rename to vcl/inc/accessibility/accessiblemenucomponent.hxx index 90c89922654a..2954b52119e5 100644 --- a/accessibility/inc/standard/accessiblemenucomponent.hxx +++ b/vcl/inc/accessibility/accessiblemenucomponent.hxx @@ -19,7 +19,8 @@ #pragma once -#include +#include + #include #include @@ -60,7 +61,6 @@ public: virtual sal_Int32 SAL_CALL getBackground( ) override; // XAccessibleExtendedComponent - virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) override; virtual OUString SAL_CALL getTitledBorderText( ) override; virtual OUString SAL_CALL getToolTipText( ) override; diff --git a/accessibility/inc/standard/accessiblemenuitemcomponent.hxx b/vcl/inc/accessibility/accessiblemenuitemcomponent.hxx similarity index 96% rename from accessibility/inc/standard/accessiblemenuitemcomponent.hxx rename to vcl/inc/accessibility/accessiblemenuitemcomponent.hxx index b6adebbde81e..58b819f8ad66 100644 --- a/accessibility/inc/standard/accessiblemenuitemcomponent.hxx +++ b/vcl/inc/accessibility/accessiblemenuitemcomponent.hxx @@ -19,7 +19,7 @@ #pragma once -#include +#include @@ -78,7 +78,6 @@ public: virtual sal_Int32 SAL_CALL getBackground( ) override; // XAccessibleExtendedComponent - virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) override; virtual OUString SAL_CALL getTitledBorderText( ) override; virtual OUString SAL_CALL getToolTipText( ) override; }; diff --git a/accessibility/inc/standard/vclxaccessiblemenu.hxx b/vcl/inc/accessibility/vclxaccessiblemenu.hxx similarity index 98% rename from accessibility/inc/standard/vclxaccessiblemenu.hxx rename to vcl/inc/accessibility/vclxaccessiblemenu.hxx index ce7b3f0580de..3f6903587166 100644 --- a/accessibility/inc/standard/vclxaccessiblemenu.hxx +++ b/vcl/inc/accessibility/vclxaccessiblemenu.hxx @@ -19,7 +19,7 @@ #pragma once -#include +#include #include #include diff --git a/accessibility/inc/standard/vclxaccessiblemenubar.hxx b/vcl/inc/accessibility/vclxaccessiblemenubar.hxx similarity index 97% rename from accessibility/inc/standard/vclxaccessiblemenubar.hxx rename to vcl/inc/accessibility/vclxaccessiblemenubar.hxx index c5b3984e0b7e..31e50c8b75ff 100644 --- a/accessibility/inc/standard/vclxaccessiblemenubar.hxx +++ b/vcl/inc/accessibility/vclxaccessiblemenubar.hxx @@ -19,7 +19,7 @@ #pragma once -#include +#include #include class VclSimpleEvent; diff --git a/accessibility/inc/standard/vclxaccessiblemenuitem.hxx b/vcl/inc/accessibility/vclxaccessiblemenuitem.hxx similarity index 98% rename from accessibility/inc/standard/vclxaccessiblemenuitem.hxx rename to vcl/inc/accessibility/vclxaccessiblemenuitem.hxx index aa6a0afc814a..ddde3cda04b6 100644 --- a/accessibility/inc/standard/vclxaccessiblemenuitem.hxx +++ b/vcl/inc/accessibility/vclxaccessiblemenuitem.hxx @@ -19,7 +19,7 @@ #pragma once -#include +#include #include #include diff --git a/accessibility/inc/standard/vclxaccessiblemenuseparator.hxx b/vcl/inc/accessibility/vclxaccessiblemenuseparator.hxx similarity index 96% rename from accessibility/inc/standard/vclxaccessiblemenuseparator.hxx rename to vcl/inc/accessibility/vclxaccessiblemenuseparator.hxx index 51071c19d130..ce971ca49ac0 100644 --- a/accessibility/inc/standard/vclxaccessiblemenuseparator.hxx +++ b/vcl/inc/accessibility/vclxaccessiblemenuseparator.hxx @@ -19,7 +19,7 @@ #pragma once -#include +#include class VCLXAccessibleMenuSeparator final : public OAccessibleMenuItemComponent { diff --git a/accessibility/inc/standard/vclxaccessiblepopupmenu.hxx b/vcl/inc/accessibility/vclxaccessiblepopupmenu.hxx similarity index 96% rename from accessibility/inc/standard/vclxaccessiblepopupmenu.hxx rename to vcl/inc/accessibility/vclxaccessiblepopupmenu.hxx index 8e93af22d8d9..6f099b722452 100644 --- a/accessibility/inc/standard/vclxaccessiblepopupmenu.hxx +++ b/vcl/inc/accessibility/vclxaccessiblepopupmenu.hxx @@ -19,7 +19,7 @@ #pragma once -#include +#include class VCLXAccessiblePopupMenu final : public OAccessibleMenuComponent { diff --git a/vcl/inc/headless/svpdummies.hxx b/vcl/inc/headless/svpdummies.hxx index 92958f8d5529..1049637a5de3 100644 --- a/vcl/inc/headless/svpdummies.hxx +++ b/vcl/inc/headless/svpdummies.hxx @@ -42,7 +42,7 @@ public: virtual void SetPosSize( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight ) override; virtual void Show( bool bVisible ) override; - virtual const SystemEnvData* GetSystemData() const override; + virtual const SystemEnvData& GetSystemData() const override; }; class SvpSalSystem : public SalGenericSystem diff --git a/vcl/inc/headless/svpframe.hxx b/vcl/inc/headless/svpframe.hxx index 3789e44745e7..1c61236029dc 100644 --- a/vcl/inc/headless/svpframe.hxx +++ b/vcl/inc/headless/svpframe.hxx @@ -108,7 +108,7 @@ public: virtual LanguageType GetInputLanguage() override; virtual void UpdateSettings( AllSettings& rSettings ) override; virtual void Beep() override; - virtual const SystemEnvData* GetSystemData() const override; + virtual const SystemEnvData& GetSystemData() const override; virtual SalPointerState GetPointerState() override; virtual KeyIndicatorState GetIndicatorState() override; virtual void SimulateKeyPress( sal_uInt16 nKeyCode ) override; diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx index ec8cef53e238..420722c9997b 100644 --- a/vcl/inc/jsdialog/jsdialogbuilder.hxx +++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx @@ -309,6 +309,7 @@ public: virtual std::unique_ptr weld_radio_button(const OUString& id) override; virtual std::unique_ptr weld_frame(const OUString& id) override; virtual std::unique_ptr weld_menu_button(const OUString& id) override; + virtual std::unique_ptr weld_menu(const OUString& id) override; virtual std::unique_ptr weld_popover(const OUString& id) override; virtual std::unique_ptr weld_box(const OUString& id) override; virtual std::unique_ptr weld_widget(const OUString& id) override; @@ -330,6 +331,11 @@ public: static void ForgetPopup(const OUString& nWindowId); static vcl::Window* FindPopup(const OUString& nWindowId); + // menus in separate container as they don't share base class with weld::Widget + static void RememberMenu(const OUString& nWindowId, weld::Menu* pMenu); + static void ForgetMenu(const OUString& nWindowId); + static weld::Menu* FindMenu(const OUString& nWindowId); + private: const OUString& GetTypeOfJSON() const; VclPtr& GetContentWindow(); @@ -871,6 +877,16 @@ public: virtual void set_active(bool active) override; }; +class JSMenu final : public SalInstanceMenu +{ +public: + JSMenu(JSDialogSender* pSender, PopupMenu* pMenu, SalInstanceBuilder* pBuilder, + bool bTakeOwnership); + + virtual OUString popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rRect, + weld::Placement ePlace = weld::Placement::Under) override; +}; + class JSPopover : public JSWidget { vcl::LOKWindowId mnWindowId; diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h index 717e5f310178..7245a89c3447 100644 --- a/vcl/inc/osx/salframe.h +++ b/vcl/inc/osx/salframe.h @@ -145,7 +145,7 @@ public: virtual LanguageType GetInputLanguage() override; virtual void UpdateSettings( AllSettings& rSettings ) override; virtual void Beep() override; - virtual const SystemEnvData* GetSystemData() const override; + virtual const SystemEnvData& GetSystemData() const override; virtual SalPointerState GetPointerState() override; virtual KeyIndicatorState GetIndicatorState() override; virtual void SimulateKeyPress( sal_uInt16 nKeyCode ) override; diff --git a/vcl/inc/osx/salmenu.h b/vcl/inc/osx/salmenu.h index 597180cc1ac3..e750f1fd1596 100644 --- a/vcl/inc/osx/salmenu.h +++ b/vcl/inc/osx/salmenu.h @@ -66,7 +66,6 @@ public: virtual void SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const OUString& rText ) override; virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage) override; virtual void SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const vcl::KeyCode& rKeyCode, const OUString& rKeyName ) override; - virtual void GetSystemMenuData( SystemMenuData* pData ) override; virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const tools::Rectangle& rRect, FloatWinPopupFlags nFlags) override; virtual bool AddMenuBarButton( const SalMenuButtonItem& ) override; virtual void RemoveMenuBarButton( sal_uInt16 nId ) override; diff --git a/vcl/inc/osx/salobj.h b/vcl/inc/osx/salobj.h index 4c2ac88be6c1..0fc41c02d4c9 100644 --- a/vcl/inc/osx/salobj.h +++ b/vcl/inc/osx/salobj.h @@ -63,7 +63,7 @@ public: virtual void EndSetClipRegion() override; virtual void SetPosSize( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight ) override; virtual void Show( bool bVisible ) override; - virtual const SystemEnvData* GetSystemData() const override; + virtual const SystemEnvData& GetSystemData() const override; }; #endif // INCLUDED_VCL_INC_OSX_SALOBJ_H diff --git a/vcl/inc/pdf/EncryptionHashTransporter.hxx b/vcl/inc/pdf/EncryptionHashTransporter.hxx index 3ed1aa375561..596b6490570a 100644 --- a/vcl/inc/pdf/EncryptionHashTransporter.hxx +++ b/vcl/inc/pdf/EncryptionHashTransporter.hxx @@ -28,11 +28,9 @@ namespace vcl::pdf */ class EncryptionHashTransporter : public cppu::WeakImplHelper { - ::std::unique_ptr<::comphelper::Hash> m_pDigest; - sal_IntPtr maID; + std::unique_ptr m_pDigest; std::vector maOValue; - - static std::map sTransporters; + sal_IntPtr maID; public: EncryptionHashTransporter(); diff --git a/vcl/inc/pdf/IPDFEncryptor.hxx b/vcl/inc/pdf/IPDFEncryptor.hxx new file mode 100644 index 000000000000..bcd90dcef4bf --- /dev/null +++ b/vcl/inc/pdf/IPDFEncryptor.hxx @@ -0,0 +1,90 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#pragma once + +#include +#include + +namespace vcl +{ +struct PDFEncryptionProperties; +} + +namespace com::sun::star::beans +{ +class XMaterialHolder; +} +namespace com::sun::star::uno +{ +template class Reference; +} + +namespace vcl::pdf +{ +/** Interface for encrypting the PDF content + * + * This interface makes it possible to have multiple versions and + * revisions of PDF encryption, but all using the same interface, + * so the implementation details are hidden from the outside. This + * also makes it easier to add new implementations in the future as + * we only need to write a new implementation of this interface. + */ +class IPDFEncryptor +{ +public: + virtual ~IPDFEncryptor() {} + + /** PDF encryption version */ + virtual sal_Int32 getVersion() = 0; + /** PDF encryption revision */ + virtual sal_Int32 getRevision() = 0; + + /** the numerical value of the access permissions, according to PDF spec, must be signed */ + virtual sal_Int32 getAccessPermissions() = 0; + + /** Encrypted access permission + * + * Depending on the encryption revision this may not be available. In that + * case we can expect empty content. + */ + virtual std::vector getEncryptedAccessPermissions() + { + return std::vector(); + } + + /** Length of the key in bits (i.e. 256 = 256bits) */ + virtual sal_Int32 getKeyLength() = 0; + + /** Prepares the encryption when the password is entered */ + virtual bool prepareEncryption( + const css::uno::Reference& xEncryptionMaterialHolder, + PDFEncryptionProperties& rProperties) + = 0; + + /** Set up the keys and does a sanity check */ + virtual void setupKeysAndCheck(PDFEncryptionProperties& rProperties) = 0; + + /** Setup before we start encrypting - remembers the key */ + virtual void setupEncryption(std::vector const& rEncryptionKey, sal_Int32 nObject) + = 0; + + virtual void enableStreamEncryption() = 0; + virtual void disableStreamEncryption() = 0; + virtual bool isStreamEncryptionEnabled() = 0; + + /** Encrypts the input and stores into the output */ + virtual void encrypt(const void* pInput, sal_uInt64 nInputSize, sal_uInt8* pOutput, + sal_uInt64 nOutputsSize) + = 0; +}; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/pdf/PDFEncryptor.hxx b/vcl/inc/pdf/PDFEncryptor.hxx index 3547252ceb5e..be4b99f9b7d6 100644 --- a/vcl/inc/pdf/PDFEncryptor.hxx +++ b/vcl/inc/pdf/PDFEncryptor.hxx @@ -10,10 +10,10 @@ #pragma once -#include #include #include #include +#include namespace vcl { @@ -31,30 +31,6 @@ template class Reference; namespace vcl::pdf { -class EncryptionHashTransporter; - -class IPDFEncryptor -{ -public: - virtual ~IPDFEncryptor() {} - virtual sal_Int32 getAccessPermissions() = 0; - virtual sal_Int32 getKeyLength() = 0; - virtual bool prepareEncryption( - const css::uno::Reference& xEncryptionMaterialHolder, - PDFEncryptionProperties& rProperties) - = 0; - virtual void setupKeysAndCheck(PDFEncryptionProperties& rProperties) = 0; - - virtual void setupEncryption(std::vector const& rEncryptionKey, sal_Int32 nObject) - = 0; - virtual void enableStreamEncryption() = 0; - virtual void disableStreamEncryption() = 0; - virtual bool isStreamEncryptionEnabled() = 0; - virtual void encrypt(const void* pInput, sal_uInt64 nInputSize, sal_uInt8* pOutput, - sal_uInt64 nOutputsSize) - = 0; -}; - class PDFEncryptor : public IPDFEncryptor { private: @@ -70,12 +46,15 @@ private: /* set to true if the following stream must be encrypted, used inside writeBuffer() */ bool m_bEncryptThisStream = false; + /* used to cipher the stream data and for password management */ + rtlCipher m_aCipher = nullptr; + public: PDFEncryptor(); ~PDFEncryptor(); - /* used to cipher the stream data and for password management */ - rtlCipher m_aCipher = nullptr; + sal_Int32 getVersion() override { return 2; }; + sal_Int32 getRevision() override { return 3; }; sal_Int32 getAccessPermissions() override { return m_nAccessPermissions; } sal_Int32 getKeyLength() override { return m_nKeyLength; } diff --git a/vcl/inc/pdf/pdfwriter_impl.hxx b/vcl/inc/pdf/pdfwriter_impl.hxx index e7644d7c4884..3f09038068b8 100644 --- a/vcl/inc/pdf/pdfwriter_impl.hxx +++ b/vcl/inc/pdf/pdfwriter_impl.hxx @@ -483,6 +483,11 @@ struct PDFScreen : public PDFAnnotation } }; +struct PDFWidgetCopy +{ + sal_Int32 m_nObject = -1; +}; + struct PDFWidget : public PDFAnnotation { PDFWriter::WidgetType m_eType; @@ -769,9 +774,10 @@ private: /* structure elements (object ids) that should have ID */ std::unordered_set m_StructElemObjsWithID; - /* contains all widgets used in the PDF - */ - std::vector m_aWidgets; + /* contains all widgets used in the PDF */ + std::vector m_aWidgets; + std::vector m_aCopiedWidgets; + /* maps radio group id to index of radio group control in m_aWidgets */ std::map< sal_Int32, sal_Int32 > m_aRadioGroupWidgets; /* unordered_map for field names, used to ensure unique field names */ @@ -896,6 +902,8 @@ private: /// Writes the form XObject proxy for the image. void writeReferenceXObject(const ReferenceXObjectEmit& rEmit); + void mergeAnnotationsFromExternalPage(filter::PDFObjectElement* pPage, std::map& rCopiedResourcesMap); + /* tries to find the bitmap by its id and returns its emit data if exists, else creates a new emit data block */ const BitmapEmit& createBitmapEmit( const BitmapEx& rBitmapEx, const Graphic& rGraphic, std::list& rBitmaps, ResourceDict& rResourceDict, std::list& rOutputStreams ); diff --git a/vcl/inc/qt5/QtFrame.hxx b/vcl/inc/qt5/QtFrame.hxx index efb534825e29..4d1c0fd02cd5 100644 --- a/vcl/inc/qt5/QtFrame.hxx +++ b/vcl/inc/qt5/QtFrame.hxx @@ -204,7 +204,7 @@ public: virtual LanguageType GetInputLanguage() override; virtual void UpdateSettings(AllSettings& rSettings) override; virtual void Beep() override; - virtual const SystemEnvData* GetSystemData() const override { return &m_aSystemData; } + virtual const SystemEnvData& GetSystemData() const override { return m_aSystemData; } virtual SalPointerState GetPointerState() override; virtual KeyIndicatorState GetIndicatorState() override; virtual void SimulateKeyPress(sal_uInt16 nKeyCode) override; diff --git a/vcl/inc/qt5/QtInstanceButton.hxx b/vcl/inc/qt5/QtInstanceButton.hxx index a302ba54e978..c25342e0bc83 100644 --- a/vcl/inc/qt5/QtInstanceButton.hxx +++ b/vcl/inc/qt5/QtInstanceButton.hxx @@ -14,7 +14,7 @@ #include #include -class QtInstanceButton : public QObject, public QtInstanceWidget, public virtual weld::Button +class QtInstanceButton : public QtInstanceWidget, public virtual weld::Button { QPushButton* m_pButton; diff --git a/vcl/inc/qt5/QtInstanceCheckButton.hxx b/vcl/inc/qt5/QtInstanceCheckButton.hxx index a13c883ac310..a929dfe5e465 100644 --- a/vcl/inc/qt5/QtInstanceCheckButton.hxx +++ b/vcl/inc/qt5/QtInstanceCheckButton.hxx @@ -14,9 +14,7 @@ #include #include -class QtInstanceCheckButton : public QObject, - public QtInstanceWidget, - public virtual weld::CheckButton +class QtInstanceCheckButton : public QtInstanceWidget, public virtual weld::CheckButton { Q_OBJECT @@ -35,6 +33,9 @@ public: virtual void set_label(const OUString& rText) override; virtual OUString get_label() const override; virtual void set_label_wrap(bool bWrap) override; + +private Q_SLOTS: + void handleToggled(); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/inc/qt5/QtInstanceComboBox.hxx b/vcl/inc/qt5/QtInstanceComboBox.hxx index 26e47f6e71c6..15c91eb20915 100644 --- a/vcl/inc/qt5/QtInstanceComboBox.hxx +++ b/vcl/inc/qt5/QtInstanceComboBox.hxx @@ -13,7 +13,7 @@ #include -class QtInstanceComboBox : public QObject, public QtInstanceWidget, public virtual weld::ComboBox +class QtInstanceComboBox : public QtInstanceWidget, public virtual weld::ComboBox { Q_OBJECT @@ -87,7 +87,7 @@ private: void sortItems(); private slots: - void handleCurrentIndexChanged(); + void signalChanged(); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/inc/qt5/QtInstanceContainer.hxx b/vcl/inc/qt5/QtInstanceContainer.hxx index dc38f2ae6e49..8fea34cd8d74 100644 --- a/vcl/inc/qt5/QtInstanceContainer.hxx +++ b/vcl/inc/qt5/QtInstanceContainer.hxx @@ -13,7 +13,7 @@ #include -class QtInstanceContainer : public QObject, public QtInstanceWidget, public virtual weld::Container +class QtInstanceContainer : public QtInstanceWidget, public virtual weld::Container { Q_OBJECT diff --git a/vcl/inc/qt5/QtInstanceDrawingArea.hxx b/vcl/inc/qt5/QtInstanceDrawingArea.hxx index 866d39bdccea..c403662ef6f9 100644 --- a/vcl/inc/qt5/QtInstanceDrawingArea.hxx +++ b/vcl/inc/qt5/QtInstanceDrawingArea.hxx @@ -13,9 +13,7 @@ #include -class QtInstanceDrawingArea : public QObject, - public QtInstanceWidget, - public virtual weld::DrawingArea +class QtInstanceDrawingArea : public QtInstanceWidget, public virtual weld::DrawingArea { Q_OBJECT diff --git a/vcl/inc/qt5/QtInstanceEntry.hxx b/vcl/inc/qt5/QtInstanceEntry.hxx index 73a4e3fec9a3..b7b1ef162d6a 100644 --- a/vcl/inc/qt5/QtInstanceEntry.hxx +++ b/vcl/inc/qt5/QtInstanceEntry.hxx @@ -13,7 +13,7 @@ #include -class QtInstanceEntry : public QObject, public QtInstanceWidget, public virtual weld::Entry +class QtInstanceEntry : public QtInstanceWidget, public virtual weld::Entry { Q_OBJECT; @@ -49,6 +49,8 @@ public: virtual void set_alignment(TxtAlign eXAlign) override; + static void setMessageType(QLineEdit& rLineEdit, weld::EntryMessageType eType); + protected Q_SLOTS: void handleTextChanged(); }; diff --git a/vcl/inc/qt5/QtInstanceExpander.hxx b/vcl/inc/qt5/QtInstanceExpander.hxx index d596acb9ba94..efafd8a7cf30 100644 --- a/vcl/inc/qt5/QtInstanceExpander.hxx +++ b/vcl/inc/qt5/QtInstanceExpander.hxx @@ -12,7 +12,7 @@ #include "QtInstanceWidget.hxx" #include "QtExpander.hxx" -class QtInstanceExpander : public QObject, public QtInstanceWidget, public virtual weld::Expander +class QtInstanceExpander : public QtInstanceWidget, public virtual weld::Expander { Q_OBJECT diff --git a/vcl/inc/qt5/QtInstanceImage.hxx b/vcl/inc/qt5/QtInstanceImage.hxx index 4f6588d49867..ebef898bb011 100644 --- a/vcl/inc/qt5/QtInstanceImage.hxx +++ b/vcl/inc/qt5/QtInstanceImage.hxx @@ -15,6 +15,8 @@ class QtInstanceImage : public QtInstanceWidget, public virtual weld::Image { + Q_OBJECT + QLabel* m_pLabel; public: diff --git a/vcl/inc/qt5/QtInstanceLabel.hxx b/vcl/inc/qt5/QtInstanceLabel.hxx index 0feb6ce7ac2f..64fb09e6c399 100644 --- a/vcl/inc/qt5/QtInstanceLabel.hxx +++ b/vcl/inc/qt5/QtInstanceLabel.hxx @@ -16,6 +16,8 @@ class QtInstanceLabel : public QtInstanceWidget, public virtual weld::Label { + Q_OBJECT + QLabel* m_pLabel; public: diff --git a/vcl/inc/qt5/QtInstanceLevelBar.hxx b/vcl/inc/qt5/QtInstanceLevelBar.hxx index cb819b0da902..5d728335ae13 100644 --- a/vcl/inc/qt5/QtInstanceLevelBar.hxx +++ b/vcl/inc/qt5/QtInstanceLevelBar.hxx @@ -13,7 +13,7 @@ #include -class QtInstanceLevelBar : public QObject, public QtInstanceWidget, public virtual weld::LevelBar +class QtInstanceLevelBar : public QtInstanceWidget, public virtual weld::LevelBar { Q_OBJECT diff --git a/vcl/inc/qt5/QtInstanceLinkButton.hxx b/vcl/inc/qt5/QtInstanceLinkButton.hxx index 43b91344eebf..425daf13849c 100644 --- a/vcl/inc/qt5/QtInstanceLinkButton.hxx +++ b/vcl/inc/qt5/QtInstanceLinkButton.hxx @@ -14,9 +14,7 @@ #include -class QtInstanceLinkButton : public QObject, - public QtInstanceWidget, - public virtual weld::LinkButton +class QtInstanceLinkButton : public QtInstanceWidget, public virtual weld::LinkButton { Q_OBJECT diff --git a/vcl/inc/qt5/QtInstanceNotebook.hxx b/vcl/inc/qt5/QtInstanceNotebook.hxx index bf43ac39e54f..2a18a65784a0 100644 --- a/vcl/inc/qt5/QtInstanceNotebook.hxx +++ b/vcl/inc/qt5/QtInstanceNotebook.hxx @@ -16,7 +16,7 @@ #include -class QtInstanceNotebook : public QObject, public QtInstanceWidget, public virtual weld::Notebook +class QtInstanceNotebook : public QtInstanceWidget, public virtual weld::Notebook { Q_OBJECT diff --git a/vcl/inc/qt5/QtInstanceProgressBar.hxx b/vcl/inc/qt5/QtInstanceProgressBar.hxx index 2efe6d126ed6..9f26a5cdeb73 100644 --- a/vcl/inc/qt5/QtInstanceProgressBar.hxx +++ b/vcl/inc/qt5/QtInstanceProgressBar.hxx @@ -13,9 +13,7 @@ #include -class QtInstanceProgressBar : public QObject, - public QtInstanceWidget, - public virtual weld::ProgressBar +class QtInstanceProgressBar : public QtInstanceWidget, public virtual weld::ProgressBar { Q_OBJECT diff --git a/vcl/inc/qt5/QtInstanceRadioButton.hxx b/vcl/inc/qt5/QtInstanceRadioButton.hxx index 5dee84d36f01..56955c5f51d5 100644 --- a/vcl/inc/qt5/QtInstanceRadioButton.hxx +++ b/vcl/inc/qt5/QtInstanceRadioButton.hxx @@ -14,9 +14,7 @@ #include #include -class QtInstanceRadioButton : public QObject, - public QtInstanceWidget, - public virtual weld::RadioButton +class QtInstanceRadioButton : public QtInstanceWidget, public virtual weld::RadioButton { Q_OBJECT diff --git a/vcl/inc/qt5/QtInstanceTextView.hxx b/vcl/inc/qt5/QtInstanceTextView.hxx index 36dfda0d3379..4fb8ca94c6c9 100644 --- a/vcl/inc/qt5/QtInstanceTextView.hxx +++ b/vcl/inc/qt5/QtInstanceTextView.hxx @@ -15,6 +15,8 @@ class QtInstanceTextView : public QtInstanceWidget, public virtual weld::TextView { + Q_OBJECT + QPlainTextEdit* m_pTextEdit; public: diff --git a/vcl/inc/qt5/QtInstanceTreeView.hxx b/vcl/inc/qt5/QtInstanceTreeView.hxx index a344c365a7c4..dd252c3e2b47 100644 --- a/vcl/inc/qt5/QtInstanceTreeView.hxx +++ b/vcl/inc/qt5/QtInstanceTreeView.hxx @@ -14,7 +14,7 @@ #include #include -class QtInstanceTreeView : public QObject, public QtInstanceWidget, public virtual weld::TreeView +class QtInstanceTreeView : public QtInstanceWidget, public virtual weld::TreeView { Q_OBJECT diff --git a/vcl/inc/qt5/QtInstanceWidget.hxx b/vcl/inc/qt5/QtInstanceWidget.hxx index b63376208200..fc84a4adda59 100644 --- a/vcl/inc/qt5/QtInstanceWidget.hxx +++ b/vcl/inc/qt5/QtInstanceWidget.hxx @@ -19,8 +19,10 @@ #include #include -class QtInstanceWidget : public virtual weld::Widget +class QtInstanceWidget : public QObject, public virtual weld::Widget { + Q_OBJECT + QWidget* m_pWidget; public: @@ -130,7 +132,8 @@ public: virtual void grab_remove() override; - virtual bool get_extents_relative_to(const Widget&, int&, int&, int&, int&) const override; + virtual bool get_extents_relative_to(const Widget& rRelative, int& rX, int& rY, int& rWidth, + int& rHeight) const override; virtual bool get_direction() const override; @@ -173,11 +176,14 @@ public: virtual void set_highlight_background() override; - virtual void set_background(const Color&) override; + virtual void set_background(const Color& rBackColor) override; virtual void draw(OutputDevice&, const Point&, const Size&) override; static void setHelpId(QWidget& rWidget, const OUString& rHelpId); + +private Q_SLOTS: + void applicationFocusChanged(QWidget* pOldFocus, QWidget* pNewFocus); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/inc/qt5/QtInstanceWindow.hxx b/vcl/inc/qt5/QtInstanceWindow.hxx index b92b830c7b9b..151e6d47e6ad 100644 --- a/vcl/inc/qt5/QtInstanceWindow.hxx +++ b/vcl/inc/qt5/QtInstanceWindow.hxx @@ -32,8 +32,8 @@ public: virtual void change_default_widget(weld::Widget*, weld::Widget*) override; virtual bool is_default_widget(const weld::Widget*) const override; - virtual void set_window_state(const OUString&) override; - virtual OUString get_window_state(vcl::WindowDataMask) const override; + virtual void set_window_state(const OUString& rStr) override; + virtual OUString get_window_state(vcl::WindowDataMask eMask) const override; virtual css::uno::Reference GetXWindow() override; diff --git a/vcl/inc/qt5/QtMenu.hxx b/vcl/inc/qt5/QtMenu.hxx index 8c44c079668d..8042c67720ba 100644 --- a/vcl/inc/qt5/QtMenu.hxx +++ b/vcl/inc/qt5/QtMenu.hxx @@ -93,7 +93,6 @@ public: const Image& rImage) override; virtual void SetAccelerator(unsigned nPos, SalMenuItem* pSalMenuItem, const vcl::KeyCode& rKeyCode, const OUString& rKeyName) override; - virtual void GetSystemMenuData(SystemMenuData* pData) override; virtual void ShowCloseButton(bool bShow) override; virtual bool AddMenuBarButton(const SalMenuButtonItem&) override; virtual void RemoveMenuBarButton(sal_uInt16 nId) override; diff --git a/vcl/inc/qt5/QtObject.hxx b/vcl/inc/qt5/QtObject.hxx index 4a8d194a8435..68749129079f 100644 --- a/vcl/inc/qt5/QtObject.hxx +++ b/vcl/inc/qt5/QtObject.hxx @@ -66,7 +66,7 @@ public: virtual void SetForwardKey(bool bEnable) override; - virtual const SystemEnvData* GetSystemData() const override { return &m_aSystemData; } + virtual const SystemEnvData& GetSystemData() const override { return m_aSystemData; } virtual void Reparent(SalFrame* pFrame) override; }; diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx index 8b239491d469..3d83d861e069 100644 --- a/vcl/inc/salframe.hxx +++ b/vcl/inc/salframe.hxx @@ -219,8 +219,7 @@ public: virtual void FlashWindow() const {}; // returns system data (most prominent: window handle) - virtual const SystemEnvData* - GetSystemData() const = 0; + virtual const SystemEnvData& GetSystemData() const = 0; // tdf#139609 SystemEnvData::GetWindowHandle() calls this to on-demand fill the aWindow // member of SystemEnvData for backends that want to defer doing that diff --git a/vcl/inc/salinst.hxx b/vcl/inc/salinst.hxx index 1fbe86285054..b8549b23fc5f 100644 --- a/vcl/inc/salinst.hxx +++ b/vcl/inc/salinst.hxx @@ -195,7 +195,6 @@ public: // callbacks for printer updates virtual void updatePrinterUpdate() {} - virtual void jobEndedPrinterUpdate() {} /// Set the app's (somewhat) magic/main-thread to this one. virtual void updateMainThread() {} diff --git a/vcl/inc/salmenu.hxx b/vcl/inc/salmenu.hxx index 975df9391eae..469c4e3b4945 100644 --- a/vcl/inc/salmenu.hxx +++ b/vcl/inc/salmenu.hxx @@ -73,7 +73,7 @@ public: virtual void SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const OUString& rText )= 0; virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage ) = 0; virtual void SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const vcl::KeyCode& rKeyCode, const OUString& rKeyName ) = 0; - virtual void GetSystemMenuData( SystemMenuData* pData ) = 0; + virtual void GetSystemMenuData(SystemMenuData& rData); virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const tools::Rectangle& rRect, FloatWinPopupFlags nFlags); virtual void ShowCloseButton(bool bShow); virtual bool AddMenuBarButton( const SalMenuButtonItem& ); // return false if not implemented or failure diff --git a/vcl/inc/salobj.hxx b/vcl/inc/salobj.hxx index b5d9d64f82e4..c736957d3eeb 100644 --- a/vcl/inc/salobj.hxx +++ b/vcl/inc/salobj.hxx @@ -54,7 +54,7 @@ public: virtual void SetLeaveEnterBackgrounds(const css::uno::Sequence& /*rLeaveArgs*/, const css::uno::Sequence& /*rEnterArgs*/) {} - virtual const SystemEnvData* GetSystemData() const = 0; + virtual const SystemEnvData& GetSystemData() const = 0; virtual Size GetOptimalSize() const { return Size(); } diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 3837576c486e..c183b7fdb57c 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -146,11 +146,12 @@ public: virtual ~SalInstanceBuilder() override; }; -class SAL_DLLPUBLIC_RTTI SalInstanceMenu final : public weld::Menu +class SAL_DLLPUBLIC_RTTI SalInstanceMenu : public weld::Menu { -private: +protected: VclPtr m_xMenu; +private: bool m_bTakeOwnership; sal_uInt16 m_nLastId; @@ -1979,14 +1980,30 @@ public: virtual bool get_iter_first(weld::TreeIter& rIter) const override; + virtual bool iter_next_sibling(weld::TreeIter& rIter) const override; + virtual void scroll_to_item(const weld::TreeIter& rIter) override; virtual void selected_foreach(const std::function& func) override; virtual OUString get_id(const weld::TreeIter& rIter) const override; + virtual OUString get_id(int pos) const override; + + virtual void remove(int pos) override; + + const OUString* getEntryData(int index) const; + + virtual void set_image(int pos, VirtualDevice* rImage) override; + + virtual void set_text(int pos, const OUString& rText) override; + + virtual void set_id(int pos, const OUString& rId) override; + virtual OUString get_text(const weld::TreeIter& rIter) const override; + virtual tools::Rectangle get_rect(int pos) const override; + virtual void clear() override; virtual ~SalInstanceIconView() override; diff --git a/vcl/inc/unx/geninst.h b/vcl/inc/unx/geninst.h index 32f0a61d1cc7..423047ae2106 100644 --- a/vcl/inc/unx/geninst.h +++ b/vcl/inc/unx/geninst.h @@ -63,7 +63,6 @@ public: virtual OUString GetDefaultPrinter() override; virtual void PostPrintersChanged() = 0; virtual void updatePrinterUpdate() override; - virtual void jobEndedPrinterUpdate() override; bool isPrinterInit() const { return mbPrinterInit; } virtual std::unique_ptr CreatePrintGraphics() = 0; diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx index b8b10691843b..41790d893dba 100644 --- a/vcl/inc/unx/gtk/gtkframe.hxx +++ b/vcl/inc/unx/gtk/gtkframe.hxx @@ -573,7 +573,7 @@ public: virtual void Beep() override; // returns system data (most prominent: window handle) - virtual const SystemEnvData* GetSystemData() const override; + virtual const SystemEnvData& GetSystemData() const override; virtual void ResolveWindowHandle(SystemEnvData& rData) const override; diff --git a/vcl/inc/unx/gtk/gtkobject.hxx b/vcl/inc/unx/gtk/gtkobject.hxx index 63544f56f882..dc79de17c02d 100644 --- a/vcl/inc/unx/gtk/gtkobject.hxx +++ b/vcl/inc/unx/gtk/gtkobject.hxx @@ -43,7 +43,7 @@ public: virtual void SetForwardKey( bool bEnable ) override; - virtual const SystemEnvData* GetSystemData() const override; + virtual const SystemEnvData& GetSystemData() const override; virtual Size GetOptimalSize() const override; diff --git a/vcl/inc/unx/gtk/gtksalmenu.hxx b/vcl/inc/unx/gtk/gtksalmenu.hxx index eadb096e0c1e..3172c37656bd 100644 --- a/vcl/inc/unx/gtk/gtksalmenu.hxx +++ b/vcl/inc/unx/gtk/gtksalmenu.hxx @@ -84,7 +84,6 @@ public: virtual void SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const OUString& rText ) override; virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage) override; virtual void SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const vcl::KeyCode& rKeyCode, const OUString& rKeyName ) override; - virtual void GetSystemMenuData( SystemMenuData* pData ) override; void SetMenu( Menu* pMenu ) { mpVCLMenu = pMenu; } Menu* GetMenu() { return mpVCLMenu; } diff --git a/vcl/inc/unx/salframe.h b/vcl/inc/unx/salframe.h index a6603f6777f3..3ff7a4ae4e11 100644 --- a/vcl/inc/unx/salframe.h +++ b/vcl/inc/unx/salframe.h @@ -239,7 +239,7 @@ public: virtual LanguageType GetInputLanguage() override; virtual void UpdateSettings( AllSettings& rSettings ) override; virtual void Beep() override; - virtual const SystemEnvData* GetSystemData() const override; + virtual const SystemEnvData& GetSystemData() const override; virtual SalPointerState GetPointerState() override; virtual KeyIndicatorState GetIndicatorState() override; virtual void SimulateKeyPress( sal_uInt16 nKeyCode ) override; diff --git a/vcl/inc/unx/salobj.h b/vcl/inc/unx/salobj.h index f14af351ebf9..2920d81ef693 100644 --- a/vcl/inc/unx/salobj.h +++ b/vcl/inc/unx/salobj.h @@ -81,7 +81,7 @@ public: virtual void SetLeaveEnterBackgrounds(const css::uno::Sequence& rLeaveArgs, const css::uno::Sequence& rEnterArgs) override; - virtual const SystemEnvData* GetSystemData() const override; + virtual const SystemEnvData& GetSystemData() const override; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/win/salframe.h b/vcl/inc/win/salframe.h index ca3bbd8eb323..ada7f2f022fe 100644 --- a/vcl/inc/win/salframe.h +++ b/vcl/inc/win/salframe.h @@ -130,7 +130,7 @@ public: virtual void UpdateSettings( AllSettings& rSettings ) override; virtual void Beep() override; virtual void FlashWindow() const override; - virtual const SystemEnvData* GetSystemData() const override; + virtual const SystemEnvData& GetSystemData() const override; virtual SalPointerState GetPointerState() override; virtual KeyIndicatorState GetIndicatorState() override; virtual void SimulateKeyPress( sal_uInt16 nKeyCode ) override; diff --git a/vcl/inc/win/salmenu.h b/vcl/inc/win/salmenu.h index 7058d9c82b8a..93f2610867d7 100644 --- a/vcl/inc/win/salmenu.h +++ b/vcl/inc/win/salmenu.h @@ -40,7 +40,7 @@ public: virtual void SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const OUString& rText ) override; virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage ) override; virtual void SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const vcl::KeyCode& rKeyCode, const OUString& rKeyName ) override; - virtual void GetSystemMenuData( SystemMenuData* pData ) override; + virtual void GetSystemMenuData(SystemMenuData& rData) override; HMENU mhMenu; // the menu handle bool mbMenuBar; // true for menu bars diff --git a/vcl/inc/win/salobj.h b/vcl/inc/win/salobj.h index 37bcf0317866..09a6b4ed182b 100644 --- a/vcl/inc/win/salobj.h +++ b/vcl/inc/win/salobj.h @@ -46,7 +46,7 @@ public: virtual void Show( bool bVisible ) override; virtual void Enable( bool bEnable ) override; virtual void GrabFocus() override; - virtual const SystemEnvData* GetSystemData() const override; + virtual const SystemEnvData& GetSystemData() const override; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/ios/dummies.cxx b/vcl/ios/dummies.cxx index a1d3cbcb674e..42ecc363e35d 100644 --- a/vcl/ios/dummies.cxx +++ b/vcl/ios/dummies.cxx @@ -99,10 +99,6 @@ void SalGenericInstance::updatePrinterUpdate() { } -void SalGenericInstance::jobEndedPrinterUpdate() -{ -} - using namespace psp; bool AquaGraphicsBackend::drawNativeControl(ControlType /* nType */, diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx index c6ab95c293e3..bb000d3daa97 100644 --- a/vcl/jsdialog/executor.cxx +++ b/vcl/jsdialog/executor.cxx @@ -74,7 +74,21 @@ bool ExecuteAction(const OUString& nWindowId, const OUString& rWidget, StringMap } } - if (pWidget != nullptr) + if (pWidget == nullptr) + { + // weld::Menu doesn't have base of weld::Widget + if (sControlType == "menu") + { + weld::Menu* pMenu = JSInstanceBuilder::FindMenu(nWindowId); + if (pMenu && sAction == "activated") + { + LOKTrigger::trigger_activated(*pMenu, rData["data"]); + return true; + } + } + return false; + } + else { // shared actions @@ -558,6 +572,18 @@ bool ExecuteAction(const OUString& nWindowId, const OUString& rWidget, StringMap pTreeView->drag_end(); return true; } + else if (sAction == "contextmenu") + { + sal_Int32 nEntryAbsPos = o3tl::toInt32(rData["data"]); + + std::unique_ptr itEntry(pTreeView->make_iterator()); + pTreeView->get_iter_abs_pos(*itEntry, nEntryAbsPos); + + tools::Rectangle aRect = pTreeView->get_row_area(*itEntry); + CommandEvent aCommand(aRect.Center(), CommandEventId::ContextMenu); + + LOKTrigger::trigger_popup_menu(*pTreeView, aCommand); + } } } else if (sControlType == "iconview") diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index f5459f2e9a5c..5c1e82397f9f 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -39,6 +40,14 @@ static std::map& GetLOKPopupsMap() return s_aLOKPopupsMap; } +static std::map& GetLOKMenusMap() +{ + // Map to remember the LOKWindowId <-> weld menu binding. + static std::map s_aLOKMenusMap; + + return s_aLOKMenusMap; +} + namespace { void response_help(vcl::Window* pWindow) @@ -318,7 +327,10 @@ JSDialogSender::~JSDialogSender() COVERITY_NOEXCEPT_FALSE void JSDialogSender::sendFullUpdate(bool bForce) { if (!mpIdleNotify) + { + assert(false); return; + } if (bForce) mpIdleNotify->forceUpdate(); @@ -798,6 +810,28 @@ void JSInstanceBuilder::ForgetPopup(const OUString& nWindowId) GetLOKPopupsMap().erase(it); } +void JSInstanceBuilder::RememberMenu(const OUString& nWindowId, weld::Menu* pMenu) +{ + GetLOKMenusMap()[nWindowId] = pMenu; +} + +void JSInstanceBuilder::ForgetMenu(const OUString& nWindowId) +{ + auto it = GetLOKMenusMap().find(nWindowId); + if (it != GetLOKMenusMap().end()) + GetLOKMenusMap().erase(it); +} + +weld::Menu* JSInstanceBuilder::FindMenu(const OUString& nWindowId) +{ + const auto it = GetLOKMenusMap().find(nWindowId); + + if (it != GetLOKMenusMap().end()) + return it->second; + + return nullptr; +} + vcl::Window* JSInstanceBuilder::FindPopup(const OUString& nWindowId) { const auto it = GetLOKPopupsMap().find(nWindowId); @@ -1201,6 +1235,20 @@ std::unique_ptr JSInstanceBuilder::weld_menu_button(const OUSt return pWeldWidget; } +std::unique_ptr JSInstanceBuilder::weld_menu(const OUString& id) +{ + PopupMenu* pPopupMenu = m_xBuilder->get_menu(id); + + JSMenu* pMenu = pPopupMenu ? new JSMenu(this, pPopupMenu, this, false) : nullptr; + + std::unique_ptr pWeldWidget(pMenu); + + if (pWeldWidget) + RememberMenu(getMapIdFromWindowId(), pWeldWidget.get()); + + return pWeldWidget; +} + std::unique_ptr JSInstanceBuilder::weld_popover(const OUString& id) { DockingWindow* pDockingWindow = m_xBuilder->get(id); @@ -2348,6 +2396,22 @@ void JSMenuButton::set_active(bool bActive) } } +JSMenu::JSMenu(JSDialogSender* /*pSender*/, PopupMenu* pPopupMenu, SalInstanceBuilder* /*pBuilder*/, + bool bTakeOwnership) + : SalInstanceMenu(pPopupMenu, bTakeOwnership) +{ +} + +OUString JSMenu::popup_at_rect(weld::Widget* /*pParent*/, const tools::Rectangle& /*rRect*/, + weld::Placement /*ePlace*/) +{ + // TODO: send message + + // first only send menu and cancel menu + // no return SalInstanceMenu::popup_at_rect(pParent, rRect, ePlace); + return ""; +} + JSPopover::JSPopover(JSDialogSender* pSender, DockingWindow* pDockingWindow, SalInstanceBuilder* pBuilder, bool bTakeOwnership) : JSWidget(pSender, pDockingWindow, pBuilder, bTakeOwnership) diff --git a/vcl/osx/a11ytextattributeswrapper.mm b/vcl/osx/a11ytextattributeswrapper.mm index 11b205a8039b..9310ae137726 100644 --- a/vcl/osx/a11ytextattributeswrapper.mm +++ b/vcl/osx/a11ytextattributeswrapper.mm @@ -25,6 +25,7 @@ #include "a11ytextattributeswrapper.h" #include +#include #include #include #include diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx index 73ea3ce2262a..9d85969363b6 100644 --- a/vcl/osx/salframe.cxx +++ b/vcl/osx/salframe.cxx @@ -1672,9 +1672,9 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH SAL_WNODEPRECATED_DECLARATIONS_POP } -const SystemEnvData* AquaSalFrame::GetSystemData() const +const SystemEnvData& AquaSalFrame::GetSystemData() const { - return &maSysData; + return maSysData; } void AquaSalFrame::Beep() diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx index 08a0a3620137..a14f1874c83e 100644 --- a/vcl/osx/salmenu.cxx +++ b/vcl/osx/salmenu.cxx @@ -744,10 +744,6 @@ void AquaSalMenu::SetAccelerator( unsigned /*nPos*/, SalMenuItem* pSalMenuItem, [pString release]; } -void AquaSalMenu::GetSystemMenuData( SystemMenuData* ) -{ -} - AquaSalMenu::MenuBarButtonEntry* AquaSalMenu::findButtonItem( sal_uInt16 i_nItemId ) { for( size_t i = 0; i < maButtons.size(); ++i ) diff --git a/vcl/osx/salobj.cxx b/vcl/osx/salobj.cxx index 6cf114f20c1b..43ce0521080f 100644 --- a/vcl/osx/salobj.cxx +++ b/vcl/osx/salobj.cxx @@ -284,9 +284,9 @@ void AquaSalObject::Show( bool bVisible ) [mpClipView setHidden: (bVisible ? NO : YES)]; } -const SystemEnvData* AquaSalObject::GetSystemData() const +const SystemEnvData& AquaSalObject::GetSystemData() const { - return &maSysData; + return maSysData; } namespace { diff --git a/vcl/qa/cppunit/pdfexport/data/FilledUpForm.pdf b/vcl/qa/cppunit/pdfexport/data/FilledUpForm.pdf new file mode 100644 index 000000000000..7032f8099411 Binary files /dev/null and b/vcl/qa/cppunit/pdfexport/data/FilledUpForm.pdf differ diff --git a/vcl/qa/cppunit/pdfexport/data/FilledUpForm_Source.odt b/vcl/qa/cppunit/pdfexport/data/FilledUpForm_Source.odt new file mode 100644 index 000000000000..42efe7f45dd7 Binary files /dev/null and b/vcl/qa/cppunit/pdfexport/data/FilledUpForm_Source.odt differ diff --git a/vcl/qa/cppunit/pdfexport/data/tdf162750.fodt b/vcl/qa/cppunit/pdfexport/data/tdf162750.fodt new file mode 100644 index 000000000000..be345551e91c --- /dev/null +++ b/vcl/qa/cppunit/pdfexport/data/tdf162750.fodt @@ -0,0 +1,119 @@ + + + 2024-12-04T21:34:47.4334348352024-12-04T21:37:36.661647530PT2M49S2LibreOfficeDev/25.2.0.0.alpha1$Linux_X86_64 LibreOffice_project/277d26808adc6812e17b910a6300006fe03f4614 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ffi + ffi + + + + \ No newline at end of file diff --git a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx index 214b03b861d9..3e36171f4ba0 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx @@ -5989,6 +5989,94 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf163913LeftRightMarginEm) CPPUNIT_ASSERT_DOUBLES_EQUAL(123.750, aRect.at(8).getMinX(), /*delta*/ 2.0); } +CPPUNIT_TEST_FIXTURE(PdfExportTest2, testFormRoundtrip) +{ + // We need to enable PDFium import (and make sure to disable after the test) + bool bResetEnvVar = false; + if (getenv("LO_IMPORT_USE_PDFIUM") == nullptr) + { + bResetEnvVar = true; + osl_setEnvironment(u"LO_IMPORT_USE_PDFIUM"_ustr.pData, u"1"_ustr.pData); + } + comphelper::ScopeGuard aPDFiumEnvVarGuard([&]() { + if (bResetEnvVar) + osl_clearEnvironment(u"LO_IMPORT_USE_PDFIUM"_ustr.pData); + }); + + saveAsPDF(u"FilledUpForm.pdf"); + auto pPdfDocument = parsePDFExport(); + CPPUNIT_ASSERT_EQUAL(1, pPdfDocument->getPageCount()); + std::unique_ptr pPage = pPdfDocument->openPage(0); + std::unique_ptr pPageObject = pPage->getObject(1); + CPPUNIT_ASSERT_EQUAL(5, pPage->getAnnotationCount()); + + { + std::unique_ptr pAnnotation = pPage->getAnnotation(0); + CPPUNIT_ASSERT_EQUAL(vcl::pdf::PDFFormFieldType::CheckBox, + pAnnotation->getFormFieldType(pPdfDocument.get())); + } + + { + std::unique_ptr pAnnotation = pPage->getAnnotation(1); + CPPUNIT_ASSERT_EQUAL(vcl::pdf::PDFFormFieldType::ComboBox, + pAnnotation->getFormFieldType(pPdfDocument.get())); + } + + { + std::unique_ptr pAnnotation = pPage->getAnnotation(2); + CPPUNIT_ASSERT_EQUAL(vcl::pdf::PDFFormFieldType::TextField, + pAnnotation->getFormFieldType(pPdfDocument.get())); + } + + { + std::unique_ptr pAnnotation = pPage->getAnnotation(3); + CPPUNIT_ASSERT_EQUAL(vcl::pdf::PDFFormFieldType::TextField, + pAnnotation->getFormFieldType(pPdfDocument.get())); + } + + { + std::unique_ptr pAnnotation = pPage->getAnnotation(4); + CPPUNIT_ASSERT_EQUAL(vcl::pdf::PDFFormFieldType::TextField, + pAnnotation->getFormFieldType(pPdfDocument.get())); + } +} + +CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf162750SmallCapsLigature) +{ + saveAsPDF(u"tdf162750.fodt"); + + auto pPdfDocument = parsePDFExport(); + CPPUNIT_ASSERT_EQUAL(1, pPdfDocument->getPageCount()); + + auto pPdfPage = pPdfDocument->openPage(/*nIndex*/ 0); + CPPUNIT_ASSERT(pPdfPage); + auto pTextPage = pPdfPage->getTextPage(); + CPPUNIT_ASSERT(pTextPage); + + int nPageObjectCount = pPdfPage->getObjectCount(); + + CPPUNIT_ASSERT_EQUAL(3, nPageObjectCount); + + std::vector aText; + for (int i = 0; i < nPageObjectCount; ++i) + { + auto pPageObject = pPdfPage->getObject(i); + CPPUNIT_ASSERT_MESSAGE("no object", pPageObject != nullptr); + if (pPageObject->getType() == vcl::pdf::PDFPageObjectType::Text) + { + aText.push_back(pPageObject->getText(pTextPage)); + } + } + + CPPUNIT_ASSERT_EQUAL(size_t(3), aText.size()); + CPPUNIT_ASSERT_EQUAL(u"ffi"_ustr, aText.at(0).trim()); + + // Without the fix, this will be "ffi" + CPPUNIT_ASSERT_EQUAL(u"f"_ustr, aText.at(1).trim()); + + CPPUNIT_ASSERT_EQUAL(u"FI"_ustr, aText.at(2).trim()); +} + } // end anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/vcl/qt5/QtFilePicker.cxx b/vcl/qt5/QtFilePicker.cxx index 807ba7ee853d..e97d8cb39608 100644 --- a/vcl/qt5/QtFilePicker.cxx +++ b/vcl/qt5/QtFilePicker.cxx @@ -873,8 +873,8 @@ void SAL_CALL QtFilePicker::initialize(const uno::Sequence& args) const tools::Long aWindowHandle = xSysWin.WindowHandle; const auto it = std::find_if(pFrames.begin(), pFrames.end(), [&aWindowHandle](auto pFrame) -> bool { - const SystemEnvData* pData = pFrame->GetSystemData(); - return pData && tools::Long(pData->GetWindowHandle(pFrame)) == aWindowHandle; + const SystemEnvData& rData = pFrame->GetSystemData(); + return tools::Long(rData.GetWindowHandle(pFrame)) == aWindowHandle; }); if (it != pFrames.end()) m_pParentWidget = static_cast(*it)->asChild(); diff --git a/vcl/qt5/QtInstanceCheckButton.cxx b/vcl/qt5/QtInstanceCheckButton.cxx index 835dcd356196..1a5e63408de7 100644 --- a/vcl/qt5/QtInstanceCheckButton.cxx +++ b/vcl/qt5/QtInstanceCheckButton.cxx @@ -17,7 +17,7 @@ QtInstanceCheckButton::QtInstanceCheckButton(QCheckBox* pCheckBox) , m_pCheckBox(pCheckBox) { assert(m_pCheckBox); - connect(m_pCheckBox, &QCheckBox::toggled, this, [&] { signal_toggled(); }); + connect(m_pCheckBox, &QCheckBox::toggled, this, &QtInstanceCheckButton::handleToggled); } void QtInstanceCheckButton::set_active(bool bActive) @@ -73,4 +73,10 @@ void QtInstanceCheckButton::QtInstanceCheckButton::set_label_wrap(bool /*bWrap*/ assert(false && "Not implemented yet"); } +void QtInstanceCheckButton::handleToggled() +{ + SolarMutexGuard g; + signal_toggled(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/qt5/QtInstanceComboBox.cxx b/vcl/qt5/QtInstanceComboBox.cxx index 79563be87659..b573edad0126 100644 --- a/vcl/qt5/QtInstanceComboBox.cxx +++ b/vcl/qt5/QtInstanceComboBox.cxx @@ -10,6 +10,8 @@ #include #include +#include + #include #include @@ -23,7 +25,9 @@ QtInstanceComboBox::QtInstanceComboBox(QComboBox* pComboBox) assert(pComboBox); QObject::connect(m_pComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, - &QtInstanceComboBox::handleCurrentIndexChanged); + &QtInstanceComboBox::signalChanged); + QObject::connect(m_pComboBox, &QComboBox::editTextChanged, this, + &QtInstanceComboBox::signalChanged); } void QtInstanceComboBox::insert(int nPos, const OUString& rStr, const OUString* pId, @@ -219,9 +223,9 @@ bool QtInstanceComboBox::has_entry() const return bEditable; } -void QtInstanceComboBox::set_entry_message_type(weld::EntryMessageType) +void QtInstanceComboBox::set_entry_message_type(weld::EntryMessageType eType) { - assert(false && "Not implemented yet"); + QtInstanceEntry::setMessageType(*m_pComboBox->lineEdit(), eType); } void QtInstanceComboBox::set_entry_text(const OUString& rStr) @@ -366,6 +370,10 @@ void QtInstanceComboBox::set_max_drop_down_rows(int) { assert(false && "Not impl void QtInstanceComboBox::sortItems() { m_pComboBox->model()->sort(0, Qt::AscendingOrder); } -void QtInstanceComboBox::handleCurrentIndexChanged() { signal_changed(); } +void QtInstanceComboBox::signalChanged() +{ + SolarMutexGuard g; + signal_changed(); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/qt5/QtInstanceEntry.cxx b/vcl/qt5/QtInstanceEntry.cxx index 49da357f6d8c..88f7a181f9f0 100644 --- a/vcl/qt5/QtInstanceEntry.cxx +++ b/vcl/qt5/QtInstanceEntry.cxx @@ -120,13 +120,13 @@ bool QtInstanceEntry::get_editable() const return bEditable; } -void QtInstanceEntry::set_message_type(weld::EntryMessageType eType) +void QtInstanceEntry::setMessageType(QLineEdit& rLineEdit, weld::EntryMessageType eType) { SolarMutexGuard g; GetQtInstance().RunInMainThread([&] { - for (QAction* pAction : m_pLineEdit->actions()) - m_pLineEdit->removeAction(pAction); + for (QAction* pAction : rLineEdit.actions()) + rLineEdit.removeAction(pAction); switch (eType) { @@ -134,12 +134,11 @@ void QtInstanceEntry::set_message_type(weld::EntryMessageType eType) // don't do anything special return; case weld::EntryMessageType::Warning: - m_pLineEdit->addAction(QIcon::fromTheme("dialog-warning"), - QLineEdit::TrailingPosition); + rLineEdit.addAction(QIcon::fromTheme("dialog-warning"), + QLineEdit::TrailingPosition); return; case weld::EntryMessageType::Error: - m_pLineEdit->addAction(QIcon::fromTheme("dialog-error"), - QLineEdit::TrailingPosition); + rLineEdit.addAction(QIcon::fromTheme("dialog-error"), QLineEdit::TrailingPosition); return; default: assert(false && "Unknown EntryMessageType"); @@ -148,6 +147,11 @@ void QtInstanceEntry::set_message_type(weld::EntryMessageType eType) }); } +void QtInstanceEntry::set_message_type(weld::EntryMessageType eType) +{ + setMessageType(*m_pLineEdit, eType); +} + void QtInstanceEntry::set_placeholder_text(const OUString& rText) { SolarMutexGuard g; diff --git a/vcl/qt5/QtInstanceImage.cxx b/vcl/qt5/QtInstanceImage.cxx index 291ba1be7689..1d56edea08e9 100644 --- a/vcl/qt5/QtInstanceImage.cxx +++ b/vcl/qt5/QtInstanceImage.cxx @@ -8,6 +8,7 @@ */ #include +#include #include diff --git a/vcl/qt5/QtInstanceLabel.cxx b/vcl/qt5/QtInstanceLabel.cxx index ca12c3314e81..d498e2000e7e 100644 --- a/vcl/qt5/QtInstanceLabel.cxx +++ b/vcl/qt5/QtInstanceLabel.cxx @@ -8,6 +8,7 @@ */ #include +#include #include diff --git a/vcl/qt5/QtInstanceTextView.cxx b/vcl/qt5/QtInstanceTextView.cxx index 9106ee3f2095..dc85c9850d01 100644 --- a/vcl/qt5/QtInstanceTextView.cxx +++ b/vcl/qt5/QtInstanceTextView.cxx @@ -8,6 +8,7 @@ */ #include +#include #include diff --git a/vcl/qt5/QtInstanceWidget.cxx b/vcl/qt5/QtInstanceWidget.cxx index 6636e3f1c956..29cb929cb80d 100644 --- a/vcl/qt5/QtInstanceWidget.cxx +++ b/vcl/qt5/QtInstanceWidget.cxx @@ -8,6 +8,8 @@ */ #include +#include + #include #include @@ -20,6 +22,8 @@ QtInstanceWidget::QtInstanceWidget(QWidget* pWidget) : m_pWidget(pWidget) { assert(pWidget); + + connect(qApp, &QApplication::focusChanged, this, &QtInstanceWidget::applicationFocusChanged); } void QtInstanceWidget::set_sensitive(bool bSensitive) @@ -459,10 +463,27 @@ bool QtInstanceWidget::has_grab() const void QtInstanceWidget::grab_remove() { assert(false && "Not implemented yet"); } -bool QtInstanceWidget::get_extents_relative_to(const Widget&, int&, int&, int&, int&) const +bool QtInstanceWidget::get_extents_relative_to(const Widget& rRelative, int& rX, int& rY, + int& rWidth, int& rHeight) const { - assert(false && "Not implemented yet"); - return false; + SolarMutexGuard g; + + bool bRet = false; + GetQtInstance().RunInMainThread([&] { + QRect aGeometry = m_pWidget->geometry(); + rWidth = aGeometry.width(); + rHeight = aGeometry.height(); + const QtInstanceWidget* pRelativeWidget = dynamic_cast(&rRelative); + if (!pRelativeWidget) + return; + + QPoint aRelativePos = m_pWidget->mapTo(pRelativeWidget->getQWidget(), QPoint(0, 0)); + rX = aRelativePos.x(); + rY = aRelativePos.y(); + bRet = true; + }); + + return bRet; } bool QtInstanceWidget::get_direction() const @@ -545,11 +566,27 @@ void QtInstanceWidget::set_toolbar_background() { assert(false && "Not implement void QtInstanceWidget::set_highlight_background() { assert(false && "Not implemented yet"); } -void QtInstanceWidget::set_background(const Color&) { assert(false && "Not implemented yet"); } +void QtInstanceWidget::set_background(const Color& rBackColor) +{ + QPalette aPalette = getQWidget()->palette(); + aPalette.setColor(QPalette::Base, toQColor(rBackColor)); + getQWidget()->setPalette(aPalette); + getQWidget()->setBackgroundRole(QPalette::Base); +} void QtInstanceWidget::draw(OutputDevice&, const Point&, const Size&) { assert(false && "Not implemented yet"); } +void QtInstanceWidget::applicationFocusChanged(QWidget* pOldFocus, QWidget* pNewFocus) +{ + SolarMutexGuard g; + + if (pOldFocus == m_pWidget) + signal_focus_out(); + else if (pNewFocus == m_pWidget) + signal_focus_in(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/qt5/QtInstanceWindow.cxx b/vcl/qt5/QtInstanceWindow.cxx index 262fe299a0c9..4d1cde125cfb 100644 --- a/vcl/qt5/QtInstanceWindow.cxx +++ b/vcl/qt5/QtInstanceWindow.cxx @@ -64,14 +64,21 @@ bool QtInstanceWindow::get_resizable() const Size QtInstanceWindow::get_size() const { - assert(false && "Not implemented yet"); - return Size(); + SolarMutexGuard g; + + Size aSize; + GetQtInstance().RunInMainThread([&] { aSize = toSize(getQWidget()->size()); }); + return aSize; } Point QtInstanceWindow::get_position() const { - assert(false && "Not implemented yet"); - return Point(); + SolarMutexGuard g; + + Point aPosition; + GetQtInstance().RunInMainThread( + [&] { aPosition = toPoint(getQWidget()->geometry().topLeft()); }); + return aPosition; } AbsoluteScreenPixelRectangle QtInstanceWindow::get_monitor_workarea() const @@ -108,12 +115,68 @@ bool QtInstanceWindow::is_default_widget(const weld::Widget*) const return true; } -void QtInstanceWindow::set_window_state(const OUString&) { assert(false && "Not implemented yet"); } - -OUString QtInstanceWindow::get_window_state(vcl::WindowDataMask) const +void QtInstanceWindow::set_window_state(const OUString& rStr) { - assert(false && "Not implemented yet"); - return OUString(); + SolarMutexGuard g; + + const vcl::WindowData aData(rStr); + const vcl::WindowDataMask eMask = aData.mask(); + + GetQtInstance().RunInMainThread([&] { + QRect aGeometry = getQWidget()->geometry(); + if (eMask & vcl::WindowDataMask::X) + aGeometry.setX(aData.x()); + if (eMask & vcl::WindowDataMask::Y) + aGeometry.setY(aData.y()); + if (eMask & vcl::WindowDataMask::Width) + aGeometry.setWidth(aData.width()); + if (eMask & vcl::WindowDataMask::Height) + aGeometry.setHeight(aData.height()); + + getQWidget()->setGeometry(aGeometry); + + if (eMask & vcl::WindowDataMask::State) + { + const vcl::WindowState eState = aData.state(); + if (eState & vcl::WindowState::Normal) + getQWidget()->showNormal(); + else if (eState & vcl::WindowState::Maximized) + getQWidget()->showMaximized(); + else if (eState & vcl::WindowState::Minimized) + getQWidget()->showMinimized(); + } + }); +} + +OUString QtInstanceWindow::get_window_state(vcl::WindowDataMask eMask) const +{ + SolarMutexGuard g; + + vcl::WindowData aData; + GetQtInstance().RunInMainThread([&] { + QRect aGeometry = getQWidget()->geometry(); + if (eMask & vcl::WindowDataMask::X) + aData.setX(aGeometry.x()); + if (eMask & vcl::WindowDataMask::Y) + aData.setY(aGeometry.y()); + if (eMask & vcl::WindowDataMask::Width) + aData.setWidth(aGeometry.width()); + if (eMask & vcl::WindowDataMask::Height) + aData.setHeight(aGeometry.height()); + if (eMask & vcl::WindowDataMask::State) + { + vcl::WindowState nState = vcl::WindowState::NONE; + if (getQWidget()->isMaximized()) + nState |= vcl::WindowState::Maximized; + else if (getQWidget()->isMinimized()) + nState |= vcl::WindowState::Minimized; + else + nState |= vcl::WindowState::Normal; + aData.setState(nState); + } + }); + + return aData.toStr(); } css::uno::Reference QtInstanceWindow::GetXWindow() diff --git a/vcl/qt5/QtMenu.cxx b/vcl/qt5/QtMenu.cxx index 6cdc6cf25d86..b306e35eb54a 100644 --- a/vcl/qt5/QtMenu.cxx +++ b/vcl/qt5/QtMenu.cxx @@ -597,8 +597,6 @@ void QtMenu::SetAccelerator(unsigned, SalMenuItem* pItem, const vcl::KeyCode&, pAction->setShortcut(QKeySequence(toQString(rText), QKeySequence::PortableText)); } -void QtMenu::GetSystemMenuData(SystemMenuData*) {} - QtMenu* QtMenu::GetTopLevel() { QtMenu* pMenu = this; diff --git a/accessibility/source/standard/accessiblemenubasecomponent.cxx b/vcl/source/accessibility/accessiblemenubasecomponent.cxx similarity index 97% rename from accessibility/source/standard/accessiblemenubasecomponent.cxx rename to vcl/source/accessibility/accessiblemenubasecomponent.cxx index 5c9e1e47b637..10f7dff9e6b5 100644 --- a/accessibility/source/standard/accessiblemenubasecomponent.cxx +++ b/vcl/source/accessibility/accessiblemenubasecomponent.cxx @@ -17,11 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -30,6 +29,7 @@ #include #include #include +#include #include #include @@ -342,8 +342,8 @@ Reference< XAccessible > OAccessibleMenuBaseComponent::GetChildAt( const awt::Po Reference< XAccessibleComponent > xComp( xAcc->getAccessibleContext(), UNO_QUERY ); if ( xComp.is() ) { - tools::Rectangle aRect = VCLUnoHelper::ConvertToVCLRect(xComp->getBounds()); - Point aPos = VCLUnoHelper::ConvertToVCLPoint(rPoint); + tools::Rectangle aRect = vcl::unohelper::ConvertToVCLRect(xComp->getBounds()); + Point aPos = vcl::unohelper::ConvertToVCLPoint(rPoint); if ( aRect.Contains( aPos ) ) { return xAcc; diff --git a/accessibility/source/standard/accessiblemenucomponent.cxx b/vcl/source/accessibility/accessiblemenucomponent.cxx similarity index 90% rename from accessibility/source/standard/accessiblemenucomponent.cxx rename to vcl/source/accessibility/accessiblemenucomponent.cxx index 051828d21a1f..4163d096011e 100644 --- a/accessibility/source/standard/accessiblemenucomponent.cxx +++ b/vcl/source/accessibility/accessiblemenucomponent.cxx @@ -17,10 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include - -#include -#include +#include #include #include @@ -33,6 +30,7 @@ #include #include #include +#include #include using namespace ::com::sun::star::accessibility; @@ -98,7 +96,7 @@ awt::Rectangle OAccessibleMenuComponent::implGetBounds() { // get bounding rectangle of the window in screen coordinates AbsoluteScreenPixelRectangle aRect = pWindow->GetWindowExtentsAbsolute(); - aBounds = VCLUnoHelper::ConvertToAWTRect(aRect); + aBounds = vcl::unohelper::ConvertToAWTRect(aRect); // get position of the accessible parent in screen coordinates Reference< XAccessible > xParent = getAccessibleParent(); @@ -235,7 +233,7 @@ awt::Point OAccessibleMenuComponent::getLocationOnScreen( ) if ( pWindow ) { AbsoluteScreenPixelRectangle aRect = pWindow->GetWindowExtentsAbsolute(); - aPos = VCLUnoHelper::ConvertToAWTPoint(aRect.TopLeft()); + aPos = vcl::unohelper::ConvertToAWTPoint(aRect.TopLeft()); } } @@ -277,33 +275,6 @@ sal_Int32 OAccessibleMenuComponent::getBackground( ) // XAccessibleExtendedComponent - -Reference< awt::XFont > OAccessibleMenuComponent::getFont( ) -{ - OExternalLockGuard aGuard( this ); - - Reference< awt::XFont > xFont; - - if ( m_pMenu ) - { - vcl::Window* pWindow = m_pMenu->GetWindow(); - if ( pWindow ) - { - Reference< awt::XDevice > xDev( pWindow->GetComponentInterface(), UNO_QUERY ); - if ( xDev.is() ) - { - const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); - rtl::Reference pVCLXFont = new VCLXFont; - pVCLXFont->Init( *xDev, rStyleSettings.GetMenuFont() ); - xFont = pVCLXFont; - } - } - } - - return xFont; -} - - OUString OAccessibleMenuComponent::getTitledBorderText( ) { OExternalLockGuard aGuard( this ); diff --git a/accessibility/source/standard/accessiblemenuitemcomponent.cxx b/vcl/source/accessibility/accessiblemenuitemcomponent.cxx similarity index 94% rename from accessibility/source/standard/accessiblemenuitemcomponent.cxx rename to vcl/source/accessibility/accessiblemenuitemcomponent.cxx index 011e05f9dadf..a50415e9ab77 100644 --- a/accessibility/source/standard/accessiblemenuitemcomponent.cxx +++ b/vcl/source/accessibility/accessiblemenuitemcomponent.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include @@ -26,8 +26,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -239,14 +239,14 @@ awt::Rectangle OAccessibleMenuItemComponent::implGetBounds() if ( m_pParent ) { // get bounding rectangle of the item relative to the containing window - aBounds = VCLUnoHelper::ConvertToAWTRect(m_pParent->GetBoundingRectangle(m_nItemPos)); + aBounds = vcl::unohelper::ConvertToAWTRect(m_pParent->GetBoundingRectangle(m_nItemPos)); // get position of containing window in screen coordinates vcl::Window* pWindow = m_pParent->GetWindow(); if ( pWindow ) { AbsoluteScreenPixelRectangle aRect = pWindow->GetWindowExtentsAbsolute(); - awt::Point aWindowScreenLoc = VCLUnoHelper::ConvertToAWTPoint(aRect.TopLeft()); + awt::Point aWindowScreenLoc = vcl::unohelper::ConvertToAWTPoint(aRect.TopLeft()); // get position of accessible parent in screen coordinates Reference< XAccessible > xParent = getAccessibleParent(); @@ -417,24 +417,6 @@ sal_Int32 OAccessibleMenuItemComponent::getBackground( ) // XAccessibleExtendedComponent - -Reference< awt::XFont > OAccessibleMenuItemComponent::getFont( ) -{ - OExternalLockGuard aGuard( this ); - - Reference< awt::XFont > xFont; - Reference< XAccessible > xParent = getAccessibleParent(); - if ( xParent.is() ) - { - Reference< XAccessibleExtendedComponent > xParentComp( xParent->getAccessibleContext(), UNO_QUERY ); - if ( xParentComp.is() ) - xFont = xParentComp->getFont(); - } - - return xFont; -} - - OUString OAccessibleMenuItemComponent::getTitledBorderText( ) { OExternalLockGuard aGuard( this ); diff --git a/accessibility/source/helper/characterattributeshelper.cxx b/vcl/source/accessibility/characterattributeshelper.cxx similarity index 98% rename from accessibility/source/helper/characterattributeshelper.cxx rename to vcl/source/accessibility/characterattributeshelper.cxx index 7e2a2334bf57..e01d2d8625f5 100644 --- a/accessibility/source/helper/characterattributeshelper.cxx +++ b/vcl/source/accessibility/characterattributeshelper.cxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include #include +#include #include #include diff --git a/accessibility/source/standard/vclxaccessiblemenu.cxx b/vcl/source/accessibility/vclxaccessiblemenu.cxx similarity index 99% rename from accessibility/source/standard/vclxaccessiblemenu.cxx rename to vcl/source/accessibility/vclxaccessiblemenu.cxx index 5ba208d2f368..c38cc84ebed2 100644 --- a/accessibility/source/standard/vclxaccessiblemenu.cxx +++ b/vcl/source/accessibility/vclxaccessiblemenu.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include diff --git a/accessibility/source/standard/vclxaccessiblemenubar.cxx b/vcl/source/accessibility/vclxaccessiblemenubar.cxx similarity index 98% rename from accessibility/source/standard/vclxaccessiblemenubar.cxx rename to vcl/source/accessibility/vclxaccessiblemenubar.cxx index 9664254fa543..4e64803db783 100644 --- a/accessibility/source/standard/vclxaccessiblemenubar.cxx +++ b/vcl/source/accessibility/vclxaccessiblemenubar.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include diff --git a/accessibility/source/standard/vclxaccessiblemenuitem.cxx b/vcl/source/accessibility/vclxaccessiblemenuitem.cxx similarity index 98% rename from accessibility/source/standard/vclxaccessiblemenuitem.cxx rename to vcl/source/accessibility/vclxaccessiblemenuitem.cxx index b505920aed93..a8696f43e380 100644 --- a/accessibility/source/standard/vclxaccessiblemenuitem.cxx +++ b/vcl/source/accessibility/vclxaccessiblemenuitem.cxx @@ -17,9 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include +#include #include + #include #include @@ -30,14 +30,15 @@ #include #include #include -#include +#include +#include #include #include #include #include +#include #include #include -#include using namespace ::com::sun::star::accessibility; using namespace ::com::sun::star::uno; @@ -239,7 +240,7 @@ awt::Rectangle VCLXAccessibleMenuItem::getCharacterBounds( sal_Int32 nIndex ) tools::Rectangle aItemRect = m_pParent->GetBoundingRectangle( m_nItemPos ); tools::Rectangle aCharRect = m_pParent->GetCharacterBounds( nItemId, nIndex ); aCharRect.Move( -aItemRect.Left(), -aItemRect.Top() ); - aBounds = VCLUnoHelper::ConvertToAWTRect(aCharRect); + aBounds = vcl::unohelper::ConvertToAWTRect(aCharRect); } return aBounds; @@ -263,7 +264,7 @@ sal_Int32 VCLXAccessibleMenuItem::getIndexAtPoint( const awt::Point& aPoint ) { sal_uInt16 nItemId = 0; tools::Rectangle aItemRect = m_pParent->GetBoundingRectangle( m_nItemPos ); - Point aPnt(VCLUnoHelper::ConvertToVCLPoint(aPoint)); + Point aPnt(vcl::unohelper::ConvertToVCLPoint(aPoint)); aPnt += aItemRect.TopLeft(); sal_Int32 nI = m_pParent->GetIndexForPoint( aPnt, nItemId ); if ( nI != -1 && m_pParent->GetItemId( m_nItemPos ) == nItemId ) diff --git a/accessibility/source/standard/vclxaccessiblemenuseparator.cxx b/vcl/source/accessibility/vclxaccessiblemenuseparator.cxx similarity index 96% rename from accessibility/source/standard/vclxaccessiblemenuseparator.cxx rename to vcl/source/accessibility/vclxaccessiblemenuseparator.cxx index d64ccb0baa25..7100d1972c39 100644 --- a/accessibility/source/standard/vclxaccessiblemenuseparator.cxx +++ b/vcl/source/accessibility/vclxaccessiblemenuseparator.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include diff --git a/accessibility/source/standard/vclxaccessiblepopupmenu.cxx b/vcl/source/accessibility/vclxaccessiblepopupmenu.cxx similarity index 97% rename from accessibility/source/standard/vclxaccessiblepopupmenu.cxx rename to vcl/source/accessibility/vclxaccessiblepopupmenu.cxx index d8b840eee784..95df37593bd2 100644 --- a/accessibility/source/standard/vclxaccessiblepopupmenu.cxx +++ b/vcl/source/accessibility/vclxaccessiblepopupmenu.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include diff --git a/vcl/source/app/IconThemeScanner.cxx b/vcl/source/app/IconThemeScanner.cxx index c8f6a1ac7e8d..9cc5fc83d54d 100644 --- a/vcl/source/app/IconThemeScanner.cxx +++ b/vcl/source/app/IconThemeScanner.cxx @@ -57,10 +57,9 @@ OUString convert_to_absolute_path(const OUString& path) } -IconThemeScanner::IconThemeScanner() -{} +IconThemeScanner::IconThemeScanner() = default; -void IconThemeScanner::ScanDirectoryForIconThemes(std::u16string_view paths) +IconThemeScanner::IconThemeScanner(std::u16string_view paths) { mFoundIconThemes.clear(); @@ -168,14 +167,6 @@ IconThemeScanner::IconThemeIsInstalled(const OUString& themeId) const return IconThemeInfo::IconThemeIsInVector(mFoundIconThemes, themeId); } -/*static*/ std::shared_ptr -IconThemeScanner::Create(std::u16string_view path) -{ - std::shared_ptr retval(new IconThemeScanner); - retval->ScanDirectoryForIconThemes(path); - return retval; -} - /*static*/ OUString IconThemeScanner::GetStandardIconThemePath() { diff --git a/vcl/source/app/IconThemeSelector.cxx b/vcl/source/app/IconThemeSelector.cxx index eeea0227e603..7c621aa930a5 100644 --- a/vcl/source/app/IconThemeSelector.cxx +++ b/vcl/source/app/IconThemeSelector.cxx @@ -163,30 +163,6 @@ IconThemeSelector::SetPreferredIconTheme(const OUString& theme, bool bDarkIconTh return bChanged; } -bool -IconThemeSelector::operator==(const vcl::IconThemeSelector& other) const -{ - if (this == &other) { - return true; - } - if (mPreferredIconTheme != other.mPreferredIconTheme) { - return false; - } - if (mPreferDarkIconTheme != other.mPreferDarkIconTheme) { - return false; - } - if (mUseHighContrastTheme != other.mUseHighContrastTheme) { - return false; - } - return true; -} - -bool -IconThemeSelector::operator!=(const vcl::IconThemeSelector& other) const -{ - return !(*this == other); -} - /*static*/ OUString IconThemeSelector::ReturnFallback(const std::vector& installedThemes) { diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 4f2928e53747..8f0bb080accb 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -214,6 +214,8 @@ SalObject::~SalObject() {} SalMenu::~SalMenu() {} +void SalMenu::GetSystemMenuData(SystemMenuData&) {} + bool SalMenu::ShowNativePopupMenu(FloatingWindow*, const tools::Rectangle&, FloatWinPopupFlags) { return false; @@ -739,11 +741,11 @@ SystemWindow* SalInstanceWidget::getSystemWindow() { return m_xWidget->GetSystem void SalInstanceWidget::HandleEventListener(VclWindowEvent& rEvent) { if (rEvent.GetId() == VclEventId::WindowGetFocus) - m_aFocusInHdl.Call(*this); + signal_focus_in(); else if (rEvent.GetId() == VclEventId::WindowLoseFocus) - m_aFocusOutHdl.Call(*this); + signal_focus_out(); else if (rEvent.GetId() == VclEventId::WindowResize) - m_aSizeAllocateHdl.Call(m_xWidget->GetSizePixel()); + signal_size_allocate(m_xWidget->GetSizePixel()); } namespace @@ -764,14 +766,14 @@ void SalInstanceWidget::HandleMouseEventListener(VclWindowEvent& rWinEvent) if (m_xWidget == rWinEvent.GetWindow()) { const MouseEvent* pMouseEvent = static_cast(rWinEvent.GetData()); - m_aMousePressHdl.Call(*pMouseEvent); + signal_mouse_press(*pMouseEvent); } else if (m_xWidget->ImplIsChild(rWinEvent.GetWindow())) { const MouseEvent* pMouseEvent = static_cast(rWinEvent.GetData()); const MouseEvent aTransformedEvent( TransformEvent(*pMouseEvent, m_xWidget, rWinEvent.GetWindow())); - m_aMousePressHdl.Call(aTransformedEvent); + signal_mouse_press(aTransformedEvent); } } else if (rWinEvent.GetId() == VclEventId::WindowMouseButtonUp) @@ -779,14 +781,14 @@ void SalInstanceWidget::HandleMouseEventListener(VclWindowEvent& rWinEvent) if (m_xWidget == rWinEvent.GetWindow()) { const MouseEvent* pMouseEvent = static_cast(rWinEvent.GetData()); - m_aMouseReleaseHdl.Call(*pMouseEvent); + signal_mouse_release(*pMouseEvent); } else if (m_xWidget->ImplIsChild(rWinEvent.GetWindow())) { const MouseEvent* pMouseEvent = static_cast(rWinEvent.GetData()); const MouseEvent aTransformedEvent( TransformEvent(*pMouseEvent, m_xWidget, rWinEvent.GetWindow())); - m_aMouseReleaseHdl.Call(aTransformedEvent); + signal_mouse_release(aTransformedEvent); } } else if (rWinEvent.GetId() == VclEventId::WindowMouseMove) @@ -794,14 +796,14 @@ void SalInstanceWidget::HandleMouseEventListener(VclWindowEvent& rWinEvent) if (m_xWidget == rWinEvent.GetWindow()) { const MouseEvent* pMouseEvent = static_cast(rWinEvent.GetData()); - m_aMouseMotionHdl.Call(*pMouseEvent); + signal_mouse_motion(*pMouseEvent); } else if (m_xWidget->ImplIsChild(rWinEvent.GetWindow())) { const MouseEvent* pMouseEvent = static_cast(rWinEvent.GetData()); const MouseEvent aTransformedEvent( TransformEvent(*pMouseEvent, m_xWidget, rWinEvent.GetWindow())); - m_aMouseMotionHdl.Call(aTransformedEvent); + signal_mouse_motion(aTransformedEvent); } } } @@ -814,12 +816,12 @@ bool SalInstanceWidget::HandleKeyEventListener(VclWindowEvent& rEvent) if (rEvent.GetId() == VclEventId::WindowKeyInput) { const KeyEvent* pKeyEvent = static_cast(rEvent.GetData()); - return m_aKeyPressHdl.Call(*pKeyEvent); + return signal_key_press(*pKeyEvent); } else if (rEvent.GetId() == VclEventId::WindowKeyUp) { const KeyEvent* pKeyEvent = static_cast(rEvent.GetData()); - return m_aKeyReleaseHdl.Call(*pKeyEvent); + return signal_key_release(*pKeyEvent); } return false; } @@ -841,7 +843,7 @@ IMPL_LINK(SalInstanceWidget, MouseEventListener, VclWindowEvent&, rEvent, void) IMPL_LINK_NOARG(SalInstanceWidget, MnemonicActivateHdl, vcl::Window&, bool) { - return m_aMnemonicActivateHdl.Call(*this); + return signal_mnemonic_activate(); } namespace @@ -5665,6 +5667,13 @@ bool SalInstanceIconView::get_iter_first(weld::TreeIter& rIter) const return rVclIter.iter != nullptr; } +bool SalInstanceIconView::iter_next_sibling(weld::TreeIter& rIter) const +{ + SalInstanceTreeIter& rVclIter = static_cast(rIter); + rVclIter.iter = rVclIter.iter->NextSibling(); + return rVclIter.iter != nullptr; +} + void SalInstanceIconView::scroll_to_item(const weld::TreeIter& rIter) { assert(m_xIconView->IsUpdateMode() @@ -5696,12 +5705,99 @@ OUString SalInstanceIconView::get_id(const weld::TreeIter& rIter) const return OUString(); } +OUString SalInstanceIconView::get_id(int pos) const +{ + const OUString* pRet = getEntryData(pos); + if (!pRet) + return OUString(); + return *pRet; +} + +void SalInstanceIconView::set_image(int pos, VirtualDevice* pIcon) +{ + SvTreeListEntry* aEntry = m_xIconView->GetEntry(nullptr, pos); + if (aEntry == nullptr) + return; + SvLBoxContextBmp* aItem + = static_cast(aEntry->GetFirstItem(SvLBoxItemType::ContextBmp)); + + Image aImage; + if (pIcon) + { + const Point aNull(0, 0); + const Size aSize = pIcon->GetOutputSize(); + aImage = Image(pIcon->GetBitmapEx(aNull, aSize)); + } + if (aItem == nullptr) + { + aEntry->AddItem(std::make_unique(aImage, aImage, false)); + } + else + { + aItem->SetBitmap1(aImage); + aItem->SetBitmap2(aImage); + } + + if (!m_xIconView->GetModel()->IsEnableInvalidate()) + m_xIconView->ModelHasEntryInvalidated(aEntry); +} + +void SalInstanceIconView::remove(int pos) +{ + disable_notify_events(); + SvTreeListEntry* pEntry = m_xIconView->GetEntry(nullptr, pos); + m_xIconView->RemoveEntry(pEntry); + enable_notify_events(); +} + +const OUString* SalInstanceIconView::getEntryData(int index) const +{ + SvTreeListEntry* pEntry = m_xIconView->GetEntry(nullptr, index); + return pEntry ? static_cast(pEntry->GetUserData()) : nullptr; +} + OUString SalInstanceIconView::get_text(const weld::TreeIter& rIter) const { const SalInstanceTreeIter& rVclIter = static_cast(rIter); return SvTabListBox::GetEntryText(rVclIter.iter, 0); } +void SalInstanceIconView::set_text(int pos, const OUString& rText) +{ + SvTreeListEntry* aEntry = m_xIconView->GetEntry(nullptr, pos); + if (aEntry == nullptr) + return; + + SvLBoxString* aItem = static_cast(aEntry->GetFirstItem(SvLBoxItemType::String)); + if (aItem == nullptr) + { + aEntry->AddItem(std::make_unique(rText)); + } + else + { + aItem->SetText(rText); + } + + if (!m_xIconView->GetModel()->IsEnableInvalidate()) + m_xIconView->ModelHasEntryInvalidated(aEntry); +} + +void SalInstanceIconView::set_id(int pos, const OUString& rId) +{ + SvTreeListEntry* pEntry = m_xIconView->GetEntry(nullptr, pos); + m_aUserData.emplace_back(std::make_unique(rId)); + pEntry->SetUserData(m_aUserData.back().get()); +} + +tools::Rectangle SalInstanceIconView::get_rect(int pos) const +{ + SvTreeListEntry* aEntry = m_xIconView->GetEntry(nullptr, pos); + if (aEntry == nullptr) + return tools::Rectangle(); + + return m_xIconView->GetBoundingRect(aEntry); +} + void SalInstanceIconView::clear() { disable_notify_events(); diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index ad15bd3e68a3..7d807a7bdae0 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -70,15 +70,27 @@ struct ImplMouseData MouseFollowFlags mnFollow = MouseFollowFlags::Menu; MouseMiddleButtonAction mnMiddleButtonAction= MouseMiddleButtonAction::AutoScroll; MouseWheelBehaviour mnWheelBehavior = MouseWheelBehaviour::FocusOnly; + + bool operator==(const ImplMouseData& rSet) const = default; }; -struct ImplStyleData +namespace { - ImplStyleData(); - ImplStyleData( const ImplStyleData& rData ); +constexpr Size getInitListBoxPreviewDefaultLogicSize() +{ +#ifdef IOS + return Size(30, 30); +#else + return Size(15, 7); +#endif +} - void SetStandardStyles(); +// Structures simplifying comparison in StyleSettings::operator ==, where for some reason +// not all members of ImplStyleData are compared. Adding elements here would automatically +// participate in the default comparison methods. +struct ColorSet +{ Color maActiveBorderColor; Color maActiveColor; Color maActiveTextColor; @@ -151,6 +163,12 @@ struct ImplStyleData Color maTabTextColor; Color maTabRolloverTextColor; Color maTabHighlightTextColor; + + bool operator==(const ColorSet&) const = default; +}; + +struct FontSet +{ vcl::Font maAppFont; vcl::Font maHelpFont; vcl::Font maTitleFont; @@ -164,61 +182,82 @@ struct ImplStyleData vcl::Font maIconFont; vcl::Font maTabFont; vcl::Font maGroupFont; + + bool operator==(const FontSet&) const = default; +}; +} + +struct ImplStyleData +{ + ImplStyleData(); + + void SetStandardStyles(); + + ColorSet maColors; + FontSet maFonts; sal_Int32 mnTitleHeight; sal_Int32 mnFloatTitleHeight; - sal_Int32 mnScrollBarSize; - sal_Int32 mnSpinSize; - sal_Int32 mnCursorSize; - sal_Int32 mnAntialiasedMin; - sal_uInt64 mnCursorBlinkTime; - DragFullOptions mnDragFullOptions; - SelectionOptions mnSelectionOptions; - DisplayOptions mnDisplayOptions; - ToolbarIconSize mnToolbarIconSize; - bool mnUseFlatMenus; - StyleSettingsOptions mnOptions; - bool mbHighContrast; - bool mbUseSystemUIFonts; + sal_Int32 mnScrollBarSize = 16; + sal_Int32 mnSpinSize = 16; + sal_Int32 mnCursorSize = 2; + sal_Int32 mnAntialiasedMin = 0; + sal_uInt64 mnCursorBlinkTime = STYLE_CURSOR_NOBLINKTIME; + DragFullOptions mnDragFullOptions = DragFullOptions::All; + SelectionOptions mnSelectionOptions = SelectionOptions::NONE; + DisplayOptions mnDisplayOptions = DisplayOptions::NONE; + ToolbarIconSize mnToolbarIconSize = ToolbarIconSize::Unknown; + StyleSettingsOptions mnOptions = StyleSettingsOptions::NONE; + TriState meUseImagesInMenus = TRISTATE_INDET; + std::optional mutable + mIconThemeScanner; + vcl::IconThemeSelector mIconThemeSelector; + + OUString mIconTheme; + sal_Int32 mnMinThumbSize = 16; + TriState meContextMenuShortcuts = TRISTATE_INDET; + DialogStyle maDialogStyle; + + bool mnUseFlatMenus : 1; + bool mbHighContrast : 1; + bool mbUseSystemUIFonts : 1; /** * Disabling AA doesn't actually disable AA of fonts, instead it is taken * from system settings. */ - bool mbUseFontAAFromSystem; - bool mbAutoMnemonic; - TriState meUseImagesInMenus; - bool mnUseFlatBorders; - bool mbPreferredUseImagesInMenus; - sal_Int32 mnMinThumbSize; - std::shared_ptr - mIconThemeScanner; - std::shared_ptr - mIconThemeSelector; - - OUString mIconTheme; - bool mbSkipDisabledInMenus; - bool mbHideDisabledMenuItems; - bool mbPreferredContextMenuShortcuts; - TriState meContextMenuShortcuts; + bool mbUseFontAAFromSystem : 1; + bool mbUseSubpixelAA : 1; + bool mbAutoMnemonic : 1 = true; + bool mnUseFlatBorders : 1; + bool mbPreferredUseImagesInMenus : 1; + bool mbSkipDisabledInMenus : 1; + bool mbHideDisabledMenuItems : 1; + bool mbPreferredContextMenuShortcuts : 1; //mbPrimaryButtonWarpsSlider == true for "jump to here" behavior for primary button, otherwise //primary means scroll by single page. Secondary button takes the alternative behaviour - bool mbPrimaryButtonWarpsSlider; - DialogStyle maDialogStyle; + bool mbPrimaryButtonWarpsSlider : 1; + bool mbPreviewUsesCheckeredBackground : 1 = true; - sal_uInt16 mnEdgeBlending; - Color maEdgeBlendingTopLeftColor; - Color maEdgeBlendingBottomRightColor; - sal_uInt16 mnListBoxMaximumLineCount; - sal_uInt16 mnColorValueSetColumnCount; - Size maListBoxPreviewDefaultLogicSize; - Size maListBoxPreviewDefaultPixelSize; - ComboBoxTextSelectionMode meComboBoxTextSelectionMode; - bool mbPreviewUsesCheckeredBackground; + sal_uInt16 mnEdgeBlending = 35; + Color maEdgeBlendingTopLeftColor = Color(0xC0, 0xC0, 0xC0); + Color maEdgeBlendingBottomRightColor = Color(0x40, 0x40, 0x40); + sal_uInt16 mnListBoxMaximumLineCount = 25; - OUString maPersonaHeaderFooter; ///< Cache the settings to detect changes. + // For some reason this isn't actually the column count that gets used, at least on iOS, but + // instead what SvtAccessibilityOptions_Impl::GetColorValueSetColumnCount() in + // svtools/source/config/accessibilityoptions.cxx returns. + sal_uInt16 mnColorValueSetColumnCount = 12; + ComboBoxTextSelectionMode meComboBoxTextSelectionMode = ComboBoxTextSelectionMode::SelectText; + Size maListBoxPreviewDefaultLogicSize = getInitListBoxPreviewDefaultLogicSize(); + // on-demand calculated in GetListBoxPreviewDefaultPixelSize() + Size mutable maListBoxPreviewDefaultPixelSize; - BitmapEx maPersonaHeaderBitmap; ///< Cache the header bitmap. - BitmapEx maPersonaFooterBitmap; ///< Cache the footer bitmap. - std::optional maPersonaMenuBarTextColor; ///< Cache the menubar color. + OUString mutable maPersonaHeaderFooter; ///< Cache the settings to detect changes. + + BitmapEx mutable maPersonaHeaderBitmap; ///< Cache the header bitmap. + BitmapEx mutable maPersonaFooterBitmap; ///< Cache the footer bitmap. + std::optional mutable maPersonaMenuBarTextColor; ///< Cache the menubar color. + + bool operator==(const ImplStyleData& rSet) const; }; struct ImplMiscData @@ -243,20 +282,21 @@ struct ImplAllSettingsData StyleSettings maStyleSettings; MiscSettings maMiscSettings; HelpSettings maHelpSettings; + SvtSysLocale maSysLocale; LanguageTag maLocale; LanguageTag maUILocale; - std::unique_ptr mpLocaleDataWrapper; - std::unique_ptr mpUILocaleDataWrapper; - std::unique_ptr mpNeutralLocaleDataWrapper; - std::unique_ptr mpI18nHelper; - std::unique_ptr mpUII18nHelper; - SvtSysLocale maSysLocale; + mutable std::unique_ptr mpLocaleDataWrapper; + mutable std::unique_ptr mpUILocaleDataWrapper; + mutable std::unique_ptr mpNeutralLocaleDataWrapper; + mutable std::unique_ptr mpI18nHelper; + mutable std::unique_ptr mpUII18nHelper; + + bool operator==(const ImplAllSettingsData& rSet) const; }; void MouseSettings::SetOptions(MouseSettingsOptions nOptions) { - CopyData(); mxData->mnOptions = nOptions; } @@ -269,7 +309,6 @@ MouseSettings::GetOptions() const void MouseSettings::SetDoubleClickTime( sal_uInt64 nDoubleClkTime ) { - CopyData(); mxData->mnDoubleClkTime = nDoubleClkTime; } @@ -282,7 +321,6 @@ MouseSettings::GetDoubleClickTime() const void MouseSettings::SetDoubleClickWidth( sal_Int32 nDoubleClkWidth ) { - CopyData(); mxData->mnDoubleClkWidth = nDoubleClkWidth; } @@ -295,7 +333,6 @@ MouseSettings::GetDoubleClickWidth() const void MouseSettings::SetDoubleClickHeight( sal_Int32 nDoubleClkHeight ) { - CopyData(); mxData->mnDoubleClkHeight = nDoubleClkHeight; } @@ -308,7 +345,6 @@ MouseSettings::GetDoubleClickHeight() const void MouseSettings::SetStartDragWidth( sal_Int32 nDragWidth ) { - CopyData(); mxData->mnStartDragWidth = nDragWidth; } @@ -321,7 +357,6 @@ MouseSettings::GetStartDragWidth() const void MouseSettings::SetStartDragHeight( sal_Int32 nDragHeight ) { - CopyData(); mxData->mnStartDragHeight = nDragHeight; } @@ -364,7 +399,6 @@ MouseSettings::GetButtonStartRepeat() void MouseSettings::SetButtonRepeat( sal_Int32 nRepeat ) { - CopyData(); mxData->mnButtonRepeat = nRepeat; } @@ -383,7 +417,6 @@ MouseSettings::GetActionDelay() void MouseSettings::SetMenuDelay( sal_Int32 nDelay ) { - CopyData(); mxData->mnMenuDelay = nDelay; } @@ -396,7 +429,6 @@ MouseSettings::GetMenuDelay() const void MouseSettings::SetFollow( MouseFollowFlags nFollow ) { - CopyData(); mxData->mnFollow = nFollow; } @@ -409,7 +441,6 @@ MouseSettings::GetFollow() const void MouseSettings::SetMiddleButtonAction( MouseMiddleButtonAction nAction ) { - CopyData(); mxData->mnMiddleButtonAction = nAction; } @@ -422,7 +453,6 @@ MouseSettings::GetMiddleButtonAction() const void MouseSettings::SetWheelBehavior( MouseWheelBehaviour nBehavior ) { - CopyData(); mxData->mnWheelBehavior = nBehavior; } @@ -432,214 +462,22 @@ MouseSettings::GetWheelBehavior() const return mxData->mnWheelBehavior; } -bool -MouseSettings::operator !=( const MouseSettings& rSet ) const -{ - return !(*this == rSet); -} - -MouseSettings::MouseSettings() - : mxData(std::make_shared()) -{ -} - -void MouseSettings::CopyData() -{ - // copy if other references exist - if (mxData.use_count() > 1) - { - mxData = std::make_shared(*mxData); - } -} +MouseSettings::MouseSettings() = default; +MouseSettings::MouseSettings(const MouseSettings&) = default; +MouseSettings::~MouseSettings() = default; +MouseSettings& MouseSettings::operator=(const MouseSettings&) = default; +// Until Clang 14, P2085R0 is unsupported, and the operator can't be default outside of declaration bool MouseSettings::operator ==( const MouseSettings& rSet ) const { - if ( mxData == rSet.mxData ) - return true; - - return - (mxData->mnOptions == rSet.mxData->mnOptions) && - (mxData->mnDoubleClkTime == rSet.mxData->mnDoubleClkTime) && - (mxData->mnDoubleClkWidth == rSet.mxData->mnDoubleClkWidth) && - (mxData->mnDoubleClkHeight == rSet.mxData->mnDoubleClkHeight) && - (mxData->mnStartDragWidth == rSet.mxData->mnStartDragWidth) && - (mxData->mnStartDragHeight == rSet.mxData->mnStartDragHeight) && - (mxData->mnMiddleButtonAction == rSet.mxData->mnMiddleButtonAction) && - (mxData->mnButtonRepeat == rSet.mxData->mnButtonRepeat) && - (mxData->mnMenuDelay == rSet.mxData->mnMenuDelay) && - (mxData->mnFollow == rSet.mxData->mnFollow) && - (mxData->mnWheelBehavior == rSet.mxData->mnWheelBehavior ); + return mxData == rSet.mxData; } -ImplStyleData::ImplStyleData() : - mnScrollBarSize(16), - mnSpinSize(16), - mnCursorSize(2), - mnAntialiasedMin(0), - mnCursorBlinkTime(STYLE_CURSOR_NOBLINKTIME), - mnDragFullOptions(DragFullOptions::All), - mnSelectionOptions(SelectionOptions::NONE), - mnDisplayOptions(DisplayOptions::NONE), - mnToolbarIconSize(ToolbarIconSize::Unknown), - mnOptions(StyleSettingsOptions::NONE), - mbAutoMnemonic(true), - meUseImagesInMenus(TRISTATE_INDET), - mnMinThumbSize(16), - mIconThemeSelector(std::make_shared()), - meContextMenuShortcuts(TRISTATE_INDET), - mnEdgeBlending(35), - maEdgeBlendingTopLeftColor(Color(0xC0, 0xC0, 0xC0)), - maEdgeBlendingBottomRightColor(Color(0x40, 0x40, 0x40)), - mnListBoxMaximumLineCount(25), - // For some reason this isn't actually the column count that gets used, at least on iOS, but - // instead what SvtAccessibilityOptions_Impl::GetColorValueSetColumnCount() in - // svtools/source/config/accessibilityoptions.cxx returns. - mnColorValueSetColumnCount(12), -#ifdef IOS - maListBoxPreviewDefaultLogicSize(Size(30, 30)), -#else - maListBoxPreviewDefaultLogicSize(Size(15, 7)), -#endif - maListBoxPreviewDefaultPixelSize(Size(0, 0)), // on-demand calculated in GetListBoxPreviewDefaultPixelSize(), - meComboBoxTextSelectionMode(ComboBoxTextSelectionMode::SelectText), - mbPreviewUsesCheckeredBackground(true) +ImplStyleData::ImplStyleData() { SetStandardStyles(); } -ImplStyleData::ImplStyleData( const ImplStyleData& rData ) : - maActiveBorderColor( rData.maActiveBorderColor ), - maActiveColor( rData.maActiveColor ), - maActiveTextColor( rData.maActiveTextColor ), - maAlternatingRowColor( rData.maAlternatingRowColor ), - maDefaultButtonTextColor( rData.maDefaultButtonTextColor ), - maButtonTextColor( rData.maButtonTextColor ), - maDefaultActionButtonTextColor( rData.maDefaultActionButtonTextColor ), - maActionButtonTextColor( rData.maActionButtonTextColor ), - maFlatButtonTextColor( rData.maFlatButtonTextColor ), - maDefaultButtonRolloverTextColor( rData.maDefaultButtonRolloverTextColor ), - maButtonRolloverTextColor( rData.maButtonRolloverTextColor ), - maDefaultActionButtonRolloverTextColor( rData.maDefaultActionButtonRolloverTextColor ), - maActionButtonRolloverTextColor( rData.maActionButtonRolloverTextColor ), - maFlatButtonRolloverTextColor( rData.maFlatButtonRolloverTextColor ), - maDefaultButtonPressedRolloverTextColor( rData.maDefaultButtonPressedRolloverTextColor ), - maButtonPressedRolloverTextColor( rData.maButtonPressedRolloverTextColor ), - maDefaultActionButtonPressedRolloverTextColor( rData.maDefaultActionButtonPressedRolloverTextColor ), - maActionButtonPressedRolloverTextColor( rData.maActionButtonPressedRolloverTextColor ), - maFlatButtonPressedRolloverTextColor( rData.maFlatButtonPressedRolloverTextColor ), - maCheckedColor( rData.maCheckedColor ), - maDarkShadowColor( rData.maDarkShadowColor ), - maDeactiveBorderColor( rData.maDeactiveBorderColor ), - maDeactiveColor( rData.maDeactiveColor ), - maDeactiveTextColor( rData.maDeactiveTextColor ), - maDialogColor( rData.maDialogColor ), - maDialogTextColor( rData.maDialogTextColor ), - maDisableColor( rData.maDisableColor ), - maFaceColor( rData.maFaceColor ), - maFieldColor( rData.maFieldColor ), - maFieldTextColor( rData.maFieldTextColor ), - maFieldRolloverTextColor( rData.maFieldRolloverTextColor ), - maGroupTextColor( rData.maGroupTextColor ), - maHelpColor( rData.maHelpColor ), - maHelpTextColor( rData.maHelpTextColor ), - maAccentColor( rData.maAccentColor ), - maHighlightColor( rData.maHighlightColor ), - maHighlightTextColor( rData.maHighlightTextColor ), - maLabelTextColor( rData.maLabelTextColor ), - maLightBorderColor( rData.maLightBorderColor ), - maLightColor( rData.maLightColor ), - maLinkColor( rData.maLinkColor ), - maMenuBarColor( rData.maMenuBarColor ), - maMenuBarRolloverColor( rData.maMenuBarRolloverColor ), - maMenuBorderColor( rData.maMenuBorderColor ), - maMenuColor( rData.maMenuColor ), - maMenuHighlightColor( rData.maMenuHighlightColor ), - maMenuHighlightTextColor( rData.maMenuHighlightTextColor ), - maMenuTextColor( rData.maMenuTextColor ), - maListBoxWindowBackgroundColor( rData.maListBoxWindowBackgroundColor ), - maListBoxWindowTextColor( rData.maListBoxWindowTextColor ), - maListBoxWindowHighlightColor( rData.maListBoxWindowHighlightColor ), - maListBoxWindowHighlightTextColor( rData.maListBoxWindowHighlightTextColor ), - maMenuBarTextColor( rData.maMenuBarTextColor ), - maMenuBarRolloverTextColor( rData.maMenuBarRolloverTextColor ), - maMenuBarHighlightTextColor( rData.maMenuBarHighlightTextColor ), - maMonoColor( rData.maMonoColor ), - maRadioCheckTextColor( rData.maRadioCheckTextColor ), - maShadowColor( rData.maShadowColor ), - maWarningColor( rData.maWarningColor ), - maWarningTextColor( rData.maWarningTextColor ), - maErrorColor( rData.maErrorColor ), - maErrorTextColor( rData.maErrorTextColor ), - maVisitedLinkColor( rData.maVisitedLinkColor ), - maToolTextColor( rData.maToolTextColor ), - maWindowColor( rData.maWindowColor ), - maWindowTextColor( rData.maWindowTextColor ), - maWorkspaceColor( rData.maWorkspaceColor ), - maActiveTabColor( rData.maActiveTabColor ), - maInactiveTabColor( rData.maInactiveTabColor ), - maTabTextColor( rData.maTabTextColor ), - maTabRolloverTextColor( rData.maTabRolloverTextColor ), - maTabHighlightTextColor( rData.maTabHighlightTextColor ), - maAppFont( rData.maAppFont ), - maHelpFont( rData.maAppFont ), - maTitleFont( rData.maTitleFont ), - maFloatTitleFont( rData.maFloatTitleFont ), - maMenuFont( rData.maMenuFont ), - maToolFont( rData.maToolFont ), - maLabelFont( rData.maLabelFont ), - maRadioCheckFont( rData.maRadioCheckFont ), - maPushButtonFont( rData.maPushButtonFont ), - maFieldFont( rData.maFieldFont ), - maIconFont( rData.maIconFont ), - maTabFont( rData.maTabFont ), - maGroupFont( rData.maGroupFont ), - mnTitleHeight(rData.mnTitleHeight), - mnFloatTitleHeight(rData.mnFloatTitleHeight), - mnScrollBarSize(rData.mnScrollBarSize), - mnSpinSize(rData.mnSpinSize), - mnCursorSize(rData.mnCursorSize), - mnAntialiasedMin(rData.mnAntialiasedMin), - mnCursorBlinkTime(rData.mnCursorBlinkTime), - mnDragFullOptions(rData.mnDragFullOptions), - mnSelectionOptions(rData.mnSelectionOptions), - mnDisplayOptions(rData.mnDisplayOptions), - mnToolbarIconSize(rData.mnToolbarIconSize), - mnUseFlatMenus(rData.mnUseFlatMenus), - mnOptions(rData.mnOptions), - mbHighContrast(rData.mbHighContrast), - mbUseSystemUIFonts(rData.mbUseSystemUIFonts), - mbUseFontAAFromSystem(rData.mbUseFontAAFromSystem), - mbAutoMnemonic(rData.mbAutoMnemonic), - meUseImagesInMenus(rData.meUseImagesInMenus), - mnUseFlatBorders(rData.mnUseFlatBorders), - mbPreferredUseImagesInMenus(rData.mbPreferredUseImagesInMenus), - mnMinThumbSize(rData.mnMinThumbSize), - mIconThemeSelector(std::make_shared(*rData.mIconThemeSelector)), - mIconTheme(rData.mIconTheme), - mbSkipDisabledInMenus(rData.mbSkipDisabledInMenus), - mbHideDisabledMenuItems(rData.mbHideDisabledMenuItems), - mbPreferredContextMenuShortcuts(rData.mbPreferredContextMenuShortcuts), - meContextMenuShortcuts(rData.meContextMenuShortcuts), - mbPrimaryButtonWarpsSlider(rData.mbPrimaryButtonWarpsSlider), - maDialogStyle( rData.maDialogStyle ), - mnEdgeBlending(rData.mnEdgeBlending), - maEdgeBlendingTopLeftColor(rData.maEdgeBlendingTopLeftColor), - maEdgeBlendingBottomRightColor(rData.maEdgeBlendingBottomRightColor), - mnListBoxMaximumLineCount(rData.mnListBoxMaximumLineCount), - mnColorValueSetColumnCount(rData.mnColorValueSetColumnCount), - maListBoxPreviewDefaultLogicSize(rData.maListBoxPreviewDefaultLogicSize), - maListBoxPreviewDefaultPixelSize(rData.maListBoxPreviewDefaultPixelSize), - meComboBoxTextSelectionMode(rData.meComboBoxTextSelectionMode), - mbPreviewUsesCheckeredBackground(rData.mbPreviewUsesCheckeredBackground), - maPersonaHeaderFooter( rData.maPersonaHeaderFooter ), - maPersonaHeaderBitmap( rData.maPersonaHeaderBitmap ), - maPersonaFooterBitmap( rData.maPersonaFooterBitmap ), - maPersonaMenuBarTextColor( rData.maPersonaMenuBarTextColor ) -{ - if (rData.mIconThemeScanner) - mIconThemeScanner = std::make_shared(*rData.mIconThemeScanner); -} - void ImplStyleData::SetStandardStyles() { vcl::Font aStdFont( FAMILY_SWISS, Size( 0, 8 ) ); @@ -649,104 +487,105 @@ void ImplStyleData::SetStandardStyles() aStdFont.SetFamilyName(utl::DefaultFontConfiguration::get().getUserInterfaceFont(LanguageTag(u"en"_ustr))); else aStdFont.SetFamilyName(u"Liberation Sans"_ustr); - maAppFont = aStdFont; - maHelpFont = aStdFont; - maMenuFont = aStdFont; - maToolFont = aStdFont; - maGroupFont = aStdFont; - maLabelFont = aStdFont; - maRadioCheckFont = aStdFont; - maPushButtonFont = aStdFont; - maFieldFont = aStdFont; - maIconFont = aStdFont; - maTabFont = aStdFont; + maFonts.maAppFont = aStdFont; + maFonts.maHelpFont = aStdFont; + maFonts.maMenuFont = aStdFont; + maFonts.maToolFont = aStdFont; + maFonts.maGroupFont = aStdFont; + maFonts.maLabelFont = aStdFont; + maFonts.maRadioCheckFont = aStdFont; + maFonts.maPushButtonFont = aStdFont; + maFonts.maFieldFont = aStdFont; + maFonts.maIconFont = aStdFont; + maFonts.maTabFont = aStdFont; aStdFont.SetWeight( WEIGHT_BOLD ); - maFloatTitleFont = maTitleFont = std::move(aStdFont); + maFonts.maFloatTitleFont = maFonts.maTitleFont = std::move(aStdFont); - maFaceColor = COL_LIGHTGRAY; - maCheckedColor = Color( 0xCC, 0xCC, 0xCC ); - maLightColor = COL_WHITE; - maLightBorderColor = COL_LIGHTGRAY; - maShadowColor = COL_GRAY; - maDarkShadowColor = COL_BLACK; + maColors.maFaceColor = COL_LIGHTGRAY; + maColors.maCheckedColor = Color( 0xCC, 0xCC, 0xCC ); + maColors.maLightColor = COL_WHITE; + maColors.maLightBorderColor = COL_LIGHTGRAY; + maColors.maShadowColor = COL_GRAY; + maColors.maDarkShadowColor = COL_BLACK; - maWarningColor = Color(0xFE, 0xEF, 0xB3); // tdf#105829 - maWarningTextColor = Color(0x70, 0x43, 0x00); - maErrorColor = Color(0xFF, 0xBA, 0xBA); - maErrorTextColor = Color(0x7A, 0x00, 0x06); + maColors.maWarningColor = Color(0xFE, 0xEF, 0xB3); // tdf#105829 + maColors.maWarningTextColor = Color(0x70, 0x43, 0x00); + maColors.maErrorColor = Color(0xFF, 0xBA, 0xBA); + maColors.maErrorTextColor = Color(0x7A, 0x00, 0x06); - maDefaultButtonTextColor = COL_BLACK; - maButtonTextColor = COL_BLACK; - maDefaultActionButtonTextColor = COL_BLACK; - maActionButtonTextColor = COL_BLACK; - maFlatButtonTextColor = COL_BLACK; - maDefaultButtonRolloverTextColor = COL_BLACK; - maButtonRolloverTextColor = COL_BLACK; - maDefaultActionButtonRolloverTextColor = COL_BLACK; - maActionButtonRolloverTextColor = COL_BLACK; - maFlatButtonRolloverTextColor = COL_BLACK; - maDefaultButtonPressedRolloverTextColor = COL_BLACK; - maButtonPressedRolloverTextColor = COL_BLACK; - maDefaultActionButtonPressedRolloverTextColor = COL_BLACK; - maActionButtonPressedRolloverTextColor = COL_BLACK; - maFlatButtonPressedRolloverTextColor = COL_BLACK; + maColors.maDefaultButtonTextColor = COL_BLACK; + maColors.maButtonTextColor = COL_BLACK; + maColors.maDefaultActionButtonTextColor = COL_BLACK; + maColors.maActionButtonTextColor = COL_BLACK; + maColors.maFlatButtonTextColor = COL_BLACK; + maColors.maDefaultButtonRolloverTextColor = COL_BLACK; + maColors.maButtonRolloverTextColor = COL_BLACK; + maColors.maDefaultActionButtonRolloverTextColor = COL_BLACK; + maColors.maActionButtonRolloverTextColor = COL_BLACK; + maColors.maFlatButtonRolloverTextColor = COL_BLACK; + maColors.maDefaultButtonPressedRolloverTextColor = COL_BLACK; + maColors.maButtonPressedRolloverTextColor = COL_BLACK; + maColors.maDefaultActionButtonPressedRolloverTextColor = COL_BLACK; + maColors.maActionButtonPressedRolloverTextColor = COL_BLACK; + maColors.maFlatButtonPressedRolloverTextColor = COL_BLACK; - maRadioCheckTextColor = COL_BLACK; - maGroupTextColor = COL_BLACK; - maLabelTextColor = COL_BLACK; - maWindowColor = COL_WHITE; - maWindowTextColor = COL_BLACK; - maDialogColor = COL_LIGHTGRAY; - maDialogTextColor = COL_BLACK; - maWorkspaceColor = Color( 0xDF, 0xDF, 0xDE ); - maMonoColor = COL_BLACK; - maFieldColor = COL_WHITE; - maFieldTextColor = COL_BLACK; - maFieldRolloverTextColor = COL_BLACK; - maActiveBorderColor = COL_LIGHTGRAY; - maDeactiveColor = COL_GRAY; - maDeactiveTextColor = COL_LIGHTGRAY; - maDeactiveBorderColor = COL_LIGHTGRAY; - maMenuColor = COL_LIGHTGRAY; - maMenuBarColor = COL_LIGHTGRAY; - maMenuBarRolloverColor = COL_BLUE; - maMenuBorderColor = COL_LIGHTGRAY; - maMenuTextColor = COL_BLACK; - maListBoxWindowBackgroundColor = COL_WHITE; - maListBoxWindowTextColor = COL_BLACK; - maListBoxWindowHighlightColor = COL_BLUE; - maListBoxWindowHighlightTextColor = COL_WHITE; - maMenuBarTextColor = COL_BLACK; - maMenuBarRolloverTextColor = COL_WHITE; - maMenuBarHighlightTextColor = COL_WHITE; - maMenuHighlightColor = COL_BLUE; - maMenuHighlightTextColor = COL_WHITE; - maAccentColor = COL_RED; - maHighlightColor = COL_BLUE; - maHighlightTextColor = COL_WHITE; + maColors.maRadioCheckTextColor = COL_BLACK; + maColors.maGroupTextColor = COL_BLACK; + maColors.maLabelTextColor = COL_BLACK; + maColors.maWindowColor = COL_WHITE; + maColors.maWindowTextColor = COL_BLACK; + maColors.maDialogColor = COL_LIGHTGRAY; + maColors.maDialogTextColor = COL_BLACK; + maColors.maWorkspaceColor = Color( 0xDF, 0xDF, 0xDE ); + maColors.maMonoColor = COL_BLACK; + maColors.maFieldColor = COL_WHITE; + maColors.maFieldTextColor = COL_BLACK; + maColors.maFieldRolloverTextColor = COL_BLACK; + maColors.maActiveBorderColor = COL_LIGHTGRAY; + maColors.maDeactiveColor = COL_GRAY; + maColors.maDeactiveTextColor = COL_LIGHTGRAY; + maColors.maDeactiveBorderColor = COL_LIGHTGRAY; + maColors.maMenuColor = COL_LIGHTGRAY; + maColors.maMenuBarColor = COL_LIGHTGRAY; + maColors.maMenuBarRolloverColor = COL_BLUE; + maColors.maMenuBorderColor = COL_LIGHTGRAY; + maColors.maMenuTextColor = COL_BLACK; + maColors.maListBoxWindowBackgroundColor = COL_WHITE; + maColors.maListBoxWindowTextColor = COL_BLACK; + maColors.maListBoxWindowHighlightColor = COL_BLUE; + maColors.maListBoxWindowHighlightTextColor = COL_WHITE; + maColors.maMenuBarTextColor = COL_BLACK; + maColors.maMenuBarRolloverTextColor = COL_WHITE; + maColors.maMenuBarHighlightTextColor = COL_WHITE; + maColors.maMenuHighlightColor = COL_BLUE; + maColors.maMenuHighlightTextColor = COL_WHITE; + maColors.maAccentColor = COL_RED; + maColors.maHighlightColor = COL_BLUE; + maColors.maHighlightTextColor = COL_WHITE; // make active like highlight, except with a small contrast - maActiveColor = maHighlightColor; - maActiveColor.IncreaseLuminance(32); - maActiveTextColor = maHighlightTextColor; - maActiveTabColor = COL_WHITE; - maInactiveTabColor = COL_LIGHTGRAY; - maTabTextColor = COL_BLACK; - maTabRolloverTextColor = COL_BLACK; - maTabHighlightTextColor = COL_BLACK; - maDisableColor = COL_GRAY; - maHelpColor = Color( 0xFF, 0xFF, 0xE0 ); - maHelpTextColor = COL_BLACK; - maLinkColor = COL_BLUE; - maVisitedLinkColor = Color( 0x00, 0x00, 0xCC ); - maToolTextColor = COL_BLACK; - maAlternatingRowColor = Color( 0xEE, 0xEE, 0xEE ); + maColors.maActiveColor = maColors.maHighlightColor; + maColors.maActiveColor.IncreaseLuminance(32); + maColors.maActiveTextColor = maColors.maHighlightTextColor; + maColors.maActiveTabColor = COL_WHITE; + maColors.maInactiveTabColor = COL_LIGHTGRAY; + maColors.maTabTextColor = COL_BLACK; + maColors.maTabRolloverTextColor = COL_BLACK; + maColors.maTabHighlightTextColor = COL_BLACK; + maColors.maDisableColor = COL_GRAY; + maColors.maHelpColor = Color( 0xFF, 0xFF, 0xE0 ); + maColors.maHelpTextColor = COL_BLACK; + maColors.maLinkColor = COL_BLUE; + maColors.maVisitedLinkColor = Color( 0x00, 0x00, 0xCC ); + maColors.maToolTextColor = COL_BLACK; + maColors.maAlternatingRowColor = Color( 0xEE, 0xEE, 0xEE ); mnTitleHeight = 18; mnFloatTitleHeight = 13; mbHighContrast = false; mbUseSystemUIFonts = true; mbUseFontAAFromSystem = true; + mbUseSubpixelAA = true; mnUseFlatBorders = false; mnUseFlatMenus = false; mbPreferredUseImagesInMenus = true; @@ -756,950 +595,877 @@ void ImplStyleData::SetStandardStyles() mbPrimaryButtonWarpsSlider = false; } -StyleSettings::StyleSettings() - : mxData(std::make_shared()) -{ -} +StyleSettings::StyleSettings() = default; +StyleSettings::StyleSettings(const StyleSettings&) = default; +StyleSettings::~StyleSettings() = default; +StyleSettings& StyleSettings::operator=(const StyleSettings&) = default; void StyleSettings::SetFaceColor( const Color& rColor ) { - CopyData(); - mxData->maFaceColor = rColor; + mxData->maColors.maFaceColor = rColor; } const Color& StyleSettings::GetFaceColor() const { - return mxData->maFaceColor; + return mxData->maColors.maFaceColor; } void StyleSettings::SetCheckedColor( const Color& rColor ) { - CopyData(); - mxData->maCheckedColor = rColor; + mxData->maColors.maCheckedColor = rColor; } const Color& StyleSettings::GetCheckedColor() const { - return mxData->maCheckedColor; + return mxData->maColors.maCheckedColor; } void StyleSettings::SetLightColor( const Color& rColor ) { - CopyData(); - mxData->maLightColor = rColor; + mxData->maColors.maLightColor = rColor; } const Color& StyleSettings::GetLightColor() const { - return mxData->maLightColor; + return mxData->maColors.maLightColor; } void StyleSettings::SetLightBorderColor( const Color& rColor ) { - CopyData(); - mxData->maLightBorderColor = rColor; + mxData->maColors.maLightBorderColor = rColor; } const Color& StyleSettings::GetLightBorderColor() const { - return mxData->maLightBorderColor; + return mxData->maColors.maLightBorderColor; } void StyleSettings::SetWarningColor( const Color& rColor ) { - CopyData(); - mxData->maWarningColor = rColor; + mxData->maColors.maWarningColor = rColor; } const Color& StyleSettings::GetWarningColor() const { - return mxData->maWarningColor; + return mxData->maColors.maWarningColor; } void StyleSettings::SetWarningTextColor( const Color& rColor ) { - CopyData(); - mxData->maWarningTextColor = rColor; + mxData->maColors.maWarningTextColor = rColor; } const Color& StyleSettings::GetWarningTextColor() const { - return mxData->maWarningTextColor; + return mxData->maColors.maWarningTextColor; } void StyleSettings::SetErrorColor( const Color& rColor ) { - CopyData(); - mxData->maErrorColor = rColor; + mxData->maColors.maErrorColor = rColor; } const Color& StyleSettings::GetErrorColor() const { - return mxData->maErrorColor; + return mxData->maColors.maErrorColor; } void StyleSettings::SetErrorTextColor( const Color& rColor ) { - CopyData(); - mxData->maErrorTextColor = rColor; + mxData->maColors.maErrorTextColor = rColor; } const Color& StyleSettings::GetErrorTextColor() const { - return mxData->maErrorTextColor; + return mxData->maColors.maErrorTextColor; } void StyleSettings::SetShadowColor( const Color& rColor ) { - CopyData(); - mxData->maShadowColor = rColor; + mxData->maColors.maShadowColor = rColor; } const Color& StyleSettings::GetShadowColor() const { - return mxData->maShadowColor; + return mxData->maColors.maShadowColor; } void StyleSettings::SetDarkShadowColor( const Color& rColor ) { - CopyData(); - mxData->maDarkShadowColor = rColor; + mxData->maColors.maDarkShadowColor = rColor; } const Color& StyleSettings::GetDarkShadowColor() const { - return mxData->maDarkShadowColor; + return mxData->maColors.maDarkShadowColor; } void StyleSettings::SetDefaultButtonTextColor( const Color& rColor ) { - CopyData(); - mxData->maDefaultButtonTextColor = rColor; + mxData->maColors.maDefaultButtonTextColor = rColor; } const Color& StyleSettings::GetDefaultButtonTextColor() const { - return mxData->maDefaultButtonTextColor; + return mxData->maColors.maDefaultButtonTextColor; } void StyleSettings::SetButtonTextColor( const Color& rColor ) { - CopyData(); - mxData->maButtonTextColor = rColor; + mxData->maColors.maButtonTextColor = rColor; } const Color& StyleSettings::GetButtonTextColor() const { - return mxData->maButtonTextColor; + return mxData->maColors.maButtonTextColor; } void StyleSettings::SetDefaultActionButtonTextColor( const Color& rColor ) { - CopyData(); - mxData->maDefaultActionButtonTextColor = rColor; + mxData->maColors.maDefaultActionButtonTextColor = rColor; } const Color& StyleSettings::GetDefaultActionButtonTextColor() const { - return mxData->maDefaultActionButtonTextColor; + return mxData->maColors.maDefaultActionButtonTextColor; } void StyleSettings::SetActionButtonTextColor( const Color& rColor ) { - CopyData(); - mxData->maActionButtonTextColor = rColor; + mxData->maColors.maActionButtonTextColor = rColor; } const Color& StyleSettings::GetActionButtonTextColor() const { - return mxData->maActionButtonTextColor; + return mxData->maColors.maActionButtonTextColor; } void StyleSettings::SetFlatButtonTextColor( const Color& rColor ) { - CopyData(); - mxData->maFlatButtonTextColor = rColor; + mxData->maColors.maFlatButtonTextColor = rColor; } const Color& StyleSettings::GetFlatButtonTextColor() const { - return mxData->maFlatButtonTextColor; + return mxData->maColors.maFlatButtonTextColor; } void StyleSettings::SetDefaultButtonRolloverTextColor( const Color& rColor ) { - CopyData(); - mxData->maDefaultButtonRolloverTextColor = rColor; + mxData->maColors.maDefaultButtonRolloverTextColor = rColor; } const Color& StyleSettings::GetDefaultButtonRolloverTextColor() const { - return mxData->maDefaultButtonRolloverTextColor; + return mxData->maColors.maDefaultButtonRolloverTextColor; } void StyleSettings::SetButtonRolloverTextColor( const Color& rColor ) { - CopyData(); - mxData->maButtonRolloverTextColor = rColor; + mxData->maColors.maButtonRolloverTextColor = rColor; } const Color& StyleSettings::GetButtonRolloverTextColor() const { - return mxData->maButtonRolloverTextColor; + return mxData->maColors.maButtonRolloverTextColor; } void StyleSettings::SetDefaultActionButtonRolloverTextColor( const Color& rColor ) { - CopyData(); - mxData->maDefaultActionButtonRolloverTextColor = rColor; + mxData->maColors.maDefaultActionButtonRolloverTextColor = rColor; } const Color& StyleSettings::GetDefaultActionButtonRolloverTextColor() const { - return mxData->maDefaultActionButtonRolloverTextColor; + return mxData->maColors.maDefaultActionButtonRolloverTextColor; } void StyleSettings::SetActionButtonRolloverTextColor( const Color& rColor ) { - CopyData(); - mxData->maActionButtonRolloverTextColor = rColor; + mxData->maColors.maActionButtonRolloverTextColor = rColor; } const Color& StyleSettings::GetActionButtonRolloverTextColor() const { - return mxData->maActionButtonRolloverTextColor; + return mxData->maColors.maActionButtonRolloverTextColor; } void StyleSettings::SetFlatButtonRolloverTextColor( const Color& rColor ) { - CopyData(); - mxData->maFlatButtonRolloverTextColor = rColor; + mxData->maColors.maFlatButtonRolloverTextColor = rColor; } const Color& StyleSettings::GetFlatButtonRolloverTextColor() const { - return mxData->maFlatButtonRolloverTextColor; + return mxData->maColors.maFlatButtonRolloverTextColor; } void StyleSettings::SetDefaultButtonPressedRolloverTextColor( const Color& rColor ) { - CopyData(); - mxData->maDefaultButtonPressedRolloverTextColor = rColor; + mxData->maColors.maDefaultButtonPressedRolloverTextColor = rColor; } const Color& StyleSettings::GetDefaultButtonPressedRolloverTextColor() const { - return mxData->maDefaultButtonPressedRolloverTextColor; + return mxData->maColors.maDefaultButtonPressedRolloverTextColor; } void StyleSettings::SetButtonPressedRolloverTextColor( const Color& rColor ) { - CopyData(); - mxData->maButtonPressedRolloverTextColor = rColor; + mxData->maColors.maButtonPressedRolloverTextColor = rColor; } const Color& StyleSettings::GetButtonPressedRolloverTextColor() const { - return mxData->maButtonPressedRolloverTextColor; + return mxData->maColors.maButtonPressedRolloverTextColor; } void StyleSettings::SetDefaultActionButtonPressedRolloverTextColor( const Color& rColor ) { - CopyData(); - mxData->maDefaultActionButtonPressedRolloverTextColor = rColor; + mxData->maColors.maDefaultActionButtonPressedRolloverTextColor = rColor; } const Color& StyleSettings::GetDefaultActionButtonPressedRolloverTextColor() const { - return mxData->maDefaultActionButtonPressedRolloverTextColor; + return mxData->maColors.maDefaultActionButtonPressedRolloverTextColor; } void StyleSettings::SetActionButtonPressedRolloverTextColor( const Color& rColor ) { - CopyData(); - mxData->maActionButtonPressedRolloverTextColor = rColor; + mxData->maColors.maActionButtonPressedRolloverTextColor = rColor; } const Color& StyleSettings::GetActionButtonPressedRolloverTextColor() const { - return mxData->maActionButtonPressedRolloverTextColor; + return mxData->maColors.maActionButtonPressedRolloverTextColor; } void StyleSettings::SetFlatButtonPressedRolloverTextColor( const Color& rColor ) { - CopyData(); - mxData->maFlatButtonPressedRolloverTextColor = rColor; + mxData->maColors.maFlatButtonPressedRolloverTextColor = rColor; } const Color& StyleSettings::GetFlatButtonPressedRolloverTextColor() const { - return mxData->maFlatButtonPressedRolloverTextColor; + return mxData->maColors.maFlatButtonPressedRolloverTextColor; } void StyleSettings::SetRadioCheckTextColor( const Color& rColor ) { - CopyData(); - mxData->maRadioCheckTextColor = rColor; + mxData->maColors.maRadioCheckTextColor = rColor; } const Color& StyleSettings::GetRadioCheckTextColor() const { - return mxData->maRadioCheckTextColor; + return mxData->maColors.maRadioCheckTextColor; } void StyleSettings::SetGroupTextColor( const Color& rColor ) { - CopyData(); - mxData->maGroupTextColor = rColor; + mxData->maColors.maGroupTextColor = rColor; } const Color& StyleSettings::GetGroupTextColor() const { - return mxData->maGroupTextColor; + return mxData->maColors.maGroupTextColor; } void StyleSettings::SetLabelTextColor( const Color& rColor ) { - CopyData(); - mxData->maLabelTextColor = rColor; + mxData->maColors.maLabelTextColor = rColor; } const Color& StyleSettings::GetLabelTextColor() const { - return mxData->maLabelTextColor; + return mxData->maColors.maLabelTextColor; } void StyleSettings::SetWindowColor( const Color& rColor ) { - CopyData(); - mxData->maWindowColor = rColor; + mxData->maColors.maWindowColor = rColor; } const Color& StyleSettings::GetWindowColor() const { - return mxData->maWindowColor; + return mxData->maColors.maWindowColor; } void StyleSettings::SetWindowTextColor( const Color& rColor ) { - CopyData(); - mxData->maWindowTextColor = rColor; + mxData->maColors.maWindowTextColor = rColor; } const Color& StyleSettings::GetWindowTextColor() const { - return mxData->maWindowTextColor; + return mxData->maColors.maWindowTextColor; } void StyleSettings::SetDialogColor( const Color& rColor ) { - CopyData(); - mxData->maDialogColor = rColor; + mxData->maColors.maDialogColor = rColor; } const Color& StyleSettings::GetDialogColor() const { - return mxData->maDialogColor; + return mxData->maColors.maDialogColor; } void StyleSettings::SetDialogTextColor( const Color& rColor ) { - CopyData(); - mxData->maDialogTextColor = rColor; + mxData->maColors.maDialogTextColor = rColor; } const Color& StyleSettings::GetDialogTextColor() const { - return mxData->maDialogTextColor; + return mxData->maColors.maDialogTextColor; } void StyleSettings::SetWorkspaceColor( const Color& rColor ) { - CopyData(); - mxData->maWorkspaceColor = rColor; + mxData->maColors.maWorkspaceColor = rColor; } const Color& StyleSettings::GetWorkspaceColor() const { - return mxData->maWorkspaceColor; + return mxData->maColors.maWorkspaceColor; } void StyleSettings::SetFieldColor( const Color& rColor ) { - CopyData(); - mxData->maFieldColor = rColor; + mxData->maColors.maFieldColor = rColor; } const Color& StyleSettings::GetFieldColor() const { - return mxData->maFieldColor; + return mxData->maColors.maFieldColor; } void StyleSettings::SetFieldTextColor( const Color& rColor ) { - CopyData(); - mxData->maFieldTextColor = rColor; + mxData->maColors.maFieldTextColor = rColor; } const Color& StyleSettings::GetFieldTextColor() const { - return mxData->maFieldTextColor; + return mxData->maColors.maFieldTextColor; } void StyleSettings::SetFieldRolloverTextColor( const Color& rColor ) { - CopyData(); - mxData->maFieldRolloverTextColor = rColor; + mxData->maColors.maFieldRolloverTextColor = rColor; } const Color& StyleSettings::GetFieldRolloverTextColor() const { - return mxData->maFieldRolloverTextColor; + return mxData->maColors.maFieldRolloverTextColor; } void StyleSettings::SetActiveColor( const Color& rColor ) { - CopyData(); - mxData->maActiveColor = rColor; + mxData->maColors.maActiveColor = rColor; } const Color& StyleSettings::GetActiveColor() const { - return mxData->maActiveColor; + return mxData->maColors.maActiveColor; } void StyleSettings::SetActiveTextColor( const Color& rColor ) { - CopyData(); - mxData->maActiveTextColor = rColor; + mxData->maColors.maActiveTextColor = rColor; } const Color& StyleSettings::GetActiveTextColor() const { - return mxData->maActiveTextColor; + return mxData->maColors.maActiveTextColor; } void StyleSettings::SetActiveBorderColor( const Color& rColor ) { - CopyData(); - mxData->maActiveBorderColor = rColor; + mxData->maColors.maActiveBorderColor = rColor; } const Color& StyleSettings::GetActiveBorderColor() const { - return mxData->maActiveBorderColor; + return mxData->maColors.maActiveBorderColor; } void StyleSettings::SetDeactiveColor( const Color& rColor ) { - CopyData(); - mxData->maDeactiveColor = rColor; + mxData->maColors.maDeactiveColor = rColor; } const Color& StyleSettings::GetDeactiveColor() const { - return mxData->maDeactiveColor; + return mxData->maColors.maDeactiveColor; } void StyleSettings::SetDeactiveTextColor( const Color& rColor ) { - CopyData(); - mxData->maDeactiveTextColor = rColor; + mxData->maColors.maDeactiveTextColor = rColor; } const Color& StyleSettings::GetDeactiveTextColor() const { - return mxData->maDeactiveTextColor; + return mxData->maColors.maDeactiveTextColor; } void StyleSettings::SetDeactiveBorderColor( const Color& rColor ) { - CopyData(); - mxData->maDeactiveBorderColor = rColor; + mxData->maColors.maDeactiveBorderColor = rColor; } const Color& StyleSettings::GetDeactiveBorderColor() const { - return mxData->maDeactiveBorderColor; + return mxData->maColors.maDeactiveBorderColor; } void StyleSettings::SetAccentColor( const Color& rColor ) { - CopyData(); - mxData->maAccentColor = rColor; + mxData->maColors.maAccentColor = rColor; } const Color& StyleSettings::GetAccentColor() const { - return mxData->maAccentColor; + return mxData->maColors.maAccentColor; } void StyleSettings::SetHighlightColor( const Color& rColor ) { - CopyData(); - mxData->maHighlightColor = rColor; + mxData->maColors.maHighlightColor = rColor; } const Color& StyleSettings::GetHighlightColor() const { - return mxData->maHighlightColor; + return mxData->maColors.maHighlightColor; } void StyleSettings::SetHighlightTextColor( const Color& rColor ) { - CopyData(); - mxData->maHighlightTextColor = rColor; + mxData->maColors.maHighlightTextColor = rColor; } const Color& StyleSettings::GetHighlightTextColor() const { - return mxData->maHighlightTextColor; + return mxData->maColors.maHighlightTextColor; } void StyleSettings::SetDisableColor( const Color& rColor ) { - CopyData(); - mxData->maDisableColor = rColor; + mxData->maColors.maDisableColor = rColor; } const Color& StyleSettings::GetDisableColor() const { - return mxData->maDisableColor; + return mxData->maColors.maDisableColor; } void StyleSettings::SetHelpColor( const Color& rColor ) { - CopyData(); - mxData->maHelpColor = rColor; + mxData->maColors.maHelpColor = rColor; } const Color& StyleSettings::GetHelpColor() const { - return mxData->maHelpColor; + return mxData->maColors.maHelpColor; } void StyleSettings::SetHelpTextColor( const Color& rColor ) { - CopyData(); - mxData->maHelpTextColor = rColor; + mxData->maColors.maHelpTextColor = rColor; } const Color& StyleSettings::GetHelpTextColor() const { - return mxData->maHelpTextColor; + return mxData->maColors.maHelpTextColor; } void StyleSettings::SetMenuColor( const Color& rColor ) { - CopyData(); - mxData->maMenuColor = rColor; + mxData->maColors.maMenuColor = rColor; } const Color& StyleSettings::GetMenuColor() const { - return mxData->maMenuColor; + return mxData->maColors.maMenuColor; } void StyleSettings::SetMenuBarColor( const Color& rColor ) { - CopyData(); - mxData->maMenuBarColor = rColor; + mxData->maColors.maMenuBarColor = rColor; } const Color& StyleSettings::GetMenuBarColor() const { - return mxData->maMenuBarColor; + return mxData->maColors.maMenuBarColor; } void StyleSettings::SetMenuBarRolloverColor( const Color& rColor ) { - CopyData(); - mxData->maMenuBarRolloverColor = rColor; + mxData->maColors.maMenuBarRolloverColor = rColor; } const Color& StyleSettings::GetMenuBarRolloverColor() const { - return mxData->maMenuBarRolloverColor; + return mxData->maColors.maMenuBarRolloverColor; } void StyleSettings::SetMenuBorderColor( const Color& rColor ) { - CopyData(); - mxData->maMenuBorderColor = rColor; + mxData->maColors.maMenuBorderColor = rColor; } const Color& StyleSettings::GetMenuBorderColor() const { - return mxData->maMenuBorderColor; + return mxData->maColors.maMenuBorderColor; } void StyleSettings::SetMenuTextColor( const Color& rColor ) { - CopyData(); - mxData->maMenuTextColor = rColor; + mxData->maColors.maMenuTextColor = rColor; } const Color& StyleSettings::GetMenuTextColor() const { - return mxData->maMenuTextColor; + return mxData->maColors.maMenuTextColor; } void StyleSettings::SetMenuBarTextColor( const Color& rColor ) { - CopyData(); - mxData->maMenuBarTextColor = rColor; + mxData->maColors.maMenuBarTextColor = rColor; } const Color& StyleSettings::GetMenuBarTextColor() const { - return mxData->maMenuBarTextColor; + return mxData->maColors.maMenuBarTextColor; } void StyleSettings::SetMenuBarRolloverTextColor( const Color& rColor ) { - CopyData(); - mxData->maMenuBarRolloverTextColor = rColor; + mxData->maColors.maMenuBarRolloverTextColor = rColor; } const Color& StyleSettings::GetMenuBarRolloverTextColor() const { - return mxData->maMenuBarRolloverTextColor; + return mxData->maColors.maMenuBarRolloverTextColor; } void StyleSettings::SetMenuBarHighlightTextColor( const Color& rColor ) { - CopyData(); - mxData->maMenuBarHighlightTextColor = rColor; + mxData->maColors.maMenuBarHighlightTextColor = rColor; } const Color& StyleSettings::GetMenuBarHighlightTextColor() const { - return mxData->maMenuBarHighlightTextColor; + return mxData->maColors.maMenuBarHighlightTextColor; } void StyleSettings::SetMenuHighlightColor( const Color& rColor ) { - CopyData(); - mxData->maMenuHighlightColor = rColor; + mxData->maColors.maMenuHighlightColor = rColor; } const Color& StyleSettings::GetMenuHighlightColor() const { - return mxData->maMenuHighlightColor; + return mxData->maColors.maMenuHighlightColor; } void StyleSettings::SetMenuHighlightTextColor( const Color& rColor ) { - CopyData(); - mxData->maMenuHighlightTextColor = rColor; + mxData->maColors.maMenuHighlightTextColor = rColor; } const Color& StyleSettings::GetMenuHighlightTextColor() const { - return mxData->maMenuHighlightTextColor; + return mxData->maColors.maMenuHighlightTextColor; } void StyleSettings::SetListBoxWindowBackgroundColor( const Color& rColor ) { - CopyData(); - mxData->maListBoxWindowBackgroundColor = rColor; + mxData->maColors.maListBoxWindowBackgroundColor = rColor; } const Color& StyleSettings::GetListBoxWindowBackgroundColor() const { - return mxData->maListBoxWindowBackgroundColor; + return mxData->maColors.maListBoxWindowBackgroundColor; } void StyleSettings::SetListBoxWindowTextColor( const Color& rColor ) { - CopyData(); - mxData->maListBoxWindowTextColor = rColor; + mxData->maColors.maListBoxWindowTextColor = rColor; } const Color& StyleSettings::GetListBoxWindowTextColor() const { - return mxData->maListBoxWindowTextColor; + return mxData->maColors.maListBoxWindowTextColor; } void StyleSettings::SetListBoxWindowHighlightColor( const Color& rColor ) { - CopyData(); - mxData->maListBoxWindowHighlightColor = rColor; + mxData->maColors.maListBoxWindowHighlightColor = rColor; } const Color& StyleSettings::GetListBoxWindowHighlightColor() const { - return mxData->maListBoxWindowHighlightColor; + return mxData->maColors.maListBoxWindowHighlightColor; } void StyleSettings::SetListBoxWindowHighlightTextColor( const Color& rColor ) { - CopyData(); - mxData->maListBoxWindowHighlightTextColor = rColor; + mxData->maColors.maListBoxWindowHighlightTextColor = rColor; } const Color& StyleSettings::GetListBoxWindowHighlightTextColor() const { - return mxData->maListBoxWindowHighlightTextColor; + return mxData->maColors.maListBoxWindowHighlightTextColor; } void StyleSettings::SetTabTextColor( const Color& rColor ) { - CopyData(); - mxData->maTabTextColor = rColor; + mxData->maColors.maTabTextColor = rColor; } const Color& StyleSettings::GetTabTextColor() const { - return mxData->maTabTextColor; + return mxData->maColors.maTabTextColor; } void StyleSettings::SetTabRolloverTextColor( const Color& rColor ) { - CopyData(); - mxData->maTabRolloverTextColor = rColor; + mxData->maColors.maTabRolloverTextColor = rColor; } const Color& StyleSettings::GetTabRolloverTextColor() const { - return mxData->maTabRolloverTextColor; + return mxData->maColors.maTabRolloverTextColor; } void StyleSettings::SetTabHighlightTextColor( const Color& rColor ) { - CopyData(); - mxData->maTabHighlightTextColor = rColor; + mxData->maColors.maTabHighlightTextColor = rColor; } const Color& StyleSettings::GetTabHighlightTextColor() const { - return mxData->maTabHighlightTextColor; + return mxData->maColors.maTabHighlightTextColor; } void StyleSettings::SetLinkColor( const Color& rColor ) { - CopyData(); - mxData->maLinkColor = rColor; + mxData->maColors.maLinkColor = rColor; } const Color& StyleSettings::GetLinkColor() const { - return mxData->maLinkColor; + return mxData->maColors.maLinkColor; } void StyleSettings::SetVisitedLinkColor( const Color& rColor ) { - CopyData(); - mxData->maVisitedLinkColor = rColor; + mxData->maColors.maVisitedLinkColor = rColor; } const Color& StyleSettings::GetVisitedLinkColor() const { - return mxData->maVisitedLinkColor; + return mxData->maColors.maVisitedLinkColor; } void StyleSettings::SetToolTextColor( const Color& rColor ) { - CopyData(); - mxData->maToolTextColor = rColor; + mxData->maColors.maToolTextColor = rColor; } const Color& StyleSettings::GetToolTextColor() const { - return mxData->maToolTextColor; + return mxData->maColors.maToolTextColor; } void StyleSettings::SetMonoColor( const Color& rColor ) { - CopyData(); - mxData->maMonoColor = rColor; + mxData->maColors.maMonoColor = rColor; } const Color& StyleSettings::GetMonoColor() const { - return mxData->maMonoColor; + return mxData->maColors.maMonoColor; } void StyleSettings::SetActiveTabColor( const Color& rColor ) { - CopyData(); - mxData->maActiveTabColor = rColor; + mxData->maColors.maActiveTabColor = rColor; } const Color& StyleSettings::GetActiveTabColor() const { - return mxData->maActiveTabColor; + return mxData->maColors.maActiveTabColor; } void StyleSettings::SetInactiveTabColor( const Color& rColor ) { - CopyData(); - mxData->maInactiveTabColor = rColor; + mxData->maColors.maInactiveTabColor = rColor; } const Color& StyleSettings::GetInactiveTabColor() const { - return mxData->maInactiveTabColor; + return mxData->maColors.maInactiveTabColor; } void StyleSettings::SetAlternatingRowColor(const Color& rColor) { - CopyData(); - mxData->maAlternatingRowColor = rColor; + mxData->maColors.maAlternatingRowColor = rColor; } const Color& StyleSettings::GetAlternatingRowColor() const { - return mxData->maAlternatingRowColor; + return mxData->maColors.maAlternatingRowColor; } void StyleSettings::SetUseSystemUIFonts( bool bUseSystemUIFonts ) { - CopyData(); mxData->mbUseSystemUIFonts = bUseSystemUIFonts; } @@ -1711,7 +1477,6 @@ StyleSettings::GetUseSystemUIFonts() const void StyleSettings::SetUseFontAAFromSystem(bool bUseFontAAFromSystem) { - CopyData(); mxData->mbUseFontAAFromSystem = bUseFontAAFromSystem; } @@ -1720,10 +1485,19 @@ bool StyleSettings::GetUseFontAAFromSystem() const return mxData->mbUseFontAAFromSystem; } +void StyleSettings::SetUseSubpixelAA(bool val) +{ + mxData->mbUseSubpixelAA = val; +} + +bool StyleSettings::GetUseSubpixelAA() const +{ + return mxData->mbUseSubpixelAA; +} + void StyleSettings::SetUseFlatBorders( bool bUseFlatBorders ) { - CopyData(); mxData->mnUseFlatBorders = bUseFlatBorders; } @@ -1736,7 +1510,6 @@ StyleSettings::GetUseFlatBorders() const void StyleSettings::SetUseFlatMenus( bool bUseFlatMenus ) { - CopyData(); mxData->mnUseFlatMenus = bUseFlatMenus; } @@ -1749,14 +1522,12 @@ StyleSettings::GetUseFlatMenus() const void StyleSettings::SetUseImagesInMenus( TriState eUseImagesInMenus ) { - CopyData(); mxData->meUseImagesInMenus = eUseImagesInMenus; } void StyleSettings::SetPreferredUseImagesInMenus( bool bPreferredUseImagesInMenus ) { - CopyData(); mxData->mbPreferredUseImagesInMenus = bPreferredUseImagesInMenus; } @@ -1769,7 +1540,6 @@ StyleSettings::GetPreferredUseImagesInMenus() const void StyleSettings::SetSkipDisabledInMenus( bool bSkipDisabledInMenus ) { - CopyData(); mxData->mbSkipDisabledInMenus = bSkipDisabledInMenus; } @@ -1782,7 +1552,6 @@ StyleSettings::GetSkipDisabledInMenus() const void StyleSettings::SetHideDisabledMenuItems( bool bHideDisabledMenuItems ) { - CopyData(); mxData->mbHideDisabledMenuItems = bHideDisabledMenuItems; } @@ -1795,7 +1564,6 @@ StyleSettings::GetHideDisabledMenuItems() const void StyleSettings::SetContextMenuShortcuts( TriState eContextMenuShortcuts ) { - CopyData(); mxData->meContextMenuShortcuts = eContextMenuShortcuts; } @@ -1816,7 +1584,6 @@ StyleSettings::GetContextMenuShortcuts() const void StyleSettings::SetPreferredContextMenuShortcuts( bool bContextMenuShortcuts ) { - CopyData(); mxData->mbPreferredContextMenuShortcuts = bContextMenuShortcuts; } @@ -1829,7 +1596,6 @@ StyleSettings::GetPreferredContextMenuShortcuts() const void StyleSettings::SetPrimaryButtonWarpsSlider( bool bPrimaryButtonWarpsSlider ) { - CopyData(); mxData->mbPrimaryButtonWarpsSlider = bPrimaryButtonWarpsSlider; } @@ -1842,170 +1608,157 @@ StyleSettings::GetPrimaryButtonWarpsSlider() const void StyleSettings::SetAppFont( const vcl::Font& rFont ) { - CopyData(); - mxData->maAppFont = rFont; + mxData->maFonts.maAppFont = rFont; } const vcl::Font& StyleSettings::GetAppFont() const { - return mxData->maAppFont; + return mxData->maFonts.maAppFont; } void StyleSettings::SetHelpFont( const vcl::Font& rFont ) { - CopyData(); - mxData->maHelpFont = rFont; + mxData->maFonts.maHelpFont = rFont; } const vcl::Font& StyleSettings::GetHelpFont() const { - return mxData->maHelpFont; + return mxData->maFonts.maHelpFont; } void StyleSettings::SetTitleFont( const vcl::Font& rFont ) { - CopyData(); - mxData->maTitleFont = rFont; + mxData->maFonts.maTitleFont = rFont; } const vcl::Font& StyleSettings::GetTitleFont() const { - return mxData->maTitleFont; + return mxData->maFonts.maTitleFont; } void StyleSettings::SetFloatTitleFont( const vcl::Font& rFont ) { - CopyData(); - mxData->maFloatTitleFont = rFont; + mxData->maFonts.maFloatTitleFont = rFont; } const vcl::Font& StyleSettings::GetFloatTitleFont() const { - return mxData->maFloatTitleFont; + return mxData->maFonts.maFloatTitleFont; } void StyleSettings::SetMenuFont( const vcl::Font& rFont ) { - CopyData(); - mxData->maMenuFont = rFont; + mxData->maFonts.maMenuFont = rFont; } const vcl::Font& StyleSettings::GetMenuFont() const { - return mxData->maMenuFont; + return mxData->maFonts.maMenuFont; } void StyleSettings::SetToolFont( const vcl::Font& rFont ) { - CopyData(); - mxData->maToolFont = rFont; + mxData->maFonts.maToolFont = rFont; } const vcl::Font& StyleSettings::GetToolFont() const { - return mxData->maToolFont; + return mxData->maFonts.maToolFont; } void StyleSettings::SetGroupFont( const vcl::Font& rFont ) { - CopyData(); - mxData->maGroupFont = rFont; + mxData->maFonts.maGroupFont = rFont; } const vcl::Font& StyleSettings::GetGroupFont() const { - return mxData->maGroupFont; + return mxData->maFonts.maGroupFont; } void StyleSettings::SetLabelFont( const vcl::Font& rFont ) { - CopyData(); - mxData->maLabelFont = rFont; + mxData->maFonts.maLabelFont = rFont; } const vcl::Font& StyleSettings::GetLabelFont() const { - return mxData->maLabelFont; + return mxData->maFonts.maLabelFont; } void StyleSettings::SetRadioCheckFont( const vcl::Font& rFont ) { - CopyData(); - mxData->maRadioCheckFont = rFont; + mxData->maFonts.maRadioCheckFont = rFont; } const vcl::Font& StyleSettings::GetRadioCheckFont() const { - return mxData->maRadioCheckFont; + return mxData->maFonts.maRadioCheckFont; } void StyleSettings::SetPushButtonFont( const vcl::Font& rFont ) { - CopyData(); - mxData->maPushButtonFont = rFont; + mxData->maFonts.maPushButtonFont = rFont; } const vcl::Font& StyleSettings::GetPushButtonFont() const { - return mxData->maPushButtonFont; + return mxData->maFonts.maPushButtonFont; } void StyleSettings::SetFieldFont( const vcl::Font& rFont ) { - CopyData(); - mxData->maFieldFont = rFont; + mxData->maFonts.maFieldFont = rFont; } const vcl::Font& StyleSettings::GetFieldFont() const { - return mxData->maFieldFont; + return mxData->maFonts.maFieldFont; } void StyleSettings::SetIconFont( const vcl::Font& rFont ) { - CopyData(); - mxData->maIconFont = rFont; + mxData->maFonts.maIconFont = rFont; } const vcl::Font& StyleSettings::GetIconFont() const { - return mxData->maIconFont; + return mxData->maFonts.maIconFont; } void StyleSettings::SetTabFont( const vcl::Font& rFont ) { - CopyData(); - mxData->maTabFont = rFont; + mxData->maFonts.maTabFont = rFont; } const vcl::Font& StyleSettings::GetTabFont() const { - return mxData->maTabFont; + return mxData->maFonts.maTabFont; } sal_Int32 @@ -2017,7 +1770,6 @@ StyleSettings::GetBorderSize() void StyleSettings::SetTitleHeight( sal_Int32 nSize ) { - CopyData(); mxData->mnTitleHeight = nSize; } @@ -2030,7 +1782,6 @@ StyleSettings::GetTitleHeight() const void StyleSettings::SetFloatTitleHeight( sal_Int32 nSize ) { - CopyData(); mxData->mnFloatTitleHeight = nSize; } @@ -2043,7 +1794,6 @@ StyleSettings::GetFloatTitleHeight() const void StyleSettings::SetScrollBarSize( sal_Int32 nSize ) { - CopyData(); mxData->mnScrollBarSize = nSize; } @@ -2056,7 +1806,6 @@ StyleSettings::GetScrollBarSize() const void StyleSettings::SetMinThumbSize( sal_Int32 nSize ) { - CopyData(); mxData->mnMinThumbSize = nSize; } @@ -2069,7 +1818,6 @@ StyleSettings::GetMinThumbSize() const void StyleSettings::SetSpinSize( sal_Int32 nSize ) { - CopyData(); mxData->mnSpinSize = nSize; } @@ -2088,7 +1836,6 @@ StyleSettings::GetSplitSize() void StyleSettings::SetCursorSize( sal_Int32 nSize ) { - CopyData(); mxData->mnCursorSize = nSize; } @@ -2101,7 +1848,6 @@ StyleSettings::GetCursorSize() const void StyleSettings::SetCursorBlinkTime( sal_uInt64 nBlinkTime ) { - CopyData(); mxData->mnCursorBlinkTime = nBlinkTime; } @@ -2114,7 +1860,6 @@ StyleSettings::GetCursorBlinkTime() const void StyleSettings::SetDragFullOptions( DragFullOptions nOptions ) { - CopyData(); mxData->mnDragFullOptions = nOptions; } @@ -2127,7 +1872,6 @@ StyleSettings::GetDragFullOptions() const void StyleSettings::SetSelectionOptions( SelectionOptions nOptions ) { - CopyData(); mxData->mnSelectionOptions = nOptions; } @@ -2140,7 +1884,6 @@ StyleSettings::GetSelectionOptions() const void StyleSettings::SetDisplayOptions( DisplayOptions nOptions ) { - CopyData(); mxData->mnDisplayOptions = nOptions; } @@ -2153,7 +1896,6 @@ StyleSettings::GetDisplayOptions() const void StyleSettings::SetAntialiasingMinPixelHeight( sal_Int32 nMinPixel ) { - CopyData(); mxData->mnAntialiasedMin = nMinPixel; } @@ -2166,14 +1908,12 @@ StyleSettings::GetAntialiasingMinPixelHeight() const void StyleSettings::SetOptions( StyleSettingsOptions nOptions ) { - CopyData(); mxData->mnOptions = nOptions; } void StyleSettings::SetAutoMnemonic( bool bAutoMnemonic ) { - CopyData(); mxData->mbAutoMnemonic = bAutoMnemonic; } @@ -2193,7 +1933,6 @@ StyleSettings::GetDockingFloatsSupported() void StyleSettings::SetToolbarIconSize( ToolbarIconSize nSize ) { - CopyData(); mxData->mnToolbarIconSize = nSize; } @@ -2226,7 +1965,6 @@ StyleSettings::GetDialogStyle() const void StyleSettings::SetEdgeBlending(sal_uInt16 nCount) { - CopyData(); mxData->mnEdgeBlending = nCount; } @@ -2251,7 +1989,6 @@ StyleSettings::GetEdgeBlendingBottomRightColor() const void StyleSettings::SetListBoxMaximumLineCount(sal_uInt16 nCount) { - CopyData(); mxData->mnListBoxMaximumLineCount = nCount; } @@ -2264,7 +2001,6 @@ StyleSettings::GetListBoxMaximumLineCount() const void StyleSettings::SetColorValueSetColumnCount(sal_uInt16 nCount) { - CopyData(); mxData->mnColorValueSetColumnCount = nCount; } @@ -2294,7 +2030,6 @@ ComboBoxTextSelectionMode StyleSettings::GetComboBoxTextSelectionMode() const void StyleSettings::SetPreviewUsesCheckeredBackground(bool bNew) { - CopyData(); mxData->mbPreviewUsesCheckeredBackground = bNew; } @@ -2304,22 +2039,18 @@ StyleSettings::GetPreviewUsesCheckeredBackground() const return mxData->mbPreviewUsesCheckeredBackground; } -bool -StyleSettings::operator !=( const StyleSettings& rSet ) const -{ - return !(*this == rSet); -} - void StyleSettings::SetListBoxPreviewDefaultLogicSize(Size const& rSize) { - mxData->maListBoxPreviewDefaultLogicSize = rSize; + auto* myData = mxData.get(); + myData->maListBoxPreviewDefaultLogicSize = rSize; + mxData->maListBoxPreviewDefaultPixelSize = {}; // recalc } const Size& StyleSettings::GetListBoxPreviewDefaultPixelSize() const { if(0 == mxData->maListBoxPreviewDefaultPixelSize.Width() || 0 == mxData->maListBoxPreviewDefaultPixelSize.Height()) { - const_cast< StyleSettings* >(this)->mxData->maListBoxPreviewDefaultPixelSize = + mxData->maListBoxPreviewDefaultPixelSize = Application::GetDefaultDevice()->LogicToPixel(mxData->maListBoxPreviewDefaultLogicSize, MapMode(MapUnit::MapAppFont)); } @@ -2328,55 +2059,55 @@ const Size& StyleSettings::GetListBoxPreviewDefaultPixelSize() const void StyleSettings::Set3DColors( const Color& rColor ) { - CopyData(); - mxData->maFaceColor = rColor; - mxData->maLightBorderColor = rColor; - mxData->maMenuBorderColor = rColor; - mxData->maDarkShadowColor = COL_BLACK; + auto* myData = mxData.get(); + myData->maColors.maFaceColor = rColor; + myData->maColors.maLightBorderColor = rColor; + myData->maColors.maMenuBorderColor = rColor; + myData->maColors.maDarkShadowColor = COL_BLACK; if ( rColor != COL_LIGHTGRAY ) { - mxData->maLightColor = rColor; - mxData->maShadowColor = rColor; - mxData->maDarkShadowColor = rColor; + myData->maColors.maLightColor = rColor; + myData->maColors.maShadowColor = rColor; + myData->maColors.maDarkShadowColor = rColor; if (!rColor.IsDark()) { - mxData->maLightColor.IncreaseLuminance(64); - mxData->maShadowColor.DecreaseLuminance(64); - mxData->maDarkShadowColor.DecreaseLuminance(100); + myData->maColors.maLightColor.IncreaseLuminance(64); + myData->maColors.maShadowColor.DecreaseLuminance(64); + myData->maColors.maDarkShadowColor.DecreaseLuminance(100); } else { - mxData->maLightColor.DecreaseLuminance(64); - mxData->maShadowColor.IncreaseLuminance(64); - mxData->maDarkShadowColor.IncreaseLuminance(100); + myData->maColors.maLightColor.DecreaseLuminance(64); + myData->maColors.maShadowColor.IncreaseLuminance(64); + myData->maColors.maDarkShadowColor.IncreaseLuminance(100); } - sal_uInt8 nRed = (mxData->maLightColor.GetRed() + mxData->maShadowColor.GetRed()) / 2; - sal_uInt8 nGreen = (mxData->maLightColor.GetGreen() + mxData->maShadowColor.GetGreen()) / 2; - sal_uInt8 nBlue = (mxData->maLightColor.GetBlue() + mxData->maShadowColor.GetBlue()) / 2; - mxData->maCheckedColor = Color(nRed, nGreen, nBlue); + sal_uInt8 nRed = (myData->maColors.maLightColor.GetRed() + myData->maColors.maShadowColor.GetRed()) / 2; + sal_uInt8 nGreen = (myData->maColors.maLightColor.GetGreen() + myData->maColors.maShadowColor.GetGreen()) / 2; + sal_uInt8 nBlue = (myData->maColors.maLightColor.GetBlue() + myData->maColors.maShadowColor.GetBlue()) / 2; + myData->maColors.maCheckedColor = Color(nRed, nGreen, nBlue); } else { - mxData->maCheckedColor = Color( 0x99, 0x99, 0x99 ); - mxData->maLightColor = COL_WHITE; - mxData->maShadowColor = COL_GRAY; + myData->maColors.maCheckedColor = Color( 0x99, 0x99, 0x99 ); + myData->maColors.maLightColor = COL_WHITE; + myData->maColors.maShadowColor = COL_GRAY; } } void StyleSettings::SetCheckedColorSpecialCase( ) { - CopyData(); + auto* myData = mxData.get(); // Light gray checked color special case if ( GetFaceColor() == COL_LIGHTGRAY ) - mxData->maCheckedColor = Color( 0xCC, 0xCC, 0xCC ); + myData->maColors.maCheckedColor = Color(0xCC, 0xCC, 0xCC); else { - sal_uInt8 nRed = static_cast((static_cast(mxData->maFaceColor.GetRed()) + static_cast(mxData->maLightColor.GetRed()))/2); - sal_uInt8 nGreen = static_cast((static_cast(mxData->maFaceColor.GetGreen()) + static_cast(mxData->maLightColor.GetGreen()))/2); - sal_uInt8 nBlue = static_cast((static_cast(mxData->maFaceColor.GetBlue()) + static_cast(mxData->maLightColor.GetBlue()))/2); - mxData->maCheckedColor = Color( nRed, nGreen, nBlue ); + sal_uInt8 nRed = static_cast((static_cast(myData->maColors.maFaceColor.GetRed()) + static_cast(myData->maColors.maLightColor.GetRed()))/2); + sal_uInt8 nGreen = static_cast((static_cast(myData->maColors.maFaceColor.GetGreen()) + static_cast(myData->maColors.maLightColor.GetGreen()))/2); + sal_uInt8 nBlue = static_cast((static_cast(myData->maColors.maFaceColor.GetBlue()) + static_cast(myData->maColors.maLightColor.GetBlue()))/2); + myData->maColors.maCheckedColor = Color(nRed, nGreen, nBlue); } } @@ -2509,7 +2240,6 @@ const std::optional& StyleSettings::GetPersonaMenuBarTextColor() const void StyleSettings::SetStandardStyles() { - CopyData(); mxData->SetStandardStyles(); } @@ -2535,133 +2265,57 @@ Color StyleSettings::GetSeparatorColor() const return Color::HSBtoRGB( h, s, b ); } -void StyleSettings::CopyData() -{ - // copy if other references exist - if (mxData.use_count() > 1) - { - mxData = std::make_shared(*mxData); - } -} - +// Until Clang 14, P2085R0 is unsupported, and the operator can't be default outside of declaration bool StyleSettings::operator ==( const StyleSettings& rSet ) const { - if ( mxData == rSet.mxData ) - return true; + return mxData == rSet.mxData; +} - if (mxData->mIconTheme != rSet.mxData->mIconTheme) { +bool ImplStyleData::operator==(const ImplStyleData& rSet) const +{ + if (mIconTheme != rSet.mIconTheme) { return false; } - if (*mxData->mIconThemeSelector != *rSet.mxData->mIconThemeSelector) { + if (mIconThemeSelector != rSet.mIconThemeSelector) { return false; } - return (mxData->mnOptions == rSet.mxData->mnOptions) && - (mxData->mbAutoMnemonic == rSet.mxData->mbAutoMnemonic) && - (mxData->mnDragFullOptions == rSet.mxData->mnDragFullOptions) && - (mxData->mnSelectionOptions == rSet.mxData->mnSelectionOptions) && - (mxData->mnDisplayOptions == rSet.mxData->mnDisplayOptions) && - (mxData->mnCursorSize == rSet.mxData->mnCursorSize) && - (mxData->mnCursorBlinkTime == rSet.mxData->mnCursorBlinkTime) && - (mxData->mnTitleHeight == rSet.mxData->mnTitleHeight) && - (mxData->mnFloatTitleHeight == rSet.mxData->mnFloatTitleHeight) && - (mxData->mnScrollBarSize == rSet.mxData->mnScrollBarSize) && - (mxData->mnMinThumbSize == rSet.mxData->mnMinThumbSize) && - (mxData->mnSpinSize == rSet.mxData->mnSpinSize) && - (mxData->mnAntialiasedMin == rSet.mxData->mnAntialiasedMin) && - (mxData->mbHighContrast == rSet.mxData->mbHighContrast) && - (mxData->mbUseSystemUIFonts == rSet.mxData->mbUseSystemUIFonts) && - (mxData->mbUseFontAAFromSystem == rSet.mxData->mbUseFontAAFromSystem) && - (mxData->mnUseFlatBorders == rSet.mxData->mnUseFlatBorders) && - (mxData->mnUseFlatMenus == rSet.mxData->mnUseFlatMenus) && - (mxData->maFaceColor == rSet.mxData->maFaceColor) && - (mxData->maCheckedColor == rSet.mxData->maCheckedColor) && - (mxData->maLightColor == rSet.mxData->maLightColor) && - (mxData->maLightBorderColor == rSet.mxData->maLightBorderColor) && - (mxData->maShadowColor == rSet.mxData->maShadowColor) && - (mxData->maDarkShadowColor == rSet.mxData->maDarkShadowColor) && - (mxData->maWarningColor == rSet.mxData->maWarningColor) && - (mxData->maWarningTextColor == rSet.mxData->maWarningTextColor) && - (mxData->maErrorColor == rSet.mxData->maErrorColor) && - (mxData->maErrorTextColor == rSet.mxData->maErrorTextColor) && - (mxData->maButtonTextColor == rSet.mxData->maButtonTextColor) && - (mxData->maDefaultActionButtonTextColor == rSet.mxData->maDefaultActionButtonTextColor) && - (mxData->maActionButtonTextColor == rSet.mxData->maActionButtonTextColor) && - (mxData->maButtonRolloverTextColor == rSet.mxData->maButtonRolloverTextColor) && - (mxData->maActionButtonRolloverTextColor == rSet.mxData->maActionButtonRolloverTextColor) && - (mxData->maRadioCheckTextColor == rSet.mxData->maRadioCheckTextColor) && - (mxData->maGroupTextColor == rSet.mxData->maGroupTextColor) && - (mxData->maLabelTextColor == rSet.mxData->maLabelTextColor) && - (mxData->maWindowColor == rSet.mxData->maWindowColor) && - (mxData->maWindowTextColor == rSet.mxData->maWindowTextColor) && - (mxData->maDialogColor == rSet.mxData->maDialogColor) && - (mxData->maDialogTextColor == rSet.mxData->maDialogTextColor) && - (mxData->maWorkspaceColor == rSet.mxData->maWorkspaceColor) && - (mxData->maMonoColor == rSet.mxData->maMonoColor) && - (mxData->maFieldColor == rSet.mxData->maFieldColor) && - (mxData->maFieldTextColor == rSet.mxData->maFieldTextColor) && - (mxData->maActiveColor == rSet.mxData->maActiveColor) && - (mxData->maActiveTextColor == rSet.mxData->maActiveTextColor) && - (mxData->maActiveBorderColor == rSet.mxData->maActiveBorderColor) && - (mxData->maDeactiveColor == rSet.mxData->maDeactiveColor) && - (mxData->maDeactiveTextColor == rSet.mxData->maDeactiveTextColor) && - (mxData->maDeactiveBorderColor == rSet.mxData->maDeactiveBorderColor) && - (mxData->maMenuColor == rSet.mxData->maMenuColor) && - (mxData->maMenuBarColor == rSet.mxData->maMenuBarColor) && - (mxData->maMenuBarRolloverColor == rSet.mxData->maMenuBarRolloverColor) && - (mxData->maMenuBorderColor == rSet.mxData->maMenuBorderColor) && - (mxData->maMenuTextColor == rSet.mxData->maMenuTextColor) && - (mxData->maListBoxWindowBackgroundColor == rSet.mxData->maListBoxWindowBackgroundColor) && - (mxData->maListBoxWindowTextColor == rSet.mxData->maListBoxWindowTextColor) && - (mxData->maListBoxWindowHighlightColor == rSet.mxData->maListBoxWindowHighlightColor) && - (mxData->maListBoxWindowHighlightTextColor == rSet.mxData->maListBoxWindowHighlightTextColor) && - (mxData->maMenuBarTextColor == rSet.mxData->maMenuBarTextColor) && - (mxData->maMenuBarRolloverTextColor == rSet.mxData->maMenuBarRolloverTextColor) && - (mxData->maMenuHighlightColor == rSet.mxData->maMenuHighlightColor) && - (mxData->maMenuHighlightTextColor == rSet.mxData->maMenuHighlightTextColor) && - (mxData->maAccentColor == rSet.mxData->maAccentColor) && - (mxData->maHighlightColor == rSet.mxData->maHighlightColor) && - (mxData->maHighlightTextColor == rSet.mxData->maHighlightTextColor) && - (mxData->maTabTextColor == rSet.mxData->maTabTextColor) && - (mxData->maTabRolloverTextColor == rSet.mxData->maTabRolloverTextColor) && - (mxData->maTabHighlightTextColor == rSet.mxData->maTabHighlightTextColor) && - (mxData->maActiveTabColor == rSet.mxData->maActiveTabColor) && - (mxData->maInactiveTabColor == rSet.mxData->maInactiveTabColor) && - (mxData->maDisableColor == rSet.mxData->maDisableColor) && - (mxData->maHelpColor == rSet.mxData->maHelpColor) && - (mxData->maHelpTextColor == rSet.mxData->maHelpTextColor) && - (mxData->maLinkColor == rSet.mxData->maLinkColor) && - (mxData->maVisitedLinkColor == rSet.mxData->maVisitedLinkColor) && - (mxData->maToolTextColor == rSet.mxData->maToolTextColor) && - (mxData->maAppFont == rSet.mxData->maAppFont) && - (mxData->maHelpFont == rSet.mxData->maHelpFont) && - (mxData->maTitleFont == rSet.mxData->maTitleFont) && - (mxData->maFloatTitleFont == rSet.mxData->maFloatTitleFont) && - (mxData->maMenuFont == rSet.mxData->maMenuFont) && - (mxData->maToolFont == rSet.mxData->maToolFont) && - (mxData->maGroupFont == rSet.mxData->maGroupFont) && - (mxData->maLabelFont == rSet.mxData->maLabelFont) && - (mxData->maRadioCheckFont == rSet.mxData->maRadioCheckFont) && - (mxData->maPushButtonFont == rSet.mxData->maPushButtonFont) && - (mxData->maFieldFont == rSet.mxData->maFieldFont) && - (mxData->maIconFont == rSet.mxData->maIconFont) && - (mxData->maTabFont == rSet.mxData->maTabFont) && - (mxData->meUseImagesInMenus == rSet.mxData->meUseImagesInMenus) && - (mxData->mbPreferredUseImagesInMenus == rSet.mxData->mbPreferredUseImagesInMenus) && - (mxData->mbSkipDisabledInMenus == rSet.mxData->mbSkipDisabledInMenus) && - (mxData->mbHideDisabledMenuItems == rSet.mxData->mbHideDisabledMenuItems) && - (mxData->mbPreferredContextMenuShortcuts == rSet.mxData->mbPreferredContextMenuShortcuts)&& - (mxData->meContextMenuShortcuts == rSet.mxData->meContextMenuShortcuts) && - (mxData->mbPrimaryButtonWarpsSlider == rSet.mxData->mbPrimaryButtonWarpsSlider) && - (mxData->mnEdgeBlending == rSet.mxData->mnEdgeBlending) && - (mxData->maEdgeBlendingTopLeftColor == rSet.mxData->maEdgeBlendingTopLeftColor) && - (mxData->maEdgeBlendingBottomRightColor == rSet.mxData->maEdgeBlendingBottomRightColor) && - (mxData->mnListBoxMaximumLineCount == rSet.mxData->mnListBoxMaximumLineCount) && - (mxData->mnColorValueSetColumnCount == rSet.mxData->mnColorValueSetColumnCount) && - (mxData->maListBoxPreviewDefaultLogicSize == rSet.mxData->maListBoxPreviewDefaultLogicSize) && - (mxData->maListBoxPreviewDefaultPixelSize == rSet.mxData->maListBoxPreviewDefaultPixelSize) && - (mxData->mbPreviewUsesCheckeredBackground == rSet.mxData->mbPreviewUsesCheckeredBackground); + return (mnOptions == rSet.mnOptions) && + (mbAutoMnemonic == rSet.mbAutoMnemonic) && + (mnDragFullOptions == rSet.mnDragFullOptions) && + (mnSelectionOptions == rSet.mnSelectionOptions) && + (mnDisplayOptions == rSet.mnDisplayOptions) && + (mnCursorSize == rSet.mnCursorSize) && + (mnCursorBlinkTime == rSet.mnCursorBlinkTime) && + (mnTitleHeight == rSet.mnTitleHeight) && + (mnFloatTitleHeight == rSet.mnFloatTitleHeight) && + (mnScrollBarSize == rSet.mnScrollBarSize) && + (mnMinThumbSize == rSet.mnMinThumbSize) && + (mnSpinSize == rSet.mnSpinSize) && + (mnAntialiasedMin == rSet.mnAntialiasedMin) && + (mbHighContrast == rSet.mbHighContrast) && + (mbUseSystemUIFonts == rSet.mbUseSystemUIFonts) && + (mbUseFontAAFromSystem == rSet.mbUseFontAAFromSystem) && + (mbUseSubpixelAA == rSet.mbUseSubpixelAA) && + (mnUseFlatBorders == rSet.mnUseFlatBorders) && + (mnUseFlatMenus == rSet.mnUseFlatMenus) && + (maColors == rSet.maColors) && + (maFonts == rSet.maFonts) && + (meUseImagesInMenus == rSet.meUseImagesInMenus) && + (mbPreferredUseImagesInMenus == rSet.mbPreferredUseImagesInMenus) && + (mbSkipDisabledInMenus == rSet.mbSkipDisabledInMenus) && + (mbHideDisabledMenuItems == rSet.mbHideDisabledMenuItems) && + (mbPreferredContextMenuShortcuts == rSet.mbPreferredContextMenuShortcuts) && + (meContextMenuShortcuts == rSet.meContextMenuShortcuts) && + (mbPrimaryButtonWarpsSlider == rSet.mbPrimaryButtonWarpsSlider) && + (mnEdgeBlending == rSet.mnEdgeBlending) && + (maEdgeBlendingTopLeftColor == rSet.maEdgeBlendingTopLeftColor) && + (maEdgeBlendingBottomRightColor == rSet.maEdgeBlendingBottomRightColor) && + (mnListBoxMaximumLineCount == rSet.mnListBoxMaximumLineCount) && + (mnColorValueSetColumnCount == rSet.mnColorValueSetColumnCount) && + (maListBoxPreviewDefaultLogicSize == rSet.maListBoxPreviewDefaultLogicSize) && + (mbPreviewUsesCheckeredBackground == rSet.mbPreviewUsesCheckeredBackground); } ImplMiscData::ImplMiscData() : @@ -2905,8 +2559,8 @@ HelpSettings::operator !=( const HelpSettings& rSet ) const ImplAllSettingsData::ImplAllSettingsData() : - maLocale( LANGUAGE_SYSTEM ), - maUILocale( LANGUAGE_SYSTEM ) + maLocale( maSysLocale.GetLanguageTag() ), + maUILocale( maSysLocale.GetUILanguageTag() ) { if (!comphelper::IsFuzzing()) maMiscSettings.SetEnableLocalizedDecimalSep( maSysLocale.GetOptions().IsDecimalSeparatorAsLocale() ); @@ -2932,31 +2586,20 @@ ImplAllSettingsData::~ImplAllSettingsData() mpUII18nHelper.reset(); } -AllSettings::AllSettings() - : mxData(std::make_shared()) -{ -} - -void AllSettings::CopyData() -{ - // copy if other references exist - if (mxData.use_count() > 1) - { - mxData = std::make_shared(*mxData); - } - -} +AllSettings::AllSettings() = default; +AllSettings::AllSettings(const AllSettings&) = default; +AllSettings::~AllSettings() = default; +AllSettings& AllSettings::operator=(const AllSettings&) = default; AllSettingsFlags AllSettings::Update( AllSettingsFlags nFlags, const AllSettings& rSet ) { - + const auto* constData = std::as_const(mxData).get(); AllSettingsFlags nChangeFlags = AllSettingsFlags::NONE; if ( nFlags & AllSettingsFlags::MOUSE ) { - if ( mxData->maMouseSettings != rSet.mxData->maMouseSettings ) + if (constData->maMouseSettings != rSet.mxData->maMouseSettings) { - CopyData(); mxData->maMouseSettings = rSet.mxData->maMouseSettings; nChangeFlags |= AllSettingsFlags::MOUSE; } @@ -2964,9 +2607,8 @@ AllSettingsFlags AllSettings::Update( AllSettingsFlags nFlags, const AllSettings if ( nFlags & AllSettingsFlags::STYLE ) { - if ( mxData->maStyleSettings != rSet.mxData->maStyleSettings ) + if (constData->maStyleSettings != rSet.mxData->maStyleSettings) { - CopyData(); mxData->maStyleSettings = rSet.mxData->maStyleSettings; nChangeFlags |= AllSettingsFlags::STYLE; } @@ -2974,9 +2616,8 @@ AllSettingsFlags AllSettings::Update( AllSettingsFlags nFlags, const AllSettings if ( nFlags & AllSettingsFlags::MISC ) { - if ( mxData->maMiscSettings != rSet.mxData->maMiscSettings ) + if (constData->maMiscSettings != rSet.mxData->maMiscSettings) { - CopyData(); mxData->maMiscSettings = rSet.mxData->maMiscSettings; nChangeFlags |= AllSettingsFlags::MISC; } @@ -2984,7 +2625,7 @@ AllSettingsFlags AllSettings::Update( AllSettingsFlags nFlags, const AllSettings if ( nFlags & AllSettingsFlags::LOCALE ) { - if ( mxData->maLocale != rSet.mxData->maLocale ) + if (constData->maLocale != rSet.mxData->maLocale) { SetLanguageTag( rSet.mxData->maLocale ); nChangeFlags |= AllSettingsFlags::LOCALE; @@ -3011,21 +2652,19 @@ AllSettingsFlags AllSettings::GetChangeFlags( const AllSettings& rSet ) const return nChangeFlags; } +// Until Clang 14, P2085R0 is unsupported, and the operator can't be default outside of declaration bool AllSettings::operator ==( const AllSettings& rSet ) const { - if ( mxData == rSet.mxData ) - return true; + return mxData == rSet.mxData; +} - if ( (mxData->maMouseSettings == rSet.mxData->maMouseSettings) && - (mxData->maStyleSettings == rSet.mxData->maStyleSettings) && - (mxData->maMiscSettings == rSet.mxData->maMiscSettings) && - (mxData->maHelpSettings == rSet.mxData->maHelpSettings) && - (mxData->maLocale == rSet.mxData->maLocale) ) - { - return true; - } - - return false; +bool ImplAllSettingsData::operator==(const ImplAllSettingsData& rSet) const +{ + return (maMouseSettings == rSet.maMouseSettings) && + (maStyleSettings == rSet.maStyleSettings) && + (maMiscSettings == rSet.maMiscSettings) && + (maHelpSettings == rSet.maHelpSettings) && + (maLocale == rSet.maLocale); } void AllSettings::SetLanguageTag(const OUString& rLanguage, bool bCanonicalize) @@ -3035,20 +2674,21 @@ void AllSettings::SetLanguageTag(const OUString& rLanguage, bool bCanonicalize) void AllSettings::SetLanguageTag( const LanguageTag& rLanguageTag ) { - if (mxData->maLocale == rLanguageTag) + if (std::as_const(mxData)->maLocale == rLanguageTag) return; - CopyData(); + auto* myData = mxData.get(); - mxData->maLocale = rLanguageTag; + myData->maLocale + = rLanguageTag.isSystemLocale() ? GetSysLocale().GetLanguageTag() : rLanguageTag; - if ( mxData->mpLocaleDataWrapper ) + if ( myData->mpLocaleDataWrapper ) { - mxData->mpLocaleDataWrapper.reset(); + myData->mpLocaleDataWrapper.reset(); } - if ( mxData->mpI18nHelper ) + if ( myData->mpI18nHelper ) { - mxData->mpI18nHelper.reset(); + myData->mpI18nHelper.reset(); } } @@ -3123,9 +2763,7 @@ const LanguageTag& AllSettings::GetLanguageTag() const if (comphelper::LibreOfficeKit::isActive()) return comphelper::LibreOfficeKit::getLanguageTag(); - // SYSTEM locale means: use settings from SvtSysLocale that is resolved - if ( mxData->maLocale.isSystemLocale() ) - mxData->maLocale = mxData->maSysLocale.GetLanguageTag(); + assert(!mxData->maLocale.isSystemLocale()); return mxData->maLocale; } @@ -3141,9 +2779,7 @@ const LanguageTag& AllSettings::GetUILanguageTag() const if (comphelper::LibreOfficeKit::isActive()) return comphelper::LibreOfficeKit::getLanguageTag(); - // the UILocale is never changed - if ( mxData->maUILocale.isSystemLocale() ) - mxData->maUILocale = mxData->maSysLocale.GetUILanguageTag(); + assert(!mxData->maUILocale.isSystemLocale()); return mxData->maUILocale; } @@ -3151,7 +2787,7 @@ const LanguageTag& AllSettings::GetUILanguageTag() const const LocaleDataWrapper& AllSettings::GetLocaleDataWrapper() const { if ( !mxData->mpLocaleDataWrapper ) - const_cast(this)->mxData->mpLocaleDataWrapper.reset( new LocaleDataWrapper( + mxData->mpLocaleDataWrapper.reset( new LocaleDataWrapper( comphelper::getProcessComponentContext(), GetLanguageTag() ) ); return *mxData->mpLocaleDataWrapper; } @@ -3159,7 +2795,7 @@ const LocaleDataWrapper& AllSettings::GetLocaleDataWrapper() const const LocaleDataWrapper& AllSettings::GetUILocaleDataWrapper() const { if ( !mxData->mpUILocaleDataWrapper ) - const_cast(this)->mxData->mpUILocaleDataWrapper.reset( new LocaleDataWrapper( + mxData->mpUILocaleDataWrapper.reset( new LocaleDataWrapper( comphelper::getProcessComponentContext(), GetUILanguageTag() ) ); return *mxData->mpUILocaleDataWrapper; } @@ -3167,7 +2803,7 @@ const LocaleDataWrapper& AllSettings::GetUILocaleDataWrapper() const const LocaleDataWrapper& AllSettings::GetNeutralLocaleDataWrapper() const { if ( !mxData->mpNeutralLocaleDataWrapper ) - const_cast(this)->mxData->mpNeutralLocaleDataWrapper.reset( new LocaleDataWrapper( + mxData->mpNeutralLocaleDataWrapper.reset( new LocaleDataWrapper( comphelper::getProcessComponentContext(), LanguageTag(u"en-US"_ustr) ) ); return *mxData->mpNeutralLocaleDataWrapper; } @@ -3175,7 +2811,7 @@ const LocaleDataWrapper& AllSettings::GetNeutralLocaleDataWrapper() const const vcl::I18nHelper& AllSettings::GetLocaleI18nHelper() const { if ( !mxData->mpI18nHelper ) { - const_cast(this)->mxData->mpI18nHelper.reset( new vcl::I18nHelper( + mxData->mpI18nHelper.reset( new vcl::I18nHelper( comphelper::getProcessComponentContext(), GetLanguageTag() ) ); } return *mxData->mpI18nHelper; @@ -3184,7 +2820,7 @@ const vcl::I18nHelper& AllSettings::GetLocaleI18nHelper() const const vcl::I18nHelper& AllSettings::GetUILocaleI18nHelper() const { if ( !mxData->mpUII18nHelper ) { - const_cast(this)->mxData->mpUII18nHelper.reset( new vcl::I18nHelper( + mxData->mpUII18nHelper.reset( new vcl::I18nHelper( comphelper::getProcessComponentContext(), GetUILanguageTag() ) ); } return *mxData->mpUII18nHelper; @@ -3196,7 +2832,7 @@ void AllSettings::LocaleSettingsChanged( ConfigurationHints nHint ) if ( nHint & ConfigurationHints::DecSep ) { MiscSettings aMiscSettings = aAllSettings.GetMiscSettings(); - bool bIsDecSepAsLocale = aAllSettings.mxData->maSysLocale.GetOptions().IsDecimalSeparatorAsLocale(); + bool bIsDecSepAsLocale = aAllSettings.GetSysLocale().GetOptions().IsDecimalSeparatorAsLocale(); if ( aMiscSettings.GetEnableLocalizedDecimalSep() != bIsDecSepAsLocale ) { aMiscSettings.SetEnableLocalizedDecimalSep( bIsDecSepAsLocale ); @@ -3205,7 +2841,7 @@ void AllSettings::LocaleSettingsChanged( ConfigurationHints nHint ) } if ( nHint & ConfigurationHints::Locale ) - aAllSettings.SetLanguageTag( aAllSettings.mxData->maSysLocale.GetOptions().GetLanguageTag() ); + aAllSettings.SetLanguageTag(aAllSettings.GetSysLocale().GetOptions().GetLanguageTag()); Application::SetSettings( aAllSettings ); } @@ -3226,29 +2862,22 @@ std::vector const & StyleSettings::GetInstalledIconThemes() const { if (!mxData->mIconThemeScanner) { - const_cast(this)->mxData->mIconThemeScanner = vcl::IconThemeScanner::Create(vcl::IconThemeScanner::GetStandardIconThemePath()); + mxData->mIconThemeScanner.emplace(vcl::IconThemeScanner::GetStandardIconThemePath()); } return mxData->mIconThemeScanner->GetFoundIconThemes(); } -/*static*/ OUString +OUString StyleSettings::GetAutomaticallyChosenIconTheme() const { - OUString desktopEnvironment = Application::GetDesktopEnvironment(); - if (!mxData->mIconThemeScanner) { - const_cast(this)->mxData->mIconThemeScanner = vcl::IconThemeScanner::Create(vcl::IconThemeScanner::GetStandardIconThemePath()); - } - OUString themeName = mxData->mIconThemeSelector->SelectIconThemeForDesktopEnvironment( - mxData->mIconThemeScanner->GetFoundIconThemes(), - desktopEnvironment - ); - return themeName; + return mxData->mIconThemeSelector.SelectIconThemeForDesktopEnvironment( + GetInstalledIconThemes(), + Application::GetDesktopEnvironment()); } void StyleSettings::SetIconTheme(const OUString& theme) { - CopyData(); mxData->mIconTheme = theme; } @@ -3270,25 +2899,21 @@ StyleSettings::DetermineIconTheme() const } } - if (!mxData->mIconThemeScanner) { - const_cast(this)->mxData->mIconThemeScanner = vcl::IconThemeScanner::Create(vcl::IconThemeScanner::GetStandardIconThemePath()); - } - OUString r = mxData->mIconThemeSelector->SelectIconTheme( - mxData->mIconThemeScanner->GetFoundIconThemes(), + return mxData->mIconThemeSelector.SelectIconTheme( + GetInstalledIconThemes(), sTheme); - return r; } void StyleSettings::SetHighContrastMode(bool bHighContrast ) { - if (mxData->mbHighContrast == bHighContrast) { + if (std::as_const(mxData)->mbHighContrast == bHighContrast) { return; } - CopyData(); - mxData->mbHighContrast = bHighContrast; - mxData->mIconThemeSelector->SetUseHighContrastTheme(bHighContrast); + auto* myData = mxData.get(); + myData->mbHighContrast = bHighContrast; + myData->mIconThemeSelector.SetUseHighContrastTheme(bHighContrast); } bool @@ -3300,18 +2925,18 @@ StyleSettings::GetHighContrastMode() const void StyleSettings::SetPreferredIconTheme(const OUString& theme, bool bDarkIconTheme) { - const bool bChanged = mxData->mIconThemeSelector->SetPreferredIconTheme(theme, bDarkIconTheme); + auto* myData = mxData.get(); + const bool bChanged = myData->mIconThemeSelector.SetPreferredIconTheme(theme, bDarkIconTheme); if (bChanged) { // clear this so it is recalculated if it was selected as the automatic theme - mxData->mIconTheme.clear(); + myData->mIconTheme.clear(); } } void AllSettings::SetMouseSettings( const MouseSettings& rSet ) { - CopyData(); mxData->maMouseSettings = rSet; } @@ -3324,14 +2949,12 @@ AllSettings::GetMouseSettings() const void AllSettings::SetStyleSettings( const StyleSettings& rSet ) { - CopyData(); mxData->maStyleSettings = rSet; } void AllSettings::SetMiscSettings( const MiscSettings& rSet ) { - CopyData(); mxData->maMiscSettings = rSet; } @@ -3344,7 +2967,6 @@ AllSettings::GetMiscSettings() const void AllSettings::SetHelpSettings( const HelpSettings& rSet ) { - CopyData(); mxData->maHelpSettings = rSet; } @@ -3354,14 +2976,8 @@ AllSettings::GetHelpSettings() const return mxData->maHelpSettings; } -bool -AllSettings::operator !=( const AllSettings& rSet ) const -{ - return !(*this == rSet); -} - -SvtSysLocale& -AllSettings::GetSysLocale() +const SvtSysLocale& +AllSettings::GetSysLocale() const { return mxData->maSysLocale; } diff --git a/vcl/source/app/unohelp.cxx b/vcl/source/app/unohelp.cxx index ed9f62a5df20..05ac38c4fa7e 100644 --- a/vcl/source/app/unohelp.cxx +++ b/vcl/source/app/unohelp.cxx @@ -209,5 +209,36 @@ FontItalic vcl::unohelper::ConvertFontSlant(css::awt::FontSlant eSlant) return eRet; } +Size vcl::unohelper::ConvertToVCLSize(const css::awt::Size& rAWTSize) +{ + return Size(rAWTSize.Width, rAWTSize.Height); +} + +css::awt::Size vcl::unohelper::ConvertToAWTSize(const Size& rVCLSize) +{ + return css::awt::Size(rVCLSize.Width(), rVCLSize.Height()); +} + +Point vcl::unohelper::ConvertToVCLPoint(const css::awt::Point& rAWTPoint) +{ + return Point(rAWTPoint.X, rAWTPoint.Y); +} + +css::awt::Point vcl::unohelper::ConvertToAWTPoint(const PointTemplateBase& rVCLPoint) +{ + return css::awt::Point(rVCLPoint.X(), rVCLPoint.Y()); +} + +tools::Rectangle vcl::unohelper::ConvertToVCLRect(const css::awt::Rectangle& rAWTRect) +{ + return ::tools::Rectangle(Point(rAWTRect.X, rAWTRect.Y), + Size(rAWTRect.Width, rAWTRect.Height)); +} + +css::awt::Rectangle vcl::unohelper::ConvertToAWTRect(const RectangleTemplateBase& rVCLRect) +{ + return css::awt::Rectangle(rVCLRect.Left(), rVCLRect.Top(), rVCLRect.GetWidth(), + rVCLRect.GetHeight()); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx index b44a1ca5cad9..c46f1647aa39 100644 --- a/vcl/source/bitmap/BitmapEx.cxx +++ b/vcl/source/bitmap/BitmapEx.cxx @@ -1024,7 +1024,7 @@ BitmapEx BitmapEx::ModifyBitmapEx(const basegfx::BColorModifierStack& rBColorMod return BitmapEx(aChangedBitmap); } -BitmapEx createBlendFrame( +BitmapEx createAlphaBlendFrame( const Size& rSize, sal_uInt8 nAlpha, Color aColorTopLeft, @@ -1042,13 +1042,13 @@ BitmapEx createBlendFrame( aColTopRight.Merge(aColorBottomRight, 255 - sal_uInt8((nW * 255) / nDE)); aColBottomLeft.Merge(aColorBottomRight, 255 - sal_uInt8((nH * 255) / nDE)); - return createBlendFrame(rSize, nAlpha, aColorTopLeft, aColTopRight, aColorBottomRight, aColBottomLeft); + return createAlphaBlendFrame(rSize, nAlpha, aColorTopLeft, aColTopRight, aColorBottomRight, aColBottomLeft); } return BitmapEx(); } -BitmapEx createBlendFrame( +BitmapEx createAlphaBlendFrame( const Size& rSize, sal_uInt8 nAlpha, Color aColorTopLeft, @@ -1056,8 +1056,6 @@ BitmapEx createBlendFrame( Color aColorBottomRight, Color aColorBottomLeft) { - // FIXME the call sites are actually passing in transparency - nAlpha = 255 - nAlpha; BlendFrameCache* pBlendFrameCache = ImplGetBlendFrameCache(); if(pBlendFrameCache->m_aLastSize == rSize @@ -1318,14 +1316,6 @@ tools::Polygon BitmapEx::GetContour( bool bContourEdgeDetect, if (!pAcc || !nWidth || !nHeight) return tools::Polygon(); - const tools::Long nStartX1 = aWorkRect.Left() + 1; - const tools::Long nEndX1 = aWorkRect.Right(); - const tools::Long nStartX2 = nEndX1 - 1; - const tools::Long nStartY1 = aWorkRect.Top() + 1; - const tools::Long nEndY1 = aWorkRect.Bottom(); - - sal_uInt16 nPolyPos = 0; - // tdf#161833 treat semi-transparent pixels as opaque // Limiting the contour wrapping polygon to only opaque pixels // causes clipping of any shadows or other semi-transparent @@ -1340,7 +1330,15 @@ tools::Polygon BitmapEx::GetContour( bool bContourEdgeDetect, pPoints1.reset(new Point[ nHeight ]); pPoints2.reset(new Point[ nHeight ]); - for (tools::Long nY = nStartY1; nY < nEndY1; nY++ ) + const tools::Long nStartX1 = aWorkRect.Left() + 1; + const tools::Long nEndX1 = aWorkRect.Right(); + const tools::Long nStartX2 = nEndX1 - 1; + const tools::Long nStartY1 = aWorkRect.Top() + 1; + const tools::Long nEndY1 = aWorkRect.Bottom(); + + sal_uInt16 nPolyPos = 0; + + for (tools::Long nY = nStartY1; nY < nEndY1; nY++) { tools::Long nX = nStartX1; Scanline pScanline = pAcc->GetScanline( nY ); diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx index 488c032a89f6..45b84c7db4ea 100644 --- a/vcl/source/control/imp_listbox.cxx +++ b/vcl/source/control/imp_listbox.cxx @@ -1691,8 +1691,8 @@ void ImplListBoxWindow::DrawEntry(vcl::RenderContext& rRenderContext, sal_Int32 { const Color& rTopLeft(rStyleSettings.GetEdgeBlendingTopLeftColor()); const Color& rBottomRight(rStyleSettings.GetEdgeBlendingBottomRightColor()); - const sal_uInt8 nAlpha((nEdgeBlendingPercent * 255) / 100); - const BitmapEx aBlendFrame(createBlendFrame(aImgSz, nAlpha, rTopLeft, rBottomRight)); + const sal_uInt8 nAlpha(255 - ((nEdgeBlendingPercent * 255) / 100)); + const BitmapEx aBlendFrame(createAlphaBlendFrame(aImgSz, nAlpha, rTopLeft, rBottomRight)); if (!aBlendFrame.IsEmpty()) { @@ -2709,8 +2709,8 @@ void ImplWin::DrawEntry(vcl::RenderContext& rRenderContext, bool bLayout) { const Color& rTopLeft(rStyleSettings.GetEdgeBlendingTopLeftColor()); const Color& rBottomRight(rStyleSettings.GetEdgeBlendingBottomRightColor()); - const sal_uInt8 nAlpha((nEdgeBlendingPercent * 255) / 100); - const BitmapEx aBlendFrame(createBlendFrame(aImgSz, nAlpha, rTopLeft, rBottomRight)); + const sal_uInt8 nAlpha(255 - ((nEdgeBlendingPercent * 255) / 100)); + const BitmapEx aBlendFrame(createAlphaBlendFrame(aImgSz, nAlpha, rTopLeft, rBottomRight)); if(!aBlendFrame.IsEmpty()) { diff --git a/vcl/source/filter/igif/gifread.cxx b/vcl/source/filter/igif/gifread.cxx index 6f96131a7908..a402faab1871 100644 --- a/vcl/source/filter/igif/gifread.cxx +++ b/vcl/source/filter/igif/gifread.cxx @@ -88,7 +88,6 @@ class GIFReader bool bGCTransparent; // is the image transparent, if yes: bool bInterlaced; bool bOverreadBlock; - bool bImGraphicReady; bool bGlobalPalette; sal_uInt8 nBackgroundColor; // backgroundcolour sal_uInt8 nGCTransparentIndex; // pixels of this index are transparent @@ -146,7 +145,6 @@ GIFReader::GIFReader( SvStream& rStm ) , bGCTransparent ( false ) , bInterlaced ( false) , bOverreadBlock ( false ) - , bImGraphicReady ( false ) , bGlobalPalette ( false ) , nBackgroundColor ( 0 ) , nGCTransparentIndex ( 0 ) @@ -825,7 +823,6 @@ bool GIFReader::ProcessGIF() if ( nRet == 1 ) { - bImGraphicReady = true; eActAction = NEXT_BLOCK_READING; bOverreadBlock = false; } diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index b7ccf81df469..f41309685cc1 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -5640,39 +5640,46 @@ bool PDFWriterImpl::emitCatalog() { aLine.append( "/MarkInfo<>\n" ); } - if( !m_aWidgets.empty() ) + + if (!m_aWidgets.empty() || !m_aCopiedWidgets.empty()) { - aLine.append( "/AcroForm< 0 -#if HAVE_FEATURE_NSS - || ( m_nSignatureObject != -1 ) -#endif - ) - aLine.append( ">>\n" ); - else - aLine.append( "/NeedAppearances true>>\n" ); + // NeedAppearances must not be used if PDF is signed, PDF/A is used or + // we have copied widgets (can't guarantee we have appearance streams in this case) + if (m_nPDFA_Version == 0 && !bSigned && m_aCopiedWidgets.empty()) + aLine.append("/NeedAppearances true "); + + aLine.append(">>\n"); } //check if there is a Metadata object @@ -9343,6 +9350,14 @@ void PDFWriterImpl::writeReferenceXObject(const ReferenceXObjectEmit& rEmit) return; } + // Get the copied resource map, so we can use that to skip objects we already copied + auto& rCopiedResourcesMap = rExternalPDFStream.getCopiedResources(); + + // Add page mapping to the copied resources map. + // Needed if we reference the current page and we want to prevent copying the page + // if it is referenced. + rCopiedResourcesMap.emplace(pPage->GetObjectValue(), m_aPages.back().m_nPageObject); + double aOrigin[2] = { 0.0, 0.0 }; // tdf#160714 use crop box for bounds of embedded PDF object @@ -9389,52 +9404,8 @@ void PDFWriterImpl::writeReferenceXObject(const ReferenceXObjectEmit& rEmit) return; } - // Merge link annotations from pPage to our page. - std::vector aAnnots; - if (auto pArray = dynamic_cast(pPage->Lookup("Annots"_ostr))) - { - for (const auto pElement : pArray->GetElements()) - { - auto pReference = dynamic_cast(pElement); - if (!pReference) - { - continue; - } - - filter::PDFObjectElement* pObject = pReference->LookupObject(); - if (!pObject) - { - continue; - } - - auto pType = dynamic_cast(pObject->Lookup("Type"_ostr)); - if (!pType || pType->GetValue() != "Annot") - { - continue; - } - - auto pSubtype = dynamic_cast(pObject->Lookup("Subtype"_ostr)); - if (!pSubtype || pSubtype->GetValue() != "Link") - { - continue; - } - - // Reference to a link annotation object, remember it. - aAnnots.push_back(pObject); - } - } - if (!aAnnots.empty()) - { - PDFObjectCopier aCopier(*this); - SvMemoryStream& rDocBuffer = pPage->GetDocument().GetEditBuffer(); - std::map aMap; - for (const auto& pAnnot : aAnnots) - { - // Copy over the annotation and refer to its new id. - sal_Int32 nNewId = aCopier.copyExternalResource(rDocBuffer, *pAnnot, aMap); - m_aPages.back().m_aAnnotations.push_back(nNewId); - } - } + // Merge link and widget annotations from pPage to our page. + mergeAnnotationsFromExternalPage(pPage, rCopiedResourcesMap); nWrappedFormObject = createObject(); // Write the form XObject wrapped below. This is a separate object from @@ -9485,8 +9456,7 @@ void PDFWriterImpl::writeReferenceXObject(const ReferenceXObjectEmit& rEmit) } PDFObjectCopier aCopier(*this); - auto & rResources = rExternalPDFStream.getCopiedResources(); - aCopier.copyPageResources(pPage, aLine, rResources); + aCopier.copyPageResources(pPage, aLine, rCopiedResourcesMap); aLine.append(" /BBox [ "); aLine.append(aOrigin[0]); @@ -9639,6 +9609,99 @@ void PDFWriterImpl::writeReferenceXObject(const ReferenceXObjectEmit& rEmit) return; } +namespace +{ + +sal_Int32 getRootParent(filter::PDFObjectElement* pObject) +{ + auto* pReference = dynamic_cast(pObject->Lookup("Parent"_ostr)); + if (!pReference) + return pObject->GetObjectValue(); + + auto* pParent = pReference->LookupObject(); + return getRootParent(pParent); +} + +} // end anonymous + +void PDFWriterImpl::mergeAnnotationsFromExternalPage(filter::PDFObjectElement* pPage, std::map& rCopiedResourcesMap) +{ + auto* pResult = pPage->Lookup("Annots"_ostr); + filter::PDFArrayElement* pArray = nullptr; + // If the Annots array is a reference - get the array from the referenced object + auto pAnnotsReference = dynamic_cast(pResult); + if (pAnnotsReference) + { + filter::PDFObjectElement* pObject = pAnnotsReference->LookupObject(); + pArray = pObject->GetArray(); + } + else + { + // Not a reference so is it an array + pArray = dynamic_cast(pResult); + } + + // Have we found our /Annots array? + if (!pArray) + return; + + std::unordered_set aAlreadyCopied; + PDFObjectCopier aCopier(*this); + SvMemoryStream& rDocBuffer = pPage->GetDocument().GetEditBuffer(); + + for (const auto pElement : pArray->GetElements()) + { + auto pReference = dynamic_cast(pElement); + if (!pReference) + continue; + + filter::PDFObjectElement* pObject = pReference->LookupObject(); + if (!pObject) + continue; + + // Get the /Type and the /Subtype + auto pType = dynamic_cast(pObject->Lookup("Type"_ostr)); + auto pSubtype = dynamic_cast(pObject->Lookup("Subtype"_ostr)); + + // Is it a /Annot we want to copy? + if (pType && pType->GetValue() == "Annot" && pSubtype) + { + bool bIsLink = pSubtype->GetValue() == "Link"; + bool bIsWidget = pSubtype->GetValue() == "Widget"; + + // is link or widget + if (!bIsLink && !bIsWidget) + continue; + + // Copy over the annotation and refer to its new id. + sal_Int32 nNewId = aCopier.copyExternalResource(rDocBuffer, *pObject, rCopiedResourcesMap); + m_aPages.back().m_aAnnotations.push_back(nNewId); + + if (!bIsWidget) + continue; + + // Find the root + sal_Int32 nRootID = getRootParent(pObject); + + auto aIterator = rCopiedResourcesMap.find(nRootID); + if (aIterator == rCopiedResourcesMap.end()) // Can't find the mapped ID ? + continue; + + nNewId = aIterator->second; + + // Ignore if we added the ID already + if (aAlreadyCopied.find(nNewId) == aAlreadyCopied.end()) + { + // Add new entry into copied widgets vector + auto& rCopiedWidget = m_aCopiedWidgets.emplace_back(); + rCopiedWidget.m_nObject = nNewId; + aAlreadyCopied.emplace(nNewId); + } + } + } + +} + bool PDFWriterImpl::writeBitmapObject( const BitmapEmit& rObject, bool bMask ) { if (rObject.m_aReferenceXObject.hasExternalPDFData() && !m_aContext.UseReferenceXObject) diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 9833aa125771..f0308a5ec686 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -1316,6 +1316,15 @@ bool Printer::SetPaperSizeUser( const Size& rSize ) bNeedToChange = maJobSetup.ImplGetConstData().GetPaperFormat() != PAPER_USER && maJobSetup.ImplGetConstData().GetPaperFormat() != aPaper; + + if (!bNeedToChange) + { + Size aPaperSize = GetPaperSizePixel(); + bNeedToChange = (aPageSize.Width() < aPageSize.Height() + && aPaperSize.Width() > aPaperSize.Height()) + || (aPageSize.Width() > aPageSize.Height() + && aPaperSize.Width() < aPaperSize.Height()); + } } if(bNeedToChange) diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index 73b70a37ded8..934a80fe991a 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -1683,6 +1683,11 @@ bool PrinterController::isUIOptionEnabled( const OUString& i_rProperty ) const return bEnabled; } +void PrinterController::setUIChoicesDisabled(const OUString& rPropName, css::uno::Sequence& rChoicesDisabled) +{ + mpImplData->maChoiceDisableMap[rPropName] = std::move(rChoicesDisabled); +} + bool PrinterController::isUIChoiceEnabled( const OUString& i_rProperty, sal_Int32 i_nValue ) const { bool bEnabled = true; diff --git a/vcl/source/outdev/bitmapex.cxx b/vcl/source/outdev/bitmapex.cxx index 45408ac5cba6..3024b7ba86ed 100644 --- a/vcl/source/outdev/bitmapex.cxx +++ b/vcl/source/outdev/bitmapex.cxx @@ -40,13 +40,13 @@ void OutputDevice::DrawBitmapEx( const Point& rDestPt, if( !rBitmapEx.IsAlpha() ) { - DrawBitmap( rDestPt, rBitmapEx.GetBitmap() ); - } - else - { - const Size aSizePix( rBitmapEx.GetSizePixel() ); - DrawBitmapEx( rDestPt, PixelToLogic( aSizePix ), Point(), aSizePix, rBitmapEx, MetaActionType::BMPEX ); + DrawBitmap(rDestPt, rBitmapEx.GetBitmap()); + return; } + + const Size& rSizePx = rBitmapEx.GetSizePixel(); + DrawBitmapEx(rDestPt, PixelToLogic(rSizePx), Point(), rSizePx, rBitmapEx, + MetaActionType::BMPEX); } void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize, @@ -59,12 +59,12 @@ void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize, if ( !rBitmapEx.IsAlpha() ) { - DrawBitmap( rDestPt, rDestSize, rBitmapEx.GetBitmap() ); - } - else - { - DrawBitmapEx( rDestPt, rDestSize, Point(), rBitmapEx.GetSizePixel(), rBitmapEx, MetaActionType::BMPEXSCALE ); + DrawBitmap(rDestPt, rDestSize, rBitmapEx.GetBitmap()); + return; } + + DrawBitmapEx(rDestPt, rDestSize, Point(), rBitmapEx.GetSizePixel(), + rBitmapEx, MetaActionType::BMPEXSCALE); } void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize, @@ -78,12 +78,13 @@ void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize, if ( !rBitmapEx.IsAlpha() ) { - DrawBitmap( rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel, rBitmapEx.GetBitmap() ); - } - else - { - DrawBitmapEx( rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel, rBitmapEx, MetaActionType::BMPEXSCALEPART ); + DrawBitmap(rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel, + rBitmapEx.GetBitmap()); + return; } + + DrawBitmapEx(rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel, rBitmapEx, + MetaActionType::BMPEXSCALEPART); } void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize, @@ -97,71 +98,68 @@ void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize, if( !rBitmapEx.IsAlpha() ) { - DrawBitmap( rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel, rBitmapEx.GetBitmap() ); + DrawBitmap(rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel, + rBitmapEx.GetBitmap()); + return; } - else + + if (RasterOp::Invert == meRasterOp) { - if ( RasterOp::Invert == meRasterOp ) - { - DrawRect( tools::Rectangle( rDestPt, rDestSize ) ); - return; - } - - BitmapEx aBmpEx(vcl::drawmode::GetBitmapEx(rBitmapEx, GetDrawMode())); - - if ( mpMetaFile ) - { - switch( nAction ) - { - case MetaActionType::BMPEX: - mpMetaFile->AddAction( new MetaBmpExAction( rDestPt, aBmpEx ) ); - break; - - case MetaActionType::BMPEXSCALE: - mpMetaFile->AddAction( new MetaBmpExScaleAction( rDestPt, rDestSize, aBmpEx ) ); - break; - - case MetaActionType::BMPEXSCALEPART: - mpMetaFile->AddAction( new MetaBmpExScalePartAction( rDestPt, rDestSize, - rSrcPtPixel, rSrcSizePixel, aBmpEx ) ); - break; - - default: break; - } - } - - if ( !IsDeviceOutputNecessary() ) - return; - - if ( !mpGraphics && !AcquireGraphics() ) - return; - - if ( mbInitClipRegion ) - InitClipRegion(); - - if ( mbOutputClipped ) - return; - - DrawDeviceBitmapEx( rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel, aBmpEx ); + DrawRect(tools::Rectangle(rDestPt, rDestSize)); + return; } + + BitmapEx aBmpEx(vcl::drawmode::GetBitmapEx(rBitmapEx, GetDrawMode())); + + if (mpMetaFile) + { + switch(nAction) + { + case MetaActionType::BMPEX: + mpMetaFile->AddAction(new MetaBmpExAction(rDestPt, aBmpEx)); + break; + + case MetaActionType::BMPEXSCALE: + mpMetaFile->AddAction(new MetaBmpExScaleAction(rDestPt, rDestSize, aBmpEx)); + break; + + case MetaActionType::BMPEXSCALEPART: + mpMetaFile->AddAction(new MetaBmpExScalePartAction(rDestPt, rDestSize, + rSrcPtPixel, rSrcSizePixel, aBmpEx)); + break; + + default: + break; + } + } + + if (!IsDeviceOutputNecessary()) + return; + + if (!mpGraphics && !AcquireGraphics()) + return; + + if (mbInitClipRegion) + InitClipRegion(); + + if (mbOutputClipped) + return; + + DrawDeviceBitmapEx(rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel, aBmpEx); } BitmapEx OutputDevice::GetBitmapEx( const Point& rSrcPt, const Size& rSize ) const { + if (!mpAlphaVDev) + return BitmapEx(GetBitmap(rSrcPt, rSize)); // #110958# Extract alpha value from VDev, if any - if( mpAlphaVDev ) - { - Bitmap aAlphaBitmap( mpAlphaVDev->GetBitmap( rSrcPt, rSize ) ); + Bitmap aAlphaBitmap(mpAlphaVDev->GetBitmap(rSrcPt, rSize)); - // ensure 8 bit alpha - if (aAlphaBitmap.getPixelFormat() > vcl::PixelFormat::N8_BPP) - aAlphaBitmap.Convert( BmpConversion::N8BitNoConversion ); + if (aAlphaBitmap.getPixelFormat() > vcl::PixelFormat::N8_BPP) + aAlphaBitmap.Convert(BmpConversion::N8BitNoConversion); - return BitmapEx(GetBitmap( rSrcPt, rSize ), AlphaMask( aAlphaBitmap ) ); - } - - return BitmapEx(GetBitmap( rSrcPt, rSize )); + return BitmapEx(GetBitmap(rSrcPt, rSize), AlphaMask(aAlphaBitmap)); } void OutputDevice::DrawDeviceBitmapEx( const Point& rDestPt, const Size& rDestSize, @@ -172,34 +170,39 @@ void OutputDevice::DrawDeviceBitmapEx( const Point& rDestPt, const Size& rDestSi if (rBitmapEx.IsAlpha()) { - DrawDeviceAlphaBitmap(rBitmapEx.GetBitmap(), rBitmapEx.GetAlphaMask(), rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel); + DrawDeviceAlphaBitmap(rBitmapEx.GetBitmap(), rBitmapEx.GetAlphaMask(), + rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel); + return; } - else if (!rBitmapEx.IsEmpty()) + + if (rBitmapEx.IsEmpty()) + return; + + SalTwoRect aPosAry(rSrcPtPixel.X(), rSrcPtPixel.Y(), rSrcSizePixel.Width(), + rSrcSizePixel.Height(), ImplLogicXToDevicePixel(rDestPt.X()), + ImplLogicYToDevicePixel(rDestPt.Y()), + ImplLogicWidthToDevicePixel(rDestSize.Width()), + ImplLogicHeightToDevicePixel(rDestSize.Height())); + + const BmpMirrorFlags nMirrFlags = AdjustTwoRect(aPosAry, rBitmapEx.GetSizePixel()); + + if (!(aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight)) + return; + + if (nMirrFlags != BmpMirrorFlags::NONE) + rBitmapEx.Mirror(nMirrFlags); + + const SalBitmap* pSalSrcBmp = rBitmapEx.ImplGetBitmapSalBitmap().get(); + + assert(!rBitmapEx.maAlphaMask.GetBitmap().ImplGetSalBitmap() + && "I removed some code here that will need to be restored"); + + mpGraphics->DrawBitmap(aPosAry, *pSalSrcBmp, *this); + + if (mpAlphaVDev) { - SalTwoRect aPosAry(rSrcPtPixel.X(), rSrcPtPixel.Y(), rSrcSizePixel.Width(), rSrcSizePixel.Height(), - ImplLogicXToDevicePixel(rDestPt.X()), ImplLogicYToDevicePixel(rDestPt.Y()), - ImplLogicWidthToDevicePixel(rDestSize.Width()), - ImplLogicHeightToDevicePixel(rDestSize.Height())); - - const BmpMirrorFlags nMirrFlags = AdjustTwoRect(aPosAry, rBitmapEx.GetSizePixel()); - - if (aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight) - { - - if (nMirrFlags != BmpMirrorFlags::NONE) - rBitmapEx.Mirror(nMirrFlags); - - const SalBitmap* pSalSrcBmp = rBitmapEx.ImplGetBitmapSalBitmap().get(); - assert(!rBitmapEx.maAlphaMask.GetBitmap().ImplGetSalBitmap() && "I removed some code here that will need to be restored"); - - mpGraphics->DrawBitmap(aPosAry, *pSalSrcBmp, *this); - - if (mpAlphaVDev) - { - // #i32109#: Make bitmap area opaque - mpAlphaVDev->ImplFillOpaqueRectangle( tools::Rectangle(rDestPt, rDestSize) ); - } - } + // #i32109#: Make bitmap area opaque + mpAlphaVDev->ImplFillOpaqueRectangle(tools::Rectangle(rDestPt, rDestSize)); } } diff --git a/vcl/source/pdf/EncryptionHashTransporter.cxx b/vcl/source/pdf/EncryptionHashTransporter.cxx index 6ecd43396c3a..057925d57836 100644 --- a/vcl/source/pdf/EncryptionHashTransporter.cxx +++ b/vcl/source/pdf/EncryptionHashTransporter.cxx @@ -16,40 +16,19 @@ namespace vcl::pdf { EncryptionHashTransporter::EncryptionHashTransporter() : m_pDigest(new ::comphelper::Hash(::comphelper::HashType::MD5)) + , maID(reinterpret_cast(this)) { - maID = reinterpret_cast(this); - while (sTransporters.find(maID) != sTransporters.end()) // paranoia mode - maID++; - sTransporters[maID] = this; } -EncryptionHashTransporter::~EncryptionHashTransporter() -{ - sTransporters.erase(maID); - SAL_INFO("vcl", "EncryptionHashTransporter freed"); -} +EncryptionHashTransporter::~EncryptionHashTransporter() {} EncryptionHashTransporter* EncryptionHashTransporter::getEncHashTransporter( const uno::Reference& xReference) { - EncryptionHashTransporter* pResult = nullptr; - if (xReference.is()) - { - uno::Any aMat(xReference->getMaterial()); - sal_Int64 nMat = 0; - if (aMat >>= nMat) - { - std::map::iterator it - = sTransporters.find(static_cast(nMat)); - if (it != sTransporters.end()) - pResult = it->second; - } - } + EncryptionHashTransporter* pResult = dynamic_cast(xReference.get()); return pResult; } -std::map EncryptionHashTransporter::sTransporters; - } // end vcl::pdf /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/pdf/PDFEncryptor.cxx b/vcl/source/pdf/PDFEncryptor.cxx index 16b88ec160b0..d97e671247de 100644 --- a/vcl/source/pdf/PDFEncryptor.cxx +++ b/vcl/source/pdf/PDFEncryptor.cxx @@ -364,13 +364,15 @@ bool PDFEncryptor::prepareEncryption( = EncryptionHashTransporter::getEncHashTransporter(xEncryptionMaterialHolder); if (pTransporter) { - sal_Int32 nKeyLength = 0, nRC4KeyLength = 0; + sal_Int32 nKeyLength = 0; + sal_Int32 nRC4KeyLength = 0; sal_Int32 nAccessPermissions = computeAccessPermissions(rProperties, nKeyLength, nRC4KeyLength); rProperties.OValue = pTransporter->getOValue(); bSuccess = computeUDictionaryValue(pTransporter, rProperties, nKeyLength, nAccessPermissions); } + if (!bSuccess) { rProperties.OValue.clear(); diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 9b00d9cb23bf..12c4490aa9df 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -17,9 +17,14 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include +#include +#include + #include #include +#include #include #include #include @@ -161,7 +166,7 @@ Menu::Menu() : mpFirstDel(nullptr), pItemList(new MenuItemList), pStartedFrom(nullptr), - pWindow(nullptr), + m_pWindow(nullptr), nTitleHeight(0), nEventId(nullptr), mnHighlightedItemPos(ITEMPOS_INVALID), @@ -184,23 +189,10 @@ void Menu::dispose() { ImplCallEventListeners( VclEventId::ObjectDying, ITEMPOS_INVALID ); - // at the window free the reference to the accessible component - // and make sure the MenuFloatingWindow knows about our destruction - if ( pWindow ) - { - MenuFloatingWindow* pFloat = static_cast(pWindow.get()); - if( pFloat->pMenu.get() == this ) - pFloat->pMenu.clear(); - pWindow->SetAccessible( css::uno::Reference< css::accessibility::XAccessible >() ); - } + m_pWindow.disposeAndClear(); // dispose accessible components - if ( mxAccessible.is() ) - { - css::uno::Reference< css::lang::XComponent> xComponent( mxAccessible, css::uno::UNO_QUERY ); - if ( xComponent.is() ) - xComponent->dispose(); - } + comphelper::disposeComponent(mxAccessible); if ( nEventId ) Application::RemoveUserEvent( nEventId ); @@ -233,7 +225,7 @@ void Menu::dispose() mpSalMenu.reset(); pStartedFrom.clear(); - pWindow.clear(); + m_pWindow.clear(); VclReferenceBase::dispose(); } @@ -445,7 +437,7 @@ void Menu::InsertItem(sal_uInt16 nItemId, const OUString& rStr, MenuItemBits nIt // put Item in MenuItemList NbcInsertItem(nItemId, nItemBits, rStr, this, nPos, rIdent); - vcl::Window* pWin = ImplGetWindow(); + vcl::Window* pWin = GetWindow(); mpLayoutData.reset(); if ( pWin ) { @@ -509,7 +501,7 @@ void Menu::RemoveItem( sal_uInt16 nPos ) bRemove = true; } - vcl::Window* pWin = ImplGetWindow(); + vcl::Window* pWin = GetWindow(); if ( pWin ) { ImplCalcSize( pWin ); @@ -939,7 +931,7 @@ void Menu::EnableItem( sal_uInt16 nItemId, bool bEnable ) pItemData->bEnabled = bEnable; - vcl::Window* pWin = ImplGetWindow(); + vcl::Window* pWin = GetWindow(); if ( pWin && pWin->IsVisible() ) { SAL_WARN_IF(!IsMenuBar(), "vcl", "Menu::EnableItem - Popup visible!" ); @@ -983,7 +975,7 @@ void Menu::ShowItem( sal_uInt16 nItemId, bool bVisible ) if (IsMenuBar() || !pData || (pData->bVisible == bVisible)) return; - vcl::Window* pWin = ImplGetWindow(); + vcl::Window* pWin = GetWindow(); if ( pWin && pWin->IsVisible() ) { SAL_WARN( "vcl", "Menu::ShowItem - ignored for visible popups!" ); @@ -1015,7 +1007,7 @@ void Menu::SetItemText( sal_uInt16 nItemId, const OUString& rStr ) if( ImplGetSalMenu() && pData->pSalMenuItem ) ImplGetSalMenu()->SetItemText( nPos, pData->pSalMenuItem.get(), rStr ); - vcl::Window* pWin = ImplGetWindow(); + vcl::Window* pWin = GetWindow(); mpLayoutData.reset(); if (pWin && IsMenuBar()) { @@ -1302,7 +1294,7 @@ bool Menu::IsItemPosVisible( sal_uInt16 nItemPos ) const bool Menu::IsMenuVisible() const { - return pWindow && pWindow->IsReallyVisible(); + return m_pWindow && m_pWindow->IsReallyVisible(); } bool Menu::ImplIsSelectable( sal_uInt16 nPos ) const @@ -1317,6 +1309,17 @@ bool Menu::ImplIsSelectable( sal_uInt16 nPos ) const return bSelectable; } +css::uno::Reference Menu::CreateAccessible() +{ + rtl::Reference xAccessible; + if (IsMenuBar()) + xAccessible = new VCLXAccessibleMenuBar(this); + else + xAccessible = new VCLXAccessiblePopupMenu(this); + xAccessible->SetStates(); + return xAccessible; +} + css::uno::Reference Menu::GetAccessible() { // Since PopupMenu are sometimes shared by different instances of MenuBar, the mxAccessible member gets @@ -1340,11 +1343,7 @@ css::uno::Reference Menu::GetAccessible() } } else if ( !mxAccessible.is() ) - { - UnoWrapperBase* pWrapper = UnoWrapperBase::GetUnoWrapper(); - if ( pWrapper ) - mxAccessible = pWrapper->CreateAccessible(this, IsMenuBar()); - } + mxAccessible = CreateAccessible(); return mxAccessible; } @@ -1629,20 +1628,20 @@ Size Menu::ImplCalcSize( vcl::Window* pWin ) aSz.setHeight( nFontHeight+6 ); // get menubar height from native methods if supported - if( pWindow->IsNativeControlSupported( ControlType::Menubar, ControlPart::Entire ) ) + if (m_pWindow->IsNativeControlSupported(ControlType::Menubar, ControlPart::Entire)) { ImplControlValue aVal; tools::Rectangle aNativeBounds; tools::Rectangle aNativeContent; Point tmp( 0, 0 ); tools::Rectangle aCtrlRegion( tmp, Size( 100, 15 ) ); - if( pWindow->GetNativeControlRegion( ControlType::Menubar, - ControlPart::Entire, - aCtrlRegion, - ControlState::ENABLED, - aVal, - aNativeBounds, - aNativeContent ) + if (m_pWindow->GetNativeControlRegion(ControlType::Menubar, + ControlPart::Entire, + aCtrlRegion, + ControlState::ENABLED, + aVal, + aNativeBounds, + aNativeContent) ) { int nNativeHeight = aNativeBounds.GetHeight(); @@ -1653,7 +1652,7 @@ Size Menu::ImplCalcSize( vcl::Window* pWin ) // account for the size of the close button, which actually is a toolbox // due to NWF this is variable - tools::Long nCloseButtonHeight = static_cast(pWindow.get())->MinCloseButtonSize().Height(); + tools::Long nCloseButtonHeight = static_cast(m_pWindow.get())->MinCloseButtonSize().Height(); if (aSz.Height() < nCloseButtonHeight) aSz.setHeight( nCloseButtonHeight ); } @@ -1819,7 +1818,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, Size const & rSize, // contained. The application itself should check for this! // Otherwise it could happen entries are disabled due to // asynchronous loading - if (!pData->bEnabled || !pWindow->IsEnabled()) + if (!pData->bEnabled || !m_pWindow->IsEnabled()) { nTextStyle |= DrawTextFlags::Disable; nSymbolStyle |= DrawSymbolFlags::Disable; @@ -1833,7 +1832,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, Size const & rSize, if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::Separator)) { ControlState nState = ControlState::NONE; - if (pData->bEnabled && pWindow->IsEnabled()) + if (pData->bEnabled && m_pWindow->IsEnabled()) nState |= ControlState::ENABLED; if (bHighlighted) nState |= ControlState::SELECTED; @@ -1885,7 +1884,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, Size const & rSize, if (pData->bChecked) nState |= ControlState::PRESSED; - if (pData->bEnabled && pWindow->IsEnabled()) + if (pData->bEnabled && m_pWindow->IsEnabled()) nState |= ControlState::ENABLED; if (bHighlighted) @@ -1905,7 +1904,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, Size const & rSize, } else if (pData->bChecked) // by default do nothing for unchecked items { - ImplPaintCheckBackground(rRenderContext, *pWindow, aOuterCheckRect, pThisItemOnly && bHighlighted); + ImplPaintCheckBackground(rRenderContext, *m_pWindow, aOuterCheckRect, pThisItemOnly && bHighlighted); SymbolType eSymbol; Size aSymbolSize; @@ -1932,7 +1931,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, Size const & rSize, { // Don't render an image for a check thing if (pData->bChecked) - ImplPaintCheckBackground(rRenderContext, *pWindow, aOuterCheckRect, pThisItemOnly && bHighlighted); + ImplPaintCheckBackground(rRenderContext, *m_pWindow, aOuterCheckRect, pThisItemOnly && bHighlighted); Image aImage = pData->aImage; @@ -1953,7 +1952,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, Size const & rSize, const Menu *pMenu = this; while (!pMenu->IsMenuBar() && pMenu->pStartedFrom) pMenu = pMenu->pStartedFrom; - if (!pMenu->IsMenuBar() || !static_cast(pMenu->pWindow.get())->GetMBWHideAccel()) + if (!pMenu->IsMenuBar() || !static_cast(pMenu->m_pWindow.get())->GetMBWHideAccel()) nStyle |= DrawTextFlags::Mnemonic; if (pData->bIsTemporary) @@ -2048,7 +2047,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, Size const & rSize, aSpacing = nOuterSpaceX; } - if (pData->bEnabled && pWindow->IsEnabled()) + if (pData->bEnabled && m_pWindow->IsEnabled()) nState |= ControlState::ENABLED; if (bHighlighted) nState |= ControlState::SELECTED; @@ -2238,18 +2237,18 @@ void Menu::ImplKillLayoutData() const void Menu::ImplFillLayoutData() const { - if (!(pWindow && pWindow->IsReallyVisible())) + if (!(m_pWindow && m_pWindow->IsReallyVisible())) return; mpLayoutData.reset(new MenuLayoutData); if (IsMenuBar()) { - ImplPaint(*pWindow->GetOutDev(), pWindow->GetOutputSizePixel(), 0, 0, nullptr, false, true); // FIXME + ImplPaint(*m_pWindow->GetOutDev(), m_pWindow->GetOutputSizePixel(), 0, 0, nullptr, false, true); // FIXME } else { - MenuFloatingWindow* pFloat = static_cast(pWindow.get()); - ImplPaint(*pWindow->GetOutDev(), pWindow->GetOutputSizePixel(), pFloat->nScrollerHeight, pFloat->ImplGetStartY(), + MenuFloatingWindow* pFloat = static_cast(m_pWindow.get()); + ImplPaint(*m_pWindow->GetOutDev(), m_pWindow->GetOutputSizePixel(), pFloat->nScrollerHeight, pFloat->ImplGetStartY(), nullptr, false, true); //FIXME } } @@ -2351,12 +2350,11 @@ OUString Menu::GetAccessibleDescription( sal_uInt16 nItemId ) const return GetHelpText(nItemId); } -void Menu::GetSystemMenuData( SystemMenuData* pData ) const +void Menu::GetSystemMenuData(SystemMenuData& rData) const { - Menu* pMenu = const_cast(this); - if( pData && pMenu->ImplGetSalMenu() ) + if (ImplGetSalMenu()) { - pMenu->ImplGetSalMenu()->GetSystemMenuData( pData ); + ImplGetSalMenu()->GetSystemMenuData(rData); } } @@ -2364,12 +2362,12 @@ bool Menu::IsHighlighted( sal_uInt16 nItemPos ) const { bool bRet = false; - if( pWindow ) + if (m_pWindow) { if (IsMenuBar()) - bRet = ( nItemPos == static_cast< MenuBarWindow * > (pWindow.get())->GetHighlightedItem() ); + bRet = ( nItemPos == static_cast< MenuBarWindow * > (m_pWindow.get())->GetHighlightedItem() ); else - bRet = ( nItemPos == static_cast< MenuFloatingWindow * > (pWindow.get())->GetHighlightedItem() ); + bRet = ( nItemPos == static_cast< MenuFloatingWindow * > (m_pWindow.get())->GetHighlightedItem() ); } return bRet; @@ -2377,18 +2375,18 @@ bool Menu::IsHighlighted( sal_uInt16 nItemPos ) const void Menu::HighlightItem( sal_uInt16 nItemPos ) { - if ( !pWindow ) + if ( !m_pWindow ) return; if (IsMenuBar()) { - MenuBarWindow* pMenuWin = static_cast< MenuBarWindow* >( pWindow.get() ); + MenuBarWindow* pMenuWin = static_cast< MenuBarWindow* >( m_pWindow.get() ); pMenuWin->SetAutoPopup( false ); pMenuWin->ChangeHighlightItem( nItemPos, false ); } else { - static_cast< MenuFloatingWindow* >( pWindow.get() )->ChangeHighlightItem( nItemPos, false ); + static_cast< MenuFloatingWindow* >( m_pWindow.get() )->ChangeHighlightItem( nItemPos, false ); } } @@ -2396,9 +2394,9 @@ MenuBarWindow* MenuBar::getMenuBarWindow() { // so far just a dynamic_cast, hopefully to be turned into something saner // at some stage - MenuBarWindow *pWin = dynamic_cast(pWindow.get()); + MenuBarWindow *pWin = dynamic_cast(m_pWindow.get()); //either there is no window (fdo#87663) or it is a MenuBarWindow - assert(!pWindow || pWin); + assert(!m_pWindow || pWin); return pWin; } @@ -2432,17 +2430,17 @@ void MenuBar::dispose() Menu::dispose(); } -void MenuBar::ClosePopup(Menu *pMenu) +void MenuBar::ClosePopup(PopupMenu *pPopupMenu) { MenuBarWindow* pMenuWin = getMenuBarWindow(); if (!pMenuWin) return; - pMenuWin->PopupClosed(pMenu); + pMenuWin->PopupClosed(pPopupMenu); } void MenuBar::MenuBarKeyInput(const KeyEvent& rEvent) { - pWindow->KeyInput(rEvent); + m_pWindow->KeyInput(rEvent); } void MenuBar::ShowCloseButton(bool bShow) @@ -2484,18 +2482,18 @@ void MenuBar::SetDisplayable( bool bDisplayable ) } } -VclPtr MenuBar::ImplCreate(vcl::Window* pParent, vcl::Window* pWindow, MenuBar* pMenu) +VclPtr MenuBar::ImplCreate(vcl::Window* pParent, MenuBarWindow* pWindow, MenuBar* pMenu) { - VclPtr pMenuBarWindow = dynamic_cast(pWindow); + VclPtr pMenuBarWindow = pWindow; if (!pMenuBarWindow) { - pWindow = pMenuBarWindow = VclPtr::Create( pParent ); + pMenuBarWindow = VclPtr::Create(pParent); } pMenu->pStartedFrom = nullptr; - pMenu->pWindow = pWindow; + pMenu->m_pWindow = pMenuBarWindow; pMenuBarWindow->SetMenu(pMenu); - tools::Long nHeight = pWindow ? pMenu->ImplCalcSize(pWindow).Height() : 0; + tools::Long nHeight = pMenu->ImplCalcSize(pMenuBarWindow).Height(); // depending on the native implementation or the displayable flag // the menubar windows is suppressed (ie, height=0) @@ -2505,20 +2503,18 @@ VclPtr MenuBar::ImplCreate(vcl::Window* pParent, vcl::Window* pWind } pMenuBarWindow->SetHeight(nHeight); - return pWindow; + return pMenuBarWindow; } void MenuBar::ImplDestroy( MenuBar* pMenu, bool bDelete ) { - vcl::Window *pWindow = pMenu->ImplGetWindow(); - if (pWindow && bDelete) + MenuBarWindow* pMenuWin = pMenu->getMenuBarWindow(); + if (pMenuWin && bDelete) { - MenuBarWindow* pMenuWin = pMenu->getMenuBarWindow(); - if (pMenuWin) - pMenuWin->KillActivePopup(); - pWindow->disposeOnce(); + pMenuWin->KillActivePopup(); + pMenuWin->disposeOnce(); } - pMenu->pWindow = nullptr; + pMenu->m_pWindow = nullptr; if (pMenu->mpSalMenu) { pMenu->mpSalMenu->ShowMenuBar(false); } @@ -2545,7 +2541,7 @@ bool MenuBar::ImplHandleKeyEvent( const KeyEvent& rKEvent ) bool bDone = false; // check for enabled, if this method is called from another window... - vcl::Window* pWin = ImplGetWindow(); + vcl::Window* pWin = GetWindow(); if (pWin && pWin->IsEnabled() && pWin->IsInputEnabled() && !pWin->IsInModalMode()) { MenuBarWindow* pMenuWin = getMenuBarWindow(); @@ -2562,7 +2558,7 @@ bool MenuBar::ImplHandleCmdEvent( const CommandEvent& rCEvent ) return false; // check for enabled, if this method is called from another window... - MenuBarWindow* pWin = static_cast(ImplGetWindow()); + MenuBarWindow* pWin = static_cast(GetWindow()); if ( pWin && pWin->IsEnabled() && pWin->IsInputEnabled() && ! pWin->IsInModalMode() ) { if (rCEvent.GetCommand() == CommandEventId::ModKeyChange && ImplGetSVData()->maNWFData.mbAutoAccel) @@ -2582,10 +2578,10 @@ bool MenuBar::ImplHandleCmdEvent( const CommandEvent& rCEvent ) void MenuBar::SelectItem(sal_uInt16 nId) { - if (!pWindow) + if (!m_pWindow) return; - pWindow->GrabFocus(); + m_pWindow->GrabFocus(); nId = GetItemPos( nId ); MenuBarWindow* pMenuWin = getMenuBarWindow(); @@ -2725,10 +2721,8 @@ int MenuBar::GetMenuBarHeight() const return nMenubarHeight; } -// bool PopupMenu::bAnyPopupInExecute = false; - MenuFloatingWindow * PopupMenu::ImplGetFloatingWindow() const { - return static_cast(Menu::ImplGetWindow()); + return static_cast(GetWindow()); } PopupMenu::PopupMenu() @@ -2747,12 +2741,11 @@ PopupMenu::~PopupMenu() disposeOnce(); } -void PopupMenu::ClosePopup(Menu* pMenu) +void PopupMenu::ClosePopup(PopupMenu* pPopupMenu) { - MenuFloatingWindow* p = dynamic_cast(ImplGetWindow()); - PopupMenu *pPopup = dynamic_cast(pMenu); - if (p && pPopup) - p->KillActivePopup(pPopup); + MenuFloatingWindow* p = ImplGetFloatingWindow(); + if (p && pPopupMenu && p->GetActivePopup() == pPopupMenu) + p->KillActivePopup(); } namespace vcl @@ -2771,13 +2764,13 @@ PopupMenu* PopupMenu::GetActivePopupMenu() void PopupMenu::EndExecute() { - if ( ImplGetWindow() ) + if (GetWindow()) ImplGetFloatingWindow()->EndExecute( 0 ); } void PopupMenu::SelectItem(sal_uInt16 nId) { - if ( !ImplGetWindow() ) + if (!GetWindow()) return; if( nId != ITEMPOS_INVALID ) @@ -2854,14 +2847,16 @@ void PopupMenu::ImplFlushPendingSelect() } } -bool PopupMenu::PrepareRun(const VclPtr& pParentWin, tools::Rectangle& rRect, - FloatWinPopupFlags& nPopupModeFlags, Menu* pSFrom, - bool& bRealExecute, VclPtr& pWin) +sal_uInt16 PopupMenu::ImplExecute(const VclPtr& pParentWin, const tools::Rectangle& rRect, + FloatWinPopupFlags nPopupModeFlags, Menu* pSFrom, bool bPreSelectFirst) { - bRealExecute = false; + // tdf#126054 hold this until after function completes + VclPtr xThis(this); + + bool bRealExecute = false; const sal_uInt16 nItemCount = GetItemCount(); if (!pSFrom && (vcl::IsInPopupMenuExecute() || !nItemCount)) - return false; + return 0; mpLayoutData.reset(); @@ -2887,8 +2882,8 @@ bool PopupMenu::PrepareRun(const VclPtr& pParentWin, tools::Rectang | FloatWinPopupEndFlags::CloseAll); } - SAL_WARN_IF( ImplGetWindow(), "vcl", "Win?!" ); - rRect.SetPos(pParentWin->OutputToScreenPixel(rRect.TopLeft())); + tools::Rectangle aRect(rRect); + aRect.SetPos(pParentWin->OutputToScreenPixel(aRect.TopLeft())); nPopupModeFlags |= FloatWinPopupFlags::NoKeyClose | FloatWinPopupFlags::AllMouseButtonClose | FloatWinPopupFlags::GrabFocus; if (bRealExecute) @@ -2902,13 +2897,13 @@ bool PopupMenu::PrepareRun(const VclPtr& pParentWin, tools::Rectang SetMenuFlags(nMenuFlagsSaved); if (pParentWin->isDisposed()) - return false; + return 0; if ( bCanceled || bKilled ) - return false; + return 0; if (!nItemCount) - return false; + return 0; // The flag MenuFlags::HideDisabledEntries is inherited. if ( pSFrom ) @@ -2935,7 +2930,7 @@ bool PopupMenu::PrepareRun(const VclPtr& pParentWin, tools::Rectang ImplCallEventListeners(VclEventId::MenuSubmenuChanged, nPos); } - pWin = VclPtrInstance(this, pParentWin, WB_BORDER | WB_SYSTEMWINDOW); + VclPtr pWin = VclPtrInstance(this, pParentWin, WB_BORDER | WB_SYSTEMWINDOW); if (comphelper::LibreOfficeKit::isActive() && get_id() == "editviewspellmenu") { VclPtr xNotifierParent = pParentWin->GetParentWithLOKNotifier(); @@ -2947,19 +2942,21 @@ bool PopupMenu::PrepareRun(const VclPtr& pParentWin, tools::Rectang pWin->SetBorderStyle( WindowBorderStyle::NOBORDER ); else pWin->SetBorderStyle( pWin->GetBorderStyle() | WindowBorderStyle::MENU ); - pWindow = pWin; + + m_pWindow.disposeAndClear(); + m_pWindow = pWin; Size aSz = ImplCalcSize( pWin ); AbsoluteScreenPixelRectangle aDesktopRect(pWin->GetDesktopRectPixel()); if( Application::GetScreenCount() > 1 ) { - vcl::Window* pDeskW = pWindow->GetWindow( GetWindowType::RealParent ); + vcl::Window* pDeskW = m_pWindow->GetWindow( GetWindowType::RealParent ); if( ! pDeskW ) - pDeskW = pWindow; - AbsoluteScreenPixelPoint aDesktopTL(pDeskW->OutputToAbsoluteScreenPixel(rRect.TopLeft())); + pDeskW = m_pWindow; + AbsoluteScreenPixelPoint aDesktopTL(pDeskW->OutputToAbsoluteScreenPixel(aRect.TopLeft())); aDesktopRect = Application::GetScreenPosSizePixel( - Application::GetBestScreen(AbsoluteScreenPixelRectangle(aDesktopTL, rRect.GetSize()))); + Application::GetBestScreen(AbsoluteScreenPixelRectangle(aDesktopTL, aRect.GetSize()))); } tools::Long nMaxHeight = aDesktopRect.GetHeight(); @@ -2974,8 +2971,8 @@ bool PopupMenu::PrepareRun(const VclPtr& pParentWin, tools::Rectang if ( pRef->GetParent() ) pRef = pRef->GetParent(); - AbsoluteScreenPixelRectangle devRect(pRef->OutputToAbsoluteScreenPixel(rRect.TopLeft()), - pRef->OutputToAbsoluteScreenPixel(rRect.BottomRight())); + AbsoluteScreenPixelRectangle devRect(pRef->OutputToAbsoluteScreenPixel(aRect.TopLeft()), + pRef->OutputToAbsoluteScreenPixel(aRect.BottomRight())); tools::Long nHeightAbove = devRect.Top() - aDesktopRect.Top(); tools::Long nHeightBelow = aDesktopRect.Bottom() - devRect.Bottom(); @@ -2992,7 +2989,7 @@ bool PopupMenu::PrepareRun(const VclPtr& pParentWin, tools::Rectang if (pStartedFrom && pStartedFrom->IsMenuBar()) nMaxHeight -= pParentWin->GetSizePixel().Height(); sal_Int32 nLeft, nTop, nRight, nBottom; - pWindow->GetBorder( nLeft, nTop, nRight, nBottom ); + m_pWindow->GetBorder( nLeft, nTop, nRight, nBottom ); nMaxHeight -= nTop+nBottom; if ( aSz.Height() > nMaxHeight ) { @@ -3004,7 +3001,10 @@ bool PopupMenu::PrepareRun(const VclPtr& pParentWin, tools::Rectang pWin->SetFocusId( xFocusId ); pWin->SetOutputSizePixel( aSz ); - return true; + + const bool bNative = Run(pWin, bRealExecute, bPreSelectFirst, nPopupModeFlags, pSFrom, aRect); + FinishRun(pWin, pParentWin, bRealExecute, bNative); + return nSelectedId; } bool PopupMenu::Run(const VclPtr& pWin, const bool bRealExecute, const bool bPreSelectFirst, @@ -3019,9 +3019,9 @@ bool PopupMenu::Run(const VclPtr& pWin, const bool bRealExec { sal_uInt16 aPos; if (pSFrom->IsMenuBar()) - aPos = static_cast(pSFrom->pWindow.get())->GetHighlightedItem(); + aPos = static_cast(pSFrom->m_pWindow.get())->GetHighlightedItem(); else - aPos = static_cast(pSFrom->pWindow.get())->GetHighlightedItem(); + aPos = static_cast(pSFrom->m_pWindow.get())->GetHighlightedItem(); pWin->SetPosInParent(aPos); // store position to be sent in SUBMENUDEACTIVATE pSFrom->ImplCallEventListeners(VclEventId::MenuSubmenuActivate, aPos); @@ -3077,26 +3077,10 @@ void PopupMenu::FinishRun(const VclPtr& pWin, const VclPtrStopExecute(); pWin->doShutdown(); - pWindow.disposeAndClear(); ImplClosePopupToolBox(pParentWin); ImplFlushPendingSelect(); } -sal_uInt16 PopupMenu::ImplExecute(const VclPtr& pParentWin, const tools::Rectangle& rRect, - FloatWinPopupFlags nPopupModeFlags, Menu* pSFrom, bool bPreSelectFirst) -{ - // tdf#126054 hold this until after function completes - VclPtr xThis(this); - bool bRealExecute = false; - tools::Rectangle aRect(rRect); - VclPtr pWin; - if (!PrepareRun(pParentWin, aRect, nPopupModeFlags, pSFrom, bRealExecute, pWin)) - return 0; - const bool bNative = Run(pWin, bRealExecute, bPreSelectFirst, nPopupModeFlags, pSFrom, aRect); - FinishRun(pWin, pParentWin, bRealExecute, bNative); - return nSelectedId; -} - sal_uInt16 PopupMenu::ImplCalcVisEntries( tools::Long nMaxHeight, sal_uInt16 nStartEntry, sal_uInt16* pLastVisible ) const { nMaxHeight -= 2 * ImplGetFloatingWindow()->GetScrollerHeight(); diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx index 9062e9952d9e..a4eb0f74952a 100644 --- a/vcl/source/window/menubarwindow.cxx +++ b/vcl/source/window/menubarwindow.cxx @@ -350,9 +350,9 @@ void MenuBarWindow::KillActivePopup() if ( !m_pActivePopup ) return; - if( m_pActivePopup->pWindow ) - if( static_cast(m_pActivePopup->pWindow.get())->IsInCleanUp() ) - return; // kill it later + FloatingWindow* pFloatWin = m_pActivePopup->ImplGetFloatingWindow(); + if (pFloatWin && pFloatWin->IsInCleanUp()) + return; // kill it later if ( m_pActivePopup->bInCallback ) m_pActivePopup->bCanceled = true; @@ -361,7 +361,7 @@ void MenuBarWindow::KillActivePopup() m_pActivePopup->Deactivate(); m_pActivePopup->bInCallback = false; // check for pActivePopup, if stopped by deactivate... - if ( m_pActivePopup->ImplGetWindow() ) + if (m_pActivePopup->GetWindow()) { if (mpParentPopup) { @@ -375,7 +375,7 @@ void MenuBarWindow::KillActivePopup() } m_pActivePopup->ImplGetFloatingWindow()->StopExecute(); m_pActivePopup->ImplGetFloatingWindow()->doShutdown(); - m_pActivePopup->pWindow.disposeAndClear(); + m_pActivePopup->m_pWindow.disposeAndClear(); } m_pActivePopup = nullptr; } @@ -470,7 +470,7 @@ void MenuBarWindow::ChangeHighlightItem( sal_uInt16 n, bool bSelectEntry, bool b // #57934# close active popup if applicable, as TH's background storage works. MenuItemData* pNextData = m_pMenu->pItemList->GetDataFromPos( n ); - if ( m_pActivePopup && m_pActivePopup->ImplGetWindow() && ( !pNextData || ( m_pActivePopup != pNextData->pSubMenu ) ) ) + if (m_pActivePopup && m_pActivePopup->GetWindow() && (!pNextData || (m_pActivePopup != pNextData->pSubMenu))) KillActivePopup(); // pActivePopup when applicable without pWin, if Rescheduled in Activate() // activate menubar only ones per cycle... diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx index 7de7a5801282..d49469a7ab2c 100644 --- a/vcl/source/window/menufloatingwindow.cxx +++ b/vcl/source/window/menufloatingwindow.cxx @@ -29,7 +29,7 @@ #include #include -MenuFloatingWindow::MenuFloatingWindow( Menu* pMen, vcl::Window* pParent, WinBits nStyle ) : +MenuFloatingWindow::MenuFloatingWindow(PopupMenu* pMen, vcl::Window* pParent, WinBits nStyle ) : FloatingWindow( pParent, nStyle ), pMenu(pMen), aHighlightChangedTimer("vcl::MenuFloatingWindow aHighlightChangedTimer"), @@ -85,7 +85,7 @@ void MenuFloatingWindow::doShutdown() } if( i < nCount ) { - MenuFloatingWindow* pPWin = static_cast(pMenu->pStartedFrom->ImplGetWindow()); + MenuFloatingWindow* pPWin = static_cast(pMenu->pStartedFrom->GetWindow()); if (pPWin) pPWin->InvalidateItem(i); } @@ -125,6 +125,11 @@ void MenuFloatingWindow::dispose() pMenu.clear(); pActivePopup.clear(); xSaveFocusId.clear(); + + // unset accessible taken from the PopupMenu (s. CreateAccessible), + // it is owned and therefore disposed by the PopupMenu + SetAccessible(nullptr); + FloatingWindow::dispose(); } @@ -375,7 +380,7 @@ IMPL_LINK( MenuFloatingWindow, HighlightChanged, Timer*, pTimer, void ) SetPopupModeFlags( nOldFlags ); // nRet != 0, if it was stopped during Activate()... - if ( !nRet && ( pActivePopup == pTest ) && pActivePopup->ImplGetWindow() ) + if ( !nRet && ( pActivePopup == pTest ) && pActivePopup->GetWindow() ) pActivePopup->ImplGetFloatingWindow()->AddPopupModeWindow( this ); } @@ -451,7 +456,7 @@ void MenuFloatingWindow::Execute() { ImplSVData* pSVData = ImplGetSVData(); - pSVData->maAppData.mpActivePopupMenu = static_cast(pMenu.get()); + pSVData->maAppData.mpActivePopupMenu = pMenu.get(); Start(); @@ -477,14 +482,16 @@ void MenuFloatingWindow::StopExecute() pMenu->pStartedFrom->ImplCallEventListeners( VclEventId::MenuSubmenuDeactivate, nPosInParent ); } -void MenuFloatingWindow::KillActivePopup( PopupMenu* pThisOnly ) +void MenuFloatingWindow::KillActivePopup() { - if ( !pActivePopup || ( pThisOnly && ( pThisOnly != pActivePopup ) ) ) + if (!pActivePopup) return; - if( pActivePopup->pWindow ) - if( static_cast(pActivePopup->pWindow.get())->IsInCleanUp() ) + if (MenuFloatingWindow* pFloatWin = pActivePopup->ImplGetFloatingWindow()) + { + if (pFloatWin->IsInCleanUp()) return; // kill it later + } if ( pActivePopup->bInCallback ) pActivePopup->bCanceled = true; @@ -495,11 +502,11 @@ void MenuFloatingWindow::KillActivePopup( PopupMenu* pThisOnly ) pPopup->bInCallback = true; pPopup->Deactivate(); pPopup->bInCallback = false; - if ( pPopup->ImplGetWindow() ) + if (pPopup->GetWindow()) { pPopup->ImplGetFloatingWindow()->StopExecute(); pPopup->ImplGetFloatingWindow()->doShutdown(); - pPopup->pWindow.disposeAndClear(); + pPopup->m_pWindow.disposeAndClear(); PaintImmediately(); } @@ -679,7 +686,7 @@ void MenuFloatingWindow::ImplScroll( bool bUp ) tools::Long nHeight = GetOutputSizePixel().Height(); sal_uInt16 nLastVisible; - static_cast(pMenu.get())->ImplCalcVisEntries( nHeight, nFirstEntry, &nLastVisible ); + pMenu->ImplCalcVisEntries(nHeight, nFirstEntry, &nLastVisible); if ( pMenu->ImplGetNextVisible( nLastVisible ) == ITEMPOS_INVALID ) { bScrollDown = false; @@ -765,7 +772,7 @@ void MenuFloatingWindow::ChangeHighlightItem( sal_uInt16 n, bool bStartPopupTime } if( i < nCount ) { - MenuFloatingWindow* pPWin = static_cast(pMenu->pStartedFrom->ImplGetWindow()); + MenuFloatingWindow* pPWin = static_cast(pMenu->pStartedFrom->GetWindow()); if( pPWin && pPWin->nHighlightedItem != i ) { pPWin->InvalidateItem(i); @@ -1015,11 +1022,11 @@ void MenuFloatingWindow::ImplCursorUpDown( bool bUp, bool bHomeEnd ) Size aOutSz = GetOutputSizePixel(); sal_uInt16 nLastVisible; - static_cast(pMenu.get())->ImplCalcVisEntries( aOutSz.Height(), nFirstEntry, &nLastVisible ); + pMenu->ImplCalcVisEntries(aOutSz.Height(), nFirstEntry, &nLastVisible); while ( n > nLastVisible ) { ImplScroll( false ); - static_cast(pMenu.get())->ImplCalcVisEntries( aOutSz.Height(), nFirstEntry, &nLastVisible ); + pMenu->ImplCalcVisEntries(aOutSz.Height(), nFirstEntry, &nLastVisible); } } ChangeHighlightItem( n, false ); @@ -1118,7 +1125,7 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent ) if (pStart && pStart->IsMenuBar()) { // Forward... - pStart->ImplGetWindow()->KeyInput( rKEvent ); + pStart->GetWindow()->KeyInput(rKEvent); } } } @@ -1149,7 +1156,7 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent ) if (pStart && pStart->IsMenuBar()) { // Forward... - pStart->ImplGetWindow()->KeyInput( rKEvent ); + pStart->GetWindow()->KeyInput(rKEvent); } } } diff --git a/vcl/source/window/menufloatingwindow.hxx b/vcl/source/window/menufloatingwindow.hxx index f26fb50373ca..3d364847361a 100644 --- a/vcl/source/window/menufloatingwindow.hxx +++ b/vcl/source/window/menufloatingwindow.hxx @@ -35,7 +35,7 @@ class MenuFloatingWindow : public FloatingWindow, public MenuWindow friend void Menu::dispose(); private: - VclPtr pMenu; + VclPtr pMenu; VclPtr pActivePopup; Timer aHighlightChangedTimer; Timer aSubmenuCloseTimer; @@ -83,7 +83,7 @@ protected: void InvalidateItem( sal_uInt16 nPos ); public: - MenuFloatingWindow(Menu* pMenu, vcl::Window* pParent, WinBits nStyle); + MenuFloatingWindow(PopupMenu* pMenu, vcl::Window* pParent, WinBits nStyle); virtual ~MenuFloatingWindow() override; virtual void dispose() override; @@ -113,7 +113,7 @@ public: void EndExecute( sal_uInt16 nSelectId ); PopupMenu* GetActivePopup() const { return pActivePopup; } - void KillActivePopup( PopupMenu* pThisOnly = nullptr ); + void KillActivePopup(); void ChangeHighlightItem(sal_uInt16 n, bool bStartPopupTimer); sal_uInt16 GetHighlightedItem() const { return nHighlightedItem; } diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 1bad80864979..46bd7df183f5 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -659,6 +659,8 @@ PrintDialog::PrintDialog(weld::Window* i_pWindow, std::shared_ptrgetMultipage() ); + updatePageSize(mxOrientationBox->get_active()); + // setup optional UI options set by application setupOptionalUI(); @@ -1205,10 +1207,23 @@ void PrintDialog::updateNup( bool i_bMayUseCache ) aMPS.aPaperSize = maNupPortraitSize; else // automatic mode { + updatePageSize(mxOrientationBox->get_active()); + Size aPrintPageSize = maPController->getPrinter()->GetPrintPageSize(); + // get size of first real page to see if it is portrait or landscape // we assume same page sizes for all the pages for this Size aPageSize = getJobPageSize(); + if ((aPageSize.Width() < aPageSize.Height() + && aPrintPageSize.Width() > aPrintPageSize.Height()) + || (aPageSize.Width() > aPageSize.Height() + && aPrintPageSize.Width() < aPrintPageSize.Height())) + { + tools::Long nTmp = aPageSize.Width(); + aPageSize.setWidth(aPageSize.Height()); + aPageSize.setHeight(nTmp); + } + Size aMultiSize( aPageSize.Width() * nCols, aPageSize.Height() * nRows ); if( aMultiSize.Width() > aMultiSize.Height() ) // fits better on landscape { @@ -2069,6 +2084,10 @@ IMPL_LINK( PrintDialog, SelectHdl, weld::ComboBox&, rBox, void ) updatePageSize(mxOrientationBox->get_active()); + int nOrientation = mxOrientationBox->get_active(); + if (nOrientation != ORIENTATION_AUTOMATIC) + setPaperOrientation(static_cast(nOrientation - 1), true); + maUpdatePreviewNoCacheIdle.Start(); } } @@ -2186,8 +2205,18 @@ IMPL_LINK( PrintDialog, UIOption_SelectHdl, weld::ComboBox&, i_rBox, void ) //n-up print, we will assume notes are in landscape unless we throw //away maFirstPageSize when we change page content type if (pVal->Name == "PageContentType") + { maFirstPageSize = Size(); + css::uno::Sequence aChoicesDisabled{ + false, // Original size + false, // Fit to printable page + (nVal == 2) /*Notes*/ ? true : false, // disable/enable Multiple sheets of paper + (nVal == 2) /*Notes*/ ? true : false // disable/enable Tile sheet of paper + }; + maPController->setUIChoicesDisabled(u"PageOptions"_ustr, aChoicesDisabled); + } + checkOptionalControlDependencies(); // update preview and page settings diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx index 644aa1f095f2..c03df17ba1d5 100644 --- a/vcl/source/window/syschild.cxx +++ b/vcl/source/window/syschild.cxx @@ -130,7 +130,7 @@ void SystemChildWindow::dispose() const SystemEnvData* SystemChildWindow::GetSystemData() const { if ( mpWindowImpl->mpSysObj ) - return mpWindowImpl->mpSysObj->GetSystemData(); + return &mpWindowImpl->mpSysObj->GetSystemData(); else return nullptr; } diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index 810f1c5cf4ff..e92806e739fe 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -19,6 +19,8 @@ #include +#include "menubarwindow.hxx" + #include #include #include @@ -253,7 +255,7 @@ TaskPaneList* SystemWindow::GetTaskPaneList() pMBar = static_cast(pWin)->GetMenuBar(); } if( pMBar ) - mpImplData->mpTaskPaneList->AddWindow( pMBar->ImplGetWindow() ); + mpImplData->mpTaskPaneList->AddWindow(pMBar->GetWindow()); return mpImplData->mpTaskPaneList.get(); } } @@ -844,14 +846,14 @@ void SystemWindow::SetMenuBar(MenuBar* pMenuBar) return; MenuBar* pOldMenuBar = mpMenuBar; - vcl::Window* pOldWindow = nullptr; - VclPtr pNewWindow; + MenuBarWindow* pOldWindow = nullptr; + VclPtr pNewWindow; mpMenuBar = pMenuBar; if ( mpWindowImpl->mpBorderWindow && (mpWindowImpl->mpBorderWindow->GetType() == WindowType::BORDERWINDOW) ) { if ( pOldMenuBar ) - pOldWindow = pOldMenuBar->ImplGetWindow(); + pOldWindow = pOldMenuBar->getMenuBarWindow(); else pOldWindow = nullptr; if ( pOldWindow ) @@ -861,7 +863,7 @@ void SystemWindow::SetMenuBar(MenuBar* pMenuBar) } if ( pMenuBar ) { - SAL_WARN_IF( pMenuBar->pWindow, "vcl", "SystemWindow::SetMenuBar() - MenuBars can only set in one SystemWindow at time" ); + SAL_WARN_IF( pMenuBar->m_pWindow, "vcl", "SystemWindow::SetMenuBar() - MenuBars can only set in one SystemWindow at time" ); pNewWindow = MenuBar::ImplCreate(mpWindowImpl->mpBorderWindow, pOldWindow, pMenuBar); static_cast(mpWindowImpl->mpBorderWindow.get())->SetMenuBarWindow(pNewWindow); @@ -888,9 +890,9 @@ void SystemWindow::SetMenuBar(MenuBar* pMenuBar) else { if( pMenuBar ) - pNewWindow = pMenuBar->ImplGetWindow(); + pNewWindow = pMenuBar->getMenuBarWindow(); if( pOldMenuBar ) - pOldWindow = pOldMenuBar->ImplGetWindow(); + pOldWindow = pOldMenuBar->getMenuBarWindow(); } // update taskpane list to make menubar accessible diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 06e3e4db76cb..23df41fa50ce 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -3870,7 +3870,7 @@ void Window::ApplySettings(vcl::RenderContext& /*rRenderContext*/) const SystemEnvData* Window::GetSystemData() const { - return mpWindowImpl->mpFrame ? mpWindowImpl->mpFrame->GetSystemData() : nullptr; + return mpWindowImpl->mpFrame ? &mpWindowImpl->mpFrame->GetSystemData() : nullptr; } bool Window::SupportsDoubleBuffering() const diff --git a/vcl/unx/generic/app/i18n_ic.cxx b/vcl/unx/generic/app/i18n_ic.cxx index 32390a888864..1fd3454aeaa7 100644 --- a/vcl/unx/generic/app/i18n_ic.cxx +++ b/vcl/unx/generic/app/i18n_ic.cxx @@ -162,9 +162,9 @@ SalI18N_InputContext::SalI18N_InputContext ( SalFrame *pFrame ) : if (pInputMethod->UseMethod() && SupportInputMethodStyle( pInputMethod->GetSupportedStyles() ) ) { - const SystemEnvData* pEnv = pFrame->GetSystemData(); - ::Window aClientWindow = pEnv->aShellWindow; - ::Window aFocusWindow = pEnv->GetWindowHandle(pFrame); + const SystemEnvData& rEnv = pFrame->GetSystemData(); + ::Window aClientWindow = rEnv.aShellWindow; + ::Window aFocusWindow = rEnv.GetWindowHandle(pFrame); // for status callbacks and commit string callbacks #define PREEDIT_BUFSZ 16 @@ -546,9 +546,9 @@ SalI18N_InputContext::SetICFocus( SalFrame* pFocusFrame ) maClientData.pFrame = pFocusFrame; - const SystemEnvData* pEnv = pFocusFrame->GetSystemData(); - ::Window aClientWindow = pEnv->aShellWindow; - ::Window aFocusWindow = pEnv->GetWindowHandle(pFocusFrame); + const SystemEnvData& rEnv = pFocusFrame->GetSystemData(); + ::Window aClientWindow = rEnv.aShellWindow; + ::Window aFocusWindow = rEnv.GetWindowHandle(pFocusFrame); XSetICValues( maContext, XNFocusWindow, aFocusWindow, diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index a5f9c2f42e5d..46f97074bc26 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -1820,11 +1820,11 @@ int SalDisplay::CaptureMouse( SalFrame *pCapture ) m_pCapture = nullptr; // FIXME: get rid of X11SalFrame - const SystemEnvData* pEnvData = pCapture->GetSystemData(); + const SystemEnvData& rEnvData = pCapture->GetSystemData(); if( !pEnv || !*pEnv ) { int ret = XGrabPointer( GetDisplay(), - static_cast<::Window>(pEnvData->GetWindowHandle(pCapture)), + static_cast<::Window>(rEnvData.GetWindowHandle(pCapture)), False, PointerMotionMask| ButtonPressMask|ButtonReleaseMask, GrabModeAsync, diff --git a/vcl/unx/generic/app/wmadaptor.cxx b/vcl/unx/generic/app/wmadaptor.cxx index 6de1fbd2e8e7..51c273e3c983 100644 --- a/vcl/unx/generic/app/wmadaptor.cxx +++ b/vcl/unx/generic/app/wmadaptor.cxx @@ -996,9 +996,9 @@ void WMAdaptor::setWMName( X11SalFrame* pFrame, const OUString& rWMName ) const Atom nType = aProp.nitems ? aProp.encoding : XA_STRING; int nFormat = aProp.nitems ? aProp.format : 8; int nBytes = aProp.nitems ? aProp.nitems : aTitle.getLength(); - const SystemEnvData* pEnv = pFrame->GetSystemData(); + const SystemEnvData& rEnv = pFrame->GetSystemData(); XChangeProperty( m_pDisplay, - static_cast<::Window>(pEnv->aShellWindow), + static_cast<::Window>(rEnv.aShellWindow), XA_WM_NAME, nType, nFormat, @@ -1006,7 +1006,7 @@ void WMAdaptor::setWMName( X11SalFrame* pFrame, const OUString& rWMName ) const pData, nBytes ); XChangeProperty( m_pDisplay, - static_cast<::Window>(pEnv->aShellWindow), + static_cast<::Window>(rEnv.aShellWindow), XA_WM_ICON_NAME, nType, nFormat, @@ -1014,7 +1014,7 @@ void WMAdaptor::setWMName( X11SalFrame* pFrame, const OUString& rWMName ) const pData, nBytes ); XChangeProperty( m_pDisplay, - static_cast<::Window>(pEnv->aShellWindow), + static_cast<::Window>(rEnv.aShellWindow), m_aWMAtoms[ WM_LOCALE_NAME ], XA_STRING, 8, @@ -1037,10 +1037,10 @@ void NetWMAdaptor::setWMName( X11SalFrame* pFrame, const OUString& rWMName ) con WMAdaptor::setWMName( pFrame, rWMName ); OString aTitle(OUStringToOString(rWMName, RTL_TEXTENCODING_UTF8)); - const SystemEnvData* pEnv = pFrame->GetSystemData(); + const SystemEnvData& rEnv = pFrame->GetSystemData(); if( m_aWMAtoms[ NET_WM_NAME ] ) XChangeProperty( m_pDisplay, - static_cast<::Window>(pEnv->aShellWindow), + static_cast<::Window>(rEnv.aShellWindow), m_aWMAtoms[ NET_WM_NAME ], m_aWMAtoms[ UTF8_STRING ], 8, @@ -1049,7 +1049,7 @@ void NetWMAdaptor::setWMName( X11SalFrame* pFrame, const OUString& rWMName ) con aTitle.getLength() ); if( m_aWMAtoms[ NET_WM_ICON_NAME ] ) XChangeProperty( m_pDisplay, - static_cast<::Window>(pEnv->aShellWindow), + static_cast<::Window>(rEnv.aShellWindow), m_aWMAtoms[ NET_WM_ICON_NAME ], m_aWMAtoms[ UTF8_STRING ], 8, diff --git a/vcl/unx/generic/print/genprnpsp.cxx b/vcl/unx/generic/print/genprnpsp.cxx index b9dd1ec6f465..bbba1230b624 100644 --- a/vcl/unx/generic/print/genprnpsp.cxx +++ b/vcl/unx/generic/print/genprnpsp.cxx @@ -721,7 +721,6 @@ bool PspSalPrinter::StartJob( bool PspSalPrinter::EndJob() { - GetSalInstance()->jobEndedPrinterUpdate(); return true; } @@ -1035,8 +1034,4 @@ void SalGenericInstance::updatePrinterUpdate() PostPrintersChanged(); } -void SalGenericInstance::jobEndedPrinterUpdate() -{ -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index dbd35f5417d9..d495d5bbe8bc 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -842,7 +842,7 @@ void X11SalFrame::SetExtendedFrameStyle( SalExtStyle nStyle ) } } -const SystemEnvData* X11SalFrame::GetSystemData() const +const SystemEnvData& X11SalFrame::GetSystemData() const { X11SalFrame *pFrame = const_cast(this); pFrame->maSystemChildData.pDisplay = GetXDisplay(); @@ -854,7 +854,7 @@ const SystemEnvData* X11SalFrame::GetSystemData() const pFrame->maSystemChildData.aShellWindow = pFrame->GetShellWindow(); pFrame->maSystemChildData.toolkit = SystemEnvData::Toolkit::Gen; pFrame->maSystemChildData.platform = SystemEnvData::Platform::Xcb; - return &maSystemChildData; + return maSystemChildData; } SalGraphics *X11SalFrame::AcquireGraphics() diff --git a/vcl/unx/generic/window/salobj.cxx b/vcl/unx/generic/window/salobj.cxx index e2571c7911a2..3879fdab3244 100644 --- a/vcl/unx/generic/window/salobj.cxx +++ b/vcl/unx/generic/window/salobj.cxx @@ -48,10 +48,10 @@ X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* p { int error_base, event_base; X11SalObject* pObject = new X11SalObject(); - SystemEnvData* pObjData = const_cast(pObject->GetSystemData()); + SystemEnvData& rObjData = const_cast(pObject->GetSystemData()); - if ( ! XShapeQueryExtension( static_cast(pObjData->pDisplay), - &event_base, &error_base ) ) + if (!XShapeQueryExtension(static_cast(rObjData.pDisplay), + &event_base, &error_base)) { delete pObject; return nullptr; @@ -60,9 +60,9 @@ X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* p pObject->mpParent = pParent; SalDisplay* pSalDisp = vcl_sal::getSalDisplay(GetGenericUnixSalData()); - const SystemEnvData* pEnv = pParent->GetSystemData(); + const SystemEnvData& rEnv = pParent->GetSystemData(); Display* pDisp = pSalDisp->GetDisplay(); - ::Window aObjectParent = static_cast<::Window>(pEnv->GetWindowHandle(pParent)); + ::Window aObjectParent = static_cast<::Window>(rEnv.GetWindowHandle(pParent)); pObject->maParentWin = aObjectParent; // find out on which screen that window is @@ -156,10 +156,10 @@ X11SalObject* X11SalObject::CreateObject( SalFrame* pParent, SystemWindowData* p XMapWindow( pDisp, pObject->maPrimary ); } - pObjData->pDisplay = pDisp; - pObjData->SetWindowHandle(pObject->maSecondary); - pObjData->pWidget = nullptr; - pObjData->pVisual = pVisual; + rObjData.pDisplay = pDisp; + rObjData.SetWindowHandle(pObject->maSecondary); + rObjData.pWidget = nullptr; + rObjData.pVisual = pVisual; XSync(pDisp, False); if( GetGenericUnixSalData()->ErrorTrapPop( false ) ) @@ -358,9 +358,9 @@ void X11SalObject::GrabFocus() CurrentTime ); } -const SystemEnvData* X11SalObject::GetSystemData() const +const SystemEnvData& X11SalObject::GetSystemData() const { - return &maSystemChildData; + return maSystemChildData; } static sal_uInt16 sal_GetCode( int state ) diff --git a/vcl/unx/gtk3/gtkdata.cxx b/vcl/unx/gtk3/gtkdata.cxx index 17ae4ec928b8..2f71818296c5 100644 --- a/vcl/unx/gtk3/gtkdata.cxx +++ b/vcl/unx/gtk3/gtkdata.cxx @@ -870,9 +870,9 @@ GtkWidget* GtkSalDisplay::findGtkWidgetForNativeHandle(sal_uIntPtr hWindow) cons { for (auto pSalFrame : m_aFrames ) { - const SystemEnvData* pEnvData = pSalFrame->GetSystemData(); - if (pEnvData->GetWindowHandle(pSalFrame) == hWindow) - return GTK_WIDGET(pEnvData->pWidget); + const SystemEnvData& rEnvData = pSalFrame->GetSystemData(); + if (rEnvData.GetWindowHandle(pSalFrame) == hWindow) + return GTK_WIDGET(rEnvData.pWidget); } return nullptr; } diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx index f101834627c5..8b96d7a321c0 100644 --- a/vcl/unx/gtk3/gtkframe.cxx +++ b/vcl/unx/gtk3/gtkframe.cxx @@ -3035,9 +3035,9 @@ void GtkSalFrame::Beep() gdk_display_beep( getGdkDisplay() ); } -const SystemEnvData* GtkSalFrame::GetSystemData() const +const SystemEnvData& GtkSalFrame::GetSystemData() const { - return &m_aSystemData; + return m_aSystemData; } void GtkSalFrame::ResolveWindowHandle(SystemEnvData& rData) const diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 834984642a1e..13d33a19a30a 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -2262,6 +2262,24 @@ namespace { rOutRect = GdkRectangle{static_cast(rInRect.Left()), static_cast(rInRect.Top()), static_cast(rInRect.GetWidth()), static_cast(rInRect.GetHeight())}; + + if (GTK_IS_ICON_VIEW(pWidget)) + { + // GtkIconView is a little weird in its positioning with scrolling, so adjust here to match what + // it expects + gint nOffsetX(0), nOffsetY(0); +#if !GTK_CHECK_VERSION(4, 0, 0) + gtk_icon_view_convert_widget_to_bin_window_coords(GTK_ICON_VIEW(pWidget), 0, 0, &nOffsetX, &nOffsetY); +#else + GtkAdjustment* pVAdjustment = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(pWidget)); + nOffsetY = pVAdjustment ? gtk_adjustment_get_value(pVAdjustment) : 0; + GtkAdjustment* pHAdjustment = gtk_scrollable_get_hadjustment(GTK_SCROLLABLE(pWidget)); + nOffsetX = pHAdjustment ? gtk_adjustment_get_value(pHAdjustment) : 0; +#endif + rOutRect.x -= nOffsetX; + rOutRect.y -= nOffsetY; + } + if (SwapForRTL(pWidget)) rOutRect.x = gtk_widget_get_allocated_width(pWidget) - rOutRect.width - 1 - rOutRect.x; } @@ -2575,7 +2593,7 @@ protected: if (pTopLevel && g_object_get_data(G_OBJECT(pTopLevel), "g-lo-BlockFocusChange")) return; - m_aFocusInHdl.Call(*this); + weld::Widget::signal_focus_in(); } static gboolean signalMnemonicActivate(GtkWidget*, gboolean, gpointer widget) @@ -2585,11 +2603,6 @@ protected: return pThis->signal_mnemonic_activate(); } - bool signal_mnemonic_activate() - { - return m_aMnemonicActivateHdl.Call(*this); - } - #if GTK_CHECK_VERSION(4, 0, 0) static void signalFocusOut(GtkEventControllerFocus*, gpointer widget) { @@ -2625,7 +2638,7 @@ protected: if (pTopLevel && g_object_get_data(G_OBJECT(pTopLevel), "g-lo-BlockFocusChange")) return; - m_aFocusOutHdl.Call(*this); + weld::Widget::signal_focus_out(); } virtual void ensureMouseEventWidget() @@ -2977,10 +2990,10 @@ private: sal_uInt16 nCode = m_nLastMouseButton | (nModCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2)); MouseEvent aMEvt(aPos, n_press, ImplGetMouseButtonMode(m_nLastMouseButton, nModCode), nCode, nCode); - if (nEventType == SalEvent::MouseButtonDown && m_aMousePressHdl.Call(aMEvt)) + if (nEventType == SalEvent::MouseButtonDown && signal_mouse_press(aMEvt)) gtk_gesture_set_state(GTK_GESTURE(pGesture), GTK_EVENT_SEQUENCE_CLAIMED); - if (nEventType == SalEvent::MouseButtonUp && m_aMouseReleaseHdl.Call(aMEvt)) + if (nEventType == SalEvent::MouseButtonUp && signal_mouse_release(aMEvt)) gtk_gesture_set_state(GTK_GESTURE(pGesture), GTK_EVENT_SEQUENCE_CLAIMED); } @@ -3083,12 +3096,12 @@ private: { if (!m_aMousePressHdl.IsSet()) return false; - return m_aMousePressHdl.Call(aMEvt); + return signal_mouse_press(aMEvt); } if (!m_aMouseReleaseHdl.IsSet()) return false; - return m_aMouseReleaseHdl.Call(aMEvt); + return signal_mouse_release(aMEvt); } #endif @@ -3103,7 +3116,7 @@ private: sal_uInt32 nModCode = GtkSalFrame::GetMouseModCode(nState); MouseEvent aMEvt(aPos, 0, ImplGetMouseMoveMode(nModCode), nModCode, nModCode); - return m_aMouseMotionHdl.Call(aMEvt); + return signal_mouse_motion(aMEvt); } #if GTK_CHECK_VERSION(4, 0, 0) @@ -3165,7 +3178,7 @@ private: eModifiers = eModifiers | eMouseEventModifiers; MouseEvent aMEvt(aPos, 0, eModifiers, nModCode, nModCode); - m_aMouseMotionHdl.Call(aMEvt); + signal_mouse_motion(aMEvt); return false; } @@ -4087,7 +4100,7 @@ public: virtual void signal_size_allocate(guint nWidth, guint nHeight) { - m_aSizeAllocateHdl.Call(Size(nWidth, nHeight)); + weld::Widget::signal_size_allocate(Size(nWidth, nHeight)); } #if GTK_CHECK_VERSION(4, 0, 0) @@ -4096,7 +4109,7 @@ public: if (m_aKeyPressHdl.IsSet()) { SolarMutexGuard aGuard; - return m_aKeyPressHdl.Call(CreateKeyEvent(keyval, keycode, state, 0)); + return weld::Widget::signal_key_press(CreateKeyEvent(keyval, keycode, state, 0)); } return false; } @@ -4106,7 +4119,7 @@ public: if (m_aKeyReleaseHdl.IsSet()) { SolarMutexGuard aGuard; - return m_aKeyReleaseHdl.Call(CreateKeyEvent(keyval, keycode, state, 0)); + return weld::Widget::signal_key_release(CreateKeyEvent(keyval, keycode, state, 0)); } return false; } @@ -4117,7 +4130,7 @@ public: if (m_aKeyPressHdl.IsSet()) { SolarMutexGuard aGuard; - return m_aKeyPressHdl.Call(GtkToVcl(*pEvent)); + return weld::Widget::signal_key_press(GtkToVcl(*pEvent)); } return false; } @@ -4127,7 +4140,7 @@ public: if (m_aKeyReleaseHdl.IsSet()) { SolarMutexGuard aGuard; - return m_aKeyReleaseHdl.Call(GtkToVcl(*pEvent)); + return weld::Widget::signal_key_release(GtkToVcl(*pEvent)); } return false; } @@ -4598,7 +4611,7 @@ IMPL_LINK(GtkInstanceWidget, SettingsChangedHdl, VclWindowEvent&, rEvent, void) DataChangedEvent* pData = static_cast(rEvent.GetData()); if (pData->GetType() == DataChangedEventType::SETTINGS) - m_aStyleUpdatedHdl.Call(*this); + signal_style_updated(); } #if !GTK_CHECK_VERSION(4, 0, 0) @@ -6372,9 +6385,8 @@ public: { GtkSalFrame* pFrame = GtkSalFrame::getFromWindow(GTK_WIDGET(m_pWindow)); assert(pFrame && "nothing should call this impl, yet anyway, if ever, except on result of GetFrameWeld()"); - const SystemEnvData* pEnvData = pFrame->GetSystemData(); - assert(pEnvData); - return *pEnvData; + const SystemEnvData& rEnvData = pFrame->GetSystemData(); + return rEnvData; } virtual Size get_size() const override @@ -17123,6 +17135,94 @@ private: return sRet; } + OUString get(int pos, int col) const + { + GtkTreeModel* pModel = GTK_TREE_MODEL(m_pTreeStore); + OUString sRet; + GtkTreeIter iter; + if (gtk_tree_model_iter_nth_child(pModel, &iter, nullptr, pos)) + sRet = get(iter, col); + return sRet; + } + + tools::Rectangle get_rect(int pos) const override + { + GtkTreeModel* pModel = GTK_TREE_MODEL(m_pTreeStore); + GtkTreeIter rIter; + if (!gtk_tree_model_iter_nth_child(pModel, &rIter, nullptr, pos)) + return tools::Rectangle(); + + const GtkInstanceTreeIter& rGtkIter = static_cast(rIter); + GtkTreePath* path + = gtk_tree_model_get_path(pModel, const_cast(&rGtkIter.iter)); + + GdkRectangle aRect; + gtk_icon_view_get_cell_rect(m_pIconView, path, nullptr, &aRect); + gtk_tree_path_free(path); + + // GtkIconView is a little weird in its positioning with scrolling +#if !GTK_CHECK_VERSION(4, 0, 0) + gtk_icon_view_convert_widget_to_bin_window_coords(m_pIconView, aRect.x, aRect.y, &aRect.x, + &aRect.y); +#else + GtkAdjustment* pVAdjustment = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(m_pIconView)); + aRect.y -= pVAdjustment ? gtk_adjustment_get_value(pVAdjustment) : 0; + GtkAdjustment* pHAdjustment = gtk_scrollable_get_hadjustment(GTK_SCROLLABLE(m_pIconView)); + aRect.x -= pHAdjustment ? gtk_adjustment_get_value(pHAdjustment) : 0; +#endif + + return tools::Rectangle(aRect.x, aRect.y, aRect.x + aRect.width, aRect.y + aRect.height); + } + + void set_image(int pos, VirtualDevice* pIcon) override + { + GtkTreeModel* pModel = GTK_TREE_MODEL(m_pTreeStore); + GtkTreeIter iter; + if (gtk_tree_model_iter_nth_child(pModel, &iter, nullptr, pos)) + { + if (pIcon) + { + GdkPixbuf* pixbuf = getPixbuf(*pIcon); + gtk_tree_store_set(m_pTreeStore, &iter, m_nImageCol, pixbuf, -1); + if (pixbuf) + g_object_unref(pixbuf); + } + } + } + + virtual void set_text(int pos, const OUString& rText) override + { + GtkTreeModel* pModel = GTK_TREE_MODEL(m_pTreeStore); + GtkTreeIter iter; + if (gtk_tree_model_iter_nth_child(pModel, &iter, nullptr, pos)) + { + OString aStr(OUStringToOString(rText, RTL_TEXTENCODING_UTF8)); + gtk_tree_store_set(m_pTreeStore, &iter, m_nTextCol, aStr.getStr(), -1); + } + } + + virtual void set_id(int pos, const OUString& rId) override + { + GtkTreeModel* pModel = GTK_TREE_MODEL(m_pTreeStore); + GtkTreeIter iter; + + if (gtk_tree_model_iter_nth_child(pModel, &iter, nullptr, pos)) + { + OString aStr(OUStringToOString(rId, RTL_TEXTENCODING_UTF8)); + gtk_tree_store_set(m_pTreeStore, &iter, m_nIdCol, aStr.getStr(), -1); + } + } + + virtual void remove(int pos) override + { + disable_notify_events(); + GtkTreeModel* pModel = GTK_TREE_MODEL(m_pTreeStore); + GtkTreeIter iter; + if (gtk_tree_model_iter_nth_child(pModel, &iter, nullptr, pos)) + tree_store_remove(pModel, &iter); + enable_notify_events(); + } + bool get_selected_iterator(GtkTreeIter* pIter) const { assert(gtk_icon_view_get_model(m_pIconView) && "don't request selection when frozen"); @@ -17387,6 +17487,13 @@ public: return gtk_tree_model_get_iter_first(pModel, &rGtkIter.iter); } + virtual bool iter_next_sibling(weld::TreeIter& rIter) const override + { + GtkInstanceTreeIter& rGtkIter = static_cast(rIter); + GtkTreeModel* pModel = GTK_TREE_MODEL(m_pTreeStore); + return gtk_tree_model_iter_next(pModel, &rGtkIter.iter); + } + virtual void scroll_to_item(const weld::TreeIter& rIter) override { assert(gtk_icon_view_get_model(m_pIconView) && "don't select when frozen, select after thaw. Note selection doesn't survive a freeze"); @@ -17431,6 +17538,8 @@ public: return get(rGtkIter.iter, m_nIdCol); } + virtual OUString get_id(int pos) const override { return get(pos, m_nIdCol); } + virtual OUString get_text(const weld::TreeIter& rIter) const override { const GtkInstanceTreeIter& rGtkIter = static_cast(rIter); @@ -18951,8 +19060,8 @@ public: virtual void click(const Point& rPos) override { MouseEvent aEvent(rPos); - m_aMousePressHdl.Call(aEvent); - m_aMouseReleaseHdl.Call(aEvent); + signal_mouse_press(aEvent); + signal_mouse_release(aEvent); } }; diff --git a/vcl/unx/gtk3/gtkobject.cxx b/vcl/unx/gtk3/gtkobject.cxx index bd553137a81b..2352c4eec425 100644 --- a/vcl/unx/gtk3/gtkobject.cxx +++ b/vcl/unx/gtk3/gtkobject.cxx @@ -239,9 +239,9 @@ Size GtkSalObjectBase::GetOptimalSize() const return Size(); } -const SystemEnvData* GtkSalObjectBase::GetSystemData() const +const SystemEnvData& GtkSalObjectBase::GetSystemData() const { - return &m_aSystemData; + return m_aSystemData; } #if !GTK_CHECK_VERSION(4, 0, 0) diff --git a/vcl/unx/gtk3/gtksalmenu.cxx b/vcl/unx/gtk3/gtksalmenu.cxx index efe4da3dde44..50aa39919749 100644 --- a/vcl/unx/gtk3/gtksalmenu.cxx +++ b/vcl/unx/gtk3/gtksalmenu.cxx @@ -1622,10 +1622,6 @@ void GtkSalMenu::SetAccelerator( unsigned, SalMenuItem*, const vcl::KeyCode&, co { } -void GtkSalMenu::GetSystemMenuData( SystemMenuData* ) -{ -} - int GtkSalMenu::GetMenuBarHeight() const { return mpMenuBarWidget ? gtk_widget_get_allocated_height(mpMenuBarWidget) : 0; diff --git a/vcl/win/gdi/DWriteTextRenderer.cxx b/vcl/win/gdi/DWriteTextRenderer.cxx index 06f927b725a6..cb3c1ba4c060 100644 --- a/vcl/win/gdi/DWriteTextRenderer.cxx +++ b/vcl/win/gdi/DWriteTextRenderer.cxx @@ -41,7 +41,9 @@ namespace D2D1_TEXT_ANTIALIAS_MODE lclGetSystemTextAntiAliasType() { UINT t; - if (SystemParametersInfoW(SPI_GETFONTSMOOTHINGTYPE, 0, &t, 0) && t == FE_FONTSMOOTHINGCLEARTYPE) + if (Application::GetSettings().GetStyleSettings().GetUseSubpixelAA() + && SystemParametersInfoW(SPI_GETFONTSMOOTHINGTYPE, 0, &t, 0) + && t == FE_FONTSMOOTHINGCLEARTYPE) return D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE; return D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE; } diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index 751e85012bff..9a3705c4d525 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -3017,9 +3017,9 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings ) WinSalGraphics::updateSettingsNative( rSettings ); } -const SystemEnvData* WinSalFrame::GetSystemData() const +const SystemEnvData& WinSalFrame::GetSystemData() const { - return &maSysData; + return maSysData; } void WinSalFrame::Beep() diff --git a/vcl/win/window/salmenu.cxx b/vcl/win/window/salmenu.cxx index 91a15284aeb5..afb69de605a5 100644 --- a/vcl/win/window/salmenu.cxx +++ b/vcl/win/window/salmenu.cxx @@ -302,10 +302,9 @@ void WinSalMenu::SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const } } -void WinSalMenu::GetSystemMenuData( SystemMenuData* pData ) +void WinSalMenu::GetSystemMenuData(SystemMenuData& rData) { - if( pData ) - pData->hMenu = mhMenu; + rData.hMenu = mhMenu; } /* diff --git a/vcl/win/window/salobj.cxx b/vcl/win/window/salobj.cxx index 05ad16b0d4cd..ce39575b9341 100644 --- a/vcl/win/window/salobj.cxx +++ b/vcl/win/window/salobj.cxx @@ -671,9 +671,9 @@ void WinSalObject::GrabFocus() ::SetFocus( mhWndChild ); } -const SystemEnvData* WinSalObject::GetSystemData() const +const SystemEnvData& WinSalObject::GetSystemData() const { - return &maSysData; + return maSysData; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/inc/AccTopWindowListener.hxx b/winaccessibility/inc/AccTopWindowListener.hxx index d48ad035dd6a..2623dd2db737 100644 --- a/winaccessibility/inc/AccTopWindowListener.hxx +++ b/winaccessibility/inc/AccTopWindowListener.hxx @@ -24,6 +24,7 @@ #include #include +#include #include "AccObjectWinManager.hxx" @@ -55,10 +56,10 @@ public: // XEventListener virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; - virtual void AddAllListeners(css::accessibility::XAccessible* pAccessible, - css::accessibility::XAccessible* pParentXAcc, HWND pWND); + void AddAllListeners(css::accessibility::XAccessible* pAccessible, + css::accessibility::XAccessible* pParentXAcc, HWND pWND); //for On-Demand load. - virtual void HandleWindowOpened(css::accessibility::XAccessible* pAccessible); + void HandleWindowOpened(vcl::Window* pWindow); sal_Int64 GetMSComPtr(sal_Int64 hWnd, sal_Int64 lParam, sal_Int64 wParam); }; diff --git a/winaccessibility/source/service/AccTopWindowListener.cxx b/winaccessibility/source/service/AccTopWindowListener.cxx index 3d51db848ece..f19a16b26acc 100644 --- a/winaccessibility/source/service/AccTopWindowListener.cxx +++ b/winaccessibility/source/service/AccTopWindowListener.cxx @@ -36,57 +36,46 @@ using namespace com::sun::star::uno; /** * For the new opened window, generate all the UNO accessible's object, COM object and add * accessible listener to monitor all these objects. - * @param pAccessible the accessible of the new opened window + * @param pWindow the new opened window */ -void AccTopWindowListener::HandleWindowOpened( css::accessibility::XAccessible* pAccessible ) +void AccTopWindowListener::HandleWindowOpened(vcl::Window* pWindow) { - //get SystemData from window - VclPtr window; - if (auto pvclwindow = dynamic_cast(pAccessible)) - window = pvclwindow->GetWindow(); - else if (auto pvclxcomponent = dynamic_cast(pAccessible)) - window = pvclxcomponent->GetWindow(); - assert(window); - // The SalFrame of window may be destructed at this time - const SystemEnvData* systemdata = nullptr; - try - { - systemdata = window->GetSystemData(); - } - catch(...) - { - systemdata = nullptr; - } - Reference xContext = pAccessible->getAccessibleContext(); + assert(pWindow); + + const SystemEnvData* pSystemData = pWindow->GetSystemData(); + if (!pSystemData) + return; + + Reference xAccessible = pWindow->GetAccessible(); + if (!xAccessible.is()) + return; + + Reference xContext = xAccessible->getAccessibleContext(); if(!xContext.is()) return; - css::accessibility::XAccessibleContext* pAccessibleContext = xContext.get(); - //Only AccessibleContext exist, add all listeners - if(pAccessibleContext != nullptr && systemdata != nullptr) + // add all listeners + m_aAccObjectManager.SaveTopWindowHandle(pSystemData->hWnd, xAccessible.get()); + + AddAllListeners(xAccessible.get(), nullptr, pSystemData->hWnd); + + if (pWindow->GetStyle() & WB_MOVEABLE) + m_aAccObjectManager.IncreaseState(xAccessible.get(), static_cast(-1) /* U_MOVEBLE */ ); + + short role = xContext->getAccessibleRole(); + + if (role == css::accessibility::AccessibleRole::POPUP_MENU || + role == css::accessibility::AccessibleRole::MENU ) { - m_aAccObjectManager.SaveTopWindowHandle(systemdata->hWnd, pAccessible); + m_aAccObjectManager.NotifyAccEvent(xAccessible.get(), UnoMSAAEvent::MENUPOPUPSTART); + } - AddAllListeners(pAccessible,nullptr,systemdata->hWnd); - - if( window->GetStyle() & WB_MOVEABLE ) - m_aAccObjectManager.IncreaseState( pAccessible, static_cast(-1) /* U_MOVEBLE */ ); - - short role = pAccessibleContext->getAccessibleRole(); - - if (role == css::accessibility::AccessibleRole::POPUP_MENU || - role == css::accessibility::AccessibleRole::MENU ) - { - m_aAccObjectManager.NotifyAccEvent(pAccessible, UnoMSAAEvent::MENUPOPUPSTART); - } - - if (role == css::accessibility::AccessibleRole::FRAME || - role == css::accessibility::AccessibleRole::DIALOG || - role == css::accessibility::AccessibleRole::WINDOW || - role == css::accessibility::AccessibleRole::ALERT) - { - m_aAccObjectManager.NotifyAccEvent(pAccessible, UnoMSAAEvent::SHOW); - } + if (role == css::accessibility::AccessibleRole::FRAME || + role == css::accessibility::AccessibleRole::DIALOG || + role == css::accessibility::AccessibleRole::WINDOW || + role == css::accessibility::AccessibleRole::ALERT) + { + m_aAccObjectManager.NotifyAccEvent(xAccessible.get(), UnoMSAAEvent::SHOW); } } @@ -109,14 +98,15 @@ void AccTopWindowListener::windowOpened( const css::lang::EventObject& e ) if ( !e.Source.is()) return; - Reference< css::accessibility::XAccessible > xAccessible ( e.Source, UNO_QUERY ); - css::accessibility::XAccessible* pAccessible = xAccessible.get(); - if ( !pAccessible ) - return; - SolarMutexGuard g; - HandleWindowOpened( pAccessible ); + VCLXWindow* pVCLXWindow = dynamic_cast(e.Source.get()); + assert(pVCLXWindow && "Window is not a VCLXWindow"); + + vcl::Window* pWindow = pVCLXWindow->GetWindow(); + assert(pWindow); + + HandleWindowOpened(pWindow); } /** @@ -181,35 +171,30 @@ void AccTopWindowListener::windowClosed( const css::lang::EventObject& e ) if ( !e.Source.is()) return; - Reference< css::accessibility::XAccessible > xAccessible ( e.Source, UNO_QUERY ); - css::accessibility::XAccessible* pAccessible = xAccessible.get(); - if ( pAccessible == nullptr) + VCLXWindow* pVCLXWindow = dynamic_cast(e.Source.get()); + assert(pVCLXWindow && "Window is not a VCLXWindow"); + + vcl::Window* pWindow = pVCLXWindow->GetWindow(); + assert(pWindow); + + Reference xAccessible = pWindow->GetAccessible(); + if (!xAccessible.is()) return; - Reference xContext = pAccessible->getAccessibleContext(); + Reference xContext = xAccessible->getAccessibleContext(); if(!xContext.is()) - { return; - } - css::accessibility::XAccessibleContext* pAccessibleContext = xContext.get(); - short role = -1; - if(pAccessibleContext != nullptr) + short role = xContext->getAccessibleRole(); + if (role == css::accessibility::AccessibleRole::POPUP_MENU || + role == css::accessibility::AccessibleRole::MENU) { - role = pAccessibleContext->getAccessibleRole(); - - if (role == css::accessibility::AccessibleRole::POPUP_MENU || - role == css::accessibility::AccessibleRole::MENU) - { - m_aAccObjectManager.NotifyAccEvent(pAccessible, UnoMSAAEvent::MENUPOPUPEND); - } + m_aAccObjectManager.NotifyAccEvent(xAccessible.get(), UnoMSAAEvent::MENUPOPUPEND); } - - m_aAccObjectManager.DeleteChildrenAccObj( pAccessible ); + m_aAccObjectManager.DeleteChildrenAccObj(xAccessible.get()); if( role != css::accessibility::AccessibleRole::POPUP_MENU ) - m_aAccObjectManager.DeleteAccObj( pAccessible ); - + m_aAccObjectManager.DeleteAccObj(xAccessible.get()); } void AccTopWindowListener::windowMinimized( const css::lang::EventObject& ) diff --git a/winaccessibility/source/service/msaaservice_impl.cxx b/winaccessibility/source/service/msaaservice_impl.cxx index 3891b6df4872..823238215a25 100644 --- a/winaccessibility/source/service/msaaservice_impl.cxx +++ b/winaccessibility/source/service/msaaservice_impl.cxx @@ -109,7 +109,7 @@ void MSAAServiceImpl::handleWindowOpened(sal_Int64 nAcc) if (m_pTopWindowListener.is() && nAcc) { m_pTopWindowListener->HandleWindowOpened( - static_cast( + static_cast( reinterpret_cast(nAcc))); } } @@ -139,70 +139,12 @@ Sequence< OUString > MSAAServiceImpl::getSupportedServiceNames() return { "com.sun.star.accessibility.MSAAService" }; } -static void AccessBridgeHandleExistingWindow(const Reference< XMSAAService > &xAccMgr, - vcl::Window *pWindow, bool bShow) +static void AccessBridgeHandleExistingWindow(const Reference< XMSAAService>& xAccMgr, + vcl::Window* pWindow) { - if ( pWindow ) - { - css::uno::Reference< css::accessibility::XAccessible > xAccessible; - - SAL_INFO( "iacc2", "Decide whether to register existing window with IAccessible2" ); - - // Test for combo box - drop down floating windows first - vcl::Window * pParentWindow = pWindow->GetParent(); - - if ( pParentWindow ) - { - try - { - // The parent window of a combo box floating window should have the role COMBO_BOX - css::uno::Reference< css::accessibility::XAccessible > xParentAccessible(pParentWindow->GetAccessible()); - if ( xParentAccessible.is() ) - { - css::uno::Reference< css::accessibility::XAccessibleContext > xParentAC( xParentAccessible->getAccessibleContext() ); - if ( xParentAC.is() && (css::accessibility::AccessibleRole::COMBO_BOX == xParentAC->getAccessibleRole()) ) - { - // O.k. - this is a combo box floating window corresponding to the child of role LIST of the parent. - // Let's not rely on a specific child order, just search for the child with the role LIST - sal_Int64 nCount = xParentAC->getAccessibleChildCount(); - for (sal_Int64 n = 0; (n < nCount) && !xAccessible.is(); n++) - { - css::uno::Reference< css::accessibility::XAccessible > xChild = xParentAC->getAccessibleChild(n); - if ( xChild.is() ) - { - css::uno::Reference< css::accessibility::XAccessibleContext > xChildAC = xChild->getAccessibleContext(); - if ( xChildAC.is() && (css::accessibility::AccessibleRole::LIST == xChildAC->getAccessibleRole()) ) - { - xAccessible = xChild; - } - } - } - } - } - } - catch (css::uno::RuntimeException const&) - { - // Ignore show events that throw DisposedExceptions in getAccessibleContext(), - // but keep revoking these windows in hide(s). - if (bShow) - return; - } - } - - // We have to rely on the fact that Window::GetAccessible()->getAccessibleContext() returns a valid XAccessibleContext - // also for other menus than menubar or toplevel popup window. Otherwise we had to traverse the hierarchy to find the - // context object to this menu floater. This makes the call to Window->IsMenuFloatingWindow() obsolete. - if ( ! xAccessible.is() ) - xAccessible = pWindow->GetAccessible(); - - assert( xAccMgr.is() ); - if ( xAccessible.is() ) - { - xAccMgr->handleWindowOpened( - reinterpret_cast(xAccessible.get())); - SAL_INFO( "iacc2", "Decide whether to register existing window with IAccessible2" ); - } - } + assert(xAccMgr.is()); + assert(pWindow); + xAccMgr->handleWindowOpened(reinterpret_cast(pWindow)); } /* @@ -210,9 +152,8 @@ static void AccessBridgeHandleExistingWindow(const Reference< XMSAAService > &xA */ static void AccessBridgeUpdateOldTopWindows( const Reference< XMSAAService > &xAccMgr ) { - sal_uInt16 nTopWindowCount = static_cast(Application::GetTopWindowCount()); - - for ( sal_uInt16 i = 0; i < nTopWindowCount; i++ ) + tools::Long nTopWindowCount = Application::GetTopWindowCount(); + for (tools::Long i = 0; i < nTopWindowCount; i++) { vcl::Window* pTopWindow = Application::GetTopWindow( i ); css::uno::Reference< css::accessibility::XAccessible > xAccessible = pTopWindow->GetAccessible(); @@ -222,7 +163,7 @@ static void AccessBridgeUpdateOldTopWindows( const Reference< XMSAAService > &xA if ( xAC.is()) { if ( !xAC->getAccessibleName().isEmpty() ) - AccessBridgeHandleExistingWindow( xAccMgr, pTopWindow, true ); + AccessBridgeHandleExistingWindow(xAccMgr, pTopWindow); } } } diff --git a/wizards/source/scriptforge/SF_Array.xba b/wizards/source/scriptforge/SF_Array.xba index 53b72b72b225..05c96c96d494 100644 --- a/wizards/source/scriptforge/SF_Array.xba +++ b/wizards/source/scriptforge/SF_Array.xba @@ -446,7 +446,7 @@ Public Function ConvertToDataArray(Optional ByRef Data As Variant _ ''' If bigger than Data, fill with zero-length strings ''' If smaller than Data, truncate ''' If Rows = 1 and the input array is a vector, the data array is aligned horizontally -''' By defauly, vectors are aligned vertically. +''' By default, vectors are aligned vertically. ''' When absent, the size of the output is determined by the input array. ''' Returns: ''' The output is always an array of nested arrays. Array and nested arrays are zero-based. @@ -2673,19 +2673,30 @@ Private Function _ConvertToCellValue(ByVal pvItem As Variant _ , ByVal pbIsCell As Boolean _ ) As Variant ''' Convert the argument to a valid Calc cell content, i.e. a string or a double. -''' When the argument is not convertible, either +''' When the argument is not immediately convertible, either +''' - the cell range is returned unchanged if the argument is a UNO com.sun.star.table.XCellRange object +''' - the date is converted to a double when the argument is a UNO com.sun.star.util.DateTime object ''' - the zero-length string is returned (pbIsCell = True) ''' - the argument is returned unchanged (pbIsCell = False) -Dim vCell As Variant ' Return value +Dim vCell As Variant ' Return value +Dim oObjectDescriptor As Object ' Object descriptor (see SF_Utils) Try: + ' Conversion takes place only when pbIsCell = True If pbIsCell Then Select Case SF_Utils._VarTypeExt(pvItem) Case V_STRING : vCell = pvItem Case V_DATE : vCell = CDbl(pvItem) Case V_NUMERIC : vCell = CDbl(pvItem) Case V_BOOLEAN : vCell = CDbl(Iif(pvItem, 1, 0)) + Case V_OBJECT + Set oObjectDescriptor = SF_Utils._VarTypeObj(pvItem) + Select Case oObjectDescriptor.sObjectType + Case "ScCellRangeObj" : vCell = pvItem + Case "com.sun.star.util.DateTime" : vCell = CDbl(CDateFromUnoDateTime(pvItem)) ' Python date + Case Else : vCell = "" + End Select Case Else : vCell = "" End Select Else ' Return the input item unchanged diff --git a/wizards/source/scriptforge/SF_Session.xba b/wizards/source/scriptforge/SF_Session.xba index ebde30256c7f..30d220d3be4c 100644 --- a/wizards/source/scriptforge/SF_Session.xba +++ b/wizards/source/scriptforge/SF_Session.xba @@ -190,8 +190,10 @@ Public Function ExecuteCalcFunction(Optional ByVal CalcFunction As Variant _ ''' Args: ''' CalcFunction: the english name of the function to execute ''' pvArgs: the arguments of the called function -''' Each argument must be either a string, a numeric value -''' or an array of arrays combining those types +''' Each argument must be either +''' - a string, a numeric value, a date or a boolean +''' - a 1D array, a 2D array or an array of arrays combining those types +''' - a com.sun.star.table.XCellRange UNO object ''' Returns: ''' The (string or numeric) value or the array of arrays returned by the call to the function ''' When the arguments contain arrays, the function is executed as an array function @@ -205,6 +207,7 @@ Public Function ExecuteCalcFunction(Optional ByVal CalcFunction As Variant _ Dim oCalc As Object ' Give access to the com.sun.star.sheet.FunctionAccess service Dim vReturn As Variant ' Returned value +Dim i As Long Const cstThisSub = "Session.ExecuteCalcFunction" Const cstSubArgs = "CalcFunction, arg0[, arg1] ..." @@ -223,6 +226,11 @@ Try: If UBound(pvArgs) = 0 Then If IsEmpty(pvArgs(0)) Then pvArgs = Array() End If + ' Force suitable arguments + For i = 0 To UBound(pvArgs) + pvArgs(i) = SF_Array.ConvertToRange(pvArgs(i), Direction := "V") + Next i + ' Error trapping and execution If SF_Utils._ErrorHandling() Then On Local Error GoTo CatchCall vReturn = oCalc.callFunction(UCase(CalcFunction), pvArgs()) diff --git a/wizards/source/scriptforge/python/scriptforge.py b/wizards/source/scriptforge/python/scriptforge.py index 05a7fa557e74..9dd8a90d7b2f 100644 --- a/wizards/source/scriptforge/python/scriptforge.py +++ b/wizards/source/scriptforge/python/scriptforge.py @@ -1545,7 +1545,8 @@ class SFScriptForge: # Arguments of Calc functions are strings or numbers. None == Empty is a good alias for no argument args = (calcfunction,) + (None,) else: - args = (calcfunction,) + args + # Date arguments are converted on-the-fly to com.sun.star.util.DateTime + args = (calcfunction,) + tuple(map(SFScriptForge.SF_Basic.CDateToUnoDateTime, args)) # ExecuteCalcFunction method has a ParamArray parameter in Basic return cls.SIMPLEEXEC('@SF_Session.ExecuteCalcFunction', args) diff --git a/wizards/source/scriptforge/python/scriptforge.pyi b/wizards/source/scriptforge/python/scriptforge.pyi index 879db366e4a9..0fe33b7fef46 100644 --- a/wizards/source/scriptforge/python/scriptforge.pyi +++ b/wizards/source/scriptforge/python/scriptforge.pyi @@ -1797,11 +1797,12 @@ class SFScriptForge: Args ``calcfunction``: the name of the Calc function to be called, in English. - ``args``: the arguments to be passed to the called Calc function. - Each argument must be either a string, a numeric value or an array of arrays combining - those types. + ``args``: the arguments to be passed to the called Calc function. Each argument may be either + - a string, a numeric value, a bool or a datetime.datetime instance + - a tuple or a tuple of tuples combining those types + - a com.sun.star.table.XCellRange UNO object Returns - The value returned by the function. + The value returned by the function as a scalar or a tuple of tuples. """ ... diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 1cebc8631334..9d9cb7506b14 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -3411,7 +3411,7 @@ lcl_StoreMediaAndGetURL(SvXMLExport & rExport, namespace { -void ExportGraphicPreview(const uno::Reference& xGraphic, SvXMLExport& rExport, const std::u16string_view& rPrefix, const std::u16string_view& rExtension, const OUString& rMimeType) +void ExportGraphicPreview(const uno::Reference& xGraphic, SvXMLExport& rExport, std::u16string_view rPrefix, std::u16string_view rExtension, const OUString& rMimeType) { const bool bExportEmbedded(rExport.getExportFlags() & SvXMLExportFlags::EMBEDDED); diff --git a/xmlsecurity/source/helper/ooxmlsecexporter.cxx b/xmlsecurity/source/helper/ooxmlsecexporter.cxx index 874fc4079c28..f8a870d16860 100644 --- a/xmlsecurity/source/helper/ooxmlsecexporter.cxx +++ b/xmlsecurity/source/helper/ooxmlsecexporter.cxx @@ -94,10 +94,9 @@ bool OOXMLSecExporter::Impl::isOOXMLDenylist(std::u16string_view rStreamName) // Don't attempt to sign other signatures for now. u"/_xmlsignatures" }; // Just check the prefix, as we don't care about the content type part of the stream name. - return std::any_of(vDenylist.begin(), vDenylist.end(), - [&](const std::u16string_view& rLiteral) { - return o3tl::starts_with(rStreamName, rLiteral); - }); + return std::any_of(vDenylist.begin(), vDenylist.end(), [&](std::u16string_view rLiteral) { + return o3tl::starts_with(rStreamName, rLiteral); + }); } bool OOXMLSecExporter::Impl::isOOXMLRelationDenylist(const OUString& rRelationName)