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:
parent
8cc51cf988
commit
a97374fca8
@ -37,7 +37,7 @@ namespace com::sun::star {
|
|||||||
|
|
||||||
class XMLOFF_DLLPUBLIC XMLGradientStyleImport
|
class XMLOFF_DLLPUBLIC XMLGradientStyleImport
|
||||||
{
|
{
|
||||||
SvXMLImport& rImport;
|
SvXMLImport& m_rImport;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
XMLGradientStyleImport( SvXMLImport& rImport );
|
XMLGradientStyleImport( SvXMLImport& rImport );
|
||||||
@ -60,7 +60,7 @@ public:
|
|||||||
|
|
||||||
class XMLOFF_DLLPUBLIC XMLGradientStyleExport
|
class XMLOFF_DLLPUBLIC XMLGradientStyleExport
|
||||||
{
|
{
|
||||||
SvXMLExport& rExport;
|
SvXMLExport& m_rExport;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
XMLGradientStyleExport( SvXMLExport& rExport );
|
XMLGradientStyleExport( SvXMLExport& rExport );
|
||||||
|
@ -35,7 +35,7 @@ namespace com::sun::star {
|
|||||||
|
|
||||||
class XMLOFF_DLLPUBLIC XMLHatchStyleImport
|
class XMLOFF_DLLPUBLIC XMLHatchStyleImport
|
||||||
{
|
{
|
||||||
SvXMLImport& rImport;
|
SvXMLImport& m_rImport;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
XMLHatchStyleImport( SvXMLImport& rImport );
|
XMLHatchStyleImport( SvXMLImport& rImport );
|
||||||
@ -48,7 +48,7 @@ public:
|
|||||||
|
|
||||||
class XMLOFF_DLLPUBLIC XMLHatchStyleExport
|
class XMLOFF_DLLPUBLIC XMLHatchStyleExport
|
||||||
{
|
{
|
||||||
SvXMLExport& rExport;
|
SvXMLExport& m_rExport;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
XMLHatchStyleExport( SvXMLExport& rExport );
|
XMLHatchStyleExport( SvXMLExport& rExport );
|
||||||
|
@ -52,7 +52,7 @@ SvXMLEnumMapEntry<awt::GradientStyle> const pXML_GradientStyle_Enum[] =
|
|||||||
// Import
|
// Import
|
||||||
XMLGradientStyleImport::XMLGradientStyleImport(
|
XMLGradientStyleImport::XMLGradientStyleImport(
|
||||||
SvXMLImport& rImp )
|
SvXMLImport& rImp )
|
||||||
: rImport(rImp)
|
: m_rImport(rImp)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,14 +114,14 @@ void XMLGradientStyleImport::importXML(
|
|||||||
break;
|
break;
|
||||||
case XML_ELEMENT(DRAW, XML_GRADIENT_ANGLE):
|
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 =
|
bool const bSuccess =
|
||||||
::sax::Converter::convertAngle(aGradient.Angle, aIter.toView(),
|
::sax::Converter::convertAngle(aGradient.Angle, aIter.toView(),
|
||||||
// tdf#89475 try to detect borked OOo angles
|
// tdf#89475 try to detect borked OOo angles
|
||||||
(cmp12 < 0) || (cmp12 == 0
|
(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
|
// 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");
|
SAL_INFO_IF(!bSuccess, "xmloff.style", "failed to import draw:angle");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -139,7 +139,7 @@ void XMLGradientStyleImport::importXML(
|
|||||||
|
|
||||||
if( !aDisplayName.isEmpty() )
|
if( !aDisplayName.isEmpty() )
|
||||||
{
|
{
|
||||||
rImport.AddStyleDisplayName( XmlStyleFamily::SD_GRADIENT_ID, rStrName,
|
m_rImport.AddStyleDisplayName( XmlStyleFamily::SD_GRADIENT_ID, rStrName,
|
||||||
aDisplayName );
|
aDisplayName );
|
||||||
rStrName = aDisplayName;
|
rStrName = aDisplayName;
|
||||||
}
|
}
|
||||||
@ -211,7 +211,7 @@ XMLGradientStopContext::~XMLGradientStopContext()
|
|||||||
|
|
||||||
XMLGradientStyleExport::XMLGradientStyleExport(
|
XMLGradientStyleExport::XMLGradientStyleExport(
|
||||||
SvXMLExport& rExp )
|
SvXMLExport& rExp )
|
||||||
: rExport(rExp)
|
: m_rExport(rExp)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,15 +236,15 @@ void XMLGradientStyleExport::exportXML(
|
|||||||
|
|
||||||
// Name
|
// Name
|
||||||
bool bEncoded = false;
|
bool bEncoded = false;
|
||||||
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME,
|
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME,
|
||||||
rExport.EncodeStyleName( rStrName,
|
m_rExport.EncodeStyleName( rStrName,
|
||||||
&bEncoded ) );
|
&bEncoded ) );
|
||||||
if( bEncoded )
|
if( bEncoded )
|
||||||
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DISPLAY_NAME,
|
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DISPLAY_NAME,
|
||||||
rStrName );
|
rStrName );
|
||||||
|
|
||||||
aStrValue = aOut.makeStringAndClear();
|
aStrValue = aOut.makeStringAndClear();
|
||||||
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_STYLE, aStrValue );
|
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_STYLE, aStrValue );
|
||||||
|
|
||||||
// Center x/y
|
// Center x/y
|
||||||
if( aGradient.Style != awt::GradientStyle_LINEAR &&
|
if( aGradient.Style != awt::GradientStyle_LINEAR &&
|
||||||
@ -252,52 +252,52 @@ void XMLGradientStyleExport::exportXML(
|
|||||||
{
|
{
|
||||||
::sax::Converter::convertPercent(aOut, aGradient.XOffset);
|
::sax::Converter::convertPercent(aOut, aGradient.XOffset);
|
||||||
aStrValue = aOut.makeStringAndClear();
|
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);
|
::sax::Converter::convertPercent(aOut, aGradient.YOffset);
|
||||||
aStrValue = aOut.makeStringAndClear();
|
aStrValue = aOut.makeStringAndClear();
|
||||||
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_CY, aStrValue );
|
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_CY, aStrValue );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Color start
|
// Color start
|
||||||
::sax::Converter::convertColor(aOut, aGradient.StartColor);
|
::sax::Converter::convertColor(aOut, aGradient.StartColor);
|
||||||
aStrValue = aOut.makeStringAndClear();
|
aStrValue = aOut.makeStringAndClear();
|
||||||
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_START_COLOR, aStrValue );
|
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_START_COLOR, aStrValue );
|
||||||
|
|
||||||
// Color end
|
// Color end
|
||||||
::sax::Converter::convertColor(aOut, aGradient.EndColor);
|
::sax::Converter::convertColor(aOut, aGradient.EndColor);
|
||||||
aStrValue = aOut.makeStringAndClear();
|
aStrValue = aOut.makeStringAndClear();
|
||||||
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_END_COLOR, aStrValue );
|
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_END_COLOR, aStrValue );
|
||||||
|
|
||||||
// Intensity start
|
// Intensity start
|
||||||
::sax::Converter::convertPercent(aOut, aGradient.StartIntensity);
|
::sax::Converter::convertPercent(aOut, aGradient.StartIntensity);
|
||||||
aStrValue = aOut.makeStringAndClear();
|
aStrValue = aOut.makeStringAndClear();
|
||||||
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_START_INTENSITY, aStrValue );
|
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_START_INTENSITY, aStrValue );
|
||||||
|
|
||||||
// Intensity end
|
// Intensity end
|
||||||
::sax::Converter::convertPercent(aOut, aGradient.EndIntensity);
|
::sax::Converter::convertPercent(aOut, aGradient.EndIntensity);
|
||||||
aStrValue = aOut.makeStringAndClear();
|
aStrValue = aOut.makeStringAndClear();
|
||||||
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_END_INTENSITY, aStrValue );
|
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_END_INTENSITY, aStrValue );
|
||||||
|
|
||||||
// Angle
|
// Angle
|
||||||
if( aGradient.Style != awt::GradientStyle_RADIAL )
|
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();
|
aStrValue = aOut.makeStringAndClear();
|
||||||
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_GRADIENT_ANGLE, aStrValue );
|
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_GRADIENT_ANGLE, aStrValue );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Border
|
// Border
|
||||||
::sax::Converter::convertPercent( aOut, aGradient.Border );
|
::sax::Converter::convertPercent( aOut, aGradient.Border );
|
||||||
aStrValue = aOut.makeStringAndClear();
|
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.
|
// 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 );
|
true, false );
|
||||||
|
|
||||||
// Write child elements <loext:gradient-stop>
|
// Write child elements <loext:gradient-stop>
|
||||||
// Do not export in standard ODF 1.3 or older.
|
// 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;
|
return;
|
||||||
sal_Int32 nCount = aGradient.ColorStops.getLength();
|
sal_Int32 nCount = aGradient.ColorStops.getLength();
|
||||||
if (nCount == 0)
|
if (nCount == 0)
|
||||||
@ -310,22 +310,22 @@ void XMLGradientStyleExport::exportXML(
|
|||||||
double fOffset = std::clamp<double>(aCandidate.StopOffset, 0.0, 1.0);
|
double fOffset = std::clamp<double>(aCandidate.StopOffset, 0.0, 1.0);
|
||||||
if (fOffset < fPreviousOffset)
|
if (fOffset < fPreviousOffset)
|
||||||
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;
|
fPreviousOffset = fOffset;
|
||||||
|
|
||||||
// As of LO 7.6.0 only color-type="rgb" is implemented.
|
// 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.
|
// Attribute loext:color-value, data type color, that is #rrggbb.
|
||||||
rendering::RGBColor aDecimalColor = aCandidate.StopColor;
|
rendering::RGBColor aDecimalColor = aCandidate.StopColor;
|
||||||
::Color aToolsColor(std::clamp<sal_uInt8>(std::round(aDecimalColor.Red * 255.0), 0, 255),
|
::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.Green * 255.0), 0, 255),
|
||||||
std::clamp<sal_uInt8>(std::round(aDecimalColor.Blue * 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());
|
rtl::OUStringChar('#') + aToolsColor.AsRGBHexString());
|
||||||
|
|
||||||
// write gradient stop element
|
// 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ SvXMLEnumMapEntry<drawing::HatchStyle> const pXML_HatchStyle_Enum[] =
|
|||||||
// Import
|
// Import
|
||||||
|
|
||||||
XMLHatchStyleImport::XMLHatchStyleImport( SvXMLImport& rImp )
|
XMLHatchStyleImport::XMLHatchStyleImport( SvXMLImport& rImp )
|
||||||
: rImport(rImp)
|
: m_rImport(rImp)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ void XMLHatchStyleImport::importXML(
|
|||||||
aHatch.Distance = 0;
|
aHatch.Distance = 0;
|
||||||
aHatch.Angle = 0;
|
aHatch.Angle = 0;
|
||||||
|
|
||||||
SvXMLUnitConverter& rUnitConverter = rImport.GetMM100UnitConverter();
|
SvXMLUnitConverter& rUnitConverter = m_rImport.GetMM100UnitConverter();
|
||||||
|
|
||||||
for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList ))
|
for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList ))
|
||||||
{
|
{
|
||||||
@ -110,7 +110,7 @@ void XMLHatchStyleImport::importXML(
|
|||||||
|
|
||||||
if( !aDisplayName.isEmpty() )
|
if( !aDisplayName.isEmpty() )
|
||||||
{
|
{
|
||||||
rImport.AddStyleDisplayName( XmlStyleFamily::SD_HATCH_ID, rStrName,
|
m_rImport.AddStyleDisplayName( XmlStyleFamily::SD_HATCH_ID, rStrName,
|
||||||
aDisplayName );
|
aDisplayName );
|
||||||
rStrName = aDisplayName;
|
rStrName = aDisplayName;
|
||||||
}
|
}
|
||||||
@ -119,7 +119,7 @@ void XMLHatchStyleImport::importXML(
|
|||||||
// Export
|
// Export
|
||||||
|
|
||||||
XMLHatchStyleExport::XMLHatchStyleExport( SvXMLExport& rExp )
|
XMLHatchStyleExport::XMLHatchStyleExport( SvXMLExport& rExp )
|
||||||
: rExport(rExp)
|
: m_rExport(rExp)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,7 +139,7 @@ void XMLHatchStyleExport::exportXML(
|
|||||||
OUStringBuffer aOut;
|
OUStringBuffer aOut;
|
||||||
|
|
||||||
SvXMLUnitConverter& rUnitConverter =
|
SvXMLUnitConverter& rUnitConverter =
|
||||||
rExport.GetMM100UnitConverter();
|
m_rExport.GetMM100UnitConverter();
|
||||||
|
|
||||||
// Style
|
// Style
|
||||||
if( !SvXMLUnitConverter::convertEnum( aOut, aHatch.Style, pXML_HatchStyle_Enum ) )
|
if( !SvXMLUnitConverter::convertEnum( aOut, aHatch.Style, pXML_HatchStyle_Enum ) )
|
||||||
@ -147,31 +147,31 @@ void XMLHatchStyleExport::exportXML(
|
|||||||
|
|
||||||
// Name
|
// Name
|
||||||
bool bEncoded = false;
|
bool bEncoded = false;
|
||||||
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME,
|
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME,
|
||||||
rExport.EncodeStyleName( rStrName,
|
m_rExport.EncodeStyleName( rStrName,
|
||||||
&bEncoded ) );
|
&bEncoded ) );
|
||||||
if( bEncoded )
|
if( bEncoded )
|
||||||
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DISPLAY_NAME,
|
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DISPLAY_NAME,
|
||||||
rStrName );
|
rStrName );
|
||||||
|
|
||||||
aStrValue = aOut.makeStringAndClear();
|
aStrValue = aOut.makeStringAndClear();
|
||||||
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_STYLE, aStrValue );
|
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_STYLE, aStrValue );
|
||||||
|
|
||||||
// Color
|
// Color
|
||||||
::sax::Converter::convertColor(aOut, aHatch.Color);
|
::sax::Converter::convertColor(aOut, aHatch.Color);
|
||||||
aStrValue = aOut.makeStringAndClear();
|
aStrValue = aOut.makeStringAndClear();
|
||||||
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_COLOR, aStrValue );
|
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_COLOR, aStrValue );
|
||||||
|
|
||||||
// Distance
|
// Distance
|
||||||
rUnitConverter.convertMeasureToXML( aOut, aHatch.Distance );
|
rUnitConverter.convertMeasureToXML( aOut, aHatch.Distance );
|
||||||
aStrValue = aOut.makeStringAndClear();
|
aStrValue = aOut.makeStringAndClear();
|
||||||
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DISTANCE, aStrValue );
|
m_rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DISTANCE, aStrValue );
|
||||||
|
|
||||||
// Angle
|
// 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
|
// Do Write
|
||||||
SvXMLElementExport rElem( rExport, XML_NAMESPACE_DRAW, XML_HATCH,
|
SvXMLElementExport rElem( m_rExport, XML_NAMESPACE_DRAW, XML_HATCH,
|
||||||
true, false );
|
true, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user