[Libreoffice-commits] core.git: Branch 'feature/orcus-rebased' - 191 commits - avmedia/source basctl/source basic/source chart2/source configmgr/source configure.ac connectivity/source cui/Library_cui.mk cui/source dbaccess/source desktop/source download.lst editeng/source embeddedobj/source extensions/source external/libmwaw external/libwps filter/qa filter/source formula/source fpicker/source fpicker/test framework/source helpcontent2 i18nlangtag/source i18npool/source include/editeng include/filter include/i18nlangtag include/o3tl include/oox include/sfx2 include/svtools include/svx include/tools include/vcl include/xmloff jvmfwk/source linguistic/source lotuswordpro/source o3tl/qa offapi/com offapi/UnoApi_offapi.mk officecfg/Configuration_officecfg.mk officecfg/registry oox/source opencl/source package/inc package/source postprocess/CustomTarget_registry.mk reportdesign/inc reportdesign/source sax/qa sax/source sax/test sc/inc sc/qa sc/source sc/uiconfig sd/inc sd/qa sd/source sfx2/inc sfx2/s ource slideshow/source solenv/bin starmath/inc starmath/source svtools/qa svtools/source svx/Library_svxcore.mk svx/source svx/uiconfig sw/CppunitTest_sw_odfexport.mk sw/inc sw/qa sw/source sw/uiconfig tools/qa tools/source ucb/source unotools/source uui/source vbahelper/source vcl/generic vcl/inc vcl/opengl vcl/osx vcl/qa vcl/README.vars vcl/source vcl/unx vcl/win vcl/workben writerperfect/inc writerperfect/qa writerperfect/source xmloff/inc xmloff/source xmlsecurity/inc xmlsecurity/source
Markus Mohrhard
markus.mohrhard at collabora.co.uk
Thu Aug 27 16:20:26 PDT 2015
Rebased ref, commits from common ancestor:
commit 9828cb4f913444cdd10ad0ff04d57e71689d4a5c
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Tue Jan 27 04:31:25 2015 +0100
call it as well
Change-Id: I8ac7ebdf8af13ebd76a3c044fea5b0156808c852
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 8b3a616..b9291a8 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -682,6 +682,8 @@ void ScOrcusStyles::applyXfToItemSet(SfxItemSet& rSet, const xf& rXf)
SAL_WARN("sc.orcus.style", "invalid border id");
return;
}
+ const border& rBorder = maBorders[nBorderId];
+ rBorder.applyToItemSet(rSet);
size_t nProtectionId = rXf.mnProtectionId;
if (nProtectionId >= maProtections.size())
@@ -689,6 +691,8 @@ void ScOrcusStyles::applyXfToItemSet(SfxItemSet& rSet, const xf& rXf)
SAL_WARN("sc.orcus.style", "invalid protection id");
return;
}
+ const protection& rProtection = maProtections[nProtectionId];
+ rProtection.applyToItemSet(rSet);
size_t nNumberFormatId = rXf.mnNumberFormatId;
if (nNumberFormatId >= maNumberFormats.size())
@@ -696,6 +700,8 @@ void ScOrcusStyles::applyXfToItemSet(SfxItemSet& rSet, const xf& rXf)
SAL_WARN("sc.orcus.style", "invalid number format id");
return;
}
+ const number_format& rFormat = maNumberFormats[nNumberFormatId];
+ rFormat.applyToItemSet(rSet);
}
bool ScOrcusStyles::applyXfToItemSet(SfxItemSet& rSet, size_t xfId)
commit 1bc2cfbc016b8776ad2261fde24ce2ead5c2e76b
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Tue Jan 27 04:30:59 2015 +0100
implement the applyToItemSet for more properties
Change-Id: I120fe6b4c52c40560aa589debb610aeccc438b81
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 0586b43..8b3a616 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -622,10 +622,22 @@ ScOrcusStyles::protection::protection():
{
}
+void ScOrcusStyles::protection::applyToItemSet(SfxItemSet& /*rSet*/) const
+{
+}
+
ScOrcusStyles::border::border()
{
}
+void ScOrcusStyles::border::applyToItemSet(SfxItemSet& /*rSet*/) const
+{
+}
+
+void ScOrcusStyles::number_format::applyToItemSet(SfxItemSet& /*rSet*/) const
+{
+}
+
ScOrcusStyles::xf::xf():
mnFontId(0),
mnFillId(0),
commit 76f27d9ce71a0c1bf2c2e30d521305a437ee59b5
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Fri Jan 16 22:16:46 2015 +0100
add applyToItemSet method to all properties
Change-Id: Iaa67f0c6c619af248074d9c1a436a1e59563fd2b
diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx
index 5862276..dec7d38 100644
--- a/sc/source/filter/inc/orcusinterface.hxx
+++ b/sc/source/filter/inc/orcusinterface.hxx
@@ -218,8 +218,9 @@ private:
struct border
{
-
border();
+
+ void applyToItemSet(SfxItemSet& rSet) const;
};
border maCurrentBorder;
@@ -231,6 +232,7 @@ private:
bool mbLocked;
protection();
+ void applyToItemSet(SfxItemSet& rSet) const;
};
protection maCurrentProtection;
@@ -239,6 +241,8 @@ private:
struct number_format
{
OUString maCode;
+
+ void applyToItemSet(SfxItemSet& rSet) const;
};
number_format maCurrentNumberFormat;
commit 6f8984cf57a802e157e970880e75f4100db2c9c9
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sun Jan 11 22:04:42 2015 +0100
apply fill properties to item set
Change-Id: I89d8d84d199a991d75b9c613fd72d66c18642b12
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 7e4987b..0586b43 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -661,6 +661,9 @@ void ScOrcusStyles::applyXfToItemSet(SfxItemSet& rSet, const xf& rXf)
return;
}
+ const fill& rFill = maFills[nFillId];
+ rFill.applyToItemSet(rSet);
+
size_t nBorderId = rXf.mnBorderId;
if (nBorderId >= maBorders.size())
{
commit 9f0bf9c7660815c149355f07a03399f59a5a85f0
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sun Jan 11 21:38:50 2015 +0100
import the background color
Change-Id: I63dfc5b879abcb63cc4d0d67389467d76f94bca9
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 718fa4c..7e4987b 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -608,9 +608,12 @@ void ScOrcusStyles::font::applyToItemSet(SfxItemSet& rSet) const
void ScOrcusStyles::fill::applyToItemSet(SfxItemSet& rSet) const
{
if (maPattern.equalsIgnoreAsciiCase("none"))
+ {
+ SAL_INFO("sc.orcus.style", "no fill style");
return;
+ }
- rSet.Put(SvxBrushItem(maFgColor, ATTR_BACKGROUND));
+ rSet.Put(SvxBrushItem(maBgColor, ATTR_BACKGROUND));
}
ScOrcusStyles::protection::protection():
commit 529f002af0c49aeddf17735615623a58d7374172
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sun Jan 11 21:37:52 2015 +0100
make sure to print numbers as ints and not as characters
Change-Id: I8409ac35a6368c80d0f9bf6b49619a63ce502a5a
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index cba4b70..718fa4c 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -586,7 +586,7 @@ namespace {
std::ostream& operator<<(std::ostream& rStrm, const Color& rColor)
{
- rStrm << "Red: " << rColor.GetRed() << ", Green: " << rColor.GetGreen() << ", Blue: " << rColor.GetBlue();
+ rStrm << "Red: " << (int)rColor.GetRed() << ", Green: " << (int)rColor.GetGreen() << ", Blue: " << (int)rColor.GetBlue();
return rStrm;
}
commit 992383ed2e3685c75517ae808fe59839e9c769fb
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sun Jan 11 16:48:33 2015 +0100
make sure that the cell properties are really imported
Conflicts:
sc/source/filter/orcus/interface.cxx
Change-Id: I6cac96214fd57162fb4421c9dbc9e54c20207385
diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx
index 06551c2..5862276 100644
--- a/sc/source/filter/inc/orcusinterface.hxx
+++ b/sc/source/filter/inc/orcusinterface.hxx
@@ -30,6 +30,7 @@
class ScDocumentImport;
class ScOrcusSheet;
+class ScOrcusStyles;
class ScOrcusFactory;
class ScRangeData;
class SfxItemSet;
@@ -125,6 +126,7 @@ class ScOrcusSheet : public orcus::spreadsheet::iface::import_sheet
ScDocumentImport& mrDoc;
SCTAB mnTab;
ScOrcusFactory& mrFactory;
+ ScOrcusStyles& mrStyles;
sc::SharedFormulaGroups maFormulaGroups;
ScOrcusAutoFilter maAutoFilter;
ScOrcusSheetProperties maProperties;
@@ -273,6 +275,9 @@ private:
public:
ScOrcusStyles(ScDocument& rDoc);
+
+ bool applyXfToItemSet(SfxItemSet& rSet, size_t xfId);
+
// font
virtual void set_font_count(size_t n) SAL_OVERRIDE;
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 0957714..cba4b70 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -20,6 +20,8 @@
#include "dbdata.hxx"
#include "stlpool.hxx"
#include "scitems.hxx"
+#include "patattr.hxx"
+#include "docpool.hxx"
#include <editeng/postitem.hxx>
#include <editeng/wghtitem.hxx>
@@ -283,6 +285,7 @@ ScOrcusSheet::ScOrcusSheet(ScDocumentImport& rDoc, SCTAB nTab, ScOrcusFactory& r
mrDoc(rDoc),
mnTab(nTab),
mrFactory(rFactory),
+ mrStyles(static_cast<ScOrcusStyles&>(*mrFactory.get_styles())),
maAutoFilter(rDoc.getDoc()),
maProperties(mnTab, mrDoc),
mnCellCount(0)
@@ -368,9 +371,13 @@ void ScOrcusSheet::set_format(os::row_t /*row*/, os::col_t /*col*/, size_t xf_in
SAL_INFO("sc.orcus.style", "set format: " << xf_index);
}
-void ScOrcusSheet::set_format(os::row_t /*row*/, os::col_t /*col*/,
- os::row_t /*row_end*/, os::col_t /*col_end*/, size_t /*xf_index*/)
+void ScOrcusSheet::set_format(os::row_t row_start, os::col_t col_start,
+ os::row_t row_end, os::col_t col_end, size_t xf_index)
{
+ SAL_INFO("sc.orcus.style", "set format range: " << xf_index);
+ ScPatternAttr aPattern(mrDoc.getDoc().GetPool());
+ mrStyles.applyXfToItemSet(aPattern.GetItemSet(), xf_index);
+ mrDoc.getDoc().ApplyPatternAreaTab(col_start, row_start, col_end, row_end, mnTab, aPattern);
}
namespace {
@@ -673,6 +680,20 @@ void ScOrcusStyles::applyXfToItemSet(SfxItemSet& rSet, const xf& rXf)
}
}
+bool ScOrcusStyles::applyXfToItemSet(SfxItemSet& rSet, size_t xfId)
+{
+ SAL_INFO("sc.orcus.style", "applyXfToitemSet: " << xfId);
+ if (maCellXfs.size() <= xfId)
+ {
+ SAL_WARN("sc.orcus.style", "invalid xf id");
+ return false;
+ }
+
+ const xf& rXf = maCellXfs[xfId];
+ applyXfToItemSet(rSet, rXf);
+ return true;
+}
+
void ScOrcusStyles::set_font_count(size_t /*n*/)
{
// needed at all?
commit eca0b91665ded0983fd3a6ebe1980391bf80ded7
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sun Jan 11 15:29:45 2015 +0100
use a consistent log area for orcus styles
Change-Id: I8d020d541cbe1ccd4fbc38f2ba0ba63351ddfaa4
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 10a1ce4..0957714 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -363,8 +363,9 @@ void ScOrcusSheet::set_date_time(
cellInserted();
}
-void ScOrcusSheet::set_format(os::row_t /*row*/, os::col_t /*col*/, size_t /*xf_index*/)
+void ScOrcusSheet::set_format(os::row_t /*row*/, os::col_t /*col*/, size_t xf_index)
{
+ SAL_INFO("sc.orcus.style", "set format: " << xf_index);
}
void ScOrcusSheet::set_format(os::row_t /*row*/, os::col_t /*col*/,
@@ -573,6 +574,18 @@ ScOrcusStyles::font::font():
{
}
+/*
+namespace {
+
+std::ostream& operator<<(std::ostream& rStrm, const Color& rColor)
+{
+ rStrm << "Red: " << rColor.GetRed() << ", Green: " << rColor.GetGreen() << ", Blue: " << rColor.GetBlue();
+ return rStrm;
+}
+
+}
+*/
+
void ScOrcusStyles::font::applyToItemSet(SfxItemSet& rSet) const
{
FontItalic eItalic = mbItalic ? ITALIC_NORMAL : ITALIC_NONE;
@@ -624,7 +637,7 @@ void ScOrcusStyles::applyXfToItemSet(SfxItemSet& rSet, const xf& rXf)
size_t nFontId = rXf.mnFontId;
if (nFontId >= maFonts.size())
{
- SAL_WARN("sc.orcus.styles", "invalid font id");
+ SAL_WARN("sc.orcus.style", "invalid font id");
return;
}
@@ -634,28 +647,28 @@ void ScOrcusStyles::applyXfToItemSet(SfxItemSet& rSet, const xf& rXf)
size_t nFillId = rXf.mnFillId;
if (nFillId >= maFills.size())
{
- SAL_WARN("sc.orcus.styles", "invalid fill id");
+ SAL_WARN("sc.orcus.style", "invalid fill id");
return;
}
size_t nBorderId = rXf.mnBorderId;
if (nBorderId >= maBorders.size())
{
- SAL_WARN("sc.orcus.styles", "invalid border id");
+ SAL_WARN("sc.orcus.style", "invalid border id");
return;
}
size_t nProtectionId = rXf.mnProtectionId;
if (nProtectionId >= maProtections.size())
{
- SAL_WARN("sc.orcus.styles", "invalid protection id");
+ SAL_WARN("sc.orcus.style", "invalid protection id");
return;
}
size_t nNumberFormatId = rXf.mnNumberFormatId;
if (nNumberFormatId >= maNumberFormats.size())
{
- SAL_WARN("sc.orcus.styles", "invalid number format id");
+ SAL_WARN("sc.orcus.style", "invalid number format id");
return;
}
}
@@ -771,7 +784,7 @@ void ScOrcusStyles::set_border_color(orcus::spreadsheet::border_direction_t /*di
size_t ScOrcusStyles::commit_border()
{
- SAL_INFO("sc.orcus.styles", "commit border");
+ SAL_INFO("sc.orcus.style", "commit border");
return 0;
}
@@ -788,7 +801,7 @@ void ScOrcusStyles::set_cell_locked(bool b)
size_t ScOrcusStyles::commit_cell_protection()
{
- SAL_INFO("sc.orcus.styles", "commit cell protection");
+ SAL_INFO("sc.orcus.style", "commit cell protection");
maProtections.push_back(maCurrentProtection);
return maProtections.size() - 1;
}
@@ -809,7 +822,7 @@ void ScOrcusStyles::set_number_format_code(const char* s, size_t n)
size_t ScOrcusStyles::commit_number_format()
{
- SAL_INFO("sc.orcus.styles", "commit number format");
+ SAL_INFO("sc.orcus.style", "commit number format");
maNumberFormats.push_back(maCurrentNumberFormat);
return maNumberFormats.size() - 1;
}
@@ -823,7 +836,7 @@ void ScOrcusStyles::set_cell_style_xf_count(size_t /*n*/)
size_t ScOrcusStyles::commit_cell_style_xf()
{
- SAL_INFO("sc.orcus.styles", "commit cell style xf");
+ SAL_INFO("sc.orcus.style", "commit cell style xf");
maCellStyleXfs.push_back(maCurrentXF);
return maCellStyleXfs.size() - 1;
}
@@ -837,7 +850,7 @@ void ScOrcusStyles::set_cell_xf_count(size_t /*n*/)
size_t ScOrcusStyles::commit_cell_xf()
{
- SAL_INFO("sc.orcus.styles", "commit cell xf");
+ SAL_INFO("sc.orcus.style", "commit cell xf");
maCellXfs.push_back(maCurrentXF);
return maCellXfs.size() - 1;
}
@@ -924,10 +937,10 @@ void ScOrcusStyles::set_cell_style_builtin(size_t index)
size_t ScOrcusStyles::commit_cell_style()
{
- SAL_INFO("sc.orcus.styles", "commit cell styles");
+ SAL_INFO("sc.orcus.style", "commit cell style: " << maCurrentCellStyle.maName);
if (maCurrentCellStyle.mnXFId >= maCellStyleXfs.size())
{
- SAL_WARN("sc.orcus.styles", "invalid xf id for commit cell style");
+ SAL_WARN("sc.orcus.style", "invalid xf id for commit cell style");
return 0;
}
commit 45c801f06e10e8a61c135acbedd962f1631db4f4
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sat Jan 10 22:33:22 2015 +0100
correct import for row height and col width
Change-Id: Id26ae200b3262769e66528e1d00639471e72c0d7
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index e1db595..10a1ce4 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -228,22 +228,33 @@ double translateToInternal(double nVal, orcus::length_unit_t unit)
switch(unit)
{
case orcus::length_unit_inch:
+ return nVal * 72.0 * 20.0;
+ break;
case orcus::length_unit_twip:
+ return nVal;
+ break;
case orcus::length_unit_point:
+ return nVal * 20.0;
+ break;
case orcus::length_unit_centimeter:
+ return nVal * 20.0 * 72.0 / 2.54;
+ break;
case orcus::length_unit_unknown:
+ SAL_WARN("sc,orcus", "unknown unit");
+ break;
default:
break;
}
- return 0;
+ return nVal;
}
}
-void ScOrcusSheetProperties::set_column_width(os::col_t col, double width, orcus::length_unit_t /*unit*/)
+void ScOrcusSheetProperties::set_column_width(os::col_t col, double width, orcus::length_unit_t unit)
{
- mrDoc.getDoc().SetColWidthOnly(col, mnTab, width);
+ double nNewWidth = translateToInternal(width, unit);
+ mrDoc.getDoc().SetColWidthOnly(col, mnTab, nNewWidth);
}
void ScOrcusSheetProperties::set_column_hidden(os::col_t col, bool hidden)
@@ -252,9 +263,10 @@ void ScOrcusSheetProperties::set_column_hidden(os::col_t col, bool hidden)
mrDoc.getDoc().SetColHidden(col, col, mnTab, hidden);
}
-void ScOrcusSheetProperties::set_row_height(os::row_t row, double height, orcus::length_unit_t /*unit*/)
+void ScOrcusSheetProperties::set_row_height(os::row_t row, double height, orcus::length_unit_t unit)
{
- mrDoc.getDoc().SetRowHeightOnly(row, row,mnTab, height);
+ double nNewHeight = translateToInternal(height, unit);
+ mrDoc.getDoc().SetRowHeightOnly(row, row,mnTab, nNewHeight);
}
void ScOrcusSheetProperties::set_row_hidden(os::row_t row, bool hidden)
commit 7b6122e4f38ac23fc76890f6ead982d5a6b8c5f9
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Fri Jan 9 18:39:35 2015 +0100
temp
Change-Id: Ia71c6f0b673f58b804403841a92f7ab30a619e3e
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 9cad8e9..e1db595 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -221,6 +221,26 @@ ScOrcusSheetProperties::~ScOrcusSheetProperties()
{
}
+namespace {
+
+double translateToInternal(double nVal, orcus::length_unit_t unit)
+{
+ switch(unit)
+ {
+ case orcus::length_unit_inch:
+ case orcus::length_unit_twip:
+ case orcus::length_unit_point:
+ case orcus::length_unit_centimeter:
+ case orcus::length_unit_unknown:
+ default:
+ break;
+ }
+ return 0;
+}
+
+
+}
+
void ScOrcusSheetProperties::set_column_width(os::col_t col, double width, orcus::length_unit_t /*unit*/)
{
mrDoc.getDoc().SetColWidthOnly(col, mnTab, width);
commit d0fa970c32e85c2e7180f4592e73a3519dcb2fc9
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Tue Oct 28 14:46:26 2014 +0100
implement import_sheet_properties interface
Conflicts:
sc/source/filter/inc/orcusinterface.hxx
sc/source/filter/orcus/interface.cxx
Change-Id: Ifed14df422c067fb6faacf370cbe9e1acf336d24
diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx
index b72f6a8..06551c2 100644
--- a/sc/source/filter/inc/orcusinterface.hxx
+++ b/sc/source/filter/inc/orcusinterface.hxx
@@ -101,6 +101,25 @@ private:
ScRange maRange;
};
+class ScOrcusSheetProperties : public orcus::spreadsheet::iface::import_sheet_properties
+{
+ ScDocumentImport& mrDoc;
+ SCTAB mnTab;
+public:
+ ScOrcusSheetProperties(SCTAB nTab, ScDocumentImport& rDoc);
+ virtual ~ScOrcusSheetProperties();
+
+ virtual void set_column_width(orcus::spreadsheet::col_t col, double width, orcus::length_unit_t unit) SAL_OVERRIDE;
+
+ virtual void set_column_hidden(orcus::spreadsheet::col_t col, bool hidden) SAL_OVERRIDE;
+
+ virtual void set_row_height(orcus::spreadsheet::row_t row, double height, orcus::length_unit_t unit) SAL_OVERRIDE;
+
+ virtual void set_row_hidden(orcus::spreadsheet::row_t row, bool hidden) SAL_OVERRIDE;
+
+ virtual void set_merge_cell_range(const char* p_range, size_t n_range) SAL_OVERRIDE;
+};
+
class ScOrcusSheet : public orcus::spreadsheet::iface::import_sheet
{
ScDocumentImport& mrDoc;
@@ -108,6 +127,7 @@ class ScOrcusSheet : public orcus::spreadsheet::iface::import_sheet
ScOrcusFactory& mrFactory;
sc::SharedFormulaGroups maFormulaGroups;
ScOrcusAutoFilter maAutoFilter;
+ ScOrcusSheetProperties maProperties;
typedef std::map<size_t, ScRangeData*> SharedFormulaContainer;
SharedFormulaContainer maSharedFormulas;
@@ -121,6 +141,7 @@ public:
virtual orcus::spreadsheet::iface::import_auto_filter* get_auto_filter() SAL_OVERRIDE { return &maAutoFilter; }
virtual orcus::spreadsheet::iface::import_table* get_table() SAL_OVERRIDE;
+ virtual orcus::spreadsheet::iface::import_sheet_properties* get_sheet_properties() SAL_OVERRIDE;
// Orcus import interface
virtual void set_auto(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, const char* p, size_t n) SAL_OVERRIDE;
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 8ab43e1..9cad8e9 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -211,8 +211,51 @@ void ScOrcusFactory::setStatusIndicator(const uno::Reference<task::XStatusIndica
mxStatusIndicator = rIndicator;
}
+ScOrcusSheetProperties::ScOrcusSheetProperties(SCTAB nTab, ScDocumentImport& rDoc):
+ mrDoc(rDoc),
+ mnTab(nTab)
+{
+}
+
+ScOrcusSheetProperties::~ScOrcusSheetProperties()
+{
+}
+
+void ScOrcusSheetProperties::set_column_width(os::col_t col, double width, orcus::length_unit_t /*unit*/)
+{
+ mrDoc.getDoc().SetColWidthOnly(col, mnTab, width);
+}
+
+void ScOrcusSheetProperties::set_column_hidden(os::col_t col, bool hidden)
+{
+ if (hidden)
+ mrDoc.getDoc().SetColHidden(col, col, mnTab, hidden);
+}
+
+void ScOrcusSheetProperties::set_row_height(os::row_t row, double height, orcus::length_unit_t /*unit*/)
+{
+ mrDoc.getDoc().SetRowHeightOnly(row, row,mnTab, height);
+}
+
+void ScOrcusSheetProperties::set_row_hidden(os::row_t row, bool hidden)
+{
+ if (hidden)
+ mrDoc.getDoc().SetRowHidden(row, row, mnTab, hidden);
+}
+
+void ScOrcusSheetProperties::set_merge_cell_range(const char* /*p_range*/, size_t /*n_range*/)
+{
+}
+
ScOrcusSheet::ScOrcusSheet(ScDocumentImport& rDoc, SCTAB nTab, ScOrcusFactory& rFactory) :
- mrDoc(rDoc), mnTab(nTab), mrFactory(rFactory), maAutoFilter(rDoc.getDoc()), mnCellCount(0) {}
+ mrDoc(rDoc),
+ mnTab(nTab),
+ mrFactory(rFactory),
+ maAutoFilter(rDoc.getDoc()),
+ maProperties(mnTab, mrDoc),
+ mnCellCount(0)
+{
+}
void ScOrcusSheet::cellInserted()
{
@@ -229,6 +272,11 @@ os::iface::import_table* ScOrcusSheet::get_table()
return NULL;
}
+os::iface::import_sheet_properties* ScOrcusSheet::get_sheet_properties()
+{
+ return &maProperties;
+}
+
void ScOrcusSheet::set_auto(os::row_t row, os::col_t col, const char* p, size_t n)
{
OUString aVal(p, n, RTL_TEXTENCODING_UTF8);
commit 4f714e217db2b55fb849b4f01e166db51b8a5e28
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Tue Oct 28 14:33:33 2014 +0100
prevent default operator=
Change-Id: Ibcd843a992b06b73e628b0249fb9f3ea723510d2
diff --git a/sc/inc/documentimport.hxx b/sc/inc/documentimport.hxx
index aa69458..e7fc0b6 100644
--- a/sc/inc/documentimport.hxx
+++ b/sc/inc/documentimport.hxx
@@ -42,6 +42,7 @@ class SC_DLLPUBLIC ScDocumentImport : boost::noncopyable
ScDocumentImportImpl* mpImpl;
ScDocumentImport(); // disabled
+ ScDocumentImport& operator=(const ScDocumentImport&); //disabled
public:
commit 39188b887018bf55cd69ac90fe9730207b4024f4
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Tue Oct 28 00:12:06 2014 +0100
don't protect the gnumeric filter with the USE_ORCUS flag
Change-Id: Id91c7844879bea589bf97f999fd0c69669dfa7f6
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index 3f2db03b0..aca4c09 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -666,13 +666,6 @@ namespace {
bool queryOrcusTypeAndFilter(const uno::Sequence<beans::PropertyValue>& rDescriptor, OUString& rType, OUString& rFilter)
{
- // depending on the experimental mode
- uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
- if (!xContext.is() || !officecfg::Office::Common::Misc::ExperimentalMode::get(xContext))
- {
- return false;
- }
-
OUString aURL;
sal_Int32 nSize = rDescriptor.getLength();
for (sal_Int32 i = 0; i < nSize; ++i)
@@ -688,10 +681,6 @@ bool queryOrcusTypeAndFilter(const uno::Sequence<beans::PropertyValue>& rDescrip
if (aURL.isEmpty() || aURL.copy(0,8).equalsIgnoreAsciiCase("private:"))
return false;
- OUString aUseOrcus;
- rtl::Bootstrap::get("LIBO_USE_ORCUS", aUseOrcus);
- bool bUseOrcus = (aUseOrcus == "YES");
-
// TODO : Type must be set to be generic_Text (or any other type that
// exists) in order to find a usable loader. Exploit it as a temporary
// hack.
@@ -703,6 +692,17 @@ bool queryOrcusTypeAndFilter(const uno::Sequence<beans::PropertyValue>& rDescrip
return true;
}
+ // depending on the experimental mode
+ uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
+ if (!xContext.is() || !officecfg::Office::Common::Misc::ExperimentalMode::get(xContext))
+ {
+ return false;
+ }
+
+ OUString aUseOrcus;
+ rtl::Bootstrap::get("LIBO_USE_ORCUS", aUseOrcus);
+ bool bUseOrcus = (aUseOrcus == "YES");
+
if (!bUseOrcus)
return false;
commit 7f1b55fec8ebb6b01cc8e032dc01f689e72f0213
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Tue Aug 26 15:18:19 2014 +0200
import cell fill color
Change-Id: Icbc6ef69a00f05ffa7bb78227968c13a16cdc7a0
diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx
index 8269b9b..b72f6a8 100644
--- a/sc/source/filter/inc/orcusinterface.hxx
+++ b/sc/source/filter/inc/orcusinterface.hxx
@@ -186,6 +186,8 @@ private:
OUString maPattern;
Color maFgColor;
Color maBgColor;
+
+ void applyToItemSet(SfxItemSet& rSet) const;
};
fill maCurrentFill;
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 9d0a1e8..8ab43e1 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -24,6 +24,7 @@
#include <editeng/postitem.hxx>
#include <editeng/wghtitem.hxx>
#include <editeng/colritem.hxx>
+#include <editeng/brushitem.hxx>
#include <editeng/udlnitem.hxx>
#include <formula/token.hxx>
@@ -504,6 +505,14 @@ void ScOrcusStyles::font::applyToItemSet(SfxItemSet& rSet) const
rSet.Put(SvxUnderlineItem(meUnderline, ATTR_FONT_UNDERLINE));
}
+void ScOrcusStyles::fill::applyToItemSet(SfxItemSet& rSet) const
+{
+ if (maPattern.equalsIgnoreAsciiCase("none"))
+ return;
+
+ rSet.Put(SvxBrushItem(maFgColor, ATTR_BACKGROUND));
+}
+
ScOrcusStyles::protection::protection():
mbHidden(false),
mbLocked(false)
@@ -637,22 +646,26 @@ void ScOrcusStyles::set_fill_count(size_t /*n*/)
// needed at all?
}
-void ScOrcusStyles::set_fill_pattern_type(const char* /*s*/, size_t /*n*/)
+void ScOrcusStyles::set_fill_pattern_type(const char* s, size_t n)
{
+ maCurrentFill.maPattern = OUString(s, n, RTL_TEXTENCODING_UTF8);
}
-void ScOrcusStyles::set_fill_fg_color(orcus::spreadsheet::color_elem_t /*alpha*/, orcus::spreadsheet::color_elem_t /*red*/, orcus::spreadsheet::color_elem_t /*green*/, orcus::spreadsheet::color_elem_t /*blue*/)
+void ScOrcusStyles::set_fill_fg_color(orcus::spreadsheet::color_elem_t alpha, orcus::spreadsheet::color_elem_t red, orcus::spreadsheet::color_elem_t green, orcus::spreadsheet::color_elem_t blue)
{
+ maCurrentFill.maFgColor = Color(alpha, red, green, blue);
}
-void ScOrcusStyles::set_fill_bg_color(orcus::spreadsheet::color_elem_t /*alpha*/, orcus::spreadsheet::color_elem_t /*red*/, orcus::spreadsheet::color_elem_t /*green*/, orcus::spreadsheet::color_elem_t /*blue*/)
+void ScOrcusStyles::set_fill_bg_color(orcus::spreadsheet::color_elem_t alpha, orcus::spreadsheet::color_elem_t red, orcus::spreadsheet::color_elem_t green, orcus::spreadsheet::color_elem_t blue)
{
+ maCurrentFill.maBgColor = Color(alpha, red, green, blue);
}
size_t ScOrcusStyles::commit_fill()
{
SAL_INFO("sc.orcus.style", "commit fill");
- return 0;
+ maFills.push_back(maCurrentFill);
+ return maFills.size() - 1;
}
// border
commit 0929347235a48f54a2bbfb3a94d3c6b78cbfc9f9
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Tue Aug 26 15:17:19 2014 +0200
we need to create the default styles in the interface right now
We should fix this but it needs some work in the import code.
Change-Id: If9ce52f6aa2b30faf832a89f39abef4b853a5ec1
diff --git a/sc/inc/stlpool.hxx b/sc/inc/stlpool.hxx
index e83aef0..15acaf8 100644
--- a/sc/inc/stlpool.hxx
+++ b/sc/inc/stlpool.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_SC_INC_STLPOOL_HXX
#include <svl/style.hxx>
+#include "scdllapi.h"
class ScStyleSheet;
class ScDocument;
@@ -42,7 +43,7 @@ public:
SfxStyleSheetBase* GetActualStyleSheet ()
{ return pActualStyleSheet; }
- void CreateStandardStyles();
+ void SC_DLLPUBLIC CreateStandardStyles();
void CopyStdStylesFrom( ScStyleSheetPool* pSrcPool );
void CopyStyleFrom( ScStyleSheetPool* pSrcPool,
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 905326d..9d0a1e8 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -481,6 +481,7 @@ size_t ScOrcusSharedStrings::commit_segments()
ScOrcusStyles::ScOrcusStyles(ScDocument& rDoc):
mrDoc(rDoc)
{
+ mrDoc.GetStyleSheetPool()->CreateStandardStyles();
}
ScOrcusStyles::font::font():
commit 86fad8ac2cbdd2bba62402abec234889fe86daee
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Tue Aug 26 15:14:41 2014 +0200
import font underline
Change-Id: I4857d9d49b9f6ef1b92a1d5f61f9f9e852620949
diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx
index cd08d5c..8269b9b 100644
--- a/sc/source/filter/inc/orcusinterface.hxx
+++ b/sc/source/filter/inc/orcusinterface.hxx
@@ -14,6 +14,7 @@
#include "documentimport.hxx"
#include <tools/color.hxx>
+#include <tools/fontenum.hxx>
#include "sharedformulagroups.hxx"
@@ -170,6 +171,7 @@ private:
OUString maName;
double mnSize;
Color maColor;
+ FontUnderline meUnderline;
font();
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 281a31f..905326d 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -24,6 +24,7 @@
#include <editeng/postitem.hxx>
#include <editeng/wghtitem.hxx>
#include <editeng/colritem.hxx>
+#include <editeng/udlnitem.hxx>
#include <formula/token.hxx>
#include <tools/datetime.hxx>
@@ -485,7 +486,8 @@ ScOrcusStyles::ScOrcusStyles(ScDocument& rDoc):
ScOrcusStyles::font::font():
mbBold(false),
mbItalic(false),
- mnSize(10)
+ mnSize(10),
+ meUnderline(UNDERLINE_NONE)
{
}
@@ -498,6 +500,7 @@ void ScOrcusStyles::font::applyToItemSet(SfxItemSet& rSet) const
rSet.Put(SvxWeightItem(eWeight, ATTR_FONT_WEIGHT));
rSet.Put(SvxColorItem(maColor, ATTR_FONT_COLOR));
+ rSet.Put(SvxUnderlineItem(meUnderline, ATTR_FONT_UNDERLINE));
}
ScOrcusStyles::protection::protection():
@@ -593,8 +596,22 @@ void ScOrcusStyles::set_font_size(double point)
maCurrentFont.mnSize = point;
}
-void ScOrcusStyles::set_font_underline(orcus::spreadsheet::underline_t /*e*/)
+void ScOrcusStyles::set_font_underline(orcus::spreadsheet::underline_t e)
{
+ switch(e)
+ {
+ case orcus::spreadsheet::underline_single:
+ case orcus::spreadsheet::underline_single_accounting:
+ maCurrentFont.meUnderline = UNDERLINE_SINGLE;
+ break;
+ case orcus::spreadsheet::underline_double:
+ case orcus::spreadsheet::underline_double_accounting:
+ maCurrentFont.meUnderline = UNDERLINE_DOUBLE;
+ break;
+ case orcus::spreadsheet::underline_none:
+ maCurrentFont.meUnderline = UNDERLINE_NONE;
+ break;
+ }
}
void ScOrcusStyles::set_font_color(orcus::spreadsheet::color_elem_t alpha,
commit a4bb90720f6beb26c1739c27b80b9de3db841668
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sat Aug 23 15:25:05 2014 +0200
next step on correct styles import from orcus
Change-Id: I5d7487dee3120b2a74affe6b081d0c1ea338edc0
diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx
index 2e4cc4c..cd08d5c 100644
--- a/sc/source/filter/inc/orcusinterface.hxx
+++ b/sc/source/filter/inc/orcusinterface.hxx
@@ -31,6 +31,7 @@ class ScDocumentImport;
class ScOrcusSheet;
class ScOrcusFactory;
class ScRangeData;
+class SfxItemSet;
namespace com { namespace sun { namespace star { namespace task {
@@ -160,6 +161,7 @@ public:
class ScOrcusStyles : public orcus::spreadsheet::iface::import_styles
{
private:
+ ScDocument& mrDoc;
struct font
{
@@ -170,6 +172,8 @@ private:
Color maColor;
font();
+
+ void applyToItemSet(SfxItemSet& rSet) const;
};
font maCurrentFont;
@@ -220,6 +224,7 @@ private:
size_t mnBorderId;
size_t mnProtectionId;
size_t mnNumberFormatId;
+ size_t mnStyleXf;
xf();
};
@@ -239,7 +244,10 @@ private:
cell_style maCurrentCellStyle;
+ void applyXfToItemSet(SfxItemSet& rSet, const xf& rXf);
+
public:
+ ScOrcusStyles(ScDocument& rDoc);
// font
virtual void set_font_count(size_t n) SAL_OVERRIDE;
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index ed2718a..281a31f 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -18,6 +18,12 @@
#include "globstr.hrc"
#include "compiler.hxx"
#include "dbdata.hxx"
+#include "stlpool.hxx"
+#include "scitems.hxx"
+
+#include <editeng/postitem.hxx>
+#include <editeng/wghtitem.hxx>
+#include <editeng/colritem.hxx>
#include <formula/token.hxx>
#include <tools/datetime.hxx>
@@ -52,6 +58,7 @@ ScOrcusFactory::ScOrcusFactory(ScDocument& rDoc) :
maDoc(rDoc),
maGlobalSettings(maDoc),
maSharedStrings(*this),
+ maStyles(rDoc),
mnProgress(0) {}
orcus::spreadsheet::iface::import_sheet* ScOrcusFactory::append_sheet(const char* sheet_name, size_t sheet_name_length)
@@ -470,6 +477,11 @@ size_t ScOrcusSharedStrings::commit_segments()
return mrFactory.addString(OStringToOUString(aStr, RTL_TEXTENCODING_UTF8));
}
+ScOrcusStyles::ScOrcusStyles(ScDocument& rDoc):
+ mrDoc(rDoc)
+{
+}
+
ScOrcusStyles::font::font():
mbBold(false),
mbItalic(false),
@@ -477,6 +489,17 @@ ScOrcusStyles::font::font():
{
}
+void ScOrcusStyles::font::applyToItemSet(SfxItemSet& rSet) const
+{
+ FontItalic eItalic = mbItalic ? ITALIC_NORMAL : ITALIC_NONE;
+ rSet.Put(SvxPostureItem(eItalic, ATTR_FONT_POSTURE));
+
+ FontWeight eWeight = mbBold ? WEIGHT_BOLD : WEIGHT_NORMAL;
+ rSet.Put(SvxWeightItem(eWeight, ATTR_FONT_WEIGHT));
+
+ rSet.Put(SvxColorItem(maColor, ATTR_FONT_COLOR));
+}
+
ScOrcusStyles::protection::protection():
mbHidden(false),
mbLocked(false)
@@ -492,7 +515,8 @@ ScOrcusStyles::xf::xf():
mnFillId(0),
mnBorderId(0),
mnProtectionId(0),
- mnNumberFormatId(0)
+ mnNumberFormatId(0),
+ mnStyleXf(0)
{
}
@@ -502,6 +526,47 @@ ScOrcusStyles::cell_style::cell_style():
{
}
+void ScOrcusStyles::applyXfToItemSet(SfxItemSet& rSet, const xf& rXf)
+{
+ size_t nFontId = rXf.mnFontId;
+ if (nFontId >= maFonts.size())
+ {
+ SAL_WARN("sc.orcus.styles", "invalid font id");
+ return;
+ }
+
+ const font& rFont = maFonts[nFontId];
+ rFont.applyToItemSet(rSet);
+
+ size_t nFillId = rXf.mnFillId;
+ if (nFillId >= maFills.size())
+ {
+ SAL_WARN("sc.orcus.styles", "invalid fill id");
+ return;
+ }
+
+ size_t nBorderId = rXf.mnBorderId;
+ if (nBorderId >= maBorders.size())
+ {
+ SAL_WARN("sc.orcus.styles", "invalid border id");
+ return;
+ }
+
+ size_t nProtectionId = rXf.mnProtectionId;
+ if (nProtectionId >= maProtections.size())
+ {
+ SAL_WARN("sc.orcus.styles", "invalid protection id");
+ return;
+ }
+
+ size_t nNumberFormatId = rXf.mnNumberFormatId;
+ if (nNumberFormatId >= maNumberFormats.size())
+ {
+ SAL_WARN("sc.orcus.styles", "invalid number format id");
+ return;
+ }
+}
+
void ScOrcusStyles::set_font_count(size_t /*n*/)
{
// needed at all?
@@ -542,6 +607,7 @@ void ScOrcusStyles::set_font_color(orcus::spreadsheet::color_elem_t alpha,
size_t ScOrcusStyles::commit_font()
{
+ SAL_INFO("sc.orcus.style", "commit font");
maFonts.push_back(maCurrentFont);
return maFonts.size() - 1;
}
@@ -567,6 +633,7 @@ void ScOrcusStyles::set_fill_bg_color(orcus::spreadsheet::color_elem_t /*alpha*/
size_t ScOrcusStyles::commit_fill()
{
+ SAL_INFO("sc.orcus.style", "commit fill");
return 0;
}
@@ -593,6 +660,7 @@ void ScOrcusStyles::set_border_color(orcus::spreadsheet::border_direction_t /*di
size_t ScOrcusStyles::commit_border()
{
+ SAL_INFO("sc.orcus.styles", "commit border");
return 0;
}
@@ -609,6 +677,7 @@ void ScOrcusStyles::set_cell_locked(bool b)
size_t ScOrcusStyles::commit_cell_protection()
{
+ SAL_INFO("sc.orcus.styles", "commit cell protection");
maProtections.push_back(maCurrentProtection);
return maProtections.size() - 1;
}
@@ -629,6 +698,7 @@ void ScOrcusStyles::set_number_format_code(const char* s, size_t n)
size_t ScOrcusStyles::commit_number_format()
{
+ SAL_INFO("sc.orcus.styles", "commit number format");
maNumberFormats.push_back(maCurrentNumberFormat);
return maNumberFormats.size() - 1;
}
@@ -642,6 +712,7 @@ void ScOrcusStyles::set_cell_style_xf_count(size_t /*n*/)
size_t ScOrcusStyles::commit_cell_style_xf()
{
+ SAL_INFO("sc.orcus.styles", "commit cell style xf");
maCellStyleXfs.push_back(maCurrentXF);
return maCellStyleXfs.size() - 1;
}
@@ -655,6 +726,7 @@ void ScOrcusStyles::set_cell_xf_count(size_t /*n*/)
size_t ScOrcusStyles::commit_cell_xf()
{
+ SAL_INFO("sc.orcus.styles", "commit cell xf");
maCellXfs.push_back(maCurrentXF);
return maCellXfs.size() - 1;
}
@@ -697,8 +769,9 @@ void ScOrcusStyles::set_xf_protection(size_t index)
maCurrentXF.mnProtectionId = index;
}
-void ScOrcusStyles::set_xf_style_xf(size_t /*index*/)
+void ScOrcusStyles::set_xf_style_xf(size_t index)
{
+ maCurrentXF.mnStyleXf = index;
}
void ScOrcusStyles::set_xf_apply_alignment(bool /*b*/)
@@ -740,6 +813,20 @@ void ScOrcusStyles::set_cell_style_builtin(size_t index)
size_t ScOrcusStyles::commit_cell_style()
{
+ SAL_INFO("sc.orcus.styles", "commit cell styles");
+ if (maCurrentCellStyle.mnXFId >= maCellStyleXfs.size())
+ {
+ SAL_WARN("sc.orcus.styles", "invalid xf id for commit cell style");
+ return 0;
+ }
+
+ ScStyleSheetPool* pPool = mrDoc.GetStyleSheetPool();
+ SfxStyleSheetBase& rBase = pPool->Make(maCurrentCellStyle.maName, SFX_STYLE_FAMILY_PARA);
+ SfxItemSet& rSet = rBase.GetItemSet();
+
+ xf& rXf = maCellStyleXfs[maCurrentCellStyle.mnXFId];
+ applyXfToItemSet(rSet, rXf);
+
return 0;
}
commit 77e97008b4d69462db2b5f6de748088616dcd729
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sat Aug 23 15:24:04 2014 +0200
import font color correctly
Change-Id: I7996da193d24e81a625070ddfc7d17311af38774
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 3bb0885..ed2718a 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -532,11 +532,12 @@ void ScOrcusStyles::set_font_underline(orcus::spreadsheet::underline_t /*e*/)
{
}
-void ScOrcusStyles::set_font_color(orcus::spreadsheet::color_elem_t,
- orcus::spreadsheet::color_elem_t,
- orcus::spreadsheet::color_elem_t,
- orcus::spreadsheet::color_elem_t)
+void ScOrcusStyles::set_font_color(orcus::spreadsheet::color_elem_t alpha,
+ orcus::spreadsheet::color_elem_t red,
+ orcus::spreadsheet::color_elem_t green,
+ orcus::spreadsheet::color_elem_t blue)
{
+ maCurrentFont.maColor = Color(alpha, red, green, blue);
}
size_t ScOrcusStyles::commit_font()
commit 397573b7e48da528f7c0cf2a19debf1e2419974d
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Fri Aug 22 11:22:03 2014 +0200
remove crazy whitespaces
Conflicts:
framework/source/loadenv/loadenv.cxx
Change-Id: Ia104e5dedbaf19dff5b0eaf4eb6f4c355570cc00
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index e2c1d63..3f2db03b0 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -1084,9 +1084,9 @@ bool LoadEnv::impl_loadContent()
// So we prevent our code against wrong using. Why?
// It could be, that using of this progress could make trouble. e.g. He make window visible ...
// but shouldn't do that. But if no indicator is available ... nobody has a chance to do that!
- bool bHidden = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_HIDDEN() , false );
- bool bMinimized = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_MINIMIZED() , false );
- bool bPreview = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_PREVIEW() , false );
+ bool bHidden = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_HIDDEN(), false);
+ bool bMinimized = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_MINIMIZED(), false);
+ bool bPreview = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_PREVIEW(), false);
css::uno::Reference< css::task::XStatusIndicator > xProgress = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_STATUSINDICATOR(), css::uno::Reference< css::task::XStatusIndicator >());
if (!bHidden && !bMinimized && !bPreview && !xProgress.is())
commit 7ae7e9dd7fbd53f7b97508b997af035349ec08fc
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Fri Aug 22 11:21:44 2014 +0200
make experimental orcus import work again
Change-Id: I2e599331669c3018557835ab227395c54c247ac9
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index 6f6cc12..e2c1d63 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -767,6 +767,7 @@ void LoadEnv::impl_detectTypeAndFilter()
m_lMediaDescriptor[utl::MediaDescriptor::PROP_TYPENAME()] <<= sType;
m_lMediaDescriptor[utl::MediaDescriptor::PROP_FILTERNAME()] <<= sFilter;
m_lMediaDescriptor[utl::MediaDescriptor::PROP_FILTERPROVIDER()] <<= OUString("orcus");
+ m_lMediaDescriptor[utl::MediaDescriptor::PROP_DOCUMENTSERVICE()] <<= OUString("com.sun.star.sheet.SpreadsheetDocument");
return;
}
commit a970e6a006a6b42deeafbafc40e511d0c98012ba
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Fri Aug 22 09:03:42 2014 +0200
tep for correct styles import from orcus
Change-Id: Ifdd4686b5fd8a00dbe8ff74400a909697895e30b
diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx
index 2e687ec..2e4cc4c 100644
--- a/sc/source/filter/inc/orcusinterface.hxx
+++ b/sc/source/filter/inc/orcusinterface.hxx
@@ -13,6 +13,8 @@
#include "address.hxx"
#include "documentimport.hxx"
+#include <tools/color.hxx>
+
#include "sharedformulagroups.hxx"
#include <rtl/strbuf.hxx>
@@ -23,6 +25,7 @@
#include <boost/ptr_container/ptr_vector.hpp>
#include <map>
#include <unordered_map>
+#include <vector>
class ScDocumentImport;
class ScOrcusSheet;
@@ -156,6 +159,85 @@ public:
class ScOrcusStyles : public orcus::spreadsheet::iface::import_styles
{
+private:
+
+ struct font
+ {
+ bool mbBold;
+ bool mbItalic;
+ OUString maName;
+ double mnSize;
+ Color maColor;
+
+ font();
+ };
+
+ font maCurrentFont;
+ std::vector<font> maFonts;
+
+ struct fill
+ {
+ OUString maPattern;
+ Color maFgColor;
+ Color maBgColor;
+ };
+
+ fill maCurrentFill;
+ std::vector<fill> maFills;
+
+ struct border
+ {
+
+ border();
+ };
+
+ border maCurrentBorder;
+ std::vector<border> maBorders;
+
+ struct protection
+ {
+ bool mbHidden;
+ bool mbLocked;
+
+ protection();
+ };
+
+ protection maCurrentProtection;
+ std::vector<protection> maProtections;
+
+ struct number_format
+ {
+ OUString maCode;
+ };
+
+ number_format maCurrentNumberFormat;
+ std::vector<number_format> maNumberFormats;
+
+ struct xf
+ {
+ size_t mnFontId;
+ size_t mnFillId;
+ size_t mnBorderId;
+ size_t mnProtectionId;
+ size_t mnNumberFormatId;
+
+ xf();
+ };
+
+ xf maCurrentXF;
+ std::vector<xf> maCellStyleXfs;
+ std::vector<xf> maCellXfs;
+
+ struct cell_style
+ {
+ OUString maName;
+ size_t mnXFId;
+ size_t mnBuiltInId;
+
+ cell_style();
+ };
+
+ cell_style maCurrentCellStyle;
public:
// font
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 35ecc83..3bb0885 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -470,25 +470,62 @@ size_t ScOrcusSharedStrings::commit_segments()
return mrFactory.addString(OStringToOUString(aStr, RTL_TEXTENCODING_UTF8));
}
+ScOrcusStyles::font::font():
+ mbBold(false),
+ mbItalic(false),
+ mnSize(10)
+{
+}
+
+ScOrcusStyles::protection::protection():
+ mbHidden(false),
+ mbLocked(false)
+{
+}
+
+ScOrcusStyles::border::border()
+{
+}
+
+ScOrcusStyles::xf::xf():
+ mnFontId(0),
+ mnFillId(0),
+ mnBorderId(0),
+ mnProtectionId(0),
+ mnNumberFormatId(0)
+{
+}
+
+ScOrcusStyles::cell_style::cell_style():
+ mnXFId(0),
+ mnBuiltInId(0)
+{
+}
+
void ScOrcusStyles::set_font_count(size_t /*n*/)
{
// needed at all?
}
-void ScOrcusStyles::set_font_bold(bool /*b*/)
+void ScOrcusStyles::set_font_bold(bool b)
{
+ maCurrentFont.mbBold = b;
}
-void ScOrcusStyles::set_font_italic(bool /*b*/)
+void ScOrcusStyles::set_font_italic(bool b)
{
+ maCurrentFont.mbItalic = b;
}
-void ScOrcusStyles::set_font_name(const char* /*s*/, size_t /*n*/)
+void ScOrcusStyles::set_font_name(const char* s, size_t n)
{
+ OUString aName(s, n, RTL_TEXTENCODING_UTF8);
+ maCurrentFont.maName = aName;
}
-void ScOrcusStyles::set_font_size(double /*point*/)
+void ScOrcusStyles::set_font_size(double point)
{
+ maCurrentFont.mnSize = point;
}
void ScOrcusStyles::set_font_underline(orcus::spreadsheet::underline_t /*e*/)
@@ -504,7 +541,8 @@ void ScOrcusStyles::set_font_color(orcus::spreadsheet::color_elem_t,
size_t ScOrcusStyles::commit_font()
{
- return 0;
+ maFonts.push_back(maCurrentFont);
+ return maFonts.size() - 1;
}
// fill
@@ -558,17 +596,20 @@ size_t ScOrcusStyles::commit_border()
}
// cell protection
-void ScOrcusStyles::set_cell_hidden(bool /*b*/)
+void ScOrcusStyles::set_cell_hidden(bool b)
{
+ maCurrentProtection.mbHidden = b;
}
-void ScOrcusStyles::set_cell_locked(bool /*b*/)
+void ScOrcusStyles::set_cell_locked(bool b)
{
+ maCurrentProtection.mbLocked = b;
}
size_t ScOrcusStyles::commit_cell_protection()
{
- return 0;
+ maProtections.push_back(maCurrentProtection);
+ return maProtections.size() - 1;
}
void ScOrcusStyles::set_number_format_count(size_t)
@@ -579,13 +620,16 @@ void ScOrcusStyles::set_number_format_identifier(size_t)
{
}
-void ScOrcusStyles::set_number_format_code(const char* /*s*/, size_t /*n*/)
+void ScOrcusStyles::set_number_format_code(const char* s, size_t n)
{
+ OUString aCode(s, n, RTL_TEXTENCODING_UTF8);
+ maCurrentNumberFormat.maCode = aCode;
}
size_t ScOrcusStyles::commit_number_format()
{
- return 0;
+ maNumberFormats.push_back(maCurrentNumberFormat);
+ return maNumberFormats.size() - 1;
}
// cell style xf
@@ -597,7 +641,8 @@ void ScOrcusStyles::set_cell_style_xf_count(size_t /*n*/)
size_t ScOrcusStyles::commit_cell_style_xf()
{
- return 0;
+ maCellStyleXfs.push_back(maCurrentXF);
+ return maCellStyleXfs.size() - 1;
}
// cell xf
@@ -609,7 +654,8 @@ void ScOrcusStyles::set_cell_xf_count(size_t /*n*/)
size_t ScOrcusStyles::commit_cell_xf()
{
- return 0;
+ maCellXfs.push_back(maCurrentXF);
+ return maCellXfs.size() - 1;
}
// dxf
@@ -625,25 +671,29 @@ size_t ScOrcusStyles::commit_dxf()
// xf (cell format) - used both by cell xf and cell style xf.
-void ScOrcusStyles::set_xf_number_format(size_t /*index*/)
+void ScOrcusStyles::set_xf_number_format(size_t index)
{
- // no number format interfaces implemented yet
+ maCurrentXF.mnNumberFormatId = index;
}
-void ScOrcusStyles::set_xf_font(size_t /*index*/)
+void ScOrcusStyles::set_xf_font(size_t index)
{
+ maCurrentXF.mnFontId = index;
}
-void ScOrcusStyles::set_xf_fill(size_t /*index*/)
+void ScOrcusStyles::set_xf_fill(size_t index)
{
+ maCurrentXF.mnFillId = index;
}
-void ScOrcusStyles::set_xf_border(size_t /*index*/)
+void ScOrcusStyles::set_xf_border(size_t index)
{
+ maCurrentXF.mnBorderId = index;
}
-void ScOrcusStyles::set_xf_protection(size_t /*index*/)
+void ScOrcusStyles::set_xf_protection(size_t index)
{
+ maCurrentXF.mnProtectionId = index;
}
void ScOrcusStyles::set_xf_style_xf(size_t /*index*/)
@@ -670,17 +720,21 @@ void ScOrcusStyles::set_cell_style_count(size_t /*n*/)
// needed at all?
}
-void ScOrcusStyles::set_cell_style_name(const char* /*s*/, size_t /*n*/)
+void ScOrcusStyles::set_cell_style_name(const char* s, size_t n)
{
+ OUString aName(s, n, RTL_TEXTENCODING_UTF8);
+ maCurrentCellStyle.maName = aName;
}
-void ScOrcusStyles::set_cell_style_xf(size_t /*index*/)
+void ScOrcusStyles::set_cell_style_xf(size_t index)
{
+ maCurrentCellStyle.mnXFId = index;
}
-void ScOrcusStyles::set_cell_style_builtin(size_t /*index*/)
+void ScOrcusStyles::set_cell_style_builtin(size_t index)
{
// not needed for gnumeric
+ maCurrentCellStyle.mnBuiltInId = index;
}
size_t ScOrcusStyles::commit_cell_style()
commit 676686c3b3666c6185b63ce8e67aeaef08883047
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Fri Aug 22 09:03:30 2014 +0200
parse the range for autofilter
Change-Id: Ia47e42db3a66a8d620803468182e8b9d3465b8e4
diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx
index c48163d..2e687ec 100644
--- a/sc/source/filter/inc/orcusinterface.hxx
+++ b/sc/source/filter/inc/orcusinterface.hxx
@@ -92,6 +92,8 @@ public:
private:
ScDocument& mrDoc;
+
+ ScRange maRange;
};
class ScOrcusSheet : public orcus::spreadsheet::iface::import_sheet
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 7ab97b1..35ecc83 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -704,6 +704,8 @@ void ScOrcusAutoFilter::set_range(const char* p_ref, size_t n_ref)
{
OUString aRange(p_ref, n_ref, RTL_TEXTENCODING_UTF8);
SAL_INFO("sc.orcus.autofilter", "set_range: " << aRange);
+
+ maRange.Parse(aRange);
}
void ScOrcusAutoFilter::set_column(orcus::spreadsheet::col_t col)
commit 5389f0e1cb6459ad4af49e21d6454dc34ee15e3e
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Tue Aug 19 17:31:02 2014 +0200
import table as ScDBData
Conflicts:
sc/source/filter/inc/orcusinterface.hxx
sc/source/filter/orcus/interface.cxx
Change-Id: Ibce6247b19ca7c0788743baba24d07722500efd0
diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx
index 8677bbf..c48163d 100644
--- a/sc/source/filter/inc/orcusinterface.hxx
+++ b/sc/source/filter/inc/orcusinterface.hxx
@@ -284,5 +284,48 @@ public:
void setStatusIndicator(const com::sun::star::uno::Reference<com::sun::star::task::XStatusIndicator>& rIndicator);
};
+class ScOrcusTable : public orcus::spreadsheet::iface::import_table
+{
+private:
+ SCTAB mnTab;
+ ScDocument& mrDoc;
+ ScOrcusAutoFilter maAutoFilter;
+
+ ScRange maRange;
+ OUString maName;
+
+public:
+ ScOrcusTable(SCTAB nTab, ScDocument& rDoc);
+ virtual ~ScOrcusTable();
+
+ virtual orcus::spreadsheet::iface::import_auto_filter* get_auto_filter() SAL_OVERRIDE;
+
+ virtual void set_identifier(size_t id) SAL_OVERRIDE;
+
+ virtual void set_range(const char* p_ref, size_t n_ref) SAL_OVERRIDE;
+
+ virtual void set_totals_row_count(size_t row_count) SAL_OVERRIDE;
+
+ virtual void set_name(const char* p, size_t n) SAL_OVERRIDE;
+
+ virtual void set_display_name(const char* p, size_t n) SAL_OVERRIDE;
+
+ virtual void set_column_count(size_t n) SAL_OVERRIDE;
+
+ virtual void set_column_identifier(size_t id) SAL_OVERRIDE;
+ virtual void set_column_name(const char* p, size_t n) SAL_OVERRIDE;
+ virtual void set_column_totals_row_label(const char* p, size_t n) SAL_OVERRIDE;
+ virtual void set_column_totals_row_function(orcus::spreadsheet::totals_row_function_t func) SAL_OVERRIDE;
+ virtual void commit_column() SAL_OVERRIDE;
+
+ virtual void set_style_name(const char* p, size_t n) SAL_OVERRIDE;
+ virtual void set_style_show_first_column(bool b) SAL_OVERRIDE;
+ virtual void set_style_show_last_column(bool b) SAL_OVERRIDE;
+ virtual void set_style_show_row_stripes(bool b) SAL_OVERRIDE;
+ virtual void set_style_show_column_stripes(bool b) SAL_OVERRIDE;
+
+ virtual void commit() SAL_OVERRIDE;
+};
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 04f61ee..7ab97b1 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -17,6 +17,7 @@
#include "docoptio.hxx"
#include "globstr.hrc"
#include "compiler.hxx"
+#include "dbdata.hxx"
#include <formula/token.hxx>
#include <tools/datetime.hxx>
@@ -726,4 +727,138 @@ void ScOrcusAutoFilter::commit()
SAL_INFO("sc.orcus.autofilter", "commit");
}
+ScOrcusTable::ScOrcusTable(SCTAB nTab, ScDocument& rDoc):
+ mnTab(nTab),
+ mrDoc(rDoc),
+ maAutoFilter(rDoc)
+{
+}
+
+ScOrcusTable::~ScOrcusTable()
+{
+}
+
+os::iface::import_auto_filter* ScOrcusTable::get_auto_filter()
+{
+ return &maAutoFilter;
+}
+
+void ScOrcusTable::set_identifier(size_t id)
+{
+ SAL_INFO("sc.orcus.table", "set_identifier :" << id);
+}
+
+namespace {
+
+std::ostream& operator<<(std::ostream& rStrm, const ScAddress& rAddr)
+{
+ rStrm << "Col: " << rAddr.Col() << ", Row: " << rAddr.Row() << ", Tab: " << rAddr.Tab();
+ return rStrm;
+}
+
+std::ostream& operator<<(std::ostream& rStrm, const ScRange& rRange)
+{
+ rStrm << "aStart: " << rRange.aStart << std::endl;
+ rStrm << "aEnd: " << rRange.aEnd;
+ return rStrm;
+}
+
+}
+
+void ScOrcusTable::set_range(const char* p_ref, size_t n_ref)
+{
+ OUString aRange(p_ref, n_ref, RTL_TEXTENCODING_UTF8);
+ SAL_INFO("sc.orcus.table", "set_range: " << aRange);
+
+ maRange.Parse(aRange);
+ SAL_INFO("sc.orcus.table", "set_range translated range: " << maRange);
+}
+
+void ScOrcusTable::set_totals_row_count(size_t row_count)
+{
+ SAL_INFO("sc.orcus.table", "set_totals_row_count: " << row_count);
+}
+
+void ScOrcusTable::set_name(const char* p, size_t n)
+{
+ maName = OUString(p, n, RTL_TEXTENCODING_UTF8);
+ SAL_INFO("sc.orcus.table", "set_name: " << maName);
+}
+
+void ScOrcusTable::set_display_name(const char* p, size_t n)
+{
+ OUString aName(p, n, RTL_TEXTENCODING_UTF8);
+ SAL_INFO("sc.orcus.table", "set_display_name: " << aName);
+}
+
+void ScOrcusTable::set_column_count(size_t n)
+{
+ SAL_INFO("sc.orcus.table", "set_column_count: " << n);
+}
+
+void ScOrcusTable::set_column_identifier(size_t id)
+{
+ SAL_INFO("sc.orcus.table", "set_column_identifier: " << id);
+}
+
+void ScOrcusTable::set_column_name(const char* p, size_t n)
+{
+ OUString aName(p, n, RTL_TEXTENCODING_UTF8);
+ SAL_INFO("sc.orcus.table", "set_column_name: " << aName);
+}
+
+void ScOrcusTable::set_column_totals_row_label(const char* p, size_t n)
+{
+ OUString aLabel(p, n, RTL_TEXTENCODING_UTF8);
+ SAL_INFO("sc.orcus.table", "set_column_totals_row_label: " << aLabel);
+}
+
+void ScOrcusTable::set_column_totals_row_function(os::totals_row_function_t )
+{
+ SAL_INFO("sc.orcus.table", "set_column_totals_row_function");
+}
+
+void ScOrcusTable::commit_column()
+{
+ SAL_INFO("sc.orcus.table", "commit_column");
+}
+
+void ScOrcusTable::set_style_name(const char* p, size_t n)
+{
+ OUString aName(p, n, RTL_TEXTENCODING_UTF8);
+ SAL_INFO("sc.orcus.table", "set_style_name: " << aName);
+}
+
+void ScOrcusTable::set_style_show_first_column(bool b)
+{
+ SAL_INFO("sc.orcus.table", "set_style_show_first_column: " << b);
+}
+
+void ScOrcusTable::set_style_show_last_column(bool b)
+{
+ SAL_INFO("sc.orcus.table", "set_style_show_last_column: " << b);
+}
+
+void ScOrcusTable::set_style_show_row_stripes(bool b)
+{
+ SAL_INFO("sc.orcus.table", "set_style_show_row_stripes: " << b);
+}
+
+void ScOrcusTable::set_style_show_column_stripes(bool b)
+{
+ SAL_INFO("sc.orcus.table", "set_style_show_column_stripes: " << b);
+}
+
+void ScOrcusTable::commit()
+{
+ SAL_INFO("sc.orcus.table", "commit");
+
+ ScDBData* pDBData = new ScDBData(maName, mnTab,
+ maRange.aStart.Col(), maRange.aStart.Row(),
+ maRange.aEnd.Col(), maRange.aEnd.Row());
+
+ if(!mrDoc.GetDBCollection()->getNamedDBs().insert(pDBData))
+ delete pDBData;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 6089d0ec48f57926083bf85fe23b5fae56213788
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Mon Aug 18 07:56:31 2014 +0200
add more orcus debug output
Change-Id: I6f9135d0532026dffbb43c3b32d32cfc811a5823
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index a8e3f67..04f61ee 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -699,24 +699,31 @@ ScOrcusAutoFilter::~ScOrcusAutoFilter()
{
}
-void ScOrcusAutoFilter::set_range(const char* /*p_ref*/, size_t /*n_ref*/)
+void ScOrcusAutoFilter::set_range(const char* p_ref, size_t n_ref)
{
+ OUString aRange(p_ref, n_ref, RTL_TEXTENCODING_UTF8);
+ SAL_INFO("sc.orcus.autofilter", "set_range: " << aRange);
}
-void ScOrcusAutoFilter::set_column(orcus::spreadsheet::col_t /*col*/)
+void ScOrcusAutoFilter::set_column(orcus::spreadsheet::col_t col)
{
+ SAL_INFO("sc.orcus.autofilter", "set_column: " << col);
}
-void ScOrcusAutoFilter::append_column_match_value(const char* /*p*/, size_t /*n*/)
+void ScOrcusAutoFilter::append_column_match_value(const char* p, size_t n)
{
+ OUString aString(p, n, RTL_TEXTENCODING_UTF8);
+ SAL_INFO("sc.orcus.autofilter", "append_column_match_value: " << aString);
}
void ScOrcusAutoFilter::commit_column()
{
+ SAL_INFO("sc.orcus.autofilter", "commit column");
}
void ScOrcusAutoFilter::commit()
{
+ SAL_INFO("sc.orcus.autofilter", "commit");
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 827be95532ab03baaa382d51cc158c82b763ef35
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Mon Aug 18 01:36:43 2014 +0200
make these types future proof
Our core already supports more than 32k sheets and we should not use
sal_Int16 anymore for sheets.
Change-Id: Ifeb321cba044b255ef2e7d34da0908c27877d6ae
diff --git a/sc/source/filter/inc/worksheethelper.hxx b/sc/source/filter/inc/worksheethelper.hxx
index e11d6aa..0d61437 100644
--- a/sc/source/filter/inc/worksheethelper.hxx
+++ b/sc/source/filter/inc/worksheethelper.hxx
@@ -191,7 +191,7 @@ public:
/** Returns the type of this sheet. */
WorksheetType getSheetType() const;
/** Returns the index of the current sheet. */
- sal_Int16 getSheetIndex() const;
+ sal_Int32 getSheetIndex() const;
/** Returns the XSpreadsheet interface of the current sheet. */
const ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet >&
getSheet() const;
diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx
index 40a2874..4effbef 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -219,7 +219,7 @@ public:
/** Returns the type of this sheet. */
inline WorksheetType getSheetType() const { return meSheetType; }
/** Returns the index of the current sheet. */
- inline sal_Int16 getSheetIndex() const { return maUsedArea.Sheet; }
+ inline sal_Int32 getSheetIndex() const { return maUsedArea.Sheet; }
/** Returns the XSpreadsheet interface of the current sheet. */
inline const Reference< XSpreadsheet >& getSheet() const { return mxSheet; }
@@ -1407,7 +1407,7 @@ WorksheetType WorksheetHelper::getSheetType() const
return mrSheetGlob.getSheetType();
}
-sal_Int16 WorksheetHelper::getSheetIndex() const
+sal_Int32 WorksheetHelper::getSheetIndex() const
{
return mrSheetGlob.getSheetIndex();
}
commit 7f635c41da112fbef85f22cad929a327f6223804
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Mon Aug 18 07:51:05 2014 +0200
add ScOrcusSheet::get_table method
Change-Id: I2369e29e96cf33dbe263b090dee0d1100ecce8de
diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx
index 633b43d..8677bbf 100644
--- a/sc/source/filter/inc/orcusinterface.hxx
+++ b/sc/source/filter/inc/orcusinterface.hxx
@@ -113,6 +113,7 @@ public:
ScOrcusSheet(ScDocumentImport& rDoc, SCTAB nTab, ScOrcusFactory& rFactory);
virtual orcus::spreadsheet::iface::import_auto_filter* get_auto_filter() SAL_OVERRIDE { return &maAutoFilter; }
+ virtual orcus::spreadsheet::iface::import_table* get_table() SAL_OVERRIDE;
// Orcus import interface
virtual void set_auto(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, const char* p, size_t n) SAL_OVERRIDE;
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index d897143..a8e3f67 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -214,6 +214,11 @@ void ScOrcusSheet::cellInserted()
}
}
+os::iface::import_table* ScOrcusSheet::get_table()
+{
+ return NULL;
+}
+
void ScOrcusSheet::set_auto(os::row_t row, os::col_t col, const char* p, size_t n)
{
OUString aVal(p, n, RTL_TEXTENCODING_UTF8);
commit 9293d02c779d27815f2f0e650757d5a6be81b222
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Aug 26 14:00:09 2015 +0200
cosmetic clean-up
Change-Id: I7e6689e07873dcb85c2bf1aac0db2ecddc01fe4b
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
index b9f2ebc..041339e 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
@@ -1032,13 +1032,17 @@ void ToolbarLayoutManager::setParentWindow(
{
SolarMutexGuard aGuard;
VclPtr< ::DockingAreaWindow > pWindow = dynamic_cast< ::DockingAreaWindow* >(VCLUnoHelper::GetWindow( xTopDockWindow ).get() );
- if( pWindow ) pWindow->SetAlign( WindowAlign::Top );
+ if( pWindow )
+ pWindow->SetAlign( WindowAlign::Top );
pWindow = dynamic_cast< ::DockingAreaWindow* >(VCLUnoHelper::GetWindow( xBottomDockWindow ).get() );
- if( pWindow ) pWindow->SetAlign( WindowAlign::Bottom );
+ if( pWindow )
+ pWindow->SetAlign( WindowAlign::Bottom );
pWindow = dynamic_cast< ::DockingAreaWindow* >(VCLUnoHelper::GetWindow( xLeftDockWindow ).get() );
- if( pWindow ) pWindow->SetAlign( WindowAlign::Left );
+ if( pWindow )
+ pWindow->SetAlign( WindowAlign::Left );
pWindow = dynamic_cast< ::DockingAreaWindow* >(VCLUnoHelper::GetWindow( xRightDockWindow ).get() );
- if( pWindow ) pWindow->SetAlign( WindowAlign::Right );
+ if( pWindow )
+ pWindow->SetAlign( WindowAlign::Right );
implts_reparentToolbars();
}
else
commit b0905bff3c7c91992645527f0651cdf3f4ad597e
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Aug 26 12:34:00 2015 +0200
Revert "for now show chart sidebar"
This reverts commit faed29cac93f8176bb937e6a8b437d6450b7a884.
diff --git a/embeddedobj/source/general/docholder.cxx b/embeddedobj/source/general/docholder.cxx
index f8437c2..ca993ff 100644
--- a/embeddedobj/source/general/docholder.cxx
+++ b/embeddedobj/source/general/docholder.cxx
@@ -714,9 +714,8 @@ bool DocumentHolder::ShowUI( const uno::Reference< ::com::sun::star::frame::XLay
xContainerLM->setDockingAreaAcceptor( uno::Reference < ui::XDockingAreaAcceptor >() );
// prevent further changes at this LM
- // TODO: moggi: why is this necessary?
- // xContainerLM->setVisible( sal_False );
- // xContainerLM->lock();
+ xContainerLM->setVisible( sal_False );
+ xContainerLM->lock();
bUnlock = true;
// by unlocking the LM each layout change will now resize the containers window; pending layouts will be processed now
commit b1922eecb55b233de3e6abaaa644fe9f313cf0f1
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Aug 27 15:14:20 2015 +0200
xmloff: ODF export: actually ODF 1.2 does not allow graphic-properties
... in a style with family "paragraph", as detected by a
--with-export-validation build due to the unit test added yesterday.
So use the loext namespace for the style:graphic-properties element,
and also omit it entirely (and rely on the style:paragraph-properties
attributes fo:background-*) if the ODF version is set to 1.2 or 1.1.
Also adapt a previous check that was missing the "drawing-page" style
family, where the style:graphic-properties is allowed (commit
9746dc9ad62e7f3a39961733f2ac204e90289034)
(regression from 7d9bb549d498d6beed2c4050c402d09643febdfa)
Change-Id: Iedd66483f63020328bd61e1c1e19c62787b8ff6b
diff --git a/include/xmloff/xmlexppr.hxx b/include/xmloff/xmlexppr.hxx
index 9a67145..91d323c 100644
--- a/include/xmloff/xmlexppr.hxx
+++ b/include/xmloff/xmlexppr.hxx
@@ -133,7 +133,8 @@ public:
void exportXML(
SvXMLExport& rExport,
const ::std::vector< XMLPropertyState >& rProperties,
- SvXmlExportFlags nFlags = SvXmlExportFlags::NONE ) const;
+ SvXmlExportFlags nFlags = SvXmlExportFlags::NONE,
+ bool bUseExtensionNamespaceForGraphicProperties = false ) const;
/** like above but only properties whose property map index is within the
* specified range are exported
diff --git a/xmloff/source/style/impastpl.cxx b/xmloff/source/style/impastpl.cxx
index 7c98e3e..51221b3 100644
--- a/xmloff/source/style/impastpl.cxx
+++ b/xmloff/source/style/impastpl.cxx
@@ -684,6 +684,7 @@ void SvXMLAutoStylePoolP_Impl::exportXML(
GetExport().AddAttribute(
XML_NAMESPACE_STYLE, XML_FAMILY, aStrFamilyName );
if(aStrFamilyName != "graphic" &&
+ aStrFamilyName != "drawing-page" &&
aStrFamilyName != "presentation" &&
aStrFamilyName != "chart" )
bExtensionNamespace = true;
diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx
index c6b62e8..0ab12cc 100644
--- a/xmloff/source/style/styleexp.cxx
+++ b/xmloff/source/style/styleexp.cxx
@@ -316,8 +316,14 @@ bool XMLStyleExport::exportStyle(
// <style:properties>
::std::vector< XMLPropertyState > xPropStates =
rPropMapper->Filter( xPropSet, true );
+ bool const bUseExtensionNamespaceForGraphicProperties(
+ rXMLFamily != "drawing-page" &&
+ rXMLFamily != "graphic" &&
+ rXMLFamily != "presentation" &&
+ rXMLFamily != "chart");
rPropMapper->exportXML( GetExport(), xPropStates,
- SvXmlExportFlags::IGN_WS );
+ SvXmlExportFlags::IGN_WS,
+ bUseExtensionNamespaceForGraphicProperties );
rPropMapper->SetStyleName( OUString() );
diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx
index a7876d4..04608346 100644
--- a/xmloff/source/style/xmlexppr.cxx
+++ b/xmloff/source/style/xmlexppr.cxx
@@ -749,16 +749,18 @@ void SvXMLExportPropertyMapper::exportXML( SvXMLAttributeList& rAttrList,
void SvXMLExportPropertyMapper::exportXML(
SvXMLExport& rExport,
const ::std::vector< XMLPropertyState >& rProperties,
- SvXmlExportFlags nFlags ) const
+ SvXmlExportFlags nFlags,
+ bool bUseExtensionNamespaceForGraphicProperties) const
{
- exportXML( rExport, rProperties, -1, -1, nFlags );
+ exportXML(rExport, rProperties, -1, -1, nFlags, bUseExtensionNamespaceForGraphicProperties);
}
+
void SvXMLExportPropertyMapper::exportXML(
SvXMLExport& rExport,
const ::std::vector< XMLPropertyState >& rProperties,
sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx,
- SvXmlExportFlags nFlags, bool bExtensionNamespace ) const
+ SvXmlExportFlags nFlags, bool bUseExtensionNamespaceForGraphicProperties) const
{
sal_uInt16 nPropTypeFlags = 0;
for( sal_uInt16 i=0; i<MAX_PROP_TYPES; ++i )
@@ -766,6 +768,17 @@ void SvXMLExportPropertyMapper::exportXML(
sal_uInt16 nPropType = aPropTokens[i].nType;
if( 0==i || (nPropTypeFlags & (1 << nPropType)) != 0 )
{
+ sal_uInt16 nNamespace = XML_NAMESPACE_STYLE;
+ if (bUseExtensionNamespaceForGraphicProperties &&
+ aPropTokens[i].eToken == xmloff::token::XML_GRAPHIC_PROPERTIES)
+ {
+ nNamespace = XML_NAMESPACE_LO_EXT;
+ if (rExport.getDefaultVersion() <= SvtSaveOptions::ODFVER_012)
+ {
+ continue; // don't write for ODF <= 1.2
+ }
+ }
+
std::vector<sal_uInt16> aIndexArray;
_exportXML( nPropType, nPropTypeFlags,
@@ -779,10 +792,6 @@ void SvXMLExportPropertyMapper::exportXML(
(nFlags & SvXmlExportFlags::EMPTY) ||
!aIndexArray.empty() )
{
- sal_uInt16 nNamespace = XML_NAMESPACE_STYLE;
- if(bExtensionNamespace && aPropTokens[i].eToken ==
- xmloff::token::XML_GRAPHIC_PROPERTIES)
- nNamespace = XML_NAMESPACE_LO_EXT;
SvXMLElementExport aElem( rExport, nNamespace,
aPropTokens[i].eToken,
bool(nFlags & SvXmlExportFlags::IGN_WS),
commit 7e373e92fc02393732422d05264dd5115076183f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Aug 27 14:40:37 2015 +0100
crashtesting: tiff loop detection too slow
moz323894-1.tiff and moz456356-1.tiff take too long to load
Change-Id: Iaafa064fd05e4a4152004e7ceb6256af68aeef01
diff --git a/filter/source/graphicfilter/itiff/lzwdecom.cxx b/filter/source/graphicfilter/itiff/lzwdecom.cxx
index 5fb7514..dc437e2 100644
--- a/filter/source/graphicfilter/itiff/lzwdecom.cxx
+++ b/filter/source/graphicfilter/itiff/lzwdecom.cxx
@@ -20,7 +20,7 @@
#include "lzwdecom.hxx"
#include <algorithm>
-#include <vector>
+#include <set>
#define MAX_TABLE_SIZE 4096
@@ -163,16 +163,16 @@ void LZWDecompressor::AddToTable(sal_uInt16 nPrevCode, sal_uInt16 nCodeFirstData
return;
}
- std::vector<sal_uInt16> aSeenIndexes;
+ unsigned char aSeenIndexes[MAX_TABLE_SIZE] = {0};
while (pTable[nCodeFirstData].nDataCount>1)
{
- if (std::find(aSeenIndexes.begin(), aSeenIndexes.end(), nCodeFirstData) != aSeenIndexes.end())
+ if (aSeenIndexes[nCodeFirstData])
{
SAL_WARN("filter.tiff", "Loop in chain");
bEOIFound = true;
return;
}
- aSeenIndexes.push_back(nCodeFirstData);
+ aSeenIndexes[nCodeFirstData] = 1;
nCodeFirstData=pTable[nCodeFirstData].nPrevCode;
}
commit 932f6de91904f86f38d2914b9ce07b94dfadac0c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Aug 27 14:28:35 2015 +0100
check status of SeekTo
Change-Id: Ia2bb397c3fdd783cab77a6b0dbc31c9e3d19326b
diff --git a/sd/qa/unit/data/ppt/pass/hang-10.ppt b/sd/qa/unit/data/ppt/pass/hang-10.ppt
new file mode 100644
index 0000000..99a81c4
Binary files /dev/null and b/sd/qa/unit/data/ppt/pass/hang-10.ppt differ
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index d37855d..31fe108 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -787,7 +787,8 @@ bool ImplSdPPTImport::Import()
if ( nObjCount++ ) // skipping the first object
{
Rectangle aEmpty;
- aHd2.SeekToBegOfRecord( rStCtrl );
+ if (!aHd2.SeekToBegOfRecord(rStCtrl))
+ break;
SdrObject* pImpObj = ImportObj( rStCtrl, static_cast<void*>(&aProcessData), aEmpty, aEmpty );
if ( pImpObj )
{
@@ -796,7 +797,8 @@ bool ImplSdPPTImport::Import()
}
}
}
- aHd2.SeekToEndOfRecord( rStCtrl );
+ if (!aHd2.SeekToEndOfRecord(rStCtrl))
+ break;
}
}
}
commit de71eae5807ff94c8eace0eccaabf1ffa08e77b6
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Aug 27 14:22:23 2015 +0100
avoid loops in atom chains
Change-Id: Icc40c0ee6c7d8d305cf7cc60cbf3e511c763aedd
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 30e8cfc..0f419dd 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -2553,11 +2553,17 @@ bool SdrPowerPointImport::GetColorFromPalette( sal_uInt16 nNum, Color& rColor )
while( ( pMasterPersist && pMasterPersist->aSlideAtom.nFlags & 2 ) // it is possible that a masterpage
&& pMasterPersist->aSlideAtom.nMasterId ) // itself is following a master colorscheme
{
- sal_uInt16 nNextMaster = m_pMasterPages->FindPage( pMasterPersist->aSlideAtom.nMasterId );
+ auto nOrigMasterId = pMasterPersist->aSlideAtom.nMasterId;
+ sal_uInt16 nNextMaster = m_pMasterPages->FindPage(nOrigMasterId);
if ( nNextMaster == PPTSLIDEPERSIST_ENTRY_NOTFOUND )
break;
else
pMasterPersist = &(*pPageList2)[ nNextMaster ];
+ if (pMasterPersist->aSlideAtom.nMasterId == nOrigMasterId)
+ {
+ SAL_WARN("filter.ms", "loop in atom chain");
+ break;
+ }
}
}
if ( pMasterPersist )
@@ -2566,7 +2572,7 @@ bool SdrPowerPointImport::GetColorFromPalette( sal_uInt16 nNum, Color& rColor )
}
}
}
- // resgister current color scheme
+ // register current color scheme
const_cast<SdrPowerPointImport*>(this)->nPageColorsNum = nAktPageNum;
const_cast<SdrPowerPointImport*>(this)->ePageColorsKind = eAktPageKind;
}
@@ -2790,11 +2796,17 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
PptSlidePersistEntry* pE = &(*pPageList)[ nMasterNum ];
while( ( pE->aSlideAtom.nFlags & 4 ) && pE->aSlideAtom.nMasterId )
{
- sal_uInt16 nNextMaster = m_pMasterPages->FindPage( pE->aSlideAtom.nMasterId );
+ auto nOrigMasterId = pE->aSlideAtom.nMasterId;
+ sal_uInt16 nNextMaster = m_pMasterPages->FindPage(nOrigMasterId);
if ( nNextMaster == PPTSLIDEPERSIST_ENTRY_NOTFOUND )
break;
else
pE = &(*pPageList)[ nNextMaster ];
+ if (pE->aSlideAtom.nMasterId == nOrigMasterId)
+ {
+ SAL_WARN("filter.ms", "loop in atom chain");
+ break;
+ }
}
if ( pE->nBackgroundOffset )
{
diff --git a/sd/qa/unit/data/ppt/pass/hang-9.ppt b/sd/qa/unit/data/ppt/pass/hang-9.ppt
new file mode 100644
index 0000000..97e0158
Binary files /dev/null and b/sd/qa/unit/data/ppt/pass/hang-9.ppt differ
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 8c2d75d..d37855d 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -733,11 +733,17 @@ bool ImplSdPPTImport::Import()
PptSlidePersistEntry* pE = pPersist;
while( ( pE->aSlideAtom.nFlags & 4 ) && pE->aSlideAtom.nMasterId )
{
- sal_uInt16 nNextMaster = m_pMasterPages->FindPage( pE->aSlideAtom.nMasterId );
+ auto nOrigMasterId = pE->aSlideAtom.nMasterId;
+ sal_uInt16 nNextMaster = m_pMasterPages->FindPage(nOrigMasterId);
if ( nNextMaster == PPTSLIDEPERSIST_ENTRY_NOTFOUND )
break;
else
pE = &(*pList)[ nNextMaster ];
+ if (pE->aSlideAtom.nMasterId == nOrigMasterId)
+ {
+ SAL_WARN("filter.ms", "loop in atom chain");
+ break;
+ }
}
SdrObject* pObj = ImportPageBackgroundObject( *pMPage, pE->nBackgroundOffset, true ); // import background
if ( pObj )
commit 9a695e071020639926f8b038aba64eb016a1801a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Aug 27 14:06:04 2015 +0100
check stream state after read attempt
Change-Id: Ie3836f2e95acab963634181a07565343501f00f8
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 662611e..30e8cfc 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -5218,9 +5218,13 @@ void PPTStyleTextPropReader::Init( SvStream& rIn, const DffRecordHeader& rTextHe
PPTCharPropSet aCharPropSet( nCurrentPara );
if ( bTextPropAtom )
+ {
ReadCharProps( rIn, aCharPropSet, aString, nCharCount, nCharAnzRead,
bTextPropAtom, nExtParaPos, aStyleTextProp9, nExtParaFlags,
nBuBlip, nHasAnm, nAnmScheme );
+ if (!rIn.good())
+ break;
+ }
else
nCharCount = nStringLen;
@@ -5296,7 +5300,7 @@ void PPTStyleTextPropReader::Init( SvStream& rIn, const DffRecordHeader& rTextHe
break;
}
}
- }
+ }
if ( !aCharPropList.empty() && ( aCharPropList.back()->mnParagraph != nCurrentPara ) )
{
PPTCharPropSet* pCharPropSet = new PPTCharPropSet( *aCharPropList.back(), nCurrentPara );
diff --git a/sd/qa/unit/data/ppt/pass/hang-8.ppt b/sd/qa/unit/data/ppt/pass/hang-8.ppt
new file mode 100644
index 0000000..0f52bd5
Binary files /dev/null and b/sd/qa/unit/data/ppt/pass/hang-8.ppt differ
commit 1830b4f2e324090962a993315ce76752d24d4088
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Aug 27 13:58:48 2015 +0100
check seek for success
Change-Id: I02420ffb3af009d08ce54a0932e2c7a287703a72
diff --git a/sd/qa/unit/data/ppt/pass/hang-7.ppt b/sd/qa/unit/data/ppt/pass/hang-7.ppt
new file mode 100644
index 0000000..8c05271
Binary files /dev/null and b/sd/qa/unit/data/ppt/pass/hang-7.ppt differ
diff --git a/sd/source/filter/ppt/propread.cxx b/sd/source/filter/ppt/propread.cxx
index f8804fd..86195be4 100644
--- a/sd/source/filter/ppt/propread.cxx
+++ b/sd/source/filter/ppt/propread.cxx
@@ -419,7 +419,11 @@ void Section::Read( SotStorageStream *pStrm )
if ( nPropSize )
{
if ( ( nVectorCount - i ) > 1 )
- pStrm->Seek( nPropOfs + nSecOfs + nPropSize );
+ {
+ nOffset = nPropOfs + nSecOfs + nPropSize;
+ if (nOffset != pStrm->Seek(nOffset))
+ break;
+ }
}
else
break;
commit d417ffb7dd93306be7c89526a75acab53dbd8831
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Aug 27 13:49:00 2015 +0100
check SeekToEndOfRecord for success
Change-Id: I7413a4e9e491b65122eaadb38ad574161f1aa943
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 26cf78c..662611e 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -2869,7 +2869,9 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
insertShapeId( nShapeId, pObj );
}
}
- aShapeHd.SeekToEndOfRecord( rStCtrl );
+ bool bSuccess = aShapeHd.SeekToEndOfRecord(rStCtrl);
+ if (!bSuccess)
+ break;
}
}
}
diff --git a/sd/qa/unit/data/ppt/pass/hang-6.ppt b/sd/qa/unit/data/ppt/pass/hang-6.ppt
new file mode 100644
index 0000000..f5aa247
Binary files /dev/null and b/sd/qa/unit/data/ppt/pass/hang-6.ppt differ
commit 90dc4e38928fffc3ed5fcbed40109712eb97e203
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Aug 27 13:35:37 2015 +0100
avoid hang in certain ppts
Change-Id: Iedba71b72fc815b274ca5e0da0903a558947cb06
diff --git a/sd/qa/unit/data/ppt/pass/hang-5.ppt b/sd/qa/unit/data/ppt/pass/hang-5.ppt
new file mode 100644
index 0000000..cfaa8f4
Binary files /dev/null and b/sd/qa/unit/data/ppt/pass/hang-5.ppt differ
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index abc8fc3..8c2d75d 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -2557,7 +2557,7 @@ SdrObject* ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
DffRecordHeader& rHdClientData = *maShapeRecords.Current();
while( true )
{
- sal_uInt32 nClientDataLen = rHdClientData.GetRecEndFilePos();
+ sal_uInt32 nClientDataLen = SanitizeEndPos(rSt, rHdClientData.GetRecEndFilePos());
DffRecordHeader aHd;
do
{
commit eea399ddd52a0de368321963bb828bc15632dd0b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Aug 27 13:00:36 2015 +0100
check for stream status after a read, not after a seek
Change-Id: I984e99c1a1484547aa4d60bf301167f3cbc9f716
diff --git a/sd/qa/unit/data/ppt/pass/hang-4.ppt b/sd/qa/unit/data/ppt/pass/hang-4.ppt
new file mode 100644
index 0000000..f5aa247
Binary files /dev/null and b/sd/qa/unit/data/ppt/pass/hang-4.ppt differ
diff --git a/sd/source/filter/ppt/propread.cxx b/sd/source/filter/ppt/propread.cxx
index 2312081..f8804fd 100644
--- a/sd/source/filter/ppt/propread.cxx
+++ b/sd/source/filter/ppt/propread.cxx
@@ -306,7 +306,7 @@ bool Section::GetDictionary( Dictionary& rDict )
void Section::Read( SotStorageStream *pStrm )
{
- sal_uInt32 i, nSecOfs, nPropType, nPropSize, nCurrent, nVectorCount, nTemp, nStrmSize;
+ sal_uInt32 i, nSecOfs, nPropSize, nStrmSize;
nSecOfs = pStrm->Tell();
pStrm->Seek( STREAM_SEEK_TO_END );
@@ -316,16 +316,20 @@ void Section::Read( SotStorageStream *pStrm )
mnTextEnc = RTL_TEXTENCODING_MS_1252;
sal_uInt32 nSecSize(0), nPropCount(0);
pStrm->ReadUInt32( nSecSize ).ReadUInt32( nPropCount );
- while (nPropCount-- && pStrm->good())
+ while (nPropCount--)
{
sal_uInt32 nPropId(0), nPropOfs(0);
- pStrm->ReadUInt32( nPropId ).ReadUInt32( nPropOfs );
- nCurrent = pStrm->Tell();
- pStrm->Seek( nPropOfs + nSecOfs );
+ pStrm->ReadUInt32(nPropId).ReadUInt32(nPropOfs);
+ if (!pStrm->good())
+ break;
+ auto nCurrent = pStrm->Tell();
+ sal_uInt64 nOffset = nPropOfs + nSecOfs;
+ if (nOffset != pStrm->Seek(nOffset))
+ break;
if ( nPropId ) // do not read dictionary
{
-
- pStrm->ReadUInt32( nPropType );
+ sal_uInt32 nPropType(0), nVectorCount(0);
+ pStrm->ReadUInt32(nPropType);
nPropSize = 4;
@@ -347,6 +351,7 @@ void Section::Read( SotStorageStream *pStrm )
pStrm->ReadUInt32( nPropType );
nPropSize += 4;
}
+ sal_uInt32 nTemp(0);
switch( nPropType )
{
case VT_UI1 :
@@ -440,11 +445,11 @@ void Section::Read( SotStorageStream *pStrm )
PropItem aPropItem;
if ( GetProperty( 1, aPropItem ) )
{
- sal_uInt16 nCodePage;
aPropItem.ReadUInt32( nPropType );
if ( nPropType == VT_I2 )
{
- aPropItem.ReadUInt16( nCodePage );
+ sal_uInt16 nCodePage(0);
+ aPropItem.ReadUInt16(nCodePage);
if ( nCodePage == 1200 )
{
@@ -486,7 +491,7 @@ void Section::Read( SotStorageStream *pStrm )
AddProperty( 0xffffffff, pBuf, nSize );
delete[] pBuf;
}
- pStrm->Seek( nCurrent );
+ pStrm->Seek(nCurrent);
}
pStrm->Seek( nSecOfs + nSecSize );
}
commit 3bc69b1d0d8620afd89a993b5f6bc46a2ff5267f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Aug 27 12:21:37 2015 +0100
don't write SvxBackgroundColorItem via inherited SvxColorItem::Store
SvxBackgroundColorItem inherits from SvxColorItem and for backwards
compatibility with the StarOffice 5 binary file format (yes, really)
writes/reads only rgb and not the transparency value, so copying and pasting
text from a sidebar comment in writer to itself or another one results in a
black character background as the default COL_AUTO turns into black
Change-Id: I18b5105dd8e060b9e49dda6026e26d3a0f00d8f5
diff --git a/editeng/source/editeng/editattr.cxx b/editeng/source/editeng/editattr.cxx
index 21cd750..57d0045 100644
--- a/editeng/source/editeng/editattr.cxx
+++ b/editeng/source/editeng/editattr.cxx
@@ -221,7 +221,6 @@ void EditCharAttribColor::SetFont( SvxFont& rFont, OutputDevice* )
{
Color aColor = static_cast<const SvxColorItem*>(GetItem())->GetValue();
rFont.SetColor( aColor);
- //fprintf(stderr, "Called SetFont with Color %d\n", aColor.GetColor());
}
// class EditCharAttribBackgroundColor
@@ -238,14 +237,11 @@ EditCharAttribBackgroundColor::EditCharAttribBackgroundColor(
void EditCharAttribBackgroundColor::SetFont( SvxFont& rFont, OutputDevice* )
{
Color aColor = static_cast<const SvxBackgroundColorItem*>(GetItem())->GetValue();
- rFont.SetFillColor( aColor);
rFont.SetTransparent(false);
-
+ rFont.SetFillColor(aColor);
}
-
// class EditCharAttribLanguage
-
EditCharAttribLanguage::EditCharAttribLanguage( const SvxLanguageItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
: EditCharAttrib( rAttr, _nStart, _nEnd )
{
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index 028ba85..9c76d7e 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -1850,9 +1850,12 @@ SvxBackgroundColorItem::SvxBackgroundColorItem( const Color& rCol,
{
}
-SvxBackgroundColorItem:: SvxBackgroundColorItem( SvStream& rStrm, const sal_uInt16 Id ) :
- SvxColorItem( rStrm, Id )
+SvxBackgroundColorItem::SvxBackgroundColorItem(SvStream& rStrm, const sal_uInt16 nId)
+ : SvxColorItem(nId)
{
+ Color aColor;
+ aColor.Read(rStrm);
+ SetValue(aColor);
}
SvxBackgroundColorItem::SvxBackgroundColorItem( const SvxBackgroundColorItem& rCopy ) :
@@ -1862,9 +1865,14 @@ SvxBackgroundColorItem::SvxBackgroundColorItem( const SvxBackgroundColorItem& rC
SfxPoolItem* SvxBackgroundColorItem::Clone( SfxItemPool * ) const
{
- return new SvxBackgroundColorItem( *this );
+ return new SvxBackgroundColorItem(*this);
}
+SvStream& SvxBackgroundColorItem::Store(SvStream& rStrm, sal_uInt16) const
+{
+ GetValue().Write(rStrm);
+ return rStrm;
+}
SfxPoolItem* SvxBackgroundColorItem::Create(SvStream& rStrm, sal_uInt16 ) const
{
@@ -1918,23 +1926,18 @@ bool SvxBackgroundColorItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId
}
// class SvxColorItem ----------------------------------------------------
-
SvxColorItem::SvxColorItem( const sal_uInt16 nId ) :
SfxPoolItem( nId ),
mColor( COL_BLACK )
{
}
-
-
SvxColorItem::SvxColorItem( const Color& rCol, const sal_uInt16 nId ) :
SfxPoolItem( nId ),
mColor( rCol )
{
}
-
-
SvxColorItem::SvxColorItem( SvStream &rStrm, const sal_uInt16 nId ) :
SfxPoolItem( nId )
{
@@ -1943,21 +1946,16 @@ SvxColorItem::SvxColorItem( SvStream &rStrm, const sal_uInt16 nId ) :
mColor = aColor;
}
-
-
SvxColorItem::SvxColorItem( const SvxColorItem &rCopy ) :
SfxPoolItem( rCopy ),
mColor( rCopy.mColor )
{
}
-
-
SvxColorItem::~SvxColorItem()
{
}
-
sal_uInt16 SvxColorItem::GetVersion( sal_uInt16 nFFVer ) const
{
DBG_ASSERT( SOFFICE_FILEFORMAT_31==nFFVer ||
@@ -1967,8 +1965,6 @@ sal_uInt16 SvxColorItem::GetVersion( sal_uInt16 nFFVer ) const
return SOFFICE_FILEFORMAT_50 >= nFFVer ? VERSION_USEAUTOCOLOR : 0;
}
-
-
bool SvxColorItem::operator==( const SfxPoolItem& rAttr ) const
{
DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" );
@@ -1976,16 +1972,12 @@ bool SvxColorItem::operator==( const SfxPoolItem& rAttr ) const
return mColor == static_cast<const SvxColorItem&>( rAttr ).mColor;
}
-
-
bool SvxColorItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
{
rVal <<= (sal_Int32)(mColor.GetColor());
return true;
}
-
-
bool SvxColorItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
{
sal_Int32 nColor = 0;
@@ -1996,15 +1988,11 @@ bool SvxColorItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
return true;
}
-
-
SfxPoolItem* SvxColorItem::Clone( SfxItemPool * ) const
{
return new SvxColorItem( *this );
}
-
-
SvStream& SvxColorItem::Store( SvStream& rStrm , sal_uInt16 nItemVersion ) const
{
if( VERSION_USEAUTOCOLOR == nItemVersion &&
@@ -2015,15 +2003,11 @@ SvStream& SvxColorItem::Store( SvStream& rStrm , sal_uInt16 nItemVersion ) const
return rStrm;
}
-
-
SfxPoolItem* SvxColorItem::Create(SvStream& rStrm, sal_uInt16 /*nVer*/ ) const
{
return new SvxColorItem( rStrm, Which() );
}
-
-
bool SvxColorItem::GetPresentation
(
SfxItemPresentation /*ePres*/,
diff --git a/include/editeng/colritem.hxx b/include/editeng/colritem.hxx
index 3ee4c35..106d862 100644
--- a/include/editeng/colritem.hxx
+++ b/include/editeng/colritem.hxx
@@ -82,6 +82,7 @@ class EDITENG_DLLPUBLIC SvxBackgroundColorItem : public SvxColorItem
SvxBackgroundColorItem(const SvxBackgroundColorItem& rCopy);
virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const SAL_OVERRIDE;
+ virtual SvStream& Store(SvStream& rStream, sal_uInt16 nVersion) const SAL_OVERRIDE;
virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const SAL_OVERRIDE;
virtual bool QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId = 0) const SAL_OVERRIDE;
virtual bool PutValue(const css::uno::Any& rVal, sal_uInt8 nMemberId) SAL_OVERRIDE;
commit 5fba7ebf5c465b218b650141eab28c27cc19c79e
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Thu Aug 27 14:48:36 2015 +0100
vcldemo: quit popup on mouse click.
Change-Id: I0fc1967d3863723b0c8e3e082fac19cc49aba345
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index d140b4f..9218afd 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -1636,6 +1636,11 @@ class DemoPopup : public FloatingWindow
DrawRect( Rectangle( Point( 1, 1 ), aSize ) );
SetLineColor( aColor );
}
+
+ virtual void MouseButtonDown( const MouseEvent & ) SAL_OVERRIDE
+ {
+ Application::Quit();
+ }
};
class DemoApp : public Application
commit 186c82e81f3d75be0971ff1b561172a182e46a97
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Aug 27 15:02:04 2015 +0200
Actually process the escaped character
...was like this ever since it got introduced in
b75958473503f7eca096b8843e57a031bbabe0ab "implemented date acceptance patterns
API." Found with clang-tidy's clang-analyzer-deadcode.DeadStores.
Change-Id: Ib1572ca9f254e3e835dbbe088f6a48c24dbd8235
diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx
index 4a41aa5..7db424c 100644
--- a/i18npool/source/localedata/LocaleNode.cxx
+++ b/i18npool/source/localedata/LocaleNode.cxx
@@ -1101,7 +1101,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const
break;
case '\\':
cChar = sTheDateEditFormat.iterateCodePoints( &nIndex);
- break;
+ goto handleDefault;
case '-':
case '.':
case '/':
@@ -1114,6 +1114,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const
cDateSep2 = cChar;
// fallthru
default:
+ handleDefault:
if (!cDateSep)
cDateSep = cChar;
if (!cDateSep2)
commit ad3d4a94e5dda6aa2ae39d903f0f9d13c9f85ef7
Author: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Date: Thu Aug 27 14:50:57 2015 +0200
vcl: increase timeout for timertest hang by some
Change-Id: I7e61051ca8d7ae2314514e60097ff86481d4ceae
diff --git a/vcl/qa/cppunit/timer.cxx b/vcl/qa/cppunit/timer.cxx
index 2ec940a..76db8a8 100644
--- a/vcl/qa/cppunit/timer.cxx
+++ b/vcl/qa/cppunit/timer.cxx
@@ -46,7 +46,7 @@ public:
}
};
-static WatchDog aWatchDog( 12 /* 12 secs should be enough */);
+static WatchDog aWatchDog( 120 ); // random high number in secs
class TimerTest : public test::BootstrapFixture
{
commit 033ce593af9b1505c804930c84297f1da26858c4
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Aug 27 13:06:15 2015 +0200
Simplify hasModifications check
Change-Id: Idcbd9a20ab13d0717f8728673e2c55e87aa92be4
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index 6c2726e..b3c8acb 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -277,18 +277,11 @@ void Components::addModification(Path const & path) {
data_.modifications.add(path);
}
-bool Components::hasModifications() const
-{
- return data_.modifications.getRoot().children.begin() !=
- data_.modifications.getRoot().children.end();
-}
-
void Components::writeModifications() {
- if (!hasModifications() || modificationFileUrl_.isEmpty())
- return;
-
- if (!writeThread_.is()) {
+ if (!(data_.modifications.empty() || modificationFileUrl_.isEmpty()
+ || writeThread_.is()))
+ {
writeThread_ = new WriteThread(
&writeThread_, *this, modificationFileUrl_, data_);
writeThread_->launch();
diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx
index f43181f..25d0d6e 100644
--- a/configmgr/source/components.hxx
+++ b/configmgr/source/components.hxx
@@ -78,8 +78,6 @@ public:
void writeModifications();
- bool hasModifications() const;
-
void flushModifications();
// must be called with configmgr::lock unaquired; must be called before
// shutdown if writeModifications has ever been called (probably
diff --git a/configmgr/source/modifications.hxx b/configmgr/source/modifications.hxx
index 71e06ea..04ad5c3 100644
--- a/configmgr/source/modifications.hxx
+++ b/configmgr/source/modifications.hxx
@@ -45,6 +45,8 @@ public:
void remove(Path const & path);
+ bool empty() const { return root_.children.empty(); }
+
Node const & getRoot() const { return root_;}
private:
commit 1e8b7cdbbd084a1e75f82bfff605321c8480b78d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Aug 27 11:58:47 2015 +0100
this farcical staroffice 5.0 related junk can at least be const
Change-Id: I096d98f6e0cb61cacd9cd82a623f832b88ded1e6
diff --git a/include/tools/color.hxx b/include/tools/color.hxx
index 00c89e2..0451a69 100644
--- a/include/tools/color.hxx
+++ b/include/tools/color.hxx
@@ -201,7 +201,7 @@ public:
}
SvStream& Read(SvStream& rIStream, bool bNewFormat = true);
- SvStream& Write(SvStream& rOStream, bool bNewFormat = true);
+ SvStream& Write(SvStream& rOStream, bool bNewFormat = true) const;
TOOLS_DLLPUBLIC friend SvStream& ReadColor(SvStream& rIStream, Color& rColor);
TOOLS_DLLPUBLIC friend SvStream& WriteColor(SvStream& rOStream, const Color& rColor);
diff --git a/tools/source/generic/color.cxx b/tools/source/generic/color.cxx
index 87185b8..6d7ebaf 100644
--- a/tools/source/generic/color.cxx
+++ b/tools/source/generic/color.cxx
@@ -227,7 +227,7 @@ SvStream& Color::Read( SvStream& rIStm, bool bNewFormat )
return rIStm;
}
-SvStream& Color::Write( SvStream& rOStm, bool bNewFormat )
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list