[Libreoffice-commits] core.git: 2 commits - sc/source
Eike Rathke
erack at redhat.com
Wed Sep 28 11:19:24 UTC 2016
sc/source/core/data/attarray.cxx | 5 ++++-
sc/source/filter/orcus/interface.cxx | 11 +++++++++--
2 files changed, 13 insertions(+), 3 deletions(-)
New commits:
commit e439058541cd02937cf43f399fef8767bd3d4996
Author: Eike Rathke <erack at redhat.com>
Date: Wed Sep 28 13:16:11 2016 +0200
sc-perf: avoid second call to ScAttrArray::Search(), tdf#87101 related
In that scenario, of 36791233 calls only 9217 were necessary as most times
nRow2 equals nRow1.
Change-Id: I14228d065175addee76b9142c98110efe59701e7
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index 0f51713..fb90fb4 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -1199,7 +1199,10 @@ bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, HasAttrFlags nMask ) cons
SCSIZE nStartIndex;
SCSIZE nEndIndex;
Search( nRow1, nStartIndex );
- Search( nRow2, nEndIndex );
+ if (nRow1 != nRow2)
+ Search( nRow2, nEndIndex );
+ else
+ nEndIndex = nStartIndex;
bool bFound = false;
for (SCSIZE i=nStartIndex; i<=nEndIndex && !bFound; i++)
commit a995e219a4553202f24d0da59aa22c1dd5743dfc
Author: Jaskaran Singh <jvsg1303 at gmail.com>
Date: Tue Sep 27 23:31:54 2016 +0530
Fix minor issue in importing cell styles
Change-Id: I734f4bb6a6347487d210cde2639cb704e3aedae1
Reviewed-on: https://gerrit.libreoffice.org/29337
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Jaskaran singh <jvsg1303 at gmail.com>
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 8b08c1b..e2d2031 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -757,7 +757,7 @@ ScOrcusStyles::font::font():
mbBold(false),
mbItalic(false),
mnSize(10),
- maColor(COL_WHITE),
+ maColor(COL_BLACK),
mbHasFontAttr(false),
mbHasUnderlineAttr(false),
mbHasStrikeout(false),
@@ -804,7 +804,10 @@ void ScOrcusStyles::font::applyToItemSet(SfxItemSet& rSet) const
rSet.Put(SvxWeightItem(eWeight, ATTR_FONT_WEIGHT));
rSet.Put( SvxColorItem(maColor, ATTR_FONT_COLOR));
- rSet.Put( SvxFontItem( FAMILY_DONTKNOW, maName, maName, PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, ATTR_FONT ));
+
+ if(!maName.isEmpty())
+ rSet.Put( SvxFontItem( FAMILY_DONTKNOW, maName, maName, PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, ATTR_FONT ));
+
rSet.Put( SvxFontHeightItem (translateToInternal(mnSize, orcus::length_unit_t::point), 100, ATTR_FONT_HEIGHT));
}
@@ -1034,11 +1037,13 @@ void ScOrcusStyles::set_font_count(size_t /*n*/)
void ScOrcusStyles::set_font_bold(bool b)
{
maCurrentFont.mbBold = b;
+ maCurrentFont.mbHasFontAttr = true;
}
void ScOrcusStyles::set_font_italic(bool b)
{
maCurrentFont.mbItalic = b;
+ maCurrentFont.mbHasFontAttr = true;
}
void ScOrcusStyles::set_font_name(const char* s, size_t n)
@@ -1051,6 +1056,7 @@ void ScOrcusStyles::set_font_name(const char* s, size_t n)
void ScOrcusStyles::set_font_size(double point)
{
maCurrentFont.mnSize = point;
+ maCurrentFont.mbHasFontAttr = true;
}
void ScOrcusStyles::set_font_underline(orcus::spreadsheet::underline_t e)
@@ -1166,6 +1172,7 @@ void ScOrcusStyles::set_font_color(orcus::spreadsheet::color_elem_t alpha,
orcus::spreadsheet::color_elem_t blue)
{
maCurrentFont.maColor = Color(alpha, red, green, blue);
+ maCurrentFont.mbHasFontAttr = true;
}
void ScOrcusStyles::set_strikethrough_style(orcus::spreadsheet::strikethrough_style_t /*s*/)
More information about the Libreoffice-commits
mailing list