Rebased ref, commits from common ancestor:
commit 62a6ca6dcfe253f124c4844faef1c709bb1d7c73
Author: Tamás Zolnai <[email protected]>
AuthorDate: Mon Nov 24 14:16:25 2025 +0100
Commit: Tamás Zolnai <[email protected]>
CommitDate: Thu Dec 4 14:38:33 2025 +0100
Add baseline grid.
Change-Id: I40c4cd4beeab6b1416365e9e728bfe1a7756b5c5
diff --git a/cui/inc/treeopt.hrc b/cui/inc/treeopt.hrc
index 0edd9c3aa06d..48c7b06b89b6 100644
--- a/cui/inc/treeopt.hrc
+++ b/cui/inc/treeopt.hrc
@@ -71,7 +71,7 @@ const std::pair<TranslateId, sal_uInt16>
SID_SW_EDITOPTIONS_RES[] =
{ NC_("SID_SW_EDITOPTIONS_RES", "General"), RID_SW_TP_OPTLOAD_PAGE
},
{ NC_("SID_SW_EDITOPTIONS_RES", "View"), RID_SW_TP_CONTENT_OPT },
{ NC_("SID_SW_EDITOPTIONS_RES", "Formatting Aids"),
RID_SW_TP_OPTSHDWCRSR },
- { NC_("SID_SW_EDITOPTIONS_RES", "Grid"), RID_SVXPAGE_GRID },
+ { NC_("SID_SW_EDITOPTIONS_RES", "Grids"), RID_SVXPAGE_GRID
},
{ NC_("SID_SW_EDITOPTIONS_RES", "Basic Fonts
(Western)"),RID_SW_TP_STD_FONT },
{ NC_("SID_SW_EDITOPTIONS_RES", "Basic Fonts
(Asian)"),RID_SW_TP_STD_FONT_CJK },
{ NC_("SID_SW_EDITOPTIONS_RES", "Basic Fonts (CTL)"),
RID_SW_TP_STD_FONT_CTL },
diff --git a/include/svx/optgrid.hxx b/include/svx/optgrid.hxx
index d6dc7310def2..1bb80e1a7ad5 100644
--- a/include/svx/optgrid.hxx
+++ b/include/svx/optgrid.hxx
@@ -144,6 +144,11 @@ protected:
std::unique_ptr<weld::MetricSpinButton> m_xMtrFldBezAngle;
std::unique_ptr<weld::Widget> m_xMtrFldBezAngleImg;
+ // Baseline grid related items used only by Writer
+ std::unique_ptr<weld::Widget> m_xBaselineGrid;
+ std::unique_ptr<weld::CheckButton> m_xCbxBaselineGridVisible;
+ std::unique_ptr<weld::Widget> m_xCbxBaselineGridVisibleImg;
+
bool IsDrawMode() const { return m_Emode == DRAW_MODE; }
DECL_LINK(ClickRotateHdl_Impl, weld::Toggleable&, void);
diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
index 3ce84488d980..fba655b954ee 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
@@ -1505,7 +1505,7 @@
<desc>Contains options for the grid.</desc>
</info>
<prop oor:name="SnapToGrid" oor:type="xs:boolean" oor:nillable="false">
- <!-- UIHints: Tools - Options - Text document Grid - [Section]
Options -->
+ <!-- UIHints: Tools - Options - LibreOffice Writer - Grids -
[Section] Options -->
<info>
<desc>Moves frames, drawing elements, and form functions only
between the grid points.</desc>
<label>Snap to grid</label>
@@ -1513,7 +1513,7 @@
<value>false</value>
</prop>
<prop oor:name="VisibleGrid" oor:type="xs:boolean"
oor:nillable="false">
- <!-- UIHints: Tools - Options - Text document Grid - [Section]
Options -->
+ <!-- UIHints: Tools - Options - LibreOffice Writer - Grids -
[Section] Options -->
<info>
<desc>Displays the grid.</desc>
<label>Visible grid</label>
@@ -1521,7 +1521,7 @@
<value>false</value>
</prop>
<prop oor:name="Synchronize" oor:type="xs:boolean"
oor:nillable="false">
- <!-- UIHints: Tools - Options - Text document Grid - [Section]
Options -->
+ <!-- UIHints: Tools - Options - LibreOffice Writer - Grids -
[Section] Options -->
<info>
<desc>Changes the current grid settings symmetrically. The
resolution and subdivision for the X- and Y-axis remains the same.</desc>
<label>Synchronize axes</label>
@@ -1534,7 +1534,7 @@
<desc>Contains settings for specifying the grid resolution.</desc>
</info>
<prop oor:name="XAxis" oor:type="xs:int" oor:nillable="false">
- <!-- UIHints: Tools - Options - Text document - Grid - [Section]
Grid -->
+ <!-- UIHints: Tools - Options - LibreOffice Writer - Grids -
[Section] Grid -->
<info>
<desc>Defines the grid points distance in the X-axis [UNIT=1/100
mm].</desc>
<label>X Axis Resolution</label>
@@ -1542,7 +1542,7 @@
<value>1000</value>
</prop>
<prop oor:name="YAxis" oor:type="xs:int" oor:nillable="false">
- <!-- UIHints: Tools - Options - Text document - Grid - [Section]
Grid -->
+ <!-- UIHints: Tools - Options - LibreOffice Writer - Grids -
[Section] Grid -->
<info>
<desc>Defines the grid points distance in the Y-axis [UNIT=1/100
mm].</desc>
<label>Y Axis Resolution</label>
@@ -1555,7 +1555,7 @@
<desc>Contains settings for specifying the subdivision of the
grid.</desc>
</info>
<prop oor:name="XAxis" oor:type="xs:int" oor:nillable="false">
- <!-- UIHints: Tools - Options - Text document - Grid - [Section]
Grid -->
+ <!-- UIHints: Tools - Options - LibreOffice Writer - Grids -
[Section] Grid -->
<info>
<desc>Specifies the number of intervals between two grid points on
the X-axis.</desc>
<label>X Axis Subdivision</label>
@@ -1563,7 +1563,7 @@
<value>3</value>
</prop>
<prop oor:name="YAxis" oor:type="xs:int" oor:nillable="false">
- <!-- UIHints: Tools - Options - Text document - Grid - [Section]
Grid -->
+ <!-- UIHints: Tools - Options - LibreOffice Writer - Grids -
[Section] Grid -->
<info>
<desc>Defines the distance between the grid points on the
Y-axis.</desc>
<label>Y Axis Subdivision</label>
@@ -1572,6 +1572,19 @@
</prop>
</group>
</group>
+ <group oor:name="BaselineGrid">
+ <info>
+ <desc>Contains various options for the baseline grid.</desc>
+ </info>
+ <prop oor:name="VisibleGrid" oor:type="xs:boolean" oor:nillable="false">
+ <!-- UIHints: Tools - Options - LibreOffice Writer - Grids - [Section]
Baseline Grid -->
+ <info>
+ <desc>Displays the baseline grid.</desc>
+ <label>Visible grid</label>
+ </info>
+ <value>false</value>
+ </prop>
+ </group>
<group oor:name="DefaultFont">
<info>
<desc>Specifies the basic western fonts to be used.</desc>
diff --git a/svx/source/dialog/optgrid.cxx b/svx/source/dialog/optgrid.cxx
index 6447c47ae608..4bb23f2752ff 100644
--- a/svx/source/dialog/optgrid.cxx
+++ b/svx/source/dialog/optgrid.cxx
@@ -137,6 +137,9 @@ SvxGridTabPage::SvxGridTabPage(weld::Container* pPage,
weld::DialogController* p
, m_xMtrFldAngle(m_xBuilder->weld_metric_spin_button(u"mtrfldangle"_ustr,
FieldUnit::DEGREE))
,
m_xMtrFldBezAngle(m_xBuilder->weld_metric_spin_button(u"mtrfldbezangle"_ustr,
FieldUnit::DEGREE))
, m_xMtrFldBezAngleImg(m_xBuilder->weld_widget(u"lockmtrfldbezangle"_ustr))
+ , m_xBaselineGrid(m_xBuilder->weld_widget(u"baselinegridframe"_ustr))
+ ,
m_xCbxBaselineGridVisible(m_xBuilder->weld_check_button(u"baselinegridvisible"_ustr))
+ ,
m_xCbxBaselineGridVisibleImg(m_xBuilder->weld_widget(u"lockbaselinegridvisible"_ustr))
{
// This page requires exchange Support
SetExchangeSupport();
@@ -205,7 +208,7 @@ OUString SvxGridTabPage::GetAllStrings()
OUStringBuffer sAllStrings;
OUString labels[]
= { u"label1"_ustr, u"label2"_ustr, u"flddrawx"_ustr,
u"flddrawy"_ustr, u"label6"_ustr, u"label7"_ustr, u"label3"_ustr,
- u"divisionx"_ustr, u"label4"_ustr, u"divisiony"_ustr,
u"label5"_ustr, u"label8"_ustr, u"label9"_ustr };
+ u"divisionx"_ustr, u"label4"_ustr, u"divisiony"_ustr,
u"label5"_ustr, u"label8"_ustr, u"label9"_ustr, u"label10"_ustr };
for (const auto& label : labels)
{
@@ -215,7 +218,8 @@ OUString SvxGridTabPage::GetAllStrings()
OUString checkButton[]
= { u"usegridsnap"_ustr, u"gridvisible"_ustr, u"synchronize"_ustr,
u"snaphelplines"_ustr, u"snapborder"_ustr,
- u"snapframe"_ustr, u"snappoints"_ustr, u"ortho"_ustr,
u"bigortho"_ustr, u"rotate"_ustr };
+ u"snapframe"_ustr, u"snappoints"_ustr, u"ortho"_ustr,
u"bigortho"_ustr, u"rotate"_ustr,
+ u"baselinegridvisible"_ustr };
for (const auto& check : checkButton)
{
diff --git a/svx/uiconfig/ui/optgridpage.ui b/svx/uiconfig/ui/optgridpage.ui
index d8a2ae2f39a0..7b3e0603e23a 100644
--- a/svx/uiconfig/ui/optgridpage.ui
+++ b/svx/uiconfig/ui/optgridpage.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.38.2 -->
+<!-- Generated with glade 3.40.0 -->
<interface domain="svx">
<requires lib="gtk+" version="3.24"/>
<object class="GtkAdjustment" id="adjustment1">
@@ -960,6 +960,72 @@
<property name="position">2</property>
</packing>
</child>
+ <child>
+ <object class="GtkFrame" id="baselinegridframe">
+ <property name="no-show-all">True</property>
+ <property name="can-focus">False</property>
+ <property name="label-xalign">0</property>
+ <property name="shadow-type">none</property>
+ <child>
+ <!-- n-columns=2 n-rows=1 -->
+ <object class="GtkGrid" id="grid10">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="margin-start">12</property>
+ <property name="margin-top">6</property>
+ <property name="hexpand">True</property>
+ <property name="row-spacing">6</property>
+ <child>
+ <object class="GtkCheckButton" id="baselinegridvisible">
+ <property name="label" translatable="yes"
context="optgridpage|baselinegridvisible">V_isible grid</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="baselinegridvisible-atkobject">
+ <property name="AtkObject::accessible-description"
translatable="yes" context="extended_tip|baselinegridvisible">Specifies whether
to display the baseline grid.</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkImage" id="lockbaselinegridvisible">
+ <property name="can-focus">False</property>
+ <property name="no-show-all">True</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="icon-name">res/lock.png</property>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label10">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="label" translatable="yes"
context="optgridpage|label10">Baseline Grid</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
<child internal-child="accessible">
<object class="AtkObject" id="OptGridPage-atkobject">
<property name="AtkObject::accessible-description" translatable="yes"
context="extended_tip|OptGridPage">Specifies the settings for the configurable
grid on your document pages. This grid helps you determine the exact position
of your objects. You can also set this grid in line with the "magnetic" snap
grid.</property>
diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index f887b4fa24e9..7e4cd65039a0 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -633,6 +633,7 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
sw/source/uibase/config/fontcfg \
sw/source/uibase/config/modcfg \
sw/source/uibase/config/prtopt \
+ sw/source/uibase/config/SwBaselineGridConfig \
sw/source/uibase/config/uinums \
sw/source/uibase/config/usrpref \
sw/source/uibase/config/viewopt \
diff --git a/sw/Library_swui.mk b/sw/Library_swui.mk
index cf025735337e..016519430421 100644
--- a/sw/Library_swui.mk
+++ b/sw/Library_swui.mk
@@ -95,6 +95,7 @@ $(eval $(call gb_Library_add_exception_objects,swui,\
sw/source/ui/config/optcomp \
sw/source/ui/config/optload \
sw/source/ui/config/optpage \
+ sw/source/ui/config/SwGridTabPage \
sw/source/ui/dialog/abstract \
sw/source/ui/dialog/addrdlg \
sw/source/ui/dialog/ascfldlg \
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 4757f9f50174..5b1b63310c53 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -879,6 +879,7 @@ class SwUINumRuleItem;
#define FN_TEXT_BOX (FN_PARAM2+28) /* TextBox Property*/
#define FN_BOOKMARK_HIDDEN (FN_PARAM2+29) /* Hidden Property of
bookmarks*/
#define FN_BOOKMARK_CONDITION (FN_PARAM2+30) /* Condition Property
of bookmarks*/
+#define FN_PARAM_BASELINE_GRID_VISIBLE
TypedWhichId<SfxBoolItem>(FN_PARAM2+31) /* Baseline grid visibility */
// Status: not more than 19!
#define FN_STAT_PAGE TypedWhichId<SfxStringListItem>(FN_STAT +
1)
diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx
index 64a80b5ffb64..a4120b6369fc 100644
--- a/sw/inc/viewopt.hxx
+++ b/sw/inc/viewopt.hxx
@@ -61,6 +61,7 @@ struct ViewOptFlags1
bool bSnap : 1;
bool bSynchronize : 1;
bool bGridVisible : 1;
+ bool bBaselineGridVisible : 1;
bool bOnlineSpell : 1;
bool bTreatSubOutlineLevelsAsContent : 1;
bool bShowInlineTooltips : 1; //tooltips on tracked changes
@@ -104,6 +105,7 @@ struct ViewOptFlags1
, bSnap(false)
, bSynchronize(false)
, bGridVisible(false)
+ , bBaselineGridVisible(false)
, bOnlineSpell(false)
, bTreatSubOutlineLevelsAsContent(false)
, bShowInlineTooltips(false)
@@ -146,6 +148,7 @@ struct ViewOptFlags1
&& bSnap == rOther.bSnap
&& bSynchronize == rOther.bSynchronize
&& bGridVisible == rOther.bGridVisible
+ && bBaselineGridVisible == rOther.bBaselineGridVisible
&& bOnlineSpell == rOther.bOnlineSpell
&& bTreatSubOutlineLevelsAsContent ==
rOther.bTreatSubOutlineLevelsAsContent
&& bShowInlineTooltips == rOther.bShowInlineTooltips
@@ -569,6 +572,15 @@ public:
void SetGridVisible( bool b )
{ m_nCoreOptions.bGridVisible = b; }
+ bool IsBaselineGridVisible() const
+ {
+ return m_nCoreOptions.bBaselineGridVisible;
+ }
+ void SetBaselineGridVisible( bool bVisible )
+ {
+ m_nCoreOptions.bBaselineGridVisible = bVisible;
+ }
+
bool IsOnlineSpell() const
{
return m_nCoreOptions.bOnlineSpell;
diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx
index aa2af7e0ae4c..06234ad3a8aa 100644
--- a/sw/source/core/inc/pagefrm.hxx
+++ b/sw/source/core/inc/pagefrm.hxx
@@ -38,6 +38,7 @@ class SwAnchoredObject;
namespace sw {
class VirtPageNumHint;
}
+class SwTextFormatColl;
enum class SwPageFrameInvFlags : sal_uInt8
{
@@ -173,6 +174,9 @@ public:
// Sends a Prepare() to all ContentFrames caused by a changed register
template
void PrepareRegisterChg();
+ void ComputeRegister(const SwTextFormatColl* pFormat, sal_uInt16&
rRegHeight,
+ sal_uInt16& rRegAscent) const;
+
// Appends a fly frame - the given one or a new one - at the page frame.
// Needed for <Modify> and <MakeFrames>
// - return value not needed any more
@@ -190,6 +194,8 @@ public:
void PaintGrid( OutputDevice const * pOut, SwRect const &rRect ) const;
bool HasGrid() const { return m_bHasGrid; }
+ void PaintBaselineGrid( OutputDevice& rOututDevice ) const;
+
void PaintDecorators( ) const;
virtual void PaintSubsidiaryLines( const SwPageFrame*, const SwRect& )
const override;
void AddSubsidiaryLinesBounds(const SwViewShell& rShell, RectangleVector&
rRects) const;
diff --git a/sw/source/core/layout/pagechg.cxx
b/sw/source/core/layout/pagechg.cxx
index 070b8b8ccf32..8029482c6679 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -46,6 +46,7 @@
#include <IDocumentDrawModelAccess.hxx>
#include <IDocumentSettingAccess.hxx>
#include <IDocumentFieldsAccess.hxx>
+#include <IDocumentDeviceAccess.hxx>
#include <dcontact.hxx>
#include <hints.hxx>
#include <FrameControlsManager.hxx>
@@ -66,6 +67,8 @@
#include <calbck.hxx>
#include <txtfly.hxx>
#include <frmatr.hxx>
+#include <swfntcch.hxx>
+#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
@@ -1054,21 +1057,135 @@ void SwPageFrame::PrepareRegisterChg()
if( !IsAnLower( pFrame ) )
break;
}
- if( !GetSortedObjs() )
+
+ if( GetSortedObjs() )
+ {
+ for(SwAnchoredObject* pAnchoredObj : *GetSortedObjs())
+ {
+ // #i28701#
+ if ( auto pFly = pAnchoredObj->DynCastFlyFrame() )
+ {
+ pFrame = pFly->ContainsContent();
+ while ( pFrame )
+ {
+ ::lcl_PrepFlyInCntRegister( pFrame );
+ pFrame = pFrame->GetNextContentFrame();
+ }
+ }
+ }
+ }
+
+ // If baseline grid is displayed, need to trigger a repaint
+ const SwRootFrame* pRootFrame = getRootFrame();
+ if (!pRootFrame)
+ {
return;
+ }
- for(SwAnchoredObject* pAnchoredObj : *GetSortedObjs())
+ const SwViewShell* pViewShell = pRootFrame->GetCurrShell();
+ if (!pViewShell)
{
- // #i28701#
- if ( auto pFly = pAnchoredObj->DynCastFlyFrame() )
+ return;
+ }
+
+ const SwViewOption *pViewOption = pViewShell->GetViewOptions();
+ if(!pViewOption)
+ {
+ return;
+ }
+
+ if(pViewOption->IsBaselineGridVisible())
+ {
+ InvalidatePage( this );
+ SetCompletePaint();
+ }
+}
+
+void SwPageFrame::ComputeRegister(const SwTextFormatColl* pFormat, sal_uInt16&
rRegHeight,
+ sal_uInt16& rRegAscent) const
+{
+ rRegHeight = 0;
+ rRegAscent = 0;
+
+ if (!pFormat)
+ {
+ return;
+ }
+
+ const SvxLineSpacingItem &rSpace = pFormat->GetLineSpacing();
+ if( SvxLineSpaceRule::Fix == rSpace.GetLineSpaceRule() )
+ {
+ rRegHeight = rSpace.GetLineHeight();
+ rRegAscent = ( 4 * rRegHeight ) / 5;
+ }
+ else
+ {
+ SwViewShell *pSh = getRootFrame()->GetCurrShell();
+ SwFontAccess aFontAccess( pFormat, pSh );
+ SwFont aFnt( aFontAccess.Get()->GetFont() );
+
+ OutputDevice *pOut = nullptr;
+ if(pSh)
+ {
+ if( !pSh->GetViewOptions()->getBrowseMode() ||
+ pSh->GetViewOptions()->IsPrtFormat() )
+ pOut =
pSh->GetDoc()->getIDocumentDeviceAccess().getReferenceDevice( true );
+
+ if(!pOut )
+ pOut = pSh->GetWin()->GetOutDev();
+ }
+ else
{
- pFrame = pFly->ContainsContent();
- while ( pFrame )
+ pOut = Application::GetDefaultDevice();
+ }
+
+ MapMode aOldMap( pOut->GetMapMode() );
+ pOut->SetMapMode( MapMode( MapUnit::MapTwip ) );
+
+ aFnt.ChgFnt( pSh, *pOut );
+ rRegHeight = aFnt.GetHeight( pSh, *pOut );
+ sal_uInt16 nNetHeight = rRegHeight;
+
+ switch( rSpace.GetLineSpaceRule() )
+ {
+ case SvxLineSpaceRule::Auto:
+ break;
+ case SvxLineSpaceRule::Min:
+ {
+ if( rRegHeight < rSpace.GetLineHeight() )
+ rRegHeight = rSpace.GetLineHeight();
+ break;
+ }
+ default:
+ OSL_FAIL( ": unknown LineSpaceRule" );
+ }
+ switch( rSpace.GetInterLineSpaceRule() )
+ {
+ case SvxInterLineSpaceRule::Off:
+ break;
+ case SvxInterLineSpaceRule::Prop:
+ {
+ tools::Long nTmp = rSpace.GetPropLineSpace();
+ if( nTmp < 50 )
+ nTmp = nTmp ? 50 : 100;
+ nTmp *= rRegHeight;
+ nTmp /= 100;
+ if( !nTmp )
+ ++nTmp;
+ rRegHeight = o3tl::narrowing<sal_uInt16>(nTmp);
+ nNetHeight = rRegHeight;
+ break;
+ }
+ case SvxInterLineSpaceRule::Fix:
{
- ::lcl_PrepFlyInCntRegister( pFrame );
- pFrame = pFrame->GetNextContentFrame();
+ rRegHeight = rRegHeight + rSpace.GetInterLineSpace();
+ nNetHeight = rRegHeight;
+ break;
}
+ default: OSL_FAIL( ": unknown InterLineSpaceRule" );
}
+ rRegAscent = rRegHeight - nNetHeight + aFnt.GetAscent( pSh, *pOut );
+ pOut->SetMapMode( aOldMap );
}
}
diff --git a/sw/source/core/layout/paintfrm.cxx
b/sw/source/core/layout/paintfrm.cxx
index c4d5caf3c0e2..6d92b9f3a6c7 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -81,6 +81,7 @@
#include <DocumentSettingManager.hxx>
#include <IDocumentDeviceAccess.hxx>
#include <IDocumentDrawModelAccess.hxx>
+#include <IDocumentStylePoolAccess.hxx>
#include <ndole.hxx>
#include <PostItMgr.hxx>
@@ -129,6 +130,7 @@
#include <ndtxt.hxx>
#include <unotools/configmgr.hxx>
#include <vcl/hatch.hxx>
+#include <poolfmt.hxx>
using namespace ::editeng;
using namespace ::com::sun::star;
@@ -3487,6 +3489,8 @@ void SwRootFrame::PaintSwFrame(vcl::RenderContext&
rRenderContext, SwRect const&
pPageView->DrawPageViewGrid(*pSh->GetOut(),
aPaintRect.SVRect(), pSh->GetViewOptions()->GetTextGridColor() );
}
+ pPage->PaintBaselineGrid( *pSh->GetOut() );
+
// #i68597#
// moved paint post-process for DrawingLayer overlay here, see
above
{
@@ -6185,6 +6189,91 @@ void SwPageFrame::PaintGrid( OutputDevice const * pOut,
SwRect const &rRect ) co
}
}
+void SwPageFrame::PaintBaselineGrid(OutputDevice& rOututDevice) const
+{
+ // Not displayed for printing.
+ if (rOututDevice.GetOutDevType() == OUTDEV_PRINTER)
+ {
+ return;
+ }
+
+ const SwRootFrame* pRootFrame = getRootFrame();
+ if (!pRootFrame)
+ {
+ return;
+ }
+
+ const SwViewShell* pViewShell = pRootFrame->GetCurrShell();
+ if (!pViewShell)
+ {
+ return;
+ }
+
+ const SwViewOption *pViewOption = pViewShell->GetViewOptions();
+ if(!pViewOption)
+ {
+ return;
+ }
+
+ // Draw if baseline grid visibility option is set
+ if(!pViewOption->IsBaselineGridVisible())
+ {
+ return;
+ }
+
+ const SwPageDesc* pPageDesc = GetPageDesc();
+ if (!pPageDesc)
+ {
+ return;
+ }
+
+ sal_uInt16 nLineHeight = 0;
+ sal_uInt16 nLineOffset = 0;
+ // If page line-spacing is enabled, use the selected paragraph style to
compute height / ascent values.
+ const SwTextFormatColl* pRegisterFormat =
pPageDesc->GetRegisterFormatColl();
+ if (pRegisterFormat)
+ {
+ ComputeRegister(pRegisterFormat, nLineHeight, nLineOffset);
+ }
+ else
+ {
+ // If page line spacing is disabled, use the standard paragraph style
(Body text) to compute
+ // height / ascent values.
+ SwDoc* pDoc = pViewShell->GetDoc();
+ if (!pDoc)
+ {
+ return;
+ }
+ const SwTextFormatColl* pDefaultFormat
+ =
pDoc->getIDocumentStylePoolAccess().GetTextCollFromPool(RES_POOLCOLL_TEXT);
+ if (!pDefaultFormat)
+ {
+ return;
+ }
+ ComputeRegister(pDefaultFormat, nLineHeight, nLineOffset);
+ }
+
+ const SwLayoutFrame* pBody = FindBodyCont();
+ if (!pBody)
+ {
+ return;
+ }
+
+ SwRect aGridArea(pBody->getFramePrintArea());
+ aGridArea += pBody->getFrameArea().Pos();
+ aGridArea.AddTop(nLineOffset);
+
+ const Color aGridColor(COL_BLACK);
+ const Color aOriginalLineColor(rOututDevice.GetLineColor());
+ rOututDevice.SetLineColor(aGridColor);
+
+ const tools::Long nLineWidth = aGridArea.Right() - aGridArea.Left();
+ rOututDevice.DrawGrid(aGridArea.SVRect(), Size(nLineWidth, nLineHeight),
+ DrawGridFlags::HorzLines);
+
+ rOututDevice.SetLineColor(aOriginalLineColor);
+}
+
/**
* Paint margin area of a page
*
diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx
index 5d5146e2f8c1..bf87029fb18d 100644
--- a/sw/source/core/text/porrst.cxx
+++ b/sw/source/core/text/porrst.cxx
@@ -554,7 +554,8 @@ bool SwTextFrame::FillRegister( SwTwips& rRegStart,
sal_uInt16& rRegDiff )
pFrame = pFrame->FindPageFrame();
if( pFrame->IsPageFrame() )
{
- SwPageDesc* pDesc = const_cast<SwPageFrame*>(static_cast<const
SwPageFrame*>(pFrame))->FindPageDesc();
+ const SwPageFrame* pPage = static_cast<const SwPageFrame*>(pFrame);
+ SwPageDesc* pDesc =
const_cast<SwPageFrame*>(pPage)->FindPageDesc();
if( pDesc )
{
rRegDiff = pDesc->GetRegHeight();
@@ -563,80 +564,12 @@ bool SwTextFrame::FillRegister( SwTwips& rRegStart,
sal_uInt16& rRegDiff )
const SwTextFormatColl *pFormat =
pDesc->GetRegisterFormatColl();
if( pFormat )
{
- const SvxLineSpacingItem &rSpace =
pFormat->GetLineSpacing();
- if( SvxLineSpaceRule::Fix == rSpace.GetLineSpaceRule()
)
- {
- rRegDiff = rSpace.GetLineHeight();
- pDesc->SetRegHeight( rRegDiff );
- pDesc->SetRegAscent( ( 4 * rRegDiff ) / 5 );
- }
- else
- {
- SwViewShell *pSh = getRootFrame()->GetCurrShell();
- SwFontAccess aFontAccess( pFormat, pSh );
- SwFont aFnt( aFontAccess.Get()->GetFont() );
-
- OutputDevice *pOut = nullptr;
- if( !pSh ||
!pSh->GetViewOptions()->getBrowseMode() ||
- pSh->GetViewOptions()->IsPrtFormat() )
- pOut =
GetDoc().getIDocumentDeviceAccess().getReferenceDevice( true );
-
- if( pSh && !pOut )
- pOut = pSh->GetWin()->GetOutDev();
-
- if( !pOut )
- pOut = Application::GetDefaultDevice();
-
- MapMode aOldMap( pOut->GetMapMode() );
- pOut->SetMapMode( MapMode( MapUnit::MapTwip ) );
-
- aFnt.ChgFnt( pSh, *pOut );
- rRegDiff = aFnt.GetHeight( pSh, *pOut );
- sal_uInt16 nNetHeight = rRegDiff;
-
- switch( rSpace.GetLineSpaceRule() )
- {
- case SvxLineSpaceRule::Auto:
- break;
- case SvxLineSpaceRule::Min:
- {
- if( rRegDiff < rSpace.GetLineHeight() )
- rRegDiff = rSpace.GetLineHeight();
- break;
- }
- default:
- OSL_FAIL( ": unknown LineSpaceRule" );
- }
- switch( rSpace.GetInterLineSpaceRule() )
- {
- case SvxInterLineSpaceRule::Off:
- break;
- case SvxInterLineSpaceRule::Prop:
- {
- tools::Long nTmp =
rSpace.GetPropLineSpace();
- if( nTmp < 50 )
- nTmp = nTmp ? 50 : 100;
- nTmp *= rRegDiff;
- nTmp /= 100;
- if( !nTmp )
- ++nTmp;
- rRegDiff =
o3tl::narrowing<sal_uInt16>(nTmp);
- nNetHeight = rRegDiff;
- break;
- }
- case SvxInterLineSpaceRule::Fix:
- {
- rRegDiff = rRegDiff +
rSpace.GetInterLineSpace();
- nNetHeight = rRegDiff;
- break;
- }
- default: OSL_FAIL( ": unknown
InterLineSpaceRule" );
- }
- pDesc->SetRegHeight( rRegDiff );
- pDesc->SetRegAscent( rRegDiff - nNetHeight +
- aFnt.GetAscent( pSh, *pOut )
);
- pOut->SetMapMode( aOldMap );
- }
+ sal_uInt16 nRegHeight = 0;
+ sal_uInt16 nRegAscent = 0;
+ pPage->ComputeRegister(pFormat, nRegHeight,
nRegAscent);
+ pDesc->SetRegHeight( nRegHeight );
+ pDesc->SetRegAscent( nRegAscent );
+ rRegDiff = pDesc->GetRegHeight();
}
}
const tools::Long nTmpDiff = pDesc->GetRegAscent() - rRegDiff;
diff --git a/sw/source/ui/config/SwGridTabPage.cxx
b/sw/source/ui/config/SwGridTabPage.cxx
new file mode 100644
index 000000000000..77095d9919ea
--- /dev/null
+++ b/sw/source/ui/config/SwGridTabPage.cxx
@@ -0,0 +1,60 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4;
fill-column: 100 -*- */
+/*
+ * 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/.
+ */
+
+#include <sal/config.h>
+
+#include <cmdid.h>
+#include <SwGridTabPage.hxx>
+
+#include <officecfg/Office/Writer.hxx>
+#include <svl/eitem.hxx>
+
+SwGridTabPage::SwGridTabPage(weld::Container* pPage, weld::DialogController*
pController,
+ const SfxItemSet& rItemSet)
+ : SvxGridTabPage(pPage, pController, rItemSet)
+{
+ m_xBaselineGrid->show();
+}
+
+bool SwGridTabPage::FillItemSet(SfxItemSet* pItemSet)
+{
+ SvxGridTabPage::FillItemSet(pItemSet);
+
+ if (m_xCbxBaselineGridVisible->get_state_changed_from_saved())
+ {
+ pItemSet->Put(
+ SfxBoolItem(FN_PARAM_BASELINE_GRID_VISIBLE,
m_xCbxBaselineGridVisible->get_active()));
+ }
+
+ return true;
+}
+
+void SwGridTabPage::Reset(const SfxItemSet* pItemSet)
+{
+ SvxGridTabPage::Reset(pItemSet);
+
+ if (const SfxBoolItem* pItem =
pItemSet->GetItemIfSet(FN_PARAM_BASELINE_GRID_VISIBLE, false))
+ {
+ m_xCbxBaselineGridVisible->set_active(pItem->GetValue());
+ }
+
+ const bool bReadOnly =
officecfg::Office::Writer::BaselineGrid::VisibleGrid::isReadOnly();
+ m_xCbxBaselineGridVisible->set_sensitive(!bReadOnly);
+ m_xCbxBaselineGridVisibleImg->set_visible(bReadOnly);
+ m_xCbxBaselineGridVisible->save_state();
+}
+
+std::unique_ptr<SfxTabPage> SwGridTabPage::Create(weld::Container* pPage,
+ weld::DialogController*
pController,
+ const SfxItemSet* pItemSet)
+{
+ return std::make_unique<SwGridTabPage>(pPage, pController, *pItemSet);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s
cinkeys+=0=break: */
diff --git a/sw/source/ui/dialog/swdlgfact.cxx
b/sw/source/ui/dialog/swdlgfact.cxx
index a29d8e86a175..c1fec98137b7 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -94,6 +94,7 @@
#include <formatlinebreak.hxx>
#include <translatelangselect.hxx>
#include <copyfielddlg.hxx>
+#include <SwGridTabPage.hxx>
using namespace css::frame;
using namespace css::uno;
@@ -1290,6 +1291,9 @@ CreateTabPage
SwAbstractDialogFactory_Impl::GetTabPageCreatorFunc( sal_uInt16 nI
case RID_SW_TP_COMPARISON_OPT :
pRet = SwCompareOptionsTabPage::Create;
break;
+ case RID_SVXPAGE_GRID :
+ pRet = SwGridTabPage::Create;
+ break;
}
return pRet;
diff --git a/sw/source/uibase/app/appopt.cxx b/sw/source/uibase/app/appopt.cxx
index bcd5c69d725a..927eeae82842 100644
--- a/sw/source/uibase/app/appopt.cxx
+++ b/sw/source/uibase/app/appopt.cxx
@@ -103,7 +103,8 @@ std::optional<SfxItemSet> SwModule::CreateItemSet(
sal_uInt16 nId )
FN_PARAM_WRTSHELL, FN_PARAM_WRTSHELL,
FN_PARAM_SHADOWCURSOR, FN_PARAM_SHADOWCURSOR,
FN_PARAM_CRSR_IN_PROTECTED, FN_PARAM_CRSR_IN_PROTECTED,
- FN_PARAM_FMT_AIDS_AUTOCOMPL, FN_PARAM_FMT_AIDS_AUTOCOMPL>
+ FN_PARAM_FMT_AIDS_AUTOCOMPL, FN_PARAM_FMT_AIDS_AUTOCOMPL,
+ FN_PARAM_BASELINE_GRID_VISIBLE, FN_PARAM_BASELINE_GRID_VISIBLE>
aRet(GetPool());
aRet.Put( SwDocDisplayItem( aViewOpt ) );
@@ -202,6 +203,9 @@ std::optional<SfxItemSet> SwModule::CreateItemSet(
sal_uInt16 nId )
aRet.Put(aGridItem);
+ // Baseline grid options
+ aRet.Put( SfxBoolItem(FN_PARAM_BASELINE_GRID_VISIBLE,
aViewOpt.IsBaselineGridVisible()));
+
// Options for PrintTabPage
const SwPrintData* pOpt = GetPrtOptions(!bTextDialog);
SwAddPrinterItem aAddPrinterItem(*pOpt );
@@ -372,6 +376,12 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const
SfxItemSet& rSet )
}
}
+ // Baseline grid options
+ if( const SfxBoolItem* pItem = rSet.GetItemIfSet(
FN_PARAM_BASELINE_GRID_VISIBLE, false ))
+ {
+ aViewOpt.SetBaselineGridVisible(pItem->GetValue());
+ }
+
// Interpret Writer Printer Options
if( const SwAddPrinterItem* pAddPrinterAttr = rSet.GetItemIfSet(
FN_PARAM_ADDPRINTER, false ) )
{
@@ -454,9 +464,15 @@ std::unique_ptr<SfxTabPage> SwModule::CreateTabPage(
sal_uInt16 nId, weld::Conta
break;
}
case RID_SW_TP_HTML_OPTGRID_PAGE:
- case RID_SVXPAGE_GRID:
xRet = SvxGridTabPage::Create(pPage, pController, rSet);
break;
+ case RID_SVXPAGE_GRID:
+ {
+ SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
+ ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
+ xRet = (*fnCreatePage)( pPage, pController, &rSet );
+ break;
+ }
case RID_SW_TP_STD_FONT:
case RID_SW_TP_STD_FONT_CJK:
diff --git a/sw/source/uibase/config/SwBaselineGridConfig.cxx
b/sw/source/uibase/config/SwBaselineGridConfig.cxx
new file mode 100644
index 000000000000..d356d9aeb6bb
--- /dev/null
+++ b/sw/source/uibase/config/SwBaselineGridConfig.cxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4;
fill-column: 100 -*- */
+/*
+ * 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/.
+ */
+
+#include <sal/config.h>
+
+#include <SwBaselineGridConfig.hxx>
+#include <usrpref.hxx>
+
+#include <o3tl/any.hxx>
+#include <osl/diagnose.h>
+
+css::uno::Sequence<OUString> SwBaselineGridConfig::GetPropertyNames()
+{
+ static css::uno::Sequence<OUString> aNames{
+ u"VisibleGrid"_ustr, // 0
+ };
+ return aNames;
+}
+
+SwBaselineGridConfig::SwBaselineGridConfig(SwMasterUsrPref& rParent)
+ : ConfigItem(u"Office.Writer/BaselineGrid"_ustr)
+ , m_rParent(rParent)
+{
+ Load();
+ EnableNotification(GetPropertyNames());
+}
+
+void SwBaselineGridConfig::ImplCommit()
+{
+ const css::uno::Sequence<OUString> aNames = GetPropertyNames();
+ css::uno::Sequence<css::uno::Any> aValues(aNames.getLength());
+ css::uno::Any* pValues = aValues.getArray();
+
+ for (int nProp = 0; nProp < aNames.getLength(); nProp++)
+ {
+ switch (nProp)
+ {
+ case 0: // "VisibleGrid",
+ pValues[nProp] <<= m_rParent.IsBaselineGridVisible();
+ break;
+ }
+ }
+ PutProperties(aNames, aValues);
+}
+
+void SwBaselineGridConfig::Load()
+{
+ const css::uno::Sequence<OUString> aNames = GetPropertyNames();
+ const css::uno::Sequence<css::uno::Any> aValues = GetProperties(aNames);
+ const css::uno::Any* pValues = aValues.getConstArray();
+
+ OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties
failed");
+ if (aValues.getLength() != aNames.getLength())
+ return;
+
+ for (int nProp = 0; nProp < aNames.getLength(); nProp++)
+ {
+ if (pValues[nProp].hasValue())
+ {
+ switch (nProp)
+ {
+ case 0: // "VisibleGrid"
+ {
+ bool bVisible = *o3tl::doAccess<bool>(pValues[nProp]);
+ m_rParent.SetBaselineGridVisible(bVisible);
+ break;
+ }
+ }
+ }
+ }
+}
+
+void SwBaselineGridConfig::Notify(const css::uno::Sequence<OUString>&) {
Load(); }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s
cinkeys+=0=break: */
diff --git a/sw/source/uibase/config/usrpref.cxx
b/sw/source/uibase/config/usrpref.cxx
index 1308ba687625..f96b66cc27a0 100644
--- a/sw/source/uibase/config/usrpref.cxx
+++ b/sw/source/uibase/config/usrpref.cxx
@@ -71,7 +71,8 @@ SwMasterUsrPref::SwMasterUsrPref(bool bWeb) :
m_aGridConfig(bWeb, *this),
m_aCursorConfig(*this),
m_pWebColorConfig(bWeb ? new SwWebColorConfig(*this) : nullptr),
- m_aFmtAidsAutoComplConfig(*this)
+ m_aFmtAidsAutoComplConfig(*this),
+ m_aBaselineGridConfig(bWeb ? std::nullopt :
std::make_optional<SwBaselineGridConfig>(*this))
{
if (comphelper::IsFuzzing())
{
diff --git a/sw/source/uibase/config/viewopt.cxx
b/sw/source/uibase/config/viewopt.cxx
index 0fc106ee026c..6c106d8e35b6 100644
--- a/sw/source/uibase/config/viewopt.cxx
+++ b/sw/source/uibase/config/viewopt.cxx
@@ -727,6 +727,10 @@ void ViewOptFlags1::dumpAsXml(xmlTextWriterPtr pWriter)
const
(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
BAD_CAST(OString::boolean(bGridVisible).getStr()));
(void)xmlTextWriterEndElement(pWriter);
+ (void)xmlTextWriterStartElement(pWriter, BAD_CAST("bBaselineGridVisible"));
+ (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
+
BAD_CAST(OString::boolean(bBaselineGridVisible).getStr()));
+ (void)xmlTextWriterEndElement(pWriter);
(void)xmlTextWriterStartElement(pWriter, BAD_CAST("bOnlineSpell"));
(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
BAD_CAST(OString::boolean(bOnlineSpell).getStr()));
diff --git a/sw/source/uibase/inc/SwBaselineGridConfig.hxx
b/sw/source/uibase/inc/SwBaselineGridConfig.hxx
new file mode 100644
index 000000000000..ea12215270c7
--- /dev/null
+++ b/sw/source/uibase/inc/SwBaselineGridConfig.hxx
@@ -0,0 +1,36 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4;
fill-column: 100 -*- */
+/*
+ * 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 <unotools/configitem.hxx>
+
+#include <com/sun/star/uno/Sequence.h>
+
+class SwMasterUsrPref;
+
+class SwBaselineGridConfig final : public utl::ConfigItem
+{
+private:
+ SwMasterUsrPref& m_rParent;
+
+ static css::uno::Sequence<OUString> GetPropertyNames();
+
+ virtual void ImplCommit() override;
+
+public:
+ SwBaselineGridConfig(SwMasterUsrPref& rParent);
+ virtual ~SwBaselineGridConfig() override = default;
+
+ virtual void Notify(const css::uno::Sequence<OUString>& aPropertyNames)
override;
+ void Load();
+ using ConfigItem::SetModified;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s
cinkeys+=0=break: */
diff --git a/sw/source/uibase/inc/SwGridTabPage.hxx
b/sw/source/uibase/inc/SwGridTabPage.hxx
new file mode 100644
index 000000000000..535e4a85c60e
--- /dev/null
+++ b/sw/source/uibase/inc/SwGridTabPage.hxx
@@ -0,0 +1,28 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4;
fill-column: 100 -*- */
+/*
+ * 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 <sfx2/tabdlg.hxx>
+#include <svx/optgrid.hxx>
+
+class SwGridTabPage final : public SvxGridTabPage
+{
+public:
+ SwGridTabPage(weld::Container* pPage, weld::DialogController* pController,
+ const SfxItemSet& rItemSet);
+ static std::unique_ptr<SfxTabPage>
+ Create(weld::Container* pPage, weld::DialogController* pController, const
SfxItemSet* pItemSet);
+ virtual ~SwGridTabPage() override = default;
+
+ virtual bool FillItemSet(SfxItemSet* pItemSet) override;
+ virtual void Reset(const SfxItemSet* pItemSet) override;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s
cinkeys+=0=break: */
diff --git a/sw/source/uibase/inc/usrpref.hxx b/sw/source/uibase/inc/usrpref.hxx
index 74789e15f641..a7ce4f076717 100644
--- a/sw/source/uibase/inc/usrpref.hxx
+++ b/sw/source/uibase/inc/usrpref.hxx
@@ -24,6 +24,8 @@
#include <fldupde.hxx>
#include <viewopt.hxx>
#include <tools/fldunit.hxx>
+#include <optional>
+#include <SwBaselineGridConfig.hxx>
class SwMasterUsrPref;
@@ -176,6 +178,7 @@ class SwMasterUsrPref : public SwViewOption
SwCursorConfig m_aCursorConfig;
std::unique_ptr<SwWebColorConfig> m_pWebColorConfig;
SwFmtAidsAutoComplConfig m_aFmtAidsAutoComplConfig;
+ std::optional<SwBaselineGridConfig> m_aBaselineGridConfig; // Not
available in web mode
public:
SwMasterUsrPref(bool bWeb);
@@ -192,6 +195,11 @@ public:
if(m_pWebColorConfig)
m_pWebColorConfig->SetModified();
m_aFmtAidsAutoComplConfig.SetModified();
+
+ if(m_aBaselineGridConfig.has_value())
+ {
+ m_aBaselineGridConfig->SetModified();
+ }
}
void SetUpdateLinkMode(sal_Int32 nSet, bool bNoModify = false)
commit 1d444ea4e30888812657a751b9aa37cf9fd4a648
Author: Tamás Zolnai <[email protected]>
AuthorDate: Wed Dec 3 14:13:42 2025 +0100
Commit: Tamás Zolnai <[email protected]>
CommitDate: Thu Dec 4 14:31:54 2025 +0100
tdf#169807: Fix applying the original page line-spacing option
The saved state of the page line-spacing checkbox was saved only when
the dialog was first opened. However, the saved state should also be
updated when a new state is applied to the document.
Change-Id: Ie1e62904027012e57f0fc48c8951a82706f16d2a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194976
Reviewed-by: Tamás Zolnai <[email protected]>
Tested-by: Jenkins
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index 54a6730315a4..868719dcd56d 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -864,6 +864,7 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet )
rSet->Put(SfxStringItem(SID_SWREGISTER_COLLECTION,
m_xRegisterLB->get_active_text()));
}
+ m_xRegisterCB->save_state();
}
if (m_xTextFlowBox->get_visible() &&
m_xTextFlowBox->get_value_changed_from_saved())
commit 395aa8c70ff3e1a8fb577f39a611dbf6e49f7e4f
Author: Xisco Fauli <[email protected]>
AuthorDate: Thu Dec 4 12:31:50 2025 +0100
Commit: Xisco Fauli <[email protected]>
CommitDate: Thu Dec 4 14:07:24 2025 +0100
checkExternalLibraries: keep rhino on branch 1.7
Change-Id: Ie1d28fc43e5266782663c4431a948aea074f7fd0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194987
Reviewed-by: Xisco Fauli <[email protected]>
Tested-by: Jenkins
diff --git a/bin/checkExternalLibraries.py b/bin/checkExternalLibraries.py
index 772f33046a5d..c323aeaf375b 100755
--- a/bin/checkExternalLibraries.py
+++ b/bin/checkExternalLibraries.py
@@ -19,6 +19,7 @@ python_branch = ""
openssl_branch = ""
postgres_branch = ""
mariadb_branch = ""
+rhino_branch = ""
libraryIds = {
"openssl": 2,
@@ -106,6 +107,10 @@ def get_library_list(fileName):
global mariadb_branch
mariadb_branch = ''.join(re.findall("\d{1,2}\.\d{1,2}",
libraryName)[0])
print("MariaDB is on branch: " + str(mariadb_branch))
+ elif libraryName.startswith("rhino"):
+ global rhino_branch
+ rhino_branch = ''.join(re.findall("\d{1,2}\.\d{1,2}",
libraryName)[0])
+ print("Rhino is on branch: " + str(rhino_branch))
libraryList.append(libraryName.lower())
return libraryList
@@ -155,6 +160,12 @@ def get_latest_version(libName):
latest_version = idx
break
+ elif libName == "rhino":
+ for idx, ver in enumerate(json['items'][item]['stable_versions']):
+ if ver.startswith(rhino_branch):
+ latest_version = idx
+ break
+
return
Version(json['items'][item]['stable_versions'][latest_version].replace("_",
".").replace("-", ".")), json['items'][item]['homepage']
if __name__ == '__main__':
commit 0f6c8e2baa1c73bf87bef27fd086ccd280a81ec5
Author: Xisco Fauli <[email protected]>
AuthorDate: Tue Oct 28 17:08:21 2025 +0100
Commit: Xisco Fauli <[email protected]>
CommitDate: Thu Dec 4 14:02:07 2025 +0100
tdf#169019: sc: Add UItest
Change-Id: Iaa10db0c44d415642826780aa207d514d8b963f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193104
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <[email protected]>
diff --git a/sc/qa/uitest/calc_tests8/dataProvider.py
b/sc/qa/uitest/calc_tests8/dataProvider.py
index 5880881fab43..cc9b9c69e85f 100644
--- a/sc/qa/uitest/calc_tests8/dataProvider.py
+++ b/sc/qa/uitest/calc_tests8/dataProvider.py
@@ -11,6 +11,10 @@ from uitest.framework import UITestCase
from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file,
select_by_text
from libreoffice.uno.propertyvalue import mkPropertyValues
from libreoffice.calc.document import get_cell_by_position
+from org.libreoffice.unotest import systemPathToFileUrl
+from libreoffice.calc.document import get_cell_by_position
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from tempfile import TemporaryDirectory
import os
@@ -83,4 +87,74 @@ class DataProvider(UITestCase):
"test1.csv")
self.do_import("CSV", test_file, "", "1")
+ def test_save_split_transformation(self):
+
+ with TemporaryDirectory() as tempdir:
+
+ xFilePath = os.path.join(tempdir, 'tdf169019-tmp.ods')
+
+ with
self.ui_test.load_file(get_url_for_data_file('tdf169019.ods')):
+
+ with
self.ui_test.execute_dialog_through_command(".uno:DataProvider") as xDialog:
+ xDB = xDialog.getChild("select_db_range")
+ select_by_text(xDB, "myImport")
+ self.assertEqual("myImport",
get_state_as_dict(xDB)['DisplayText'])
+
+ xBrowse = xDialog.getChild("browse")
+ with self.ui_test.execute_blocking_action(
+ xBrowse.executeAction, args=('CLICK', ()),
close_button="") as dialog:
+ xFileName = dialog.getChild("file_name")
+ xFileName.executeAction("TYPE",
mkPropertyValues({"TEXT": get_url_for_data_file("tdf169019.csv")}))
+ xOpen = dialog.getChild("open")
+ xOpen.executeAction("CLICK", tuple())
+
+ xProvider = xDialog.getChild("provider_lst")
+ xURL = xDialog.getChild("ed_url")
+ self.assertEqual(get_url_for_data_file("tdf169019.csv"),
get_state_as_dict(xURL)['Text'])
+ self.assertEqual("CSV",
get_state_as_dict(xProvider)['DisplayText'])
+
+ xTransformation = xDialog.getChild("transformation_box")
+ select_by_text(xTransformation, "Split Column")
+ self.assertEqual("Split Column",
get_state_as_dict(xTransformation)['DisplayText'])
+
+ xAdd = xDialog.getChild("add_transformation")
+ xAdd.executeAction("CLICK", tuple())
+
+ xSeparator1 = xDialog.getChild("ed_separator0")
+ xNumCols1 = xDialog.getChild("num_cols0")
+ xSeparator1.executeAction("TYPE",
mkPropertyValues({"TEXT":"|"}))
+ xNumCols1.executeAction("TYPE",
mkPropertyValues({"TEXT":"1"}))
+
+ xApply = xDialog.getChild("apply")
+ xApply.executeAction("CLICK", tuple())
+
+ self.assertEqual("Split Column",
get_state_as_dict(xTransformation)['DisplayText'])
+
+ xAdd = xDialog.getChild("add_transformation")
+ xAdd.executeAction("CLICK", tuple())
+
+ xSeparator2 = xDialog.getChild("ed_separator1")
+ xNumCols2 = xDialog.getChild("num_cols1")
+ xSeparator2.executeAction("TYPE",
mkPropertyValues({"TEXT":"|"}))
+ xNumCols2.executeAction("TYPE",
mkPropertyValues({"TEXT":"2"}))
+
+ xApply = xDialog.getChild("apply")
+ xApply.executeAction("CLICK", tuple())
+
+ # Save Copy as
+ with
self.ui_test.execute_dialog_through_command('.uno:SaveAs', close_button="open")
as xDialog:
+ xFileName = xDialog.getChild('file_name')
+ xFileName.executeAction('TYPE',
mkPropertyValues({'KEYCODE':'CTRL+A'}))
+ xFileName.executeAction('TYPE',
mkPropertyValues({'KEYCODE':'BACKSPACE'}))
+ xFileName.executeAction('TYPE', mkPropertyValues({'TEXT':
xFilePath}))
+
+ with self.ui_test.load_file(systemPathToFileUrl(xFilePath)) as
doc2:
+ # Without the fix in place, this test would have failed with
+ # AssertionError: 'Rank' != 'Rank|Males|Females '
+ self.assertEqual("Rank", get_cell_by_position(doc2, 0, 0,
0).getString())
+ self.assertEqual("Males", get_cell_by_position(doc2, 0, 1,
0).getString())
+ self.assertEqual("Females ", get_cell_by_position(doc2, 0, 2,
0).getString())
+ for i in range(1, 101):
+ self.assertEqual(str(i), get_cell_by_position(doc2, 0, 0,
i).getString())
+
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/data/tdf169019.csv b/sc/qa/uitest/data/tdf169019.csv
new file mode 100644
index 000000000000..1795ae3c5a70
--- /dev/null
+++ b/sc/qa/uitest/data/tdf169019.csv
@@ -0,0 +1,101 @@
+Rank|Males|Females
+1|James|Mary
+2|Michael|Patricia
+3|Robert|Jennifer
+4|John|Linda
+5|David|Elizabeth
+6|William|Barbara
+7|Richard|Susan
+8|Joseph|Jessica
+9|Thomas|Karen
+10|Christopher|Sarah
+11|Charles|Lisa
+12|Daniel|Nancy
+13|Matthew|Sandra
+14|Anthony|Betty
+15|Mark|Ashley
+16|Donald|Emily
+17|Steven|Kimberly
+18|Andrew|Margaret
+19|Paul|Donna
+20|Joshua|Michelle
+21|Kenneth|Carol
+22|Kevin|Amanda
+23|Brian|Melissa
+24|Timothy|Deborah
+25|Ronald|Stephanie
+26|George|Rebecca
+27|Jason|Sharon
+28|Edward|Laura
+29|Jeffrey|Cynthia
+30|Ryan|Dorothy
+31|Jacob|Amy
+32|Nicholas|Kathleen
+33|Gary|Angela
+34|Eric|Shirley
+35|Jonathan|Emma
+36|Stephen|Brenda
+37|Larry|Pamela
+38|Justin|Nicole
+39|Scott|Anna
+40|Brandon|Samantha
+41|Benjamin|Katherine
+42|Samuel|Christine
+43|Gregory|Debra
+44|Alexander|Rachel
+45|Patrick|Carolyn
+46|Frank|Janet
+47|Raymond|Maria
+48|Jack|Olivia
+49|Dennis|Heather
+50|Jerry|Helen
+51|Tyler|Catherine
+52|Aaron|Diane
+53|Jose|Julie
+54|Adam|Victoria
+55|Nathan|Joyce
+56|Henry|Lauren
+57|Zachary|Kelly
+58|Douglas|Christina
+59|Peter|Ruth
+60|Kyle|Joan
+61|Noah|Virginia
+62|Ethan|Judith
+63|Jeremy|Evelyn
+64|Christian|Hannah
+65|Walter|Andrea
+66|Keith|Megan
+67|Austin|Cheryl
+68|Roger|Jacqueline
+69|Terry|Madison
+70|Sean|Teresa
+71|Gerald|Abigail
+72|Carl|Sophia
+73|Dylan|Martha
+74|Harold|Sara
+75|Jordan|Gloria
+76|Jesse|Janice
+77|Bryan|Kathryn
+78|Lawrence|Ann
+79|Arthur|Isabella
+80|Gabriel|Judy
+81|Bruce|Charlotte
+82|Logan|Julia
+83|Billy|Grace
+84|Joe|Amber
+85|Alan|Alice
+86|Juan|Jean
+87|Elijah|Denise
+88|Willie|Frances
+89|Albert|Danielle
+90|Wayne|Marilyn
+91|Randy|Natalie
+92|Mason|Beverly
+93|Vincent|Diana
+94|Liam|Brittany
+95|Roy|Theresa
+96|Bobby|Kayla
+97|Caleb|Alexis
+98|Bradley|Doris
+99|Russell|Lori
+100|Lucas|Tiffany
diff --git a/sc/qa/uitest/data/tdf169019.ods b/sc/qa/uitest/data/tdf169019.ods
new file mode 100644
index 000000000000..c0b549aaad03
Binary files /dev/null and b/sc/qa/uitest/data/tdf169019.ods differ
diff --git a/sc/source/ui/miscdlgs/dataproviderdlg.cxx
b/sc/source/ui/miscdlgs/dataproviderdlg.cxx
index 0be34cbbe0ec..03beba8d6222 100644
--- a/sc/source/ui/miscdlgs/dataproviderdlg.cxx
+++ b/sc/source/ui/miscdlgs/dataproviderdlg.cxx
@@ -151,6 +151,11 @@
ScSplitColumnTransformationControl::ScSplitColumnTransformationControl(
, maDeleteTransformation(std::move(aDeleteTransformation))
, mpDoc(pDoc)
{
+ // for uitests
+ mxSeparator->set_buildable_name(mxSeparator->get_buildable_name() +
OUString::number(nIndex));
+ mxNumColumns->set_buildable_name(mxNumColumns->get_buildable_name() +
OUString::number(nIndex));
+ mxDelete->set_buildable_name(mxDelete->get_buildable_name() +
OUString::number(nIndex));
+
mxDelete->connect_clicked(LINK(this,ScSplitColumnTransformationControl,
DeleteHdl));
}
@@ -192,6 +197,11 @@
ScMergeColumnTransformationControl::ScMergeColumnTransformationControl(
, maDeleteTransformation(std::move(aDeleteTransformation))
, mpDoc(pDoc)
{
+ // for uitests
+ mxSeparator->set_buildable_name(mxSeparator->get_buildable_name() +
OUString::number(nIndex));
+ mxEdColumns->set_buildable_name(mxEdColumns->get_buildable_name() +
OUString::number(nIndex));
+ mxDelete->set_buildable_name(mxDelete->get_buildable_name() +
OUString::number(nIndex));
+
mxDelete->connect_clicked(LINK(this,ScMergeColumnTransformationControl,
DeleteHdl));
OUStringBuffer aBuffer;
commit ed14fd4aa973326863d7eb7d7e7bb765d22f9c00
Author: Xisco Fauli <[email protected]>
AuthorDate: Thu Dec 4 12:13:56 2025 +0100
Commit: Xisco Fauli <[email protected]>
CommitDate: Thu Dec 4 13:43:37 2025 +0100
libxslt: upgrade to 1.1.45
it fixes CVE-2025-11731
external/libxslt/gnome-libxslt-bug-139-apple-fix.diff.1 has been
fixed upstream
Downloaded from
https://download.gnome.org/sources/libxslt/1.1/libxslt-1.1.45.tar.xz
Change-Id: If1acddfd1730faedfd015132c132a307509641c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194986
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <[email protected]>
diff --git a/download.lst b/download.lst
index 4ad9689ad12e..1e87103999d2 100644
--- a/download.lst
+++ b/download.lst
@@ -466,8 +466,8 @@ LIBXML_TARBALL :=
libxml2-2.14.$(LIBXML_VERSION_MICRO).tar.xz
# three static lines
# so that git cherry-pick
# will not run into conflicts
-LIBXSLT_SHA256SUM :=
5a3d6b383ca5afc235b171118e90f5ff6aa27e9fea3303065231a6d403f0183a
-LIBXSLT_VERSION_MICRO := 43
+LIBXSLT_SHA256SUM :=
9acfe68419c4d06a45c550321b3212762d92f41465062ca4ea19e632ee5d216e
+LIBXSLT_VERSION_MICRO := 45
LIBXSLT_TARBALL := libxslt-1.1.$(LIBXSLT_VERSION_MICRO).tar.xz
# three static lines
# so that git cherry-pick
diff --git a/external/libxslt/ExternalPackage_libxslt.mk
b/external/libxslt/ExternalPackage_libxslt.mk
index 6d34589ea71a..287c529b4b72 100644
--- a/external/libxslt/ExternalPackage_libxslt.mk
+++ b/external/libxslt/ExternalPackage_libxslt.mk
@@ -25,7 +25,7 @@ $(eval $(call
gb_ExternalPackage_add_file,libxslt,$(LIBO_LIB_FOLDER)/libexslt.dl
endif
else # OS!=WNT
$(eval $(call
gb_ExternalPackage_add_file,libxslt,$(LIBO_LIB_FOLDER)/libxslt.so.1,libxslt/.libs/libxslt.so.1.1.$(LIBXSLT_VERSION_MICRO)))
-$(eval $(call
gb_ExternalPackage_add_file,libxslt,$(LIBO_LIB_FOLDER)/libexslt.so.0,libexslt/.libs/libexslt.so.0.8.24))
+$(eval $(call
gb_ExternalPackage_add_file,libxslt,$(LIBO_LIB_FOLDER)/libexslt.so.0,libexslt/.libs/libexslt.so.0.8.25))
endif
endif # DISABLE_DYNLOADING
diff --git a/external/libxslt/UnpackedTarball_libxslt.mk
b/external/libxslt/UnpackedTarball_libxslt.mk
index bd2417841e07..8941aba71c0a 100644
--- a/external/libxslt/UnpackedTarball_libxslt.mk
+++ b/external/libxslt/UnpackedTarball_libxslt.mk
@@ -20,7 +20,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,libxslt,\
external/libxslt/libxslt-msvc-sym.patch.2, \
external/libxslt/libxslt-msvc.patch.2) \
external/libxslt/rpath.patch.0 \
- external/libxslt/gnome-libxslt-bug-139-apple-fix.diff.1 \
external/libxslt/77.patch.1 \
))
diff --git a/external/libxslt/gnome-libxslt-bug-139-apple-fix.diff.1
b/external/libxslt/gnome-libxslt-bug-139-apple-fix.diff.1
deleted file mode 100644
index 62a34fa61d39..000000000000
--- a/external/libxslt/gnome-libxslt-bug-139-apple-fix.diff.1
+++ /dev/null
@@ -1,99 +0,0 @@
-From 345d6826d0eae6f0a962456b8ed6f6a1bad0877d Mon Sep 17 00:00:00 2001
-From: David Kilzer <[email protected]>
-Date: Sat, 24 May 2025 15:06:42 -0700
-Subject: [PATCH] libxslt: Type confusion in xmlNode.psvi between stylesheet
- and source nodes
-
-* libxslt/functions.c:
-(xsltDocumentFunctionLoadDocument):
-- Implement fix suggested by Ivan Fratric. This copies the xmlDoc,
- calls xsltCleanupSourceDoc() to remove pvsi fields, then adds the
- xmlDoc to tctxt->docList.
-- Add error handling for functions that may return NULL.
-* libxslt/transform.c:
-- Remove static keyword so this can be called from
- xsltDocumentFunctionLoadDocument().
-* libxslt/transformInternals.h: Add.
-(xsltCleanupSourceDoc): Add declaration.
-
-Fixes #139.
----
- libxslt/functions.c | 16 +++++++++++++++-
- libxslt/transform.c | 3 ++-
- libxslt/transformInternals.h | 9 +++++++++
- 3 files changed, 26 insertions(+), 2 deletions(-)
- create mode 100644 libxslt/transformInternals.h
-
-diff --git a/libxslt/functions.c b/libxslt/functions.c
-index 72a58dc4..11ec039f 100644
---- a/libxslt/functions.c
-+++ b/libxslt/functions.c
-@@ -34,6 +34,7 @@
- #include "numbersInternals.h"
- #include "keys.h"
- #include "documents.h"
-+#include "transformInternals.h"
-
- #ifdef WITH_XSLT_DEBUG
- #define WITH_XSLT_DEBUG_FUNCTION
-@@ -125,7 +126,20 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr
ctxt,
- /*
- * This selects the stylesheet's doc itself.
- */
-- doc = tctxt->style->doc;
-+ doc = xmlCopyDoc(tctxt->style->doc, 1);
-+ if (doc == NULL) {
-+ xsltTransformError(tctxt, NULL, NULL,
-+ "document() : failed to copy style doc
");
-+ goto out_fragment;
-+ }
-+ xsltCleanupSourceDoc(doc); /* Remove psvi fields. */
-+ idoc = xsltNewDocument(tctxt, doc);
-+ if (idoc == NULL) {
-+ xsltTransformError(tctxt, NULL, NULL,
-+ "document() : failed to create xsltDocument
");
-+ xmlFreeDoc(doc);
-+ goto out_fragment;
-+ }
- } else {
- goto out_fragment;
- }
-diff --git a/libxslt/transform.c b/libxslt/transform.c
-index 54ef821b..38c2dce6 100644
---- a/libxslt/transform.c
-+++ b/libxslt/transform.c
-@@ -43,6 +43,7 @@
- #include "xsltlocale.h"
- #include "pattern.h"
- #include "transform.h"
-+#include "transformInternals.h"
- #include "variables.h"
- #include "numbersInternals.h"
- #include "namespaces.h"
-@@ -5757,7 +5758,7 @@ xsltCountKeys(xsltTransformContextPtr ctxt)
- *
- * Resets source node flags and ids stored in 'psvi' member.
- */
--static void
-+void
- xsltCleanupSourceDoc(xmlDocPtr doc) {
- xmlNodePtr cur = (xmlNodePtr) doc;
- void **psviPtr;
-diff --git a/libxslt/transformInternals.h b/libxslt/transformInternals.h
-new file mode 100644
-index 00000000..d0f42823
---- /dev/null
-+++ b/libxslt/transformInternals.h
-@@ -0,0 +1,9 @@
-+/*
-+ * Summary: set of internal interfaces for the XSLT engine transformation
part.
-+ *
-+ * Copy: See Copyright for the status of this software.
-+ *
-+ * Author: David Kilzer <[email protected]>
-+ */
-+
-+void xsltCleanupSourceDoc(xmlDocPtr doc);
---
-2.39.5 (Apple Git-154)
-
commit 7a0cc0493fcedb44eff1bd41f6aea419dbc5109c
Author: Xisco Fauli <[email protected]>
AuthorDate: Thu Dec 4 11:02:31 2025 +0100
Commit: Xisco Fauli <[email protected]>
CommitDate: Thu Dec 4 13:12:33 2025 +0100
poppler: upgrade to 25.12
Downloaded from https://poppler.freedesktop.org/poppler-25.12.0.tar.xz
Change-Id: I9add82731a4327bf2f48eeaada56b2909bdec906
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194982
Reviewed-by: Xisco Fauli <[email protected]>
Tested-by: Jenkins
diff --git a/download.lst b/download.lst
index 02ad52035ffa..4ad9689ad12e 100644
--- a/download.lst
+++ b/download.lst
@@ -599,8 +599,8 @@ LIBTIFF_TARBALL := tiff-4.7.1.tar.xz
# three static lines
# so that git cherry-pick
# will not run into conflicts
-POPPLER_SHA256SUM :=
63f155142b77349e2bccaef148e754e7506ab1641e713b83af4f54a8f8b15369
-POPPLER_TARBALL := poppler-25.11.0.tar.xz
+POPPLER_SHA256SUM :=
c18b40eb36b1a0c5b86e29ca054bf0770304583da4f2cdd42fe86eca6a20de48
+POPPLER_TARBALL := poppler-25.12.0.tar.xz
POPPLER_DATA_SHA256SUM :=
c835b640a40ce357e1b83666aabd95edffa24ddddd49b8daff63adb851cdab74
POPPLER_DATA_TARBALL := poppler-data-0.4.12.tar.gz
# three static lines
commit 2f83cff85dec82157f91327a02c0a67298b98d4b
Author: Xisco Fauli <[email protected]>
AuthorDate: Thu Dec 4 11:14:36 2025 +0100
Commit: Xisco Fauli <[email protected]>
CommitDate: Thu Dec 4 12:43:33 2025 +0100
rhino: upgrade to 1.7.15.1
Downloaded from
https://github.com/mozilla/rhino/releases/download/Rhino1_7_15_1_Release/rhino-1.7.15.1.zip
Change-Id: Iaa82aecc650a3c2db63c61329fd061f17af56bd6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194984
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <[email protected]>
diff --git a/download.lst b/download.lst
index 091e3d32807a..02ad52035ffa 100644
--- a/download.lst
+++ b/download.lst
@@ -652,8 +652,8 @@ MD4C_TARBALL := md4c-release-0.5.2.tar.gz
# three static lines
# so that git cherry-pick
# will not run into conflicts
-RHINO_SHA256SUM :=
42fce6baf1bf789b62bf938b8e8ec18a1ac92c989dd6e7221e9531454cbd97fa
-RHINO_TARBALL := rhino-1.7.15.zip
+RHINO_SHA256SUM :=
65599965d82c0e60332601d511dacb0241e796cabfa5550c72bb80c4bf89e8ad
+RHINO_TARBALL := rhino-1.7.15.1.zip
# three static lines
# so that git cherry-pick
# will not run into conflicts
diff --git a/external/rhino/filelist.txt b/external/rhino/filelist.txt
index 51d3985c6352..79be1a23ed73 100644
--- a/external/rhino/filelist.txt
+++ b/external/rhino/filelist.txt
@@ -251,6 +251,10 @@ src/org/mozilla/javascript/debug/DebugFrame.java
src/org/mozilla/javascript/debug/DebuggableObject.java
src/org/mozilla/javascript/debug/DebuggableScript.java
src/org/mozilla/javascript/debug/Debugger.java
+src/org/mozilla/javascript/dtoa/Decimal.java
+src/org/mozilla/javascript/dtoa/DecimalFormatter.java
+src/org/mozilla/javascript/dtoa/DoubleFormatter.java
+src/org/mozilla/javascript/dtoa/MathUtils.java
src/org/mozilla/javascript/jdk18/VMBridge_jdk18.java
src/org/mozilla/javascript/json/JsonParser.java
src/org/mozilla/javascript/optimizer/Block.java
@@ -311,12 +315,7 @@
src/org/mozilla/javascript/typedarrays/NativeUint16Array.java
src/org/mozilla/javascript/typedarrays/NativeUint32Array.java
src/org/mozilla/javascript/typedarrays/NativeUint8Array.java
src/org/mozilla/javascript/typedarrays/NativeUint8ClampedArray.java
-src/org/mozilla/javascript/v8dtoa/CachedPowers.java
-src/org/mozilla/javascript/v8dtoa/DiyFp.java
src/org/mozilla/javascript/v8dtoa/DoubleConversion.java
-src/org/mozilla/javascript/v8dtoa/DoubleHelper.java
-src/org/mozilla/javascript/v8dtoa/FastDtoa.java
-src/org/mozilla/javascript/v8dtoa/FastDtoaBuilder.java
src/org/mozilla/javascript/xml/XMLLib.java
src/org/mozilla/javascript/xml/XMLObject.java
src/org/mozilla/javascript/xmlimpl/Namespace.java
commit b872dfe4f97ece3e1a52674dd5e3920defc04f10
Author: Miklos Vajna <[email protected]>
AuthorDate: Wed Dec 3 14:15:46 2025 +0100
Commit: Miklos Vajna <[email protected]>
CommitDate: Thu Dec 4 12:41:56 2025 +0100
sw: document SwFileNameField and SwFileNameFieldType
Where to find on the UI, how the shared SwField::m_nFormat is
interpreted for this field.
Change-Id: I149d3f7d9aeb1a663fc73df470f3292161a57665
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194980
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <[email protected]>
diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx
index af8e996abaf8..2a0f5b670896 100644
--- a/sw/inc/docufld.hxx
+++ b/sw/inc/docufld.hxx
@@ -228,6 +228,7 @@ public:
virtual bool PutValue( const css::uno::Any& rVal, sal_uInt16 nWhich
) override;
};
+/// Provides the expansion of of an SwFileNameField to a string.
class SAL_DLLPUBLIC_RTTI SwFileNameFieldType final : public SwFieldType
{
SwDoc& m_rDoc;
@@ -238,6 +239,10 @@ public:
virtual std::unique_ptr<SwFieldType> Copy() const override;
};
+/// Expands to the current file name. The format is stored in
SwField::m_nFormat and is interpreted
+/// as an SwFileNameFormat.
+///
+/// 'Insert' -> 'Field' -> 'More Fields' -> 'Document' -> 'File name' on the
UI.
class SW_DLLPUBLIC SwFileNameField final : public SwField
{
OUString m_aContent;
commit b5fa767e1463c0b3c4543803291178b28596a42e
Author: Daniel Lee <[email protected]>
AuthorDate: Wed Nov 26 11:13:16 2025 -0600
Commit: Ilmari Lauhakangas <[email protected]>
CommitDate: Thu Dec 4 11:54:52 2025 +0100
tdf#75280 Convert inappropriate use of sal_uIntPtr
The variables nBestDist and nDist never store pointers
so their types were converted to sal_uInt64 for
compatibility with the tools:Long type of Point.X()
and Point.Y()
Change-Id: I90b7de4688afa2f06a751ef18d7df86caa94e881
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194658
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <[email protected]>
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index 44ad75fa0cce..dc253e837952 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -2256,7 +2256,7 @@ bool SdrEdgeObj::ImpFindConnector(const Point& rPt, const
SdrPageView& rPV, SdrO
sal_uInt16 nGluePointCnt=pGPL==nullptr ? 0 : pGPL->GetCount();
sal_uInt16 nGesAnz=nGluePointCnt+9;
bool bUserFnd = false;
- sal_uIntPtr nBestDist=0xFFFFFFFF;
+ sal_uInt64 nBestDist=0xFFFFFFFF;
for (sal_uInt16 i=0; i<nGesAnz; i++)
{
bool bUser=i<nGluePointCnt;
@@ -2294,7 +2294,7 @@ bool SdrEdgeObj::ImpFindConnector(const Point& rPt, const
SdrPageView& rPV, SdrO
if (bOk && aMouseRect.Contains(aConPos)) {
if (bUser) bUserFnd = true;
bFnd = true;
- sal_uIntPtr
nDist=static_cast<sal_uIntPtr>(std::abs(aConPos.X()-rPt.X()))+static_cast<sal_uIntPtr>(std::abs(aConPos.Y()-rPt.Y()));
+ sal_uInt64
nDist=static_cast<sal_uInt64>(std::abs(aConPos.X()-rPt.X()))+static_cast<sal_uInt64>(std::abs(aConPos.Y()-rPt.Y()));
if (nDist<nBestDist) {
nBestDist=nDist;
aTestCon.m_pSdrObj=pObj;
commit 6bacbcaa102cb1bea56462fe8228c5387bbf8bdc
Author: Mike Kaganski <[email protected]>
AuthorDate: Mon Dec 1 11:17:43 2025 +0100
Commit: Mike Kaganski <[email protected]>
CommitDate: Thu Dec 4 11:03:34 2025 +0100
Don't pass 16-bit value by const reference
Change-Id: Ia9245ff724a081f5f908ccadb924ab8faf022211
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194872
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <[email protected]>
diff --git a/include/i18nlangtag/lang.h b/include/i18nlangtag/lang.h
index e04bdb13328e..5fbb7a65b53a 100644
--- a/include/i18nlangtag/lang.h
+++ b/include/i18nlangtag/lang.h
@@ -86,7 +86,7 @@
#include <ostream>
typedef o3tl::strong_int<sal_uInt16, struct LanguageTypeTag> LanguageType;
-inline std::ostream& operator<<(std::ostream& os, LanguageType const & lt) {
os << sal_uInt16(lt); return os; }
+inline std::ostream& operator<<(std::ostream& os, LanguageType lt) { return os
<< sal_uInt16(lt); }
constexpr LanguageType primary(LanguageType lt) { return
LanguageType(sal_uInt16(lt) & 0x03ff); }
namespace o3tl
commit 61dcf1283c3293629b041dcd4a4e6dcb4c049397
Author: Mike Kaganski <[email protected]>
AuthorDate: Mon Dec 1 09:47:51 2025 +0100
Commit: Mike Kaganski <[email protected]>
CommitDate: Thu Dec 4 11:03:27 2025 +0100
Simplify o3tl::strong_int ctor using concepts
Change-Id: Iaee67cb3787c26a56bfa69764d9c5d138c4e4d56
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194854
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <[email protected]>
diff --git a/include/i18nlangtag/lang.h b/include/i18nlangtag/lang.h
index 7672cf85582f..e04bdb13328e 100644
--- a/include/i18nlangtag/lang.h
+++ b/include/i18nlangtag/lang.h
@@ -98,7 +98,7 @@ namespace o3tl
// delete "sal_Int16" constructor via specialization: values > 0x7FFF are
// actually used, and unfortunately passed around in the API as signed
// "short", so use this to find all places where casts must be inserted
- template<> template<> constexpr strong_int<unsigned
short,LanguageTypeTag>::strong_int(short,
std::enable_if<std::is_integral<short>::value, int>::type) = delete;
+ template<> template<> constexpr strong_int<unsigned
short,LanguageTypeTag>::strong_int(short) = delete;
#endif
}
diff --git a/include/o3tl/strong_int.hxx b/include/o3tl/strong_int.hxx
index 4b1a108ee5b2..9bfc9c22f802 100644
--- a/include/o3tl/strong_int.hxx
+++ b/include/o3tl/strong_int.hxx
@@ -25,6 +25,7 @@
#include <cassert>
#include <type_traits>
#include <compare>
+#include <concepts>
#include <config_options.h>
#include <o3tl/safeint.hxx>
@@ -56,10 +57,8 @@ public:
explicit constexpr strong_int(int value) : m_value(value) {}
explicit constexpr strong_int(unsigned int value) : m_value(value) {}
#else
- template<typename T> explicit constexpr strong_int(
- T value,
- typename std::enable_if<std::is_integral<T>::value, int>::type = 0):
- m_value(value)
+ template <std::integral I> explicit constexpr strong_int(I value)
+ : m_value(value)
{
// catch attempts to pass in out-of-range values early
assert(ValidRange<UNDERLYING_TYPE>::isInside(value) && "out of range");
commit f42ecf8c8214316164011b2c8b6cd901f254c7ff
Author: Mike Kaganski <[email protected]>
AuthorDate: Thu Dec 4 05:59:16 2025 +0100
Commit: Mike Kaganski <[email protected]>
CommitDate: Thu Dec 4 11:03:20 2025 +0100
Simplify assertion in o3tl::strong_int ctor using o3tl::ValidRange
Change-Id: I439531ae27eca791baca3c275738f29cfffaf418
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194971
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <[email protected]>
diff --git a/include/o3tl/strong_int.hxx b/include/o3tl/strong_int.hxx
index 5da4a913aabf..4b1a108ee5b2 100644
--- a/include/o3tl/strong_int.hxx
+++ b/include/o3tl/strong_int.hxx
@@ -27,50 +27,11 @@
#include <compare>
#include <config_options.h>
+#include <o3tl/safeint.hxx>
+
namespace o3tl
{
-#if !defined(__COVERITY__) || __COVERITY_MAJOR__ > 2024
-
-namespace detail {
-
-template<typename T1, typename T2> constexpr
-typename std::enable_if<
- std::is_signed<T1>::value && std::is_signed<T2>::value, bool>::type
-isInRange(T2 value) {
- return value >= std::numeric_limits<T1>::min()
- && value <= std::numeric_limits<T1>::max();
-}
-
-template<typename T1, typename T2> constexpr
-typename std::enable_if<
- std::is_signed<T1>::value && std::is_unsigned<T2>::value, bool>::type
-isInRange(T2 value) {
- return value
- <= static_cast<typename std::make_unsigned<T1>::type>(
- std::numeric_limits<T1>::max());
-}
-
-template<typename T1, typename T2> constexpr
-typename std::enable_if<
- std::is_unsigned<T1>::value && std::is_signed<T2>::value, bool>::type
-isInRange(T2 value) {
- return value >= 0
- && (static_cast<typename std::make_unsigned<T2>::type>(value)
- <= std::numeric_limits<T1>::max());
-}
-
-template<typename T1, typename T2> constexpr
-typename std::enable_if<
- std::is_unsigned<T1>::value && std::is_unsigned<T2>::value, bool>::type
-isInRange(T2 value) {
- return value <= std::numeric_limits<T1>::max();
-}
-
-}
-
-#endif
-
///
/// Wrap up an integer type so that we prevent accidental conversion to other
integer types.
///
@@ -101,8 +62,7 @@ public:
m_value(value)
{
// catch attempts to pass in out-of-range values early
- assert(detail::isInRange<UNDERLYING_TYPE>(value)
- && "out of range");
+ assert(ValidRange<UNDERLYING_TYPE>::isInside(value) && "out of range");
}
#endif
strong_int() : m_value(0) {}
commit eb513e96584bb90a6133f838def01b0a16558192
Author: Heiko Tietze <[email protected]>
AuthorDate: Wed Dec 3 15:40:38 2025 +0100
Commit: Heiko Tietze <[email protected]>
CommitDate: Thu Dec 4 09:51:08 2025 +0100
Resolves tdf#169657 - Make the splitwindow buttons more outstanding on hover
Change-Id: I24a93f47ae0af87ecd6fb48db6bd611563913d8c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194962
Reviewed-by: Heiko Tietze <[email protected]>
Tested-by: Jenkins
diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx
index 5c06d8c15be0..0fb784f57b2e 100644
--- a/vcl/source/window/splitwin.cxx
+++ b/vcl/source/window/splitwin.cxx
@@ -1467,7 +1467,9 @@ void SplitWindow::ImplDrawGrip(vcl::RenderContext&
rRenderContext, const tools::
if (rRect.Contains(GetPointerPosPixel()))
{
- vcl::RenderTools::DrawSelectionBackground(rRenderContext, *this,
rRect, 2, false, false, false);
+ rRenderContext.SetLineColor(rStyleSettings.GetHighlightColor());
+ rRenderContext.SetFillColor(rStyleSettings.GetHighlightColor());
+ rRenderContext.DrawRect(rRect);
aColor = rStyleSettings.GetDarkShadowColor();
}
commit f15e0583c2fff48bf79dc9f1a349e40e8802ad70
Author: Tomaž Vajngerl <[email protected]>
AuthorDate: Wed Dec 3 23:49:57 2025 +0900
Commit: Tomaž Vajngerl <[email protected]>
CommitDate: Thu Dec 4 08:21:07 2025 +0100
chart2: Add ComplexColor to many properties of chart elements
This adds ComplexColor to many of the color properties that are
available in charts. It also handles some import code in oox, so
the complex colors are set correctly to the chart elements if an
OOXML document is loaded. This doesn't yet handle export and if
a theme is changed, as well if a color is changed manually in
the chart.
Change the tests so they now assert the scheme color like it is
defined in the source document and not the calculated derived
color.
In addition change the WriteRunProperties to have a struct as
an input instead a number of parameters, which in most cases don't
need to be filled out and are using the default value.
This was needed for the new parameter bUseTextSchemeColors, which
is used for charts, so the text colors use tx1 and tx2 elements
instead dk1 and dk2, which are usually used in Impress.
Change-Id: Iaebbaea983c5232c51233c1a02bd8fe1da24d551
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194939
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <[email protected]>
diff --git a/chart2/inc/unonames.hxx b/chart2/inc/unonames.hxx
index abe190844962..92cc62f2d527 100644
--- a/chart2/inc/unonames.hxx
+++ b/chart2/inc/unonames.hxx
@@ -26,6 +26,7 @@ inline constexpr OUString CHART_UNONAME_LABEL_SEP =
u"LabelSeparator"_ustr;
inline constexpr OUString CHART_UNONAME_LABEL_BORDER_STYLE =
u"LabelBorderStyle"_ustr;
inline constexpr OUString CHART_UNONAME_LABEL_BORDER_WIDTH =
u"LabelBorderWidth"_ustr;
inline constexpr OUString CHART_UNONAME_LABEL_BORDER_COLOR =
u"LabelBorderColor"_ustr;
+inline constexpr OUString CHART_UNONAME_LABEL_BORDER_COMPLEX_COLOR =
u"LabelBorderComplexColor"_ustr;
inline constexpr OUString CHART_UNONAME_LABEL_BORDER_DASH =
u"LabelBorderDash"_ustr;
inline constexpr OUString CHART_UNONAME_LABEL_BORDER_DASHNAME =
u"LabelBorderDashName"_ustr;
inline constexpr OUString CHART_UNONAME_LABEL_BORDER_TRANS =
u"LabelBorderTransparency"_ustr;
@@ -33,6 +34,7 @@ inline constexpr OUString CHART_UNONAME_LABEL_FILL_STYLE =
u"LabelFillStyle"_ust
inline constexpr OUString CHART_UNONAME_LABEL_FILL_BACKGROUND =
u"LabelFillBackground"_ustr;
inline constexpr OUString CHART_UNONAME_LABEL_FILL_HATCH_NAME =
u"LabelFillHatchName"_ustr;
inline constexpr OUString CHART_UNONAME_LABEL_FILL_COLOR =
u"LabelFillColor"_ustr;
+inline constexpr OUString CHART_UNONAME_LABEL_FILL_COMPLEX_COLOR =
u"LabelFillComplexColor"_ustr;
inline constexpr OUString CHART_UNONAME_CUSTOM_LABEL_FIELDS =
u"CustomLabelFields"_ustr;
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/qa/extras/chart2export2.cxx
b/chart2/qa/extras/chart2export2.cxx
index 5bcaaf5e09ae..1be3ab2a3822 100644
--- a/chart2/qa/extras/chart2export2.cxx
+++ b/chart2/qa/extras/chart2export2.cxx
@@ -245,7 +245,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2,
testPieChartDataPointExplosionXLSX)
CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCustomDataLabel)
{
- loadFromFile(u"pptx/tdf115107.pptx");
+ loadFromFile(u"pptx/CustomDataLabel_tdf115107.pptx");
Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0,
0), uno::UNO_QUERY);
CPPUNIT_ASSERT(xChartDoc.is());
@@ -357,12 +357,25 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2,
testCustomDataLabel)
save(TestFilter::PPTX_2007);
xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr);
CPPUNIT_ASSERT(pXmlDoc);
+
// Check the data labels font color for the complete data series
assertXPathInsensitive(
pXmlDoc,
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:txPr/a:p/a:pPr/"
- "a:defRPr/a:solidFill/a:srgbClr",
- "val", u"404040");
+ "a:defRPr/a:solidFill/a:schemeClr",
+ "val", u"tx1");
+
+ assertXPathInsensitive(
+ pXmlDoc,
+
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:txPr/a:p/a:pPr/"
+ "a:defRPr/a:solidFill/a:schemeClr/a:lumMod",
+ "val", u"75000");
+
+ assertXPathInsensitive(
+ pXmlDoc,
+
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:txPr/a:p/a:pPr/"
+ "a:defRPr/a:solidFill/a:schemeClr/a:lumOff",
+ "val", u"25000");
}
/// Test for tdf#94235
diff --git a/chart2/qa/extras/chart2export3.cxx
b/chart2/qa/extras/chart2export3.cxx
index 8bf0d154d9a5..5424f4a8bd1e 100644
--- a/chart2/qa/extras/chart2export3.cxx
+++ b/chart2/qa/extras/chart2export3.cxx
@@ -522,9 +522,28 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3,
testBarChartDataPointPropXLSX)
assertXPathInsensitive(pXmlDoc,
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[1]/c:spPr/a:ln/a:solidFill/a:srgbClr",
"val", u"000000");
assertXPath(pXmlDoc,
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:idx", "val",
u"2");
+
+ // TODO: Gradient should be using a scheme colors - accent 1
+ /*
+ <a:gs pos="0">
+ <a:schemeClr val="accent1">
+ <a:lumMod val="5000" />
+ <a:lumOff val="95000" />
+ </a:schemeClr>
+ </a:gs>
+
+ <a:gs pos="100000">
+ <a:schemeClr val="accent1">
+ <a:lumMod val="30000" />
+ <a:lumOff val="70000" />
+ </a:schemeClr>
+ </a:gs>
+ */
assertXPathInsensitive(pXmlDoc,
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:spPr/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr",
"val", u"f6f8fc");
assertXPathInsensitive(pXmlDoc,
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:spPr/a:gradFill/a:gsLst/a:gs[2]/a:srgbClr",
"val", u"c7d5ed");
- assertXPathInsensitive(pXmlDoc,
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:spPr/a:ln/a:solidFill/a:srgbClr",
"val", u"70ad47");
+
+ // Should be a scheme color - accent6 as in input document
+ assertXPathInsensitive(pXmlDoc,
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:spPr/a:ln/a:solidFill/a:schemeClr",
"val", u"accent6");
}
CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAxisCharacterPropertiesXLSX)
diff --git a/chart2/qa/extras/chart2import.cxx
b/chart2/qa/extras/chart2import.cxx
index 0eb9b9375b6f..9f0abcd4c146 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -1775,154 +1775,6 @@ CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf122226)
CPPUNIT_ASSERT_EQUAL_MESSAGE( "Data labels should be separated into new
lines", u"
"_ustr, nLabelSeparator );
}
-CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf115107)
-{
- // import complex data point labels
- loadFromFile(u"pptx/tdf115107.pptx");
-
- Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0,
0), uno::UNO_QUERY);
- CPPUNIT_ASSERT(xChartDoc.is());
-
- uno::Reference<chart2::XDataSeries>
xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
- CPPUNIT_ASSERT(xDataSeries.is());
- float nFontSize;
- sal_Int64 nFontColor;
- sal_Int32 nCharUnderline;
- uno::Reference<beans::XPropertySet> xPropertySet;
- uno::Sequence<uno::Reference<chart2::XDataPointCustomLabelField>> aFields;
-
- // 1
- xPropertySet.set(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW);
- xPropertySet->getPropertyValue(u"CustomLabelFields"_ustr) >>= aFields;
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), aFields.getLength());
-
-
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT,
aFields[0]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(u"90.0 = "_ustr, aFields[0]->getString());
- aFields[0]->getPropertyValue(u"CharHeight"_ustr) >>= nFontSize;
- aFields[0]->getPropertyValue(u"CharColor"_ustr) >>= nFontColor;
- CPPUNIT_ASSERT_EQUAL(static_cast<float>(18), nFontSize);
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int64>(0xed7d31), nFontColor);
-
-
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_VALUE,
aFields[1]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(u"90"_ustr, aFields[1]->getString());
-
- // 2
- xPropertySet.set(xDataSeries->getDataPointByIndex(1), uno::UNO_SET_THROW);
- xPropertySet->getPropertyValue(u"CustomLabelFields"_ustr) >>= aFields;
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(8), aFields.getLength());
-
-
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT,
aFields[0]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(u"Text"_ustr, aFields[0]->getString());
-
-
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT,
aFields[1]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(u" : "_ustr, aFields[1]->getString());
-
-
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_CATEGORYNAME,
aFields[2]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(u"B"_ustr, aFields[2]->getString());
- aFields[2]->getPropertyValue(u"CharHeight"_ustr) >>= nFontSize;
- aFields[2]->getPropertyValue(u"CharColor"_ustr) >>= nFontColor;
- CPPUNIT_ASSERT_EQUAL(static_cast<float>(16), nFontSize);
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int64>(0xed7d31), nFontColor);
-
-
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_NEWLINE,
aFields[3]->getFieldType());
-
-
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT,
aFields[4]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(u"Multi"_ustr, aFields[4]->getString());
-
-
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT,
aFields[5]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(u"line"_ustr, aFields[5]->getString());
- aFields[5]->getPropertyValue(u"CharHeight"_ustr) >>= nFontSize;
- aFields[5]->getPropertyValue(u"CharColor"_ustr) >>= nFontColor;
- CPPUNIT_ASSERT_EQUAL(static_cast<float>(11.97), nFontSize);
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int64>(0xbf9000), nFontColor);
-
-
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_NEWLINE,
aFields[6]->getFieldType());
-
-
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT,
aFields[7]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(u"Abc"_ustr, aFields[7]->getString());
- aFields[7]->getPropertyValue(u"CharHeight"_ustr) >>= nFontSize;
- aFields[7]->getPropertyValue(u"CharColor"_ustr) >>= nFontColor;
- aFields[7]->getPropertyValue(u"CharUnderline"_ustr) >>= nCharUnderline;
- CPPUNIT_ASSERT_EQUAL(static_cast<float>(12), nFontSize);
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int64>(0xa9d18e), nFontColor);
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), nCharUnderline);
-
- // 3
- xPropertySet.set(xDataSeries->getDataPointByIndex(2), uno::UNO_SET_THROW);
- xPropertySet->getPropertyValue(u"CustomLabelFields"_ustr) >>= aFields;
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), aFields.getLength());
-
-
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_SERIESNAME,
aFields[0]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(u"DATA"_ustr, aFields[0]->getString());
-
- // 4
- xPropertySet.set(xDataSeries->getDataPointByIndex(3), uno::UNO_SET_THROW);
- xPropertySet->getPropertyValue(u"CustomLabelFields"_ustr) >>= aFields;
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), aFields.getLength());
-
-
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_CELLREF,
aFields[0]->getFieldType());
- //CPPUNIT_ASSERT_EQUAL(OUString("70"), aFields[0]->getString()); TODO: Not
implemented yet
-
-
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT,
aFields[1]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(u" <CELLREF"_ustr, aFields[1]->getString());
-}
-
-CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf115107_2)
-{
- // import complex data point labels in cobo charts with multiple data
series
- loadFromFile(u"pptx/tdf115107-2.pptx");
-
- Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0,
0), uno::UNO_QUERY);
- CPPUNIT_ASSERT(xChartDoc.is());
-
- uno::Reference<chart2::XDataSeries>
xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
- CPPUNIT_ASSERT(xDataSeries.is());
- float nFontSize;
- sal_Int64 nFontColor;
- uno::Reference<beans::XPropertySet> xPropertySet;
- uno::Sequence<uno::Reference<chart2::XDataPointCustomLabelField>> aFields;
-
- // First series
- xPropertySet.set(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW);
- xPropertySet->getPropertyValue(u"CustomLabelFields"_ustr) >>= aFields;
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), aFields.getLength());
-
-
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_VALUE,
aFields[0]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(u"4.3"_ustr, aFields[0]->getString());
- aFields[0]->getPropertyValue(u"CharHeight"_ustr) >>= nFontSize;
- aFields[0]->getPropertyValue(u"CharColor"_ustr) >>= nFontColor;
- CPPUNIT_ASSERT_EQUAL(static_cast<float>(18), nFontSize);
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int64>(0xc00000), nFontColor);
-
-
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT,
aFields[1]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(u" "_ustr, aFields[1]->getString());
-
-
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_SERIESNAME,
aFields[2]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(u"Bars"_ustr, aFields[2]->getString());
-
- // Second series
- xDataSeries = getDataSeriesFromDoc(xChartDoc, 0, 1);
- CPPUNIT_ASSERT(xDataSeries.is());
-
- xPropertySet.set(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW);
- xPropertySet->getPropertyValue(u"CustomLabelFields"_ustr) >>= aFields;
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), aFields.getLength());
-
-
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_VALUE,
aFields[0]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(u"2"_ustr, aFields[0]->getString());
- aFields[0]->getPropertyValue(u"CharHeight"_ustr) >>= nFontSize;
- aFields[0]->getPropertyValue(u"CharColor"_ustr) >>= nFontColor;
- CPPUNIT_ASSERT_EQUAL(static_cast<float>(18), nFontSize);
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int64>(0xffd966), nFontColor);
-
-
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT,
aFields[1]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(u" "_ustr, aFields[1]->getString());
-
-
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_SERIESNAME,
aFields[2]->getFieldType());
- CPPUNIT_ASSERT_EQUAL(u"Line"_ustr, aFields[2]->getString());
-
-}
-
CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf116163)
{
loadFromFile(u"pptx/tdf116163.pptx");
diff --git a/chart2/qa/extras/data/pptx/tdf115107.pptx
b/chart2/qa/extras/data/pptx/CustomDataLabel_tdf115107.pptx
similarity index 100%
rename from chart2/qa/extras/data/pptx/tdf115107.pptx
rename to chart2/qa/extras/data/pptx/CustomDataLabel_tdf115107.pptx
diff --git a/chart2/source/inc/CharacterProperties.hxx
b/chart2/source/inc/CharacterProperties.hxx
index be3f1f989165..391d65e0bf36 100644
--- a/chart2/source/inc/CharacterProperties.hxx
+++ b/chart2/source/inc/CharacterProperties.hxx
@@ -46,15 +46,18 @@ namespace CharacterProperties
PROP_CHAR_FONT_CHAR_SET,
PROP_CHAR_FONT_PITCH,
PROP_CHAR_COLOR,
+ PROP_CHAR_COMPLEX_COLOR,
// PROP_CHAR_BACKGROUND_COLOR,
// PROP_CHAR_BACKGROUND_TRANSPARENCY, alpha channel in COLOR
PROP_CHAR_ESCAPEMENT,
PROP_CHAR_CHAR_HEIGHT,
PROP_CHAR_UNDERLINE,
PROP_CHAR_UNDERLINE_COLOR,
+ PROP_CHAR_UNDERLINE_COMPLEX_COLOR,
PROP_CHAR_UNDERLINE_HAS_COLOR,
PROP_CHAR_OVERLINE,
PROP_CHAR_OVERLINE_COLOR,
+ PROP_CHAR_OVERLINE_COMPLEX_COLOR,
PROP_CHAR_OVERLINE_HAS_COLOR,
PROP_CHAR_WEIGHT,
PROP_CHAR_POSTURE,
diff --git a/chart2/source/inc/FillProperties.hxx
b/chart2/source/inc/FillProperties.hxx
index c76ee51d1a2f..55de2b5b5482 100644
--- a/chart2/source/inc/FillProperties.hxx
+++ b/chart2/source/inc/FillProperties.hxx
@@ -37,6 +37,7 @@ namespace FillProperties
// com.sun.star.drawing.FillProperties
PROP_FILL_STYLE = FAST_PROPERTY_ID_START_FILL_PROP
, PROP_FILL_COLOR
+ , PROP_FILL_COMPLEX_COLOR
, PROP_FILL_TRANSPARENCE
, PROP_FILL_TRANSPARENCE_GRADIENT_NAME
// , PROP_FILL_TRANSPARENCE_GRADIENT //optional
diff --git a/chart2/source/inc/LinePropertiesHelper.hxx
b/chart2/source/inc/LinePropertiesHelper.hxx
index d664273916b3..7cee5c7b4917 100644
--- a/chart2/source/inc/LinePropertiesHelper.hxx
+++ b/chart2/source/inc/LinePropertiesHelper.hxx
@@ -41,6 +41,7 @@ namespace LinePropertiesHelper
PROP_LINE_DASH,
PROP_LINE_DASH_NAME, //not in service description
PROP_LINE_COLOR,
+ PROP_LINE_COMPLEX_COLOR,
PROP_LINE_TRANSPARENCE,
PROP_LINE_WIDTH,
PROP_LINE_JOINT,
diff --git a/chart2/source/model/main/DataPointProperties.cxx
b/chart2/source/model/main/DataPointProperties.cxx
index 53f88600214f..0d9ffa3b7213 100644
--- a/chart2/source/model/main/DataPointProperties.cxx
+++ b/chart2/source/model/main/DataPointProperties.cxx
@@ -35,6 +35,7 @@
#include <com/sun/star/chart2/DataPointGeometry3D.hpp>
#include <com/sun/star/chart2/DataPointLabel.hpp>
#include <com/sun/star/chart2/Symbol.hpp>
+#include <com/sun/star/util/XComplexColor.hpp>
#include <tools/color.hxx>
@@ -59,6 +60,11 @@ void DataPointProperties::AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEVOID // "maybe auto"
| beans::PropertyAttribute::MAYBEDEFAULT );
+ rOutProperties.emplace_back("ComplexColor",
+ PROP_DATAPOINT_COMPLEX_COLOR,
+ cppu::UnoType<util::XComplexColor>::get(),
+ beans::PropertyAttribute::BOUND |
beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::MAYBEDEFAULT );
+
rOutProperties.emplace_back( "FillColor",
PROP_DATAPOINT_COLOR,
cppu::UnoType<sal_Int32>::get(),
@@ -66,6 +72,11 @@ void DataPointProperties::AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEVOID // "maybe auto"
| beans::PropertyAttribute::MAYBEDEFAULT );
+ rOutProperties.emplace_back("FillComplexColor",
+ PROP_DATAPOINT_COMPLEX_COLOR,
+ cppu::UnoType<util::XComplexColor>::get(),
+ beans::PropertyAttribute::BOUND |
beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::MAYBEDEFAULT );
+
rOutProperties.emplace_back( "Transparency",
PROP_DATAPOINT_TRANSPARENCY,
cppu::UnoType<sal_Int16>::get(),
@@ -161,6 +172,11 @@ void DataPointProperties::AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEVOID // "maybe auto"
| beans::PropertyAttribute::MAYBEDEFAULT );
+ rOutProperties.emplace_back("BorderComplexColor",
+ PROP_DATAPOINT_BORDER_COMPLEX_COLOR,
+ cppu::UnoType<util::XComplexColor>::get(),
+ beans::PropertyAttribute::BOUND |
beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::MAYBEDEFAULT);
+
rOutProperties.emplace_back( "BorderStyle",
PROP_DATAPOINT_BORDER_STYLE,
cppu::UnoType<drawing::LineStyle>::get(),
@@ -194,6 +210,11 @@ void DataPointProperties::AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEVOID
| beans::PropertyAttribute::MAYBEDEFAULT );
+ rOutProperties.emplace_back("LineComplexColor",
+ PROP_DATAPOINT_BORDER_COMPLEX_COLOR,
+ cppu::UnoType<util::XComplexColor>::get(),
+ beans::PropertyAttribute::BOUND |
beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::MAYBEDEFAULT );
+
rOutProperties.emplace_back( "LineStyle",
LinePropertiesHelper::PROP_LINE_STYLE,
cppu::UnoType<drawing::LineStyle>::get(),
@@ -401,6 +422,10 @@ void DataPointProperties::AddPropertiesToVector(
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEVOID // "maybe auto"
| beans::PropertyAttribute::MAYBEDEFAULT );
+ rOutProperties.emplace_back( CHART_UNONAME_LABEL_BORDER_COMPLEX_COLOR,
+ PROP_DATAPOINT_LABEL_BORDER_COMPLEX_COLOR,
+ cppu::UnoType<util::XComplexColor>::get(),
+ beans::PropertyAttribute::BOUND |
beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::MAYBEDEFAULT);
rOutProperties.emplace_back( CHART_UNONAME_LABEL_FILL_STYLE,
PROP_DATAPOINT_LABEL_FILL_STYLE,
cppu::UnoType<drawing::FillStyle>::get(),
@@ -412,6 +437,10 @@ void DataPointProperties::AddPropertiesToVector(
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEVOID
| beans::PropertyAttribute::MAYBEDEFAULT );
+ rOutProperties.emplace_back(CHART_UNONAME_LABEL_FILL_COMPLEX_COLOR,
+ PROP_DATAPOINT_LABEL_FILL_COMPLEX_COLOR,
+ cppu::UnoType<util::XComplexColor>::get(),
+ beans::PropertyAttribute::BOUND |
beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::MAYBEDEFAULT);
rOutProperties.emplace_back( CHART_UNONAME_LABEL_FILL_BACKGROUND,
PROP_DATAPOINT_LABEL_FILL_BACKGROUND,
cppu::UnoType<sal_Bool>::get(),
diff --git a/chart2/source/model/main/DataPointProperties.hxx
b/chart2/source/model/main/DataPointProperties.hxx
index fe1969bc5f15..b3bf4cbcc147 100644
--- a/chart2/source/model/main/DataPointProperties.hxx
+++ b/chart2/source/model/main/DataPointProperties.hxx
@@ -36,11 +36,13 @@ namespace DataPointProperties
{
PROP_DATAPOINT_LABEL_FILL_STYLE,
PROP_DATAPOINT_LABEL_FILL_COLOR,
+ PROP_DATAPOINT_LABEL_FILL_COMPLEX_COLOR,
PROP_DATAPOINT_LABEL_FILL_BACKGROUND,
-e
... etc. - the rest is truncated