Rebased ref, commits from common ancestor: commit 6a92555d5a956ae90f070e9e667d0e58f89ac07a Author: Thorsten Behrens <thorsten.behr...@allotropia.de> AuthorDate: Sun Jan 14 01:32:29 2024 +0100 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Tue Apr 30 15:10:45 2024 +0200
Only run solver uitest if either lpsolve or coinbase is in Change-Id: Ic03a6df33344b92dccc9bc393d718b4011aa1613 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162034 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de> diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk index 3281184d8224..cd64a952ad1a 100644 --- a/sc/Module_sc.mk +++ b/sc/Module_sc.mk @@ -272,7 +272,6 @@ $(eval $(call gb_Module_add_uicheck_targets,sc,\ UITest_csv_dialog \ UITest_external_links \ UITest_statistics \ - UITest_solver \ UITest_goalSeek \ UITest_protect \ UITest_sc_options \ @@ -294,6 +293,12 @@ $(eval $(call gb_Module_add_uicheck_targets,sc,\ UITest_function_wizard \ UITest_manual_tests \ )) + +ifneq ($(or $(ENABLE_LPSOLVE),$(ENABLE_COINMP)),) +$(eval $(call gb_Module_add_uicheck_targets,sc,\ + UITest_solver \ +)) +endif endif # vim: set noet sw=4 ts=4: commit b81c391bbe1ac3db88edbca086be8cc27477a6a5 Author: Thorsten Behrens <thorsten.behr...@allotropia.de> AuthorDate: Mon Mar 25 00:22:13 2024 +0100 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Tue Apr 30 15:10:45 2024 +0200 fix linker error for PCH build Error was: ld.lld: error: undefined symbol: LanguageTag::~LanguageTag() >>> referenced by stl_construct.h:119 (/usr/lib64/gcc/x86_64-suse-linux/13/../../../../include/c++/13/bits/stl_construct.h:119) >>> core/workdir/CxxObject/sc/inc/pch/precompiled_vbaobj.o:(void std::_Construct<LocaleDataWrapper, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>&, LanguageTag const&>(LocaleDataWrapper*, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>&, LanguageTag const&)) >>> referenced by stl_construct.h:119 (/usr/lib64/gcc/x86_64-suse-linux/13/../../../../include/c++/13/bits/stl_construct.h:119) >>> core/workdir/CxxObject/sc/inc/pch/precompiled_vbaobj.o:(void std::_Construct<LocaleDataWrapper, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>&, LanguageTag const&>(LocaleDataWrapper*, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>&, LanguageTag const&)) >>> referenced by stl_construct.h:119 (/usr/lib64/gcc/x86_64-suse-linux/13/../../../../include/c++/13/bits/stl_construct.h:119) >>> core/workdir/CxxObject/sc/inc/pch/precompiled_vbaobj.o:(void std::_Construct<CharClass, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, LanguageTag const&>(CharClass*, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, LanguageTag const&)) >>> referenced 5 more times Change-Id: Ie84d062d1815aa8e8118171862e0f8f64331d769 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166346 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de> diff --git a/sc/Library_vbaobj.mk b/sc/Library_vbaobj.mk index 49868d85e97a..b35e929b326f 100644 --- a/sc/Library_vbaobj.mk +++ b/sc/Library_vbaobj.mk @@ -39,6 +39,7 @@ $(eval $(call gb_Library_use_libraries,vbaobj,\ cppuhelper \ editeng \ for \ + i18nlangtag \ msfilter \ sal \ sb \ commit 5cb3e95ead94445c4c856a77d4d37a8e4d58e537 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed Mar 6 09:43:28 2024 +0200 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Tue Apr 30 15:10:44 2024 +0200 tdf#158773 reduce cost of ContentInfo::GetText The specific path that is showing up on the perf profile is SdrTextObj::HasText -> EditTextObjectImpl::GetText -> ContentInfo::GetText Reduce the cost by 10% there by adding a method to check if we have text, and avoid the cost of constructing an OUString from an svl::SharedString. Also make use of the new method in places. Change-Id: Ibc2e0f61c4a2a6c33eea7f2cce09d692d82fd2b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164449 Tested-by: Noel Grandin <noel.gran...@collabora.co.uk> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index 762cac112ddb..9b17e434e53d 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -126,6 +126,12 @@ OUString ContentInfo::GetText() const return OUString(p); } +sal_Int32 ContentInfo::GetTextLen() const +{ + const rtl_uString* p = maText.getData(); + return p->length; +} + void ContentInfo::SetText( const OUString& rStr ) { maText = svl::SharedString(rStr.pData, nullptr); @@ -392,6 +398,14 @@ OUString EditTextObjectImpl::GetText(sal_Int32 nPara) const return maContents[nPara]->GetText(); } +sal_Int32 EditTextObjectImpl::GetTextLen(sal_Int32 nPara ) const +{ + if (nPara < 0 || o3tl::make_unsigned(nPara) >= maContents.size()) + return 0; + + return maContents[nPara]->GetTextLen(); +} + void EditTextObjectImpl::ClearPortionInfo() { mpPortionInfo.reset(); diff --git a/editeng/source/editeng/editobj2.hxx b/editeng/source/editeng/editobj2.hxx index fd1f1437e910..4392022b77a3 100644 --- a/editeng/source/editeng/editobj2.hxx +++ b/editeng/source/editeng/editobj2.hxx @@ -140,6 +140,7 @@ public: const svl::SharedString& GetSharedString() const { return maText;} OUString GetText() const; void SetText( const OUString& rStr ); + sal_Int32 GetTextLen() const; void dumpAsXml(xmlTextWriterPtr pWriter) const; @@ -225,6 +226,7 @@ public: virtual sal_Int32 GetParagraphCount() const override; virtual OUString GetText(sal_Int32 nParagraph) const override; + virtual sal_Int32 GetTextLen(sal_Int32 nParagraph) const override; virtual void ClearPortionInfo() override; diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 42316fa1fa34..5943d7be6c54 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -45,7 +45,7 @@ std::optional<OutlinerParaObject> TextChainingUtils::JuxtaposeParaObject( // Special case: if only empty text remove it at the end bool bOnlyOneEmptyPara = !pNextPObj || (pOutl->GetParagraphCount() == 1 && - pNextPObj->GetTextObject().GetText(0).isEmpty()); + !pNextPObj->GetTextObject().HasText(0)); EditEngine &rEditEngine = const_cast<EditEngine &>(pOutl->GetEditEngine()); diff --git a/include/editeng/editobj.hxx b/include/editeng/editobj.hxx index 5badaf8e8a2a..b78b1a918b27 100644 --- a/include/editeng/editobj.hxx +++ b/include/editeng/editobj.hxx @@ -87,6 +87,10 @@ public: virtual OUString GetText(sal_Int32 nPara) const = 0; + virtual sal_Int32 GetTextLen(sal_Int32 nPara) const = 0; + + bool HasText(sal_Int32 nPara) const { return GetTextLen(nPara) > 0; } + virtual void ClearPortionInfo() = 0; virtual bool HasOnlineSpellErrors() const = 0; diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx index e9ae7bdeba42..56d6f5edfe0d 100644 --- a/sc/source/filter/xcl97/xcl97rec.cxx +++ b/sc/source/filter/xcl97/xcl97rec.cxx @@ -921,8 +921,7 @@ XclTxo::XclTxo( const XclExpRoot& rRoot, const EditTextObject& rEditObj, SdrObje // Excel has one alignment per NoteObject while Calc supports // one alignment per paragraph - use the first paragraph // alignment (if set) as our overall alignment. - OUString aParaText( rEditObj.GetText( 0 ) ); - if( !aParaText.isEmpty() ) + if( rEditObj.HasText( 0 ) ) { const SfxItemSet& aSet( rEditObj.GetParaAttribs( 0)); if( const SvxAdjustItem* pItem = aSet.GetItemIfSet( EE_PARA_JUST ) ) diff --git a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx index a79017276b36..1c82cfac7542 100644 --- a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx +++ b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx @@ -348,7 +348,7 @@ bool ScAccessiblePageHeader::IsDefunc( sal_Int64 nParentStates ) void ScAccessiblePageHeader::AddChild(const EditTextObject* pArea, sal_uInt32 nIndex, SvxAdjust eAdjust) { - if (pArea && (!pArea->GetText(0).isEmpty() || (pArea->GetParagraphCount() > 1))) + if (pArea && ((pArea->GetParagraphCount() > 1) || pArea->HasText(0))) { if (maAreas[nIndex].is()) { diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 25633cae38f7..a88b3aad75ad 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -832,7 +832,7 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab, pDocSh->UpdateOle(GetViewData()); bool bIsEmpty = rData.GetParagraphCount() == 0 - || (rData.GetParagraphCount() == 1 && rData.GetText(0).isEmpty()); + || (rData.GetParagraphCount() == 1 && !rData.HasText(0)); const OUString aType(bIsEmpty ? u"delete-content" : u"cell-change"); HelperNotifyChanges::NotifyIfChangesListeners(*pDocSh, rMark, nCol, nRow, aType); diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx index 07a36e0eec98..9de191f2d068 100644 --- a/sd/source/filter/ppt/pptinanimations.cxx +++ b/sd/source/filter/ppt/pptinanimations.cxx @@ -2523,7 +2523,7 @@ void AnimationImporter::importTargetElementContainer( const Atom* pAtom, Any& rT while( (nPara < nParaCount) && (begin > 0) ) { - sal_Int32 nParaLength = rEditTextObject.GetText( nPara ).getLength() + 1; + sal_Int32 nParaLength = rEditTextObject.GetTextLen( nPara ) + 1; begin -= nParaLength; end -= nParaLength; nPara++; diff --git a/svx/source/svdraw/svdotxat.cxx b/svx/source/svdraw/svdotxat.cxx index 4957a4fe9806..6b39887d17f9 100644 --- a/svx/source/svdraw/svdotxat.cxx +++ b/svx/source/svdraw/svdotxat.cxx @@ -424,17 +424,16 @@ bool SdrTextObj::HasText() const OutlinerParaObject* pOPO = GetOutlinerParaObject(); - bool bHasText = false; - if( pOPO ) - { - const EditTextObject& rETO = pOPO->GetTextObject(); - sal_Int32 nParaCount = rETO.GetParagraphCount(); - - if( nParaCount > 0 ) - bHasText = (nParaCount > 1) || (!rETO.GetText( 0 ).isEmpty()); - } + if( !pOPO ) + return false; - return bHasText; + const EditTextObject& rETO = pOPO->GetTextObject(); + sal_Int32 nParaCount = rETO.GetParagraphCount(); + if( nParaCount == 0 ) + return false; + if( nParaCount > 1 ) + return true; + return rETO.HasText( 0 ); } void SdrTextObj::AppendFamilyToStyleName(OUString& styleName, SfxStyleFamily family) diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx index c617129f3fd2..5ed9b8934d27 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -563,7 +563,7 @@ bool Cell::hasText() const { if( rTextObj.GetParagraphCount() == 1 ) { - if( rTextObj.GetText(0).isEmpty() ) + if( !rTextObj.HasText(0) ) return false; } return true; diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx b/sw/source/uibase/docvw/AnnotationWin.cxx index 714c1419d2ed..409b8be9a7a7 100644 --- a/sw/source/uibase/docvw/AnnotationWin.cxx +++ b/sw/source/uibase/docvw/AnnotationWin.cxx @@ -417,7 +417,7 @@ void SwAnnotationWin::InitAnswer(OutlinerParaObject const & rText) // insert old, selected text or "..." // TODO: iterate over all paragraphs, not only first one to find out if it is empty - if (!rText.GetTextObject().GetText(0).isEmpty()) + if (rText.GetTextObject().HasText(0)) GetOutlinerView()->GetEditView().InsertText(rText.GetTextObject()); else GetOutlinerView()->InsertText("..."); commit ad271531ba5e25e2f77338848074a3a50a564ede Author: Sarper Akdemir <sarper.akdemir.ext...@allotropia.de> AuthorDate: Tue Apr 23 16:00:32 2024 +0200 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Tue Apr 30 15:10:44 2024 +0200 tdf#38164: sd: allow panning across pages when zoomed in Change-Id: I513b2b8cbdc91733e551da71a1e6782fecc981a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166542 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sar...@libreoffice.org> diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx index 89332537e94c..03625257ebee 100644 --- a/sd/source/ui/inc/ViewShell.hxx +++ b/sd/source/ui/inc/ViewShell.hxx @@ -381,6 +381,7 @@ public: */ virtual void ShowUIControls (bool bVisible); bool IsPageFlipMode() const; + bool CanPanAcrossPages() const; /** Set the given window as new parent window. This is not possible for all views, so the return value tells the caller if the relocation diff --git a/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx b/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx index 9203c06e8f9f..e8fc847a4a7b 100644 --- a/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx @@ -176,6 +176,7 @@ void CurrentSlideManager::SetCurrentSlideAtViewShellBase (const SharedPageDescri pDrawViewShell->SwitchPage(nPageNumber); TabControl& rPageTabControl = pDrawViewShell->GetPageTabControl(); rPageTabControl.SetCurPageId(rPageTabControl.GetPageId(nPageNumber)); + pDrawViewShell->UpdateScrollBars(); } } } diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx index 6792250fd8e7..99c166002cbd 100644 --- a/sd/source/ui/view/drawview.cxx +++ b/sd/source/ui/view/drawview.cxx @@ -407,6 +407,7 @@ void DrawView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint) if ( mnPOCHSmph == 0 && eHintKind == SdrHintKind::PageOrderChange ) { mpDrawViewShell->ResetActualPage(); + mpDrawViewShell->UpdateScrollBars(); } else if ( eHintKind == SdrHintKind::LayerChange || eHintKind == SdrHintKind::LayerOrderChange ) { diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx index 6d5481318e8e..ee795017c30c 100644 --- a/sd/source/ui/view/sdwindow.cxx +++ b/sd/source/ui/view/sdwindow.cxx @@ -667,8 +667,6 @@ void Window::SetVisibleXY(double fX, double fY) double Window::GetVisibleWidth() const { Size aWinSize = PixelToLogic(GetOutputSizePixel()); - if ( aWinSize.Width() > maViewSize.Width() ) - aWinSize.setWidth( maViewSize.Width() ); return maViewSize.Width() == 0 ? 0 : (static_cast<double>(aWinSize.Width()) / maViewSize.Width()); } @@ -680,8 +678,6 @@ double Window::GetVisibleWidth() const double Window::GetVisibleHeight() const { Size aWinSize = PixelToLogic(GetOutputSizePixel()); - if ( aWinSize.Height() > maViewSize.Height() ) - aWinSize.setHeight( maViewSize.Height() ); return maViewSize.Height() == 0 ? 0 : (static_cast<double>(aWinSize.Height()) / maViewSize.Height()); } @@ -705,7 +701,7 @@ Point Window::GetVisibleCenter() */ double Window::GetScrlLineWidth() const { - return (GetVisibleWidth() * SCROLL_LINE_FACT); + return std::min(1.0, GetVisibleWidth()) * SCROLL_LINE_FACT; } /** @@ -714,7 +710,7 @@ double Window::GetScrlLineWidth() const */ double Window::GetScrlLineHeight() const { - return (GetVisibleHeight() * SCROLL_LINE_FACT); + return std::min(1.0, GetVisibleHeight()) * SCROLL_LINE_FACT; } /** @@ -723,7 +719,7 @@ double Window::GetScrlLineHeight() const */ double Window::GetScrlPageWidth() const { - return (GetVisibleWidth() * SCROLL_PAGE_FACT); + return std::min(1.0, GetVisibleWidth()) * SCROLL_PAGE_FACT; } /** @@ -732,7 +728,7 @@ double Window::GetScrlPageWidth() const */ double Window::GetScrlPageHeight() const { - return (GetVisibleHeight() * SCROLL_PAGE_FACT); + return std::min(1.0, GetVisibleHeight()) * SCROLL_PAGE_FACT; } /** diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx index b7ae44f2c3e1..18658fc8c929 100644 --- a/sd/source/ui/view/viewshe2.cxx +++ b/sd/source/ui/view/viewshe2.cxx @@ -63,6 +63,19 @@ using namespace com::sun::star; +namespace +{ +inline double getViewToScrollScalarForPanAcrossPages(sal_uInt16 nTotalPages, double fVisibleHeight, + ::tools::Long nScrollRangeMax) +{ + // fTotalScrollableRange is (1 - fVisibleHeight) for all of the + // pages except the last one. Because switch to the next page + // happens when the view reaches bottom. + double fTotalScrollableRange = (nTotalPages - 1) * (1 - fVisibleHeight) + 1.0; + return nScrollRangeMax / fTotalScrollableRange; +} +} + namespace sd { /** @@ -72,7 +85,7 @@ void ViewShell::UpdateScrollBars() { if (mpHorizontalScrollBar) { - ::tools::Long nW = static_cast<::tools::Long>(mpContentWindow->GetVisibleWidth() * 32000); + ::tools::Long nW = static_cast<::tools::Long>(std::min(1.0, mpContentWindow->GetVisibleWidth()) * 32000); ::tools::Long nX = static_cast<::tools::Long>(mpContentWindow->GetVisibleX() * 32000); mpHorizontalScrollBar->SetVisibleSize(nW); mpHorizontalScrollBar->SetThumbPos(nX); @@ -85,10 +98,32 @@ void ViewShell::UpdateScrollBars() if (mpVerticalScrollBar) { - ::tools::Long nH = static_cast<::tools::Long>(mpContentWindow->GetVisibleHeight() * 32000); - ::tools::Long nY = static_cast<::tools::Long>(mpContentWindow->GetVisibleY() * 32000); + if (CanPanAcrossPages()) + { + SdPage* pPage = static_cast<DrawViewShell*>(this)->GetActualPage(); + sal_uInt16 nCurPage = (pPage->GetPageNum() - 1) / 2; + sal_uInt16 nTotalPages = GetDoc()->GetSdPageCount(pPage->GetPageKind()); - if(IsPageFlipMode()) // ie in zoom mode where no panning + // nRangeMax is max int, and not ::tools::Long since the underlying + // implementation weld::Scrollbar uses int + ::tools::Long nRangeMax = std::numeric_limits<int>::max(); + double fVisibleHeight = std::min(mpContentWindow->GetVisibleHeight(), 1.0); + double fMappingFactor + = getViewToScrollScalarForPanAcrossPages(nTotalPages, fVisibleHeight, nRangeMax); + double fVisibleY = std::max(0.0, mpContentWindow->GetVisibleY()); + double fCurrentThumbPos = nCurPage * (1 - fVisibleHeight) + fVisibleY; + double fScrollLineHeight + = mpContentWindow->GetScrlLineHeight() * (1.0 - fVisibleHeight); + double fScrollPageHeight + = mpContentWindow->GetScrlPageHeight() * (1.0 - fVisibleHeight); + + mpVerticalScrollBar->SetRange(Range(0, nRangeMax)); + mpVerticalScrollBar->SetVisibleSize(fVisibleHeight * fMappingFactor); + mpVerticalScrollBar->SetThumbPos(fCurrentThumbPos * fMappingFactor); + mpVerticalScrollBar->SetLineSize(fScrollLineHeight * fMappingFactor); + mpVerticalScrollBar->SetPageSize(fScrollPageHeight * fMappingFactor); + } + else if (IsPageFlipMode()) // ie in zoom mode where no panning { SdPage* pPage = static_cast<DrawViewShell*>(this)->GetActualPage(); sal_uInt16 nCurPage = (pPage->GetPageNum() - 1) / 2; @@ -99,8 +134,11 @@ void ViewShell::UpdateScrollBars() mpVerticalScrollBar->SetLineSize(256); mpVerticalScrollBar->SetPageSize(256); } - else + else // single page pan mode { + ::tools::Long nH = static_cast<::tools::Long>(std::min(1.0, mpContentWindow->GetVisibleHeight()) * 32000); + ::tools::Long nY = static_cast<::tools::Long>(mpContentWindow->GetVisibleY() * 32000); + mpVerticalScrollBar->SetRange(Range(0,32000)); mpVerticalScrollBar->SetVisibleSize(nH); mpVerticalScrollBar->SetThumbPos(nY); @@ -180,18 +218,8 @@ IMPL_LINK_NOARG(ViewShell, VScrollHdl, weld::Scrollbar&, void) */ void ViewShell::VirtVScrollHdl(ScrollAdaptor* pVScroll) { - if(IsPageFlipMode()) - { - SdPage* pPage = static_cast<DrawViewShell*>(this)->GetActualPage(); - sal_uInt16 nCurPage = (pPage->GetPageNum() - 1) >> 1; - sal_uInt16 nNewPage = static_cast<sal_uInt16>(pVScroll->GetThumbPos())/256; - if( nCurPage != nNewPage ) - static_cast<DrawViewShell*>(this)->SwitchPage(nNewPage); - } - else //panning mode + auto doScrollView = [&](double fY) { - double fY = static_cast<double>(pVScroll->GetThumbPos()) / pVScroll->GetRange().Len(); - ::sd::View* pView = GetView(); OutlinerView* pOLV = nullptr; @@ -222,7 +250,44 @@ void ViewShell::VirtVScrollHdl(ScrollAdaptor* pVScroll) if (mbHasRulers) UpdateVRuler(); + }; + if (CanPanAcrossPages()) + { + SdPage* pPage = static_cast<DrawViewShell*>(this)->GetActualPage(); + sal_uInt16 nCurPage = (pPage->GetPageNum() - 1) >> 1; + sal_uInt16 nTotalPages = GetDoc()->GetSdPageCount(pPage->GetPageKind()); + + double fVisibleHeight = mpContentWindow->GetVisibleHeight(); + double fMappingFactor = getViewToScrollScalarForPanAcrossPages(nTotalPages, fVisibleHeight, + pVScroll->GetRange().Max()); + + double fScrollableDistancePerPage = 1 - std::min(fVisibleHeight, 1.0); + + sal_uInt16 nNewPage + = std::min((pVScroll->GetThumbPos() / fMappingFactor) / fScrollableDistancePerPage, + static_cast<double>(nTotalPages - 1)); + + if (nCurPage != nNewPage) + static_cast<DrawViewShell*>(this)->SwitchPage(nNewPage); + + double fNewPageStart = nNewPage * fScrollableDistancePerPage; + double fY = (pVScroll->GetThumbPos() / fMappingFactor) - fNewPageStart; + + doScrollView(fY); + } + else if (IsPageFlipMode()) + { + SdPage* pPage = static_cast<DrawViewShell*>(this)->GetActualPage(); + sal_uInt16 nCurPage = (pPage->GetPageNum() - 1) >> 1; + sal_uInt16 nNewPage = static_cast<sal_uInt16>(pVScroll->GetThumbPos())/256; + if( nCurPage != nNewPage ) + static_cast<DrawViewShell*>(this)->SwitchPage(nNewPage); + } + else // single page panning mode + { + double fY = static_cast<double>(pVScroll->GetThumbPos()) / pVScroll->GetRange().Len(); + doScrollView(fY); } } diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index 03eb2535f988..9f49e4ca45a6 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -111,6 +111,13 @@ private: namespace sd { +/// When true, scrolling to bottom of a page switches to the next page. +bool ViewShell::CanPanAcrossPages() const +{ + return dynamic_cast<const DrawViewShell*>(this) && mpContentWindow && + mpContentWindow->GetVisibleHeight() < 1.0; +} + bool ViewShell::IsPageFlipMode() const { return dynamic_cast< const DrawViewShell *>( this ) != nullptr && mpContentWindow && commit 44ae2f8dbf1c247f9ff0891a55e184cc641fc057 Author: Thorsten Behrens <thorsten.behr...@allotropia.de> AuthorDate: Fri Jan 12 12:01:29 2024 +0100 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Tue Apr 30 15:10:44 2024 +0200 Fix system-libfixmath Seems distros start to disagree on whether its liblibfixmath or just libfixmath. Change-Id: I54a42b2ba050980ae632ab3c82254131cad7787e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161969 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de> diff --git a/config_host.mk.in b/config_host.mk.in index 14569b3c17bd..f8c941679038 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -442,6 +442,7 @@ export LIBXML_JAR=@LIBXML_JAR@ export LIBXML_LIBS=$(gb_SPACE)@LIBXML_LIBS@ export LIBXSLT_CFLAGS=$(gb_SPACE)@LIBXSLT_CFLAGS@ export LIBXSLT_LIBS=$(gb_SPACE)@LIBXSLT_LIBS@ +export LIBFIXMATH_LIBS=$(gb_SPACE)@LIBFIXMATH_LIBS@ export LOCKFILE=@LOCKFILE@ export LO_CLANG_CC=@LO_CLANG_CC@ export LO_CLANG_CXX=@LO_CLANG_CXX@ diff --git a/configure.ac b/configure.ac index ed30dff52746..6fcbae9b80d2 100644 --- a/configure.ac +++ b/configure.ac @@ -10664,13 +10664,17 @@ if test "$with_system_libfixmath" = "yes"; then AC_LANG_PUSH([C++]) AC_CHECK_HEADER([libfixmath/fix16.hpp], [], [AC_MSG_ERROR([libfixmath/fix16.hpp not found. install libfixmath])], []) - AC_CHECK_LIB([libfixmath], [fix16_mul], [:], [AC_MSG_ERROR(libfixmath lib not found or functional)], []) + AC_CHECK_LIB([libfixmath], [fix16_mul], [LIBFIXMATH_LIBS=-llibfixmath], + [AC_CHECK_LIB([fixmath], [fix16_mul], [LIBFIXMATH_LIBS=-lfixmath], + [AC_MSG_ERROR(libfixmath lib not found or functional)])]) AC_LANG_POP([C++]) else AC_MSG_RESULT([internal]) SYSTEM_LIBFIXMATH= + LIBFIXMATH_LIBS= fi AC_SUBST([SYSTEM_LIBFIXMATH]) +AC_SUBST([LIBFIXMATH_LIBS]) dnl =================================================================== dnl Check for system glm diff --git a/tools/Library_tl.mk b/tools/Library_tl.mk index 8269e6ae98bf..7933e7735cd6 100644 --- a/tools/Library_tl.mk +++ b/tools/Library_tl.mk @@ -116,7 +116,7 @@ endif ifeq ($(SYSTEM_LIBFIXMATH),TRUE) $(eval $(call gb_Library_add_libs,tl,\ - -llibfixmath \ + $(LIBFIXMATH_LIBS) \ )) endif diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index fb9687dc47c0..d4c72bfe9c0d 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -565,7 +565,7 @@ vcl_headless_freetype_code=\ ifeq ($(SYSTEM_LIBFIXMATH),TRUE) $(eval $(call gb_Library_add_libs,vcl,\ - -llibfixmath \ + $(LIBFIXMATH_LIBS) \ )) endif commit 4c0e18e704724e9b774b49e10c4680d5c1cb2fd7 Author: Oliver Specht <oliver.spe...@cib.de> AuthorDate: Wed Apr 10 17:11:10 2024 +0200 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Tue Apr 30 15:10:44 2024 +0200 tdf#160621 Redesign name and value fields in variabe fields dialog page The space available in the bottom of the dialog page is now used to make the input fields longer Change-Id: If936decbcc44ff356095fc291ff8306084c248ef diff --git a/sw/uiconfig/swriter/ui/fldvarpage.ui b/sw/uiconfig/swriter/ui/fldvarpage.ui index 4c6be9736980..9fd8c8f8a306 100644 --- a/sw/uiconfig/swriter/ui/fldvarpage.ui +++ b/sw/uiconfig/swriter/ui/fldvarpage.ui @@ -55,162 +55,273 @@ <property name="column-spacing">12</property> <property name="column-homogeneous">True</property> <child> - <object class="GtkBox" id="box3"> + <!-- n-columns=4 n-rows=2 --> + <object class="GtkGrid" id="gdNameValue"> <property name="visible">True</property> <property name="can-focus">False</property> - <property name="hexpand">True</property> - <property name="vexpand">True</property> - <property name="orientation">vertical</property> - <property name="spacing">12</property> + <property name="row-spacing">6</property> + <property name="column-spacing">6</property> + <child> + <object class="GtkLabel" id="nameft"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="halign">start</property> + <property name="label" translatable="yes" context="fldvarpage|nameft">Na_me:</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">name</property> + <property name="xalign">0</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="name"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="hexpand">True</property> + <property name="truncate-multiline">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="name-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|name">Type the name of the user-defined field to create.</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">0</property> + <property name="width">2</property> + </packing> + </child> <child> - <object class="GtkFrame" id="typeframe"> + <object class="GtkLabel" id="valueft"> <property name="visible">True</property> <property name="can-focus">False</property> + <property name="halign">start</property> + <property name="valign">start</property> + <property name="label" translatable="yes" context="fldvarpage|valueft">_Value:</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">value</property> + <property name="xalign">0</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">1</property> + </packing> + </child> + <child> + <object class="GtkScrolledWindow" id="scrolledwindow1"> + <property name="visible">True</property> + <property name="can-focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="label-xalign">0</property> - <property name="shadow-type">none</property> + <property name="shadow-type">in</property> <child> - <object class="GtkScrolledWindow"> + <object class="GtkTextView" id="value"> <property name="visible">True</property> <property name="can-focus">True</property> - <property name="margin-top">6</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="shadow-type">in</property> - <child> - <object class="GtkTreeView" id="type"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="hexpand">True</property> - <property name="vexpand">True</property> - <property name="model">liststore1</property> - <property name="headers-visible">False</property> - <property name="headers-clickable">False</property> - <property name="search-column">0</property> - <property name="show-expanders">False</property> - <child internal-child="selection"> - <object class="GtkTreeSelection" id="treeview-selection1"/> - </child> - <child> - <object class="GtkTreeViewColumn" id="treeviewcolumn1"> - <child> - <object class="GtkCellRendererText" id="cellrenderertext1"/> - <attributes> - <attribute name="text">0</attribute> - </attributes> - </child> - </object> - </child> - <child internal-child="accessible"> - <object class="AtkObject" id="type-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|type">Lists the available field types. To add a field to your document, click a field type, click a field in the Select list, and then click Insert.</property> - </object> - </child> + <child internal-child="accessible"> + <object class="AtkObject" id="value-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|value">Enter the contents to add to a user-defined field.</property> </object> </child> </object> </child> - <child type="label"> - <object class="GtkLabel" id="label1"> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">1</property> + <property name="width">2</property> + </packing> + </child> + <child> + <!-- n-columns=2 n-rows=1 --> + <object class="GtkGrid" id="toolbar"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="valign">end</property> + <property name="column-spacing">6</property> + <child> + <object class="GtkButton" id="apply"> <property name="visible">True</property> - <property name="can-focus">False</property> - <property name="label" translatable="yes" context="fldvarpage|label1">_Type</property> - <property name="use-underline">True</property> - <property name="xalign">0</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> + <property name="can-focus">True</property> + <property name="receives-default">True</property> + <property name="tooltip-text" translatable="yes" context="fldvarpage|apply|tooltip_text">Apply</property> + <property name="valign">center</property> + <property name="image">image2</property> + <property name="always-show-image">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="apply-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|apply">Adds the user-defined field to the Select list.</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="delete"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> + <property name="tooltip-text" translatable="yes" context="fldvarpage|delete|tooltip_text">Delete</property> + <property name="valign">center</property> + <property name="image">image1</property> + <property name="always-show-image">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="delete-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|delete">Removes the user-defined field from the select list. You can only remove fields that are not used in the current document.</property> + </object> + </child> </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">0</property> + </packing> </child> </object> <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> + <property name="left-attach">3</property> + <property name="top-attach">1</property> </packing> </child> + <child> + <placeholder/> + </child> </object> <packing> - <property name="left-attach">0</property> - <property name="top-attach">0</property> + <property name="left-attach">1</property> + <property name="top-attach">1</property> + <property name="width">2</property> </packing> </child> <child> - <object class="GtkBox" id="box4"> + <object class="GtkFrame" id="typeframe"> <property name="visible">True</property> <property name="can-focus">False</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="orientation">vertical</property> - <property name="spacing">12</property> + <property name="label-xalign">0</property> + <property name="shadow-type">none</property> <child> - <object class="GtkFrame" id="selectframe"> + <object class="GtkScrolledWindow"> <property name="visible">True</property> - <property name="can-focus">False</property> + <property name="can-focus">True</property> + <property name="margin-top">6</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="label-xalign">0</property> - <property name="shadow-type">none</property> + <property name="shadow-type">in</property> <child> - <object class="GtkScrolledWindow"> + <object class="GtkTreeView" id="type"> <property name="visible">True</property> <property name="can-focus">True</property> - <property name="margin-top">6</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="shadow-type">in</property> + <property name="model">liststore1</property> + <property name="headers-visible">False</property> + <property name="headers-clickable">False</property> + <property name="search-column">0</property> + <property name="show-expanders">False</property> <child> - <object class="GtkTreeView" id="select"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="hexpand">True</property> - <property name="vexpand">True</property> - <property name="model">liststore2</property> - <property name="headers-visible">False</property> - <property name="headers-clickable">False</property> - <property name="search-column">0</property> - <property name="show-expanders">False</property> - <child internal-child="selection"> - <object class="GtkTreeSelection" id="treeview-selection2"/> - </child> + <object class="GtkTreeViewColumn" id="treeviewcolumn1"> <child> - <object class="GtkTreeViewColumn" id="treeviewcolumn2"> - <child> - <object class="GtkCellRendererText" id="cellrenderertext2"/> - <attributes> - <attribute name="text">0</attribute> - </attributes> - </child> - </object> - </child> - <child internal-child="accessible"> - <object class="AtkObject" id="select-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|select">Lists the available fields for the field type selected in the Type list. To insert a field, click the field, and then click Insert.</property> - </object> + <object class="GtkCellRendererText" id="cellrenderertext1"/> + <attributes> + <attribute name="text">0</attribute> + </attributes> </child> </object> </child> + <child internal-child="accessible"> + <object class="AtkObject" id="type-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|type">Lists the available field types. To add a field to your document, click a field type, click a field in the Select list, and then click Insert.</property> + </object> + </child> </object> </child> - <child type="label"> - <object class="GtkLabel" id="label2"> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes" context="fldvarpage|label1">_Type</property> + <property name="use-underline">True</property> + <property name="xalign">0</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">0</property> + <property name="height">2</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="selectframe"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="label-xalign">0</property> + <property name="shadow-type">none</property> + <child> + <object class="GtkScrolledWindow"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="margin-top">6</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="shadow-type">in</property> + <child> + <object class="GtkTreeView" id="select"> <property name="visible">True</property> - <property name="can-focus">False</property> - <property name="label" translatable="yes" context="fldvarpage|label2">_Select</property> - <property name="use-underline">True</property> - <property name="xalign">0</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> + <property name="can-focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="model">liststore2</property> + <property name="headers-visible">False</property> + <property name="headers-clickable">False</property> + <property name="search-column">0</property> + <property name="show-expanders">False</property> + <child> + <object class="GtkTreeViewColumn" id="treeviewcolumn2"> + <child> + <object class="GtkCellRendererText" id="cellrenderertext2"/> + <attributes> + <attribute name="text">0</attribute> + </attributes> + </child> + </object> + </child> + <child internal-child="accessible"> + <object class="AtkObject" id="select-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|select">Lists the available fields for the field type selected in the Type list. To insert a field, click the field, and then click Insert.</property> + </object> + </child> </object> </child> </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> + </child> + <child type="label"> + <object class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes" context="fldvarpage|label2">_Select</property> + <property name="use-underline">True</property> + <property name="xalign">0</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> </child> </object> <packing> @@ -219,146 +330,104 @@ </packing> </child> <child> - <object class="GtkBox" id="box1"> + <object class="GtkFrame" id="formatframe"> <property name="visible">True</property> <property name="can-focus">False</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="orientation">vertical</property> - <property name="spacing">12</property> + <property name="label-xalign">0</property> + <property name="shadow-type">none</property> <child> - <object class="GtkBox" id="box2"> + <object class="GtkBox" id="box5"> <property name="visible">True</property> <property name="can-focus">False</property> + <property name="margin-top">6</property> + <property name="hexpand">True</property> <property name="vexpand">True</property> <property name="orientation">vertical</property> - <property name="spacing">12</property> + <property name="spacing">6</property> <child> - <object class="GtkFrame" id="formatframe"> + <object class="GtkScrolledWindow"> <property name="visible">True</property> - <property name="can-focus">False</property> + <property name="can-focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="label-xalign">0</property> - <property name="shadow-type">none</property> + <property name="shadow-type">in</property> <child> - <object class="GtkBox" id="box5"> + <object class="GtkTreeView" id="numformat"> <property name="visible">True</property> - <property name="can-focus">False</property> - <property name="margin-top">6</property> + <property name="can-focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="orientation">vertical</property> - <property name="spacing">6</property> + <property name="model">liststore3</property> + <property name="headers-visible">False</property> + <property name="headers-clickable">False</property> + <property name="search-column">0</property> + <property name="show-expanders">False</property> <child> - <object class="GtkScrolledWindow"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="hexpand">True</property> - <property name="vexpand">True</property> - <property name="shadow-type">in</property> + <object class="GtkTreeViewColumn" id="treeviewcolumn3"> <child> - <object class="GtkTreeView" id="numformat"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="hexpand">True</property> - <property name="vexpand">True</property> - <property name="model">liststore3</property> - <property name="headers-visible">False</property> - <property name="headers-clickable">False</property> - <property name="search-column">0</property> - <property name="show-expanders">False</property> - <child internal-child="selection"> - <object class="GtkTreeSelection" id="treeview-selection3"/> - </child> - <child> - <object class="GtkTreeViewColumn" id="treeviewcolumn3"> - <child> - <object class="GtkCellRendererText" id="cellrenderertext3"/> - <attributes> - <attribute name="text">0</attribute> - </attributes> - </child> - </object> - </child> - <child internal-child="accessible"> - <object class="AtkObject" id="numformat-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|numformat">Click the format to apply to the selected field, or click "Additional formats" to define a custom format.</property> - </object> - </child> - </object> + <object class="GtkCellRendererText" id="cellrenderertext3"/> + <attributes> + <attribute name="text">0</attribute> + </attributes> </child> </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> </child> - <child> - <object class="GtkScrolledWindow"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="hexpand">True</property> - <property name="vexpand">True</property> - <property name="shadow-type">in</property> - <child> - <object class="GtkTreeView" id="format"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="hexpand">True</property> - <property name="vexpand">True</property> - <property name="model">liststore4</property> - <property name="headers-visible">False</property> - <property name="headers-clickable">False</property> - <property name="search-column">0</property> - <property name="show-expanders">False</property> - <child internal-child="selection"> - <object class="GtkTreeSelection" id="treeview-selection4"/> - </child> - <child> - <object class="GtkTreeViewColumn" id="treeviewcolumn4"> - <child> - <object class="GtkCellRendererText" id="cellrenderertext4"/> - <attributes> - <attribute name="text">0</attribute> - </attributes> - </child> - </object> - </child> - <child internal-child="accessible"> - <object class="AtkObject" id="format-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|format">In the Format list, define if the value is inserted as text or as number.</property> - </object> - </child> - </object> - </child> + <child internal-child="accessible"> + <object class="AtkObject" id="numformat-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|numformat">Click the format to apply to the selected field, or click "Additional formats" to define a custom format.</property> </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> </child> </object> </child> - <child type="label"> - <object class="GtkLabel" id="label3"> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkScrolledWindow"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="shadow-type">in</property> + <child> + <object class="GtkTreeView" id="format"> <property name="visible">True</property> - <property name="can-focus">False</property> - <property name="label" translatable="yes" context="fldvarpage|label3">_Format</property> - <property name="use-underline">True</property> - <property name="xalign">0</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> + <property name="can-focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="model">liststore4</property> + <property name="headers-visible">False</property> + <property name="headers-clickable">False</property> + <property name="search-column">0</property> + <property name="show-expanders">False</property> + <child> + <object class="GtkTreeViewColumn" id="treeviewcolumn4"> + <child> + <object class="GtkCellRendererText" id="cellrenderertext4"/> + <attributes> + <attribute name="text">0</attribute> + </attributes> + </child> + </object> + </child> + <child internal-child="accessible"> + <object class="AtkObject" id="format-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|format">In the Format list, define if the value is inserted as text or as number.</property> + </object> + </child> </object> </child> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">0</property> + <property name="position">1</property> </packing> </child> <child> @@ -378,7 +447,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">1</property> + <property name="position">2</property> </packing> </child> <child> @@ -448,11 +517,11 @@ <object class="GtkEntry" id="separator"> <property name="visible">True</property> <property name="can-focus">True</property> + <property name="tooltip-text" translatable="yes" context="fldvarpage|separator|tooltip_text">Enter the character to use as a separator between the heading number and the field number.</property> <property name="max-length">1</property> <property name="width-chars">2</property> <property name="text" translatable="yes" context="fldvarpage|separator">.</property> <property name="truncate-multiline">True</property> - <property name="tooltip_text" translatable="yes" context="fldvarpage|separator|tooltip_text">Enter the character to use as a separator between the heading number and the field number.</property> <child internal-child="accessible"> <object class="AtkObject" id="separator-atkobject"> <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|separator">Enter the character to use as a separator between the heading number and the field number.</property> @@ -482,159 +551,27 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">2</property> + <property name="position">3</property> </packing> </child> </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - </object> - <packing> - <property name="left-attach">2</property> - <property name="top-attach">0</property> - </packing> - </child> - <child> - <!-- n-columns=3 n-rows=2 --> - <object class="GtkGrid"> - <property name="visible">True</property> - <property name="can-focus">False</property> - <property name="row-spacing">6</property> - <property name="column-spacing">12</property> - <property name="column-homogeneous">True</property> - <child> - <object class="GtkLabel" id="nameft"> - <property name="visible">True</property> - <property name="can-focus">False</property> - <property name="label" translatable="yes" context="fldvarpage|nameft">Na_me</property> - <property name="use-underline">True</property> - <property name="mnemonic-widget">name</property> - <property name="xalign">0</property> - </object> - <packing> - <property name="left-attach">0</property> - <property name="top-attach">0</property> - </packing> - </child> - <child> - <object class="GtkEntry" id="name"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="hexpand">True</property> - <property name="truncate-multiline">True</property> - <child internal-child="accessible"> - <object class="AtkObject" id="name-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|name">Type the name of the user-defined field to create.</property> - </object> - </child> - </object> - <packing> - <property name="left-attach">1</property> - <property name="top-attach">0</property> - </packing> </child> - <child> - <object class="GtkLabel" id="valueft"> + <child type="label"> + <object class="GtkLabel" id="label3"> <property name="visible">True</property> <property name="can-focus">False</property> - <property name="label" translatable="yes" context="fldvarpage|valueft">_Value</property> + <property name="label" translatable="yes" context="fldvarpage|label3">_Format</property> <property name="use-underline">True</property> - <property name="mnemonic-widget">value</property> <property name="xalign">0</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> - <packing> - <property name="left-attach">0</property> - <property name="top-attach">1</property> - </packing> - </child> - <child> - <object class="GtkScrolledWindow" id="scrolledwindow1"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="hexpand">True</property> - <property name="vexpand">True</property> - <property name="shadow-type">in</property> - <child> - <object class="GtkTextView" id="value"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="hexpand">True</property> - <property name="vexpand">True</property> - <child internal-child="accessible"> - <object class="AtkObject" id="comments-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|value">Enter the contents to add to a user-defined field.</property> - </object> - </child> - </object> - </child> - </object> - <packing> - <property name="left-attach">1</property> - <property name="top-attach">1</property> - </packing> - </child> - <child> - <!-- n-columns=2 n-rows=1 --> - <object class="GtkGrid" id="toolbar"> - <property name="visible">True</property> - <property name="can-focus">False</property> - <property name="valign">end</property> - <property name="column-spacing">6</property> - <child> - <object class="GtkButton" id="apply"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">True</property> - <property name="tooltip-text" translatable="yes" context="fldvarpage|apply|tooltip_text">Apply</property> - <property name="valign">center</property> - <property name="image">image2</property> - <property name="always-show-image">True</property> - <child internal-child="accessible"> - <object class="AtkObject" id="apply-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|apply">Adds the user-defined field to the Select list.</property> - </object> - </child> - </object> - <packing> - <property name="left-attach">0</property> - <property name="top-attach">0</property> - </packing> - </child> - <child> - <object class="GtkButton" id="delete"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">True</property> - <property name="tooltip-text" translatable="yes" context="fldvarpage|delete|tooltip_text">Delete</property> - <property name="valign">center</property> - <property name="image">image1</property> - <property name="always-show-image">True</property> - <child internal-child="accessible"> - <object class="AtkObject" id="delete-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="fldvarpage|extended_tip|delete">Removes the user-defined field from the select list. You can only remove fields that are not used in the current document.</property> - </object> - </child> - </object> - <packing> - <property name="left-attach">1</property> - <property name="top-attach">0</property> - </packing> - </child> - </object> - <packing> - <property name="left-attach">2</property> - <property name="top-attach">1</property> - </packing> </child> </object> <packing> - <property name="left-attach">0</property> - <property name="top-attach">1</property> - <property name="width">3</property> + <property name="left-attach">2</property> + <property name="top-attach">0</property> </packing> </child> </object> commit a0f0a6be4340e6f4a80193e94c58dd8d40970859 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sun Apr 7 20:04:57 2024 +0100 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Tue Apr 30 15:10:44 2024 +0200 Failed to set property GtkEntry.valign to top: Could not parse enum: 'top' Change-Id: I2d73204bda451bb87b64652b4dd934fc16e3b65d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165875 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sw/uiconfig/swriter/ui/fldvarpage.ui b/sw/uiconfig/swriter/ui/fldvarpage.ui index 7925bdbaaad0..4c6be9736980 100644 --- a/sw/uiconfig/swriter/ui/fldvarpage.ui +++ b/sw/uiconfig/swriter/ui/fldvarpage.ui @@ -524,7 +524,6 @@ <object class="GtkEntry" id="name"> <property name="visible">True</property> <property name="can-focus">True</property> - <property name="valign">top</property> <property name="hexpand">True</property> <property name="truncate-multiline">True</property> <child internal-child="accessible"> @@ -550,7 +549,6 @@ <packing> <property name="left-attach">0</property> <property name="top-attach">1</property> - <property name="width">1</property> </packing> </child> <child> commit 4ba45febf61af16f95b05b069108eae1e430ce6e Author: Oliver Specht <oliver.spe...@cib.de> AuthorDate: Thu Apr 11 08:56:17 2024 +0200 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Tue Apr 30 15:10:44 2024 +0200 Improve case rotation in sentence case Rotating case (Shift+F3) applies sentence case only if multiple words are already selected or selects sentence if SENTENCE_CASE is going to be applied. Change-Id: I9e8536d7744a344d7ad54150783e91e843e0e81e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165986 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de> diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx b/sw/qa/extras/uiwriter/uiwriter6.cxx index c76dd01d3d3d..6d6bdd101a0b 100644 --- a/sw/qa/extras/uiwriter/uiwriter6.cxx +++ b/sw/qa/extras/uiwriter/uiwriter6.cxx @@ -743,10 +743,6 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf157988) dispatchCommand(mxComponent, ".uno:ChangeCaseRotateCase", {}); - CPPUNIT_ASSERT(getParagraph(1)->getString().startsWith("Integer sodalesSODALES")); - - dispatchCommand(mxComponent, ".uno:ChangeCaseRotateCase", {}); - CPPUNIT_ASSERT(getParagraph(1)->getString().startsWith("Integer sodales tincidunt")); dispatchCommand(mxComponent, ".uno:ChangeCaseRotateCase", {}); @@ -765,10 +761,6 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf157988) dispatchCommand(mxComponent, ".uno:ChangeCaseRotateCase", {}); - CPPUNIT_ASSERT(getParagraph(1)->getString().startsWith("Integer sodalesSODALES")); - - dispatchCommand(mxComponent, ".uno:ChangeCaseRotateCase", {}); - CPPUNIT_ASSERT(getParagraph(1)->getString().startsWith("Integer sodales tincidunt")); dispatchCommand(mxComponent, ".uno:ChangeCaseRotateCase", {}); diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx b/sw/qa/extras/uiwriter/uiwriter8.cxx index 4fa027b0515b..70a1f6fa1796 100644 --- a/sw/qa/extras/uiwriter/uiwriter8.cxx +++ b/sw/qa/extras/uiwriter/uiwriter8.cxx @@ -850,15 +850,6 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf116315) pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_SHIFT | KEY_F3); Scheduler::ProcessEventsToIdle(); - // Sentence Case - // Without the fix in place, this test would have failed with - // - Expected: This is a Test - // - Actual : This is a TEST - CPPUNIT_ASSERT_EQUAL(OUString("This is a Test"), getParagraph(1)->getString()); - - pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_SHIFT | KEY_F3); - Scheduler::ProcessEventsToIdle(); - // Upper Case CPPUNIT_ASSERT_EQUAL(OUString("This is a TEST"), getParagraph(1)->getString()); diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx index 44a17f96a6ad..5af856f23f9e 100644 --- a/sw/source/uibase/inc/wrtsh.hxx +++ b/sw/source/uibase/inc/wrtsh.hxx @@ -239,6 +239,8 @@ typedef bool (SwWrtShell::*FNSimpleMove)(); { SimpleMove( &SwWrtShell::BwdPara_, false/*bSelect*/ ); } void FwdSentence( bool bSelect = false ) { SimpleMove( &SwWrtShell::FwdSentence_, bSelect ); } + void EndSentence( bool bSelect = false ) + { SimpleMove( &SwWrtShell::EndSentence_, bSelect ); } void BwdSentence( bool bSelect = false ) { SimpleMove( &SwWrtShell::BwdSentence_, bSelect ); } @@ -590,6 +592,7 @@ private: SAL_DLLPRIVATE bool NxtWrdForDelete(); SAL_DLLPRIVATE bool PrvWrdForDelete(); SAL_DLLPRIVATE bool FwdSentence_(); + SAL_DLLPRIVATE bool EndSentence_(); SAL_DLLPRIVATE bool BwdSentence_(); bool FwdPara_(); SAL_DLLPRIVATE bool BwdPara_(); diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index 29242d99463b..d80f8b5b51f6 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -878,20 +878,33 @@ void SwTextShell::ExecRotateTransliteration( SfxRequest const & rReq ) { if( rReq.GetSlot() == SID_TRANSLITERATE_ROTATE_CASE ) { + TransliterationFlags transFlags = m_aRotateCase.getNextMode(); + bool bSentenceCase = TransliterationFlags::SENTENCE_CASE == transFlags; SwWrtShell& rSh = GetShell(); if (rSh.HasSelection()) { - rSh.TransliterateText(m_aRotateCase.getNextMode()); + if (bSentenceCase) + { + OUString aSelection = rSh.GetSelText().trim(); + if (aSelection.getLength() <= 2 || (aSelection.indexOf(' ') < 0 && aSelection.indexOf(' ') < 0)) + transFlags = m_aRotateCase.getNextMode(); + } + rSh.TransliterateText(transFlags); } else { + if (bSentenceCase) + { + if (!rSh.IsEndSentence()) + rSh.EndSentence(false); + } if (rSh.IsEndSentence()) { rSh.BwdSentence(true); - rSh.TransliterateText(m_aRotateCase.getNextMode()); + rSh.TransliterateText(transFlags); } else if ((rSh.IsEndWrd() || rSh.IsStartWord() || rSh.IsInWord()) && rSh.SelWrd()) - rSh.TransliterateText(m_aRotateCase.getNextMode()); + rSh.TransliterateText(transFlags); } } } diff --git a/sw/source/uibase/wrtsh/wrtsh4.cxx b/sw/source/uibase/wrtsh/wrtsh4.cxx index 0442e3152bb6..0edf4a1780b1 100644 --- a/sw/source/uibase/wrtsh/wrtsh4.cxx +++ b/sw/source/uibase/wrtsh/wrtsh4.cxx @@ -190,6 +190,23 @@ bool SwWrtShell::FwdSentence_() return true; } +bool SwWrtShell::EndSentence_() +{ + Push(); + ClearMark(); + if(!SwCursorShell::Right(1,SwCursorSkipMode::Chars)) + { + Pop(SwCursorShell::PopMode::DeleteCurrent); + return false; + } + if( !GoEndSentence() && !IsEndPara() ) + SwCursorShell::MovePara(GoCurrPara, fnParaEnd); + + ClearMark(); + Combine(); + return true; +} + bool SwWrtShell::BwdSentence_() { Push(); commit 82d1e8c46a32a91bd560e02212e98163d71bb6a2 Author: Oliver Specht <oliver.spe...@cib.de> AuthorDate: Mon Apr 15 11:40:12 2024 +0200 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Tue Apr 30 15:10:44 2024 +0200 Case rotation in Impress: skip sentence case Sentence case does not make sense if a selection contains less than two words. Rotation then skkips to the next case mode. Change-Id: I79d6560c494b716a53bfed654027f6f37dc6c362 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166115 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de> diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index 5f95769e6311..138830bf74bf 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -1474,8 +1474,14 @@ void DrawViewShell::FuSupportRotate(SfxRequest const &rReq) if (!pOLV) return; - - pOLV->TransliterateText( m_aRotateCase.getNextMode() ); + TransliterationFlags transFlags = m_aRotateCase.getNextMode(); + if (TransliterationFlags::SENTENCE_CASE == transFlags) + { + OUString SelectedText = pOLV->GetSelected().trim(); + if (SelectedText.getLength() <= 2 || (SelectedText.indexOf(' ') < 0 && SelectedText.indexOf(' ') < 0)) + transFlags = m_aRotateCase.getNextMode(); + } + pOLV->TransliterateText( transFlags ); } void DrawViewShell::InsertURLField(const OUString& rURL, const OUString& rText, commit 8834eb33de01c985f45f67a93a3983f3eeae6382 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Wed Feb 21 15:49:56 2024 +0100 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Tue Apr 30 15:10:44 2024 +0200 tdf#159797: sw_uiwriter6: Add unittest Change-Id: I69b8ea673f676f1106e257cef507937cbd5ebd2c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163695 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx b/sw/qa/extras/uiwriter/uiwriter6.cxx index 5b4140e02967..c76dd01d3d3d 100644 --- a/sw/qa/extras/uiwriter/uiwriter6.cxx +++ b/sw/qa/extras/uiwriter/uiwriter6.cxx @@ -3008,6 +3008,19 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf106663HeaderTextFrameGoToNextPlacem CPPUNIT_ASSERT(pCursor->GetPoint()->GetNode().GetTextNode()->GetText().startsWith("Heading")); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf159797) +{ + createSwDoc(); + SwXTextDocument& rTextDoc = dynamic_cast<SwXTextDocument&>(*mxComponent); + + emulateTyping(rTextDoc, u"This - is replaced. - But this is not replaced."); + // Without the fix in place, this would fail with + // - Expected: This – is replaced. – But this is not replaced. + // - Actual : This – is replaced. - But this is not replaced. + CPPUNIT_ASSERT_EQUAL(u"This – is replaced. – But this is not replaced."_ustr, + getParagraph(1)->getString()); +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf155407) { createSwDoc(); commit e9208a9d03a6e06e80a6cc9335d9886c90d776f2 Author: Balazs Varga <balazs.varga.ext...@allotropia.de> AuthorDate: Wed Apr 10 17:48:20 2024 +0100 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Tue Apr 30 15:10:44 2024 +0200 tdf#160616 - Fix SUMPRODUCT calculation is broken in some cases Double refs with operators only trimmable in case of one root paramater. Follow up of: ba0ec4a5d2b025b675410cd18890d1cca3bc5a2f Change-Id: If61fb39696d9539ffc9d32a6ecad79bfa1bf92e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165957 Tested-by: Gabor Kelemen <gabor.kelemen.ext...@allotropia.de> Tested-by: Jenkins Reviewed-by: Gabor Kelemen <gabor.kelemen.ext...@allotropia.de> (cherry picked from commit 2af433f11cf24db655677bdf26e39fabaf3611fc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165932 Tested-by: allotropia jenkins <jenk...@allotropia.de> Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de> diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index 153096d6a434..feb0e8fef22a 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -1464,7 +1464,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaAnnotateTrimOnDoubleRefs) { "=SUMPRODUCT(A:A=$C$1; 1-(A:A=$C$1))", - ScRange(0, 0, 0, 0, 1048575, 0), + ScRange(-1, -1, -1, -1, -1, -1), // Has no trimmable double-ref. 0.0, false // Not in matrix mode. }, diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 451956922c29..7e1fa777bfec 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -6477,6 +6477,8 @@ void ScCompiler::AnnotateTrimOnDoubleRefs() // OpCode of the "root" operator (which is already in RPN array). OpCode eOpCode = (*(pCode - 1))->GetOpCode(); + // Param number of the "root" operator (which is already in RPN array). + sal_uInt8 nRootParam = (*(pCode - 1))->GetByte(); // eOpCode can be some operator which does not change with operands with or contains zero values. if (eOpCode == ocSum) { @@ -6569,7 +6571,8 @@ void ScCompiler::AnnotateTrimOnDoubleRefs() // such that one of the operands of ocEqual is a double-ref. // Examples of formula that matches this are: // SUMPRODUCT(IF($A:$A=$L12;$D:$D*G:G)) - // Also in case of DoubleRef arguments around other Binary operators can be trimmable: + // Also in case of DoubleRef arguments around other Binary operators can be trimmable inside one parameter + // of the root operator: // SUMPRODUCT(($D:$D>M47:M47)*($D:$D<M48:M48)*($I:$I=N$41)) bool bTillClose = true; bool bCloseTillIf = false; @@ -6621,7 +6624,9 @@ void ScCompiler::AnnotateTrimOnDoubleRefs() case ocUnion: case ocRange: { - if (!pTok->IsInForceArray()) + // tdf#160616: Double refs with these operators only + // trimmable in case of one paramater + if (!pTok->IsInForceArray() || nRootParam > 1) break; FormulaToken* pLHS = *(ppTok - 1); FormulaToken* pRHS = *(ppTok - 2); commit d9782eab51a57d3e6d0432c2a04c4f9af4a5deac Author: Rene Engelhard <r...@rene-engelhard.de> AuthorDate: Wed Apr 3 23:26:08 2024 +0200 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Tue Apr 30 15:10:44 2024 +0200 clean up after removal of patched rhino Change-Id: I193fd0c10d297555faa7a832718dbd6cd929a406 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165762 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de> diff --git a/Makefile.fetch b/Makefile.fetch index b96cb573c2bf..afb7d176e79e 100644 --- a/Makefile.fetch +++ b/Makefile.fetch @@ -224,7 +224,6 @@ $(WORKDIR)/download: $(BUILDDIR)/config_$(gb_Side).mk $(SRCDIR)/download.lst $(S $(call fetch_Optional,REDLAND,REDLAND_TARBALL) \ $(call fetch_Optional,REVENGE,REVENGE_TARBALL) \ $(call fetch_Optional,RHINO,RHINO_TARBALL) \ - $(call fetch_Optional,RHINO,SWING_TARBALL) \ $(call fetch_Optional,SKIA,SKIA_TARBALL) \ $(call fetch_Optional,STAROFFICE,STAROFFICE_TARBALL) \ $(if $(filter WNT,$(OS)),TWAIN_DSM_TARBALL) \ diff --git a/configure.ac b/configure.ac index 5505bfed8b5b..ed30dff52746 100644 --- a/configure.ac +++ b/configure.ac @@ -2389,11 +2389,8 @@ libo_FUZZ_ARG_ENABLE(scripting-javascript, AC_ARG_WITH(system-rhino, AS_HELP_STRING([--with-system-rhino], - [Use rhino already on system.]),,) -# [with_system_rhino="$with_system_jars"]) -# Above is not used as we have different debug interface -# patched into internal rhino. This code needs to be fixed -# before we can enable it by default. + [Use rhino already on system.]),, + [with_system_rhino="$with_system_jars"]) AC_ARG_WITH(rhino-jar, AS_HELP_STRING([--with-rhino-jar=JARFILE], diff --git a/download.lst b/download.lst index 8f74ec295e2a..8c8d3c4c5b8e 100644 --- a/download.lst +++ b/download.lst @@ -602,11 +602,6 @@ STAROFFICE_TARBALL := libstaroffice-0.0.$(STAROFFICE_VERSION_MICRO).tar.xz # three static lines # so that git cherry-pick # will not run into conflicts -SWING_SHA256SUM := 64585ac36a81291a58269ec5347e7e3e2e8596dbacb9221015c208191333c6e1 -SWING_TARBALL := 35c94d2df8893241173de1d16b6034c0-swingExSrc.zip -# three static lines -# so that git cherry-pick -# will not run into conflicts TWAIN_DSM_SHA256SUM := 82c818be771f242388457aa8c807e4b52aa84dc22b21c6c56184a6b4cbb085e6 TWAIN_DSM_TARBALL := twaindsm_2.4.1.orig.tar.gz # three static lines diff --git a/external/rhino/README b/external/rhino/README index 83e4135d0b89..c60378c32262 100644 --- a/external/rhino/README +++ b/external/rhino/README @@ -3,12 +3,3 @@ JavaScript engine/interpreter written in Java, used to provide JavaScript extens The Scripting Framework makes use of the Rhino ([http://www.mozilla.org/rhino/]) JavaScript interpreter, available under the Mozilla Public License ([http://www.mozilla.org/MPL/MPL-1.1.html]). - -In addition, to support the debugging of scripts contained in OpenOffice.org -documents, we have modified the Java source file Main.java. - -The Rhino source tarball is unpacked and patched with the modified code. The -Rhino Jar file (js.jar) is then built (download/swingExSrc.zip is unpacked and -built as part of this procesS) and delivered to the solver. The file -rhino1_5R5.patch contains the changes made in order to build Rhino. The patch -was generated using the command: diff -wurN diff --git a/solenv/flatpak-manifest.in b/solenv/flatpak-manifest.in index e5150ccbc5c8..6866cad5c5ce 100644 --- a/solenv/flatpak-manifest.in +++ b/solenv/flatpak-manifest.in @@ -711,13 +711,6 @@ "dest": "external/tarballs", "dest-filename": "@JFREEREPORT_SAC_TARBALL@" }, - { - "url": "https://dev-www.libreoffice.org/src/@SWING_TARBALL@", - "sha256": "@SWING_SHA256SUM@", - "type": "file", - "dest": "external/tarballs", - "dest-filename": "@SWING_TARBALL@" - }, { "url": "https://dev-www.libreoffice.org/src/@LIBNUMBERTEXT_TARBALL@", "sha256": "@LIBNUMBERTEXT_SHA256SUM@", commit a2981553b8d8147d911c2d1c65b10635c2402506 Author: Stephan Bergmann <stephan.bergm...@allotropia.de> AuthorDate: Fri Mar 22 15:53:49 2024 +0100 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Tue Apr 30 15:10:43 2024 +0200 Update to latest Rhino 1.7.14 ...at the expense of losing, at least for now, the script editor for it (which had been hacked into the old upstream sources in a hard-to-maintain way). rhino-1.7.14.zip is taken from <https://github.com/mozilla/rhino/releases/download/Rhino1_7_14_Release/rhino-1.7.14.zip>. Building it would now use Gradle, but instead just hack together an invocation of javac and jar in external/rhino/ExternalProject_rhino.mk that effectively generates the same jar as the upstream-built jar available at <https://github.com/mozilla/rhino/releases/download/Rhino1_7_14_Release/rhino-1.7.14.jar>. All the various patches are no longer necessary: * external/rhino/rhino1_5R5.patch and external/rhino/OfficeScriptInfo.java were mostly for the hacked-in script editor, which has been abandoned at least for now (see above). * external/rhino/rhino1_5R5-find_swing.patch (originally from 0a7f9346503a557f583bced269655fa1996550af "ause109: #i106296# make build.xml aware of TARFILE_LOCATION") appears to be obsolete. * external/rhino/rhino1_5R5-updateToolTip.patch is covered by <https://github.com/mozilla/rhino/commit/ab20a73b16f68daf715c7ac4808c119bb15d698c> "Fix bug 414869: Rhino debugger fails to launch due to updates in mac os x leopard". * external/rhino/rhino-classpath.patch.1 from bb58293296f843654045d7b0eba6899d11533a4a "rhino: unbreak build on Fedora 34" was only relevant when building with Ant. Change-Id: I5fca5915d785716f7aaf313ff2469a20f55f707a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165416 Tested-by: allotropia jenkins <jenk...@allotropia.de> Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de> diff --git a/download.lst b/download.lst index 0f16c450c5cd..8f74ec295e2a 100644 --- a/download.lst +++ b/download.lst @@ -586,8 +586,8 @@ REVENGE_TARBALL := librevenge-0.0.$(REVENGE_VERSION_MICRO).tar.bz2 # three static lines # so that git cherry-pick # will not run into conflicts -RHINO_SHA256SUM := 1fb458d6aab06932693cc8a9b6e4e70944ee1ff052fa63606e3131df34e21753 -RHINO_TARBALL := 798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip +RHINO_SHA256SUM := bf4d2d0c5ff8889fd494486db09291cb7965f0bf2f93ef005d3b08070a5a4f5c +RHINO_TARBALL := rhino-1.7.14.zip # three static lines # so that git cherry-pick # will not run into conflicts diff --git a/external/rhino/ExternalPackage_rhino.mk b/external/rhino/ExternalPackage_rhino.mk index 0ee1d60e309d..faac15c6978e 100644 --- a/external/rhino/ExternalPackage_rhino.mk +++ b/external/rhino/ExternalPackage_rhino.mk @@ -11,6 +11,6 @@ $(eval $(call gb_ExternalPackage_ExternalPackage,rhino,rhino)) $(eval $(call gb_ExternalPackage_use_external_project,rhino,rhino)) -$(eval $(call gb_ExternalPackage_add_file,rhino,$(LIBO_SHARE_JAVA_FOLDER)/js.jar,build/rhino1_5R5/js.jar)) +$(eval $(call gb_ExternalPackage_add_file,rhino,$(LIBO_SHARE_JAVA_FOLDER)/js.jar,build/js.jar)) # vim: set noet sw=4 ts=4: diff --git a/external/rhino/ExternalProject_rhino.mk b/external/rhino/ExternalProject_rhino.mk index 6ef30ca34f24..3df0aaa4e2d9 100644 --- a/external/rhino/ExternalProject_rhino.mk +++ b/external/rhino/ExternalProject_rhino.mk @@ -16,16 +16,32 @@ $(eval $(call gb_ExternalProject_register_targets,rhino,\ $(call gb_ExternalProject_get_state_target,rhino,build) : $(call gb_Trace_StartRange,rhino,EXTERNAL) $(call gb_ExternalProject_run,build,\ - JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \ - $(ICECREAM_RUN) "$(ANT)" \ - $(if $(verbose),-v,-q) \ - -f build.xml \ - -Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \ - -DTARFILE_LOCATION="$(if $(findstring -cygwin,$(BUILD_PLATFORM)),$(shell cygpath -m $(TARFILE_LOCATION)),$(TARFILE_LOCATION))" \ - -Dant.build.javac.source=$(JAVA_SOURCE_VER) \ - -Dant.build.javac.target=$(JAVA_TARGET_VER) \ - $(if $(debug),-Dbuild.debug="on") \ - jar \ + mkdir $(call gb_UnpackedTarball_get_dir,rhino)/build \ + && cd $(call gb_UnpackedTarball_get_dir,rhino) \ + && $(call gb_JavaClassSet_JAVACCOMMAND,$(JAVA_TARGET_VER)) $(gb_JavaClassSet_JAVACDEBUG) \ + -d $(call gb_UnpackedTarball_get_dir,rhino)/build/content \ + @$(SRCDIR)/external/rhino/filelist.txt \ + && mkdir $(call gb_UnpackedTarball_get_dir,rhino)/build/content/META-INF \ + && cp $(call gb_UnpackedTarball_get_dir,rhino)/LICENSE.txt \ + $(call gb_UnpackedTarball_get_dir,rhino)/NOTICE-tools.txt \ + $(call gb_UnpackedTarball_get_dir,rhino)/NOTICE.txt \ + $(call gb_UnpackedTarball_get_dir,rhino)/build/content/META-INF/ \ + && $(gb_Jar_JARCOMMAND) -cf $(call gb_UnpackedTarball_get_dir,rhino)/build/js.jar \ + -C $(call gb_UnpackedTarball_get_dir,rhino)/build/content . \ + -C $(call gb_UnpackedTarball_get_dir,rhino)/src \ + org/mozilla/javascript/commonjs/module/package.html \ + -C $(call gb_UnpackedTarball_get_dir,rhino)/src \ + org/mozilla/javascript/commonjs/module/provider/package.html \ + -C $(call gb_UnpackedTarball_get_dir,rhino)/src \ + org/mozilla/javascript/resources/Messages.properties \ + -C $(call gb_UnpackedTarball_get_dir,rhino)/src \ + org/mozilla/javascript/resources/Messages_en.properties \ + -C $(call gb_UnpackedTarball_get_dir,rhino)/src \ + org/mozilla/javascript/resources/Messages_fr.properties \ + -C $(call gb_UnpackedTarball_get_dir,rhino)/src \ + org/mozilla/javascript/tools/debugger/test.js \ + -C $(call gb_UnpackedTarball_get_dir,rhino)/src \ + org/mozilla/javascript/tools/resources/Messages.properties \ ) $(call gb_Trace_EndRange,rhino,EXTERNAL) diff --git a/external/rhino/OfficeScriptInfo.java b/external/rhino/OfficeScriptInfo.java deleted file mode 100644 index eb1d78641d23..000000000000 --- a/external/rhino/OfficeScriptInfo.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * 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 . - */ - -package org.mozilla.javascript.tools.debugger; -import java.net.URL; -import java.util.HashMap; -import org.mozilla.javascript.Scriptable; - -public class OfficeScriptInfo -{ - private HashMap<String, SFScriptInfo> loadedSFScripts = new HashMap<String, SFScriptInfo>(); - - public void addScript( URL url, Scriptable scope, Runnable closeCallback ) - { - addScript( url.toString(), url, scope, closeCallback ); - } - - public void addScript( String key, URL url, Scriptable scope, Runnable closeCallback ) - { - SFScriptInfo si = loadedSFScripts.get( key ); - if ( si == null ) - { - si = new SFScriptInfo(); - si.url = url; - si.scope = scope; - si.closeCallback = closeCallback; - loadedSFScripts.put( key, si ); - } - } - - public void deleteScript( String key ) - { - SFScriptInfo info = loadedSFScripts.remove( key ); - if ( info != null ) - { - if ( info.closeCallback != null ) - { - System.out.println("** In removeSFScriptInfo have callback for " + key ); - info.closeCallback.run(); // really need to do this in separate thread???? - } - } - } - - public Scriptable getScriptScope( String key ) - { - Scriptable result = null; - SFScriptInfo info = loadedSFScripts.get( key ); - if ( info != null ) - { - result = info.scope; - } - return result; - } - - public URL getScriptUrl( String key ) - { - URL result = null; - SFScriptInfo info = loadedSFScripts.get( key ); - if ( info != null ) - { - result = info.url; - } - return result; - } - public boolean hasScript( String key ) - { - boolean result = true; - SFScriptInfo info = loadedSFScripts.get( key ); - if ( info == null ) - { - result = false; - } - return result; - } - - public void setScriptRunning( String key, boolean running ) - { - SFScriptInfo info = loadedSFScripts.get( key ); - if ( info != null ) - { - info.isExecuting = running; - } - } - - public boolean isScriptRunning( String key ) - { - boolean result = false; - SFScriptInfo info = loadedSFScripts.get( key ); - if ( info != null ) - { - result = info.isExecuting; - } - return result; - } - - class SFScriptInfo - { - Scriptable scope; - boolean isExecuting; - URL url; - Runnable closeCallback; - } -} diff --git a/external/rhino/UnpackedTarball_rhino.mk b/external/rhino/UnpackedTarball_rhino.mk index 15a596eb1b0f..8cb9fd387384 100644 --- a/external/rhino/UnpackedTarball_rhino.mk +++ b/external/rhino/UnpackedTarball_rhino.mk @@ -11,15 +11,4 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,rhino)) $(eval $(call gb_UnpackedTarball_set_tarball,rhino,$(RHINO_TARBALL),,rhino)) -$(eval $(call gb_UnpackedTarball_set_patchlevel,rhino,2)) - -$(eval $(call gb_UnpackedTarball_add_patches,rhino,\ - external/rhino/rhino1_5R5.patch \ - external/rhino/rhino1_5R5-find_swing.patch \ - external/rhino/rhino1_5R5-updateToolTip.patch \ - external/rhino/rhino-classpath.patch.1 \ -)) - -$(eval $(call gb_UnpackedTarball_add_file,rhino,toolsrc/org/mozilla/javascript/tools/debugger/OfficeScriptInfo.java,external/rhino/OfficeScriptInfo.java)) - # vim: set noet sw=4 ts=4: diff --git a/external/rhino/filelist.txt b/external/rhino/filelist.txt new file mode 100644 index 000000000000..9ded7087e132 --- /dev/null +++ b/external/rhino/filelist.txt @@ -0,0 +1,330 @@ +src/org/mozilla/classfile/ByteCode.java +src/org/mozilla/classfile/ClassFileField.java +src/org/mozilla/classfile/ClassFileMethod.java +src/org/mozilla/classfile/ClassFileWriter.java +src/org/mozilla/classfile/ConstantEntry.java +src/org/mozilla/classfile/ConstantPool.java +src/org/mozilla/classfile/ExceptionTableEntry.java +src/org/mozilla/classfile/FieldOrMethodRef.java +src/org/mozilla/classfile/SuperBlock.java +src/org/mozilla/classfile/TypeInfo.java +src/org/mozilla/javascript/AbstractEcmaObjectOperations.java +src/org/mozilla/javascript/AccessorSlot.java +src/org/mozilla/javascript/Arguments.java +src/org/mozilla/javascript/ArrowFunction.java +src/org/mozilla/javascript/BaseFunction.java +src/org/mozilla/javascript/BoundFunction.java +src/org/mozilla/javascript/Callable.java +src/org/mozilla/javascript/ClassCache.java +src/org/mozilla/javascript/ClassShutter.java +src/org/mozilla/javascript/CodeGenerator.java +src/org/mozilla/javascript/CompilerEnvirons.java +src/org/mozilla/javascript/ConsString.java +src/org/mozilla/javascript/ConstProperties.java +src/org/mozilla/javascript/Constructable.java +src/org/mozilla/javascript/Context.java +src/org/mozilla/javascript/ContextAction.java +src/org/mozilla/javascript/ContextFactory.java +src/org/mozilla/javascript/ContextListener.java +src/org/mozilla/javascript/ContinuationPending.java +src/org/mozilla/javascript/DToA.java +src/org/mozilla/javascript/Decompiler.java +src/org/mozilla/javascript/DefaultErrorReporter.java +src/org/mozilla/javascript/DefiningClassLoader.java +src/org/mozilla/javascript/Delegator.java +src/org/mozilla/javascript/ES6Generator.java +src/org/mozilla/javascript/ES6Iterator.java +src/org/mozilla/javascript/EcmaError.java +src/org/mozilla/javascript/EmbeddedSlotMap.java +src/org/mozilla/javascript/EqualObjectGraphs.java +src/org/mozilla/javascript/ErrorReporter.java +src/org/mozilla/javascript/Evaluator.java +src/org/mozilla/javascript/EvaluatorException.java +src/org/mozilla/javascript/ExternalArrayData.java +src/org/mozilla/javascript/Function.java +src/org/mozilla/javascript/FunctionObject.java +src/org/mozilla/javascript/GeneratedClassLoader.java +src/org/mozilla/javascript/HashSlotMap.java +src/org/mozilla/javascript/Hashtable.java +src/org/mozilla/javascript/IRFactory.java +src/org/mozilla/javascript/Icode.java +src/org/mozilla/javascript/IdFunctionCall.java -e ... etc. - the rest is truncated