sw: prefix members of XMLGradientStyleExport, XMLGradientStyleImport, ...

... XMLHatchStyleExport and XMLHatchStyleImport

See tdf#94879 for motivation.

Change-Id: I2dd4c97c6e234447190e46bd6f6a6354e16911bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152077
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
This commit is contained in:
Miklos Vajna 2023-05-22 08:27:57 +02:00
parent 8cc51cf988
commit a97374fca8
4 changed files with 42 additions and 42 deletions

View File

@ -37,7 +37,7 @@ namespace com::sun::star {
class XMLOFF_DLLPUBLIC XMLGradientStyleImport
{
SvXMLImport& rImport;
SvXMLImport& m_rImport;
public:
XMLGradientStyleImport( SvXMLImport& rImport );
@ -60,7 +60,7 @@ public:
class XMLOFF_DLLPUBLIC XMLGradientStyleExport
{
SvXMLExport& rExport;
SvXMLExport& m_rExport;
public:
XMLGradientStyleExport( SvXMLExport& rExport );

View File

@ -35,7 +35,7 @@ namespace com::sun::star {
class XMLOFF_DLLPUBLIC XMLHatchStyleImport
{
SvXMLImport& rImport;
SvXMLImport& m_rImport;
public:
XMLHatchStyleImport( SvXMLImport& rImport );
@ -48,7 +48,7 @@ public:
class XMLOFF_DLLPUBLIC XMLHatchStyleExport
{
SvXMLExport& rExport;
SvXMLExport& m_rExport;
public:
XMLHatchStyleExport( SvXMLExport& rExport );

View File

@ -52,7 +52,7 @@ SvXMLEnumMapEntry<awt::GradientStyle> const pXML_GradientStyle_Enum[] =
// Import
XMLGradientStyleImport::XMLGradientStyleImport(
SvXMLImport& rImp )
: rImport(rImp)
: m_rImport(rImp)
{
}
@ -114,14 +114,14 @@ void XMLGradientStyleImport::importXML(
break;
case XML_ELEMENT(DRAW, XML_GRADIENT_ANGLE):
{
auto const cmp12(rImport.GetODFVersion().compareTo(ODFVER_012_TEXT));
auto const cmp12(m_rImport.GetODFVersion().compareTo(ODFVER_012_TEXT));
bool const bSuccess =
::sax::Converter::convertAngle(aGradient.Angle, aIter.toView(),
// tdf#89475 try to detect borked OOo angles
(cmp12 < 0) || (cmp12 == 0
&& (rImport.isGeneratorVersionOlderThan(SvXMLImport::AOO_4x, SvXMLImport::LO_7x)
&& (m_rImport.isGeneratorVersionOlderThan(SvXMLImport::AOO_4x, SvXMLImport::LO_7x)
// also for AOO 4.x, assume there won't ever be a 4.2
|| rImport.getGeneratorVersion() == SvXMLImport::AOO_4x)));
|| m_rImport.getGeneratorVersion() == SvXMLImport::AOO_4x)));
SAL_INFO_IF(!bSuccess, "xmloff.style", "failed to import draw:angle");
}
break;
@ -139,7 +139,7 @@ void XMLGradientStyleImport::importXML(
if( !aDisplayName.isEmpty() )
{
rImport.AddStyleDisplayName( XmlStyleFamily::SD_GRADIENT_ID, rStrName,
m_rImport.AddStyleDisplayName( XmlStyleFamily::SD_GRADIENT_ID, rStrName,
aDisplayName );
rStrName = aDisplayName;
}
@ -211,7 +211,7 @@ XMLGradientStopContext::~XMLGradientStopContext()
XMLGradientStyleExport::XMLGradientStyleExport(
SvXMLExport& rExp )
: rExport(rExp)
: m_rExport(rExp)
{
}
@ -236,15 +236,15 @@ void XMLGradientStyleExport::exportXML(
// Name
bool bEncoded = false;
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME,
rExport.EncodeStyleName( rStrName,
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME,
m_rExport.EncodeStyleName( rStrName,
&bEncoded ) );
if( bEncoded )
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DISPLAY_NAME,
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DISPLAY_NAME,
rStrName );
aStrValue = aOut.makeStringAndClear();
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_STYLE, aStrValue );
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_STYLE, aStrValue );
// Center x/y
if( aGradient.Style != awt::GradientStyle_LINEAR &&
@ -252,52 +252,52 @@ void XMLGradientStyleExport::exportXML(
{
::sax::Converter::convertPercent(aOut, aGradient.XOffset);
aStrValue = aOut.makeStringAndClear();
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_CX, aStrValue );
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_CX, aStrValue );
::sax::Converter::convertPercent(aOut, aGradient.YOffset);
aStrValue = aOut.makeStringAndClear();
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_CY, aStrValue );
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_CY, aStrValue );
}
// Color start
::sax::Converter::convertColor(aOut, aGradient.StartColor);
aStrValue = aOut.makeStringAndClear();
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_START_COLOR, aStrValue );
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_START_COLOR, aStrValue );
// Color end
::sax::Converter::convertColor(aOut, aGradient.EndColor);
aStrValue = aOut.makeStringAndClear();
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_END_COLOR, aStrValue );
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_END_COLOR, aStrValue );
// Intensity start
::sax::Converter::convertPercent(aOut, aGradient.StartIntensity);
aStrValue = aOut.makeStringAndClear();
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_START_INTENSITY, aStrValue );
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_START_INTENSITY, aStrValue );
// Intensity end
::sax::Converter::convertPercent(aOut, aGradient.EndIntensity);
aStrValue = aOut.makeStringAndClear();
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_END_INTENSITY, aStrValue );
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_END_INTENSITY, aStrValue );
// Angle
if( aGradient.Style != awt::GradientStyle_RADIAL )
{
::sax::Converter::convertAngle(aOut, aGradient.Angle, rExport.getSaneDefaultVersion());
::sax::Converter::convertAngle(aOut, aGradient.Angle, m_rExport.getSaneDefaultVersion());
aStrValue = aOut.makeStringAndClear();
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_GRADIENT_ANGLE, aStrValue );
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_GRADIENT_ANGLE, aStrValue );
}
// Border
::sax::Converter::convertPercent( aOut, aGradient.Border );
aStrValue = aOut.makeStringAndClear();
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_BORDER, aStrValue );
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_BORDER, aStrValue );
// ctor writes start tag. End-tag is written by destructor at block end.
SvXMLElementExport aElem( rExport, XML_NAMESPACE_DRAW, XML_GRADIENT,
SvXMLElementExport aElem( m_rExport, XML_NAMESPACE_DRAW, XML_GRADIENT,
true, false );
// Write child elements <loext:gradient-stop>
// Do not export in standard ODF 1.3 or older.
if ((rExport.getSaneDefaultVersion() & SvtSaveOptions::ODFSVER_EXTENDED) == 0)
if ((m_rExport.getSaneDefaultVersion() & SvtSaveOptions::ODFSVER_EXTENDED) == 0)
return;
sal_Int32 nCount = aGradient.ColorStops.getLength();
if (nCount == 0)
@ -310,22 +310,22 @@ void XMLGradientStyleExport::exportXML(
double fOffset = std::clamp<double>(aCandidate.StopOffset, 0.0, 1.0);
if (fOffset < fPreviousOffset)
fOffset = fPreviousOffset;
rExport.AddAttribute(XML_NAMESPACE_SVG, XML_OFFSET, OUString::number(fOffset));
m_rExport.AddAttribute(XML_NAMESPACE_SVG, XML_OFFSET, OUString::number(fOffset));
fPreviousOffset = fOffset;
// As of LO 7.6.0 only color-type="rgb" is implemented.
rExport.AddAttribute(XML_NAMESPACE_LO_EXT, XML_COLOR_TYPE, u"rgb");
m_rExport.AddAttribute(XML_NAMESPACE_LO_EXT, XML_COLOR_TYPE, u"rgb");
// Attribute loext:color-value, data type color, that is #rrggbb.
rendering::RGBColor aDecimalColor = aCandidate.StopColor;
::Color aToolsColor(std::clamp<sal_uInt8>(std::round(aDecimalColor.Red * 255.0), 0, 255),
std::clamp<sal_uInt8>(std::round(aDecimalColor.Green * 255.0), 0, 255),
std::clamp<sal_uInt8>(std::round(aDecimalColor.Blue * 255.0), 0, 255));
rExport.AddAttribute(XML_NAMESPACE_LO_EXT, XML_COLOR_VALUE,
m_rExport.AddAttribute(XML_NAMESPACE_LO_EXT, XML_COLOR_VALUE,
rtl::OUStringChar('#') + aToolsColor.AsRGBHexString());
// write gradient stop element
SvXMLElementExport aStopElement(rExport, XML_NAMESPACE_LO_EXT, XML_GRADIENT_STOP, true, true);
SvXMLElementExport aStopElement(m_rExport, XML_NAMESPACE_LO_EXT, XML_GRADIENT_STOP, true, true);
}
}

View File

@ -50,7 +50,7 @@ SvXMLEnumMapEntry<drawing::HatchStyle> const pXML_HatchStyle_Enum[] =
// Import
XMLHatchStyleImport::XMLHatchStyleImport( SvXMLImport& rImp )
: rImport(rImp)
: m_rImport(rImp)
{
}
@ -67,7 +67,7 @@ void XMLHatchStyleImport::importXML(
aHatch.Distance = 0;
aHatch.Angle = 0;
SvXMLUnitConverter& rUnitConverter = rImport.GetMM100UnitConverter();
SvXMLUnitConverter& rUnitConverter = m_rImport.GetMM100UnitConverter();
for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList ))
{
@ -110,7 +110,7 @@ void XMLHatchStyleImport::importXML(
if( !aDisplayName.isEmpty() )
{
rImport.AddStyleDisplayName( XmlStyleFamily::SD_HATCH_ID, rStrName,
m_rImport.AddStyleDisplayName( XmlStyleFamily::SD_HATCH_ID, rStrName,
aDisplayName );
rStrName = aDisplayName;
}
@ -119,7 +119,7 @@ void XMLHatchStyleImport::importXML(
// Export
XMLHatchStyleExport::XMLHatchStyleExport( SvXMLExport& rExp )
: rExport(rExp)
: m_rExport(rExp)
{
}
@ -139,7 +139,7 @@ void XMLHatchStyleExport::exportXML(
OUStringBuffer aOut;
SvXMLUnitConverter& rUnitConverter =
rExport.GetMM100UnitConverter();
m_rExport.GetMM100UnitConverter();
// Style
if( !SvXMLUnitConverter::convertEnum( aOut, aHatch.Style, pXML_HatchStyle_Enum ) )
@ -147,31 +147,31 @@ void XMLHatchStyleExport::exportXML(
// Name
bool bEncoded = false;
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME,
rExport.EncodeStyleName( rStrName,
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME,
m_rExport.EncodeStyleName( rStrName,
&bEncoded ) );
if( bEncoded )
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DISPLAY_NAME,
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DISPLAY_NAME,
rStrName );
aStrValue = aOut.makeStringAndClear();
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_STYLE, aStrValue );
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_STYLE, aStrValue );
// Color
::sax::Converter::convertColor(aOut, aHatch.Color);
aStrValue = aOut.makeStringAndClear();
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_COLOR, aStrValue );
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_COLOR, aStrValue );
// Distance
rUnitConverter.convertMeasureToXML( aOut, aHatch.Distance );
aStrValue = aOut.makeStringAndClear();
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DISTANCE, aStrValue );
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DISTANCE, aStrValue );
// Angle
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_ROTATION, OUString::number(aHatch.Angle) );
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_ROTATION, OUString::number(aHatch.Angle) );
// Do Write
SvXMLElementExport rElem( rExport, XML_NAMESPACE_DRAW, XML_HATCH,
SvXMLElementExport rElem( m_rExport, XML_NAMESPACE_DRAW, XML_HATCH,
true, false );
}