Kaydet (Commit) 8c6dd2cb authored tarafından Kohei Yoshida's avatar Kohei Yoshida

No point using the pimpl pattern here.

The whole class is already hidden in the source file.

Change-Id: Ib6157ae275217a95586735f74beee1700041a679
üst 20a359ea
...@@ -397,23 +397,17 @@ namespace { ...@@ -397,23 +397,17 @@ namespace {
class CellStoreInitializer class CellStoreInitializer
{ {
struct Impl
{
sc::CellTextAttrStoreType maAttrs;
sc::CellTextAttrStoreType::iterator miPos;
sal_uInt16 mnScriptNumeric;
Impl(const sal_uInt32 nMaxRowCount, const sal_uInt16 nScriptNumeric)
: maAttrs(nMaxRowCount), miPos(maAttrs.begin()), mnScriptNumeric(nScriptNumeric)
{}
};
ScDocument& mrDoc; ScDocument& mrDoc;
boost::shared_ptr<Impl> mpImpl; sc::CellTextAttrStoreType maAttrs;
sc::CellTextAttrStoreType::iterator miPos;
sal_uInt16 mnScriptNumeric;
public: public:
CellStoreInitializer(ScDocument& rDoc, sal_uInt16 nScriptNumeric) : CellStoreInitializer(ScDocument& rDoc, sal_uInt16 nScriptNumeric) :
mrDoc(rDoc), mpImpl(new Impl(MAXROWCOUNT, nScriptNumeric)) {} mrDoc(rDoc),
maAttrs(MAXROWCOUNT),
miPos(maAttrs.begin()),
mnScriptNumeric(nScriptNumeric) {}
void operator() (const sc::CellStoreType::value_type& node) void operator() (const sc::CellStoreType::value_type& node)
{ {
...@@ -423,9 +417,9 @@ public: ...@@ -423,9 +417,9 @@ public:
// Fill with default values for non-empty cell segments. // Fill with default values for non-empty cell segments.
sc::CellTextAttr aDefault; sc::CellTextAttr aDefault;
if (node.type == sc::element_type_numeric) if (node.type == sc::element_type_numeric)
aDefault.mnScriptType = mpImpl->mnScriptNumeric; aDefault.mnScriptType = mnScriptNumeric;
std::vector<sc::CellTextAttr> aDefaults(node.size, aDefault); std::vector<sc::CellTextAttr> aDefaults(node.size, aDefault);
mpImpl->miPos = mpImpl->maAttrs.set(mpImpl->miPos, node.position, aDefaults.begin(), aDefaults.end()); miPos = maAttrs.set(miPos, node.position, aDefaults.begin(), aDefaults.end());
if (node.type == sc::element_type_formula) if (node.type == sc::element_type_formula)
{ {
...@@ -442,7 +436,7 @@ public: ...@@ -442,7 +436,7 @@ public:
void swap(sc::CellTextAttrStoreType& rAttrs) void swap(sc::CellTextAttrStoreType& rAttrs)
{ {
mpImpl->maAttrs.swap(rAttrs); maAttrs.swap(rAttrs);
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment