[Libreoffice-bugs] [Bug 62268] FILEOPEN: Optimum row height should be recalculated with " style:use-optimal-row-height='true'"
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Fri Apr 21 20:16:29 UTC 2017
https://bugs.documentfoundation.org/show_bug.cgi?id=62268
--- Comment #20 from Tester <furun at arcor.de> ---
Bug is still present in 5.3.2.2.
i tray quick if i can see something in the code. here the result.
i am not a Libre coder, i look in the code the first time and only for minutes.
i have not check the code logic! please a coder should check the conclusion
here carefully, and forgive me in case i searched at the wrong place...
if this is not the bug source, i will try to search a little more, to see how
far i come... but please check the argument here first.
this is the search trace so far
from libreoffice-5.3.2.2.tar.xz
--> use-optimal-row-height
TOKEN( "use-optimal-column-width", XML_USE_OPTIMAL_COLUMN_WIDTH ),
TOKEN( "use-optimal-row-height", XML_USE_OPTIMAL_ROW_HEIGHT ),
--> XML_USE_OPTIMAL_ROW_HEIGHT
!!! This code shows a anomaly. The name mapping seams to be wrong.
libreoffice-5.3.2.2\xmloff\source\table\XMLTableExport.cxx
"XML_MIN_ROW_HEIGHT" is mapped as "OptimalHeight"
"XML_USE_OPTIMAL_ROW_HEIGHT" is mapped as "OptimalWidth"
const XMLPropertyMapEntry* getRowPropertiesMap()
{
static const XMLPropertyMapEntry aXMLRowProperties[] =
{
RMAP( "Height", XML_NAMESPACE_STYLE, XML_ROW_HEIGHT,
XML_TYPE_MEASURE, 0 ),
RMAP( "OptimalHeight", XML_NAMESPACE_STYLE, XML_MIN_ROW_HEIGHT,
XML_TYPE_MEASURE, 0 ),
RMAP( "OptimalWidth", XML_NAMESPACE_STYLE,
XML_USE_OPTIMAL_ROW_HEIGHT, XML_TYPE_BOOL, 0 ),
MAP_END
};
return &aXMLRowProperties[0];
}
--> getRowPropertiesMap
libreoffice-5.3.2.2\xmloff\source\table\XMLTableExport.cxx
mxRowExportPropertySetMapper = new SvXMLExportPropertyMapper( new
XMLPropertySetMapper( getRowPropertiesMap(), xFactoryRef.get(), true ) );
libreoffice-5.3.2.2\xmloff\source\table\XMLTableImport.cxx
rtl::Reference < XMLPropertySetMapper > xRowMapper( new
XMLPropertySetMapper( getRowPropertiesMap(), xFactoryRef.get(), false ) );
--> Some More... XML_USE_OPTIMAL_ROW_HEIGHT
Here it seams to be correct
"XML_USE_OPTIMAL_ROW_HEIGHT" is mapped as "OptimalHeight"
const XMLPropertyMapEntry aXMLScRowStylesImportProperties[] =
{
// #i57867# Include background color
(CellBackColor/IsCellBackgroundTransparent) for import only.
// Import and export should use the same map, with
MID_FLAG_NO_PROPERTY_EXPORT for the background entries,
// but this doesn't work at the moment because SvXMLImportPropertyMapper
compares MID_FLAG_NO_PROPERTY to 0.
// If this is changed (not for 2.0.x), a single map can be used again.
MAP( "CellBackColor", XML_NAMESPACE_FO, XML_BACKGROUND_COLOR,
XML_TYPE_PROP_TABLE_ROW|XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY|MID_FLAG_MERGE_ATTRIBUTE,
0 ),
MAP( "Height", XML_NAMESPACE_STYLE, XML_ROW_HEIGHT,
XML_TYPE_PROP_TABLE_ROW|XML_TYPE_MEASURE, CTF_SC_ROWHEIGHT),
MAP( "IsCellBackgroundTransparent", XML_NAMESPACE_FO, XML_BACKGROUND_COLOR,
XML_TYPE_PROP_TABLE_ROW|XML_TYPE_ISTRANSPARENT|MID_FLAG_MULTI_PROPERTY|MID_FLAG_MERGE_ATTRIBUTE,
0 ),
MAP( "IsManualPageBreak", XML_NAMESPACE_FO, XML_BREAK_BEFORE,
XML_TYPE_PROP_TABLE_ROW|XML_SC_TYPE_BREAKBEFORE, CTF_SC_ROWBREAKBEFORE),
MAP( "OptimalHeight", XML_NAMESPACE_STYLE, XML_USE_OPTIMAL_ROW_HEIGHT,
XML_TYPE_PROP_TABLE_ROW|XML_TYPE_BOOL, CTF_SC_ROWOPTIMALHEIGHT),
MAP_END()
};
const XMLPropertyMapEntry aXMLScRowStylesProperties[] =
{
MAP( "Height", XML_NAMESPACE_STYLE, XML_ROW_HEIGHT,
XML_TYPE_PROP_TABLE_ROW|XML_TYPE_MEASURE, CTF_SC_ROWHEIGHT),
MAP( "IsManualPageBreak", XML_NAMESPACE_FO, XML_BREAK_BEFORE,
XML_TYPE_PROP_TABLE_ROW|XML_SC_TYPE_BREAKBEFORE, CTF_SC_ROWBREAKBEFORE),
MAP( "OptimalHeight", XML_NAMESPACE_STYLE, XML_USE_OPTIMAL_ROW_HEIGHT,
XML_TYPE_PROP_TABLE_ROW|XML_TYPE_BOOL, CTF_SC_ROWOPTIMALHEIGHT),
MAP_END()
};
const XMLPropertyMapEntry aXMLScFromXLSRowStylesProperties[] =
{
MAP( "Height", XML_NAMESPACE_STYLE, XML_ROW_HEIGHT,
XML_TYPE_PROP_TABLE_ROW|XML_TYPE_MEASURE, CTF_SC_ROWHEIGHT),
MAP( "IsManualPageBreak", XML_NAMESPACE_FO, XML_BREAK_BEFORE,
XML_TYPE_PROP_TABLE_ROW|XML_SC_TYPE_BREAKBEFORE, CTF_SC_ROWBREAKBEFORE),
MAP( "OptimalHeight", XML_NAMESPACE_STYLE, XML_USE_OPTIMAL_ROW_HEIGHT,
XML_TYPE_PROP_TABLE_ROW|XML_TYPE_BOOL_FALSE, CTF_SC_ROWOPTIMALHEIGHT),
MAP_END()
};
Here it seams to be correct
"XML_USE_OPTIMAL_COLUMN_WIDTH" is mapped as "OptimalWidth"
const XMLPropertyMapEntry* getColumnPropertiesMap()
{
static const XMLPropertyMapEntry aXMLColumnProperties[] =
{
CMAP( "Width", XML_NAMESPACE_STYLE, XML_COLUMN_WIDTH,
XML_TYPE_MEASURE, 0 ),
CMAP( "OptimalWidth", XML_NAMESPACE_STYLE,
XML_USE_OPTIMAL_COLUMN_WIDTH, XML_TYPE_BOOL, 0 ),
MAP_END
};
return &aXMLColumnProperties[0];
}
thanks
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20170421/346ca3e5/attachment-0001.html>
More information about the Libreoffice-bugs
mailing list