diff options
author | Tomaž Vajngerl <quikee@gmail.com> | 2013-09-01 13:38:58 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2013-09-03 07:46:44 +0200 |
commit | be0759283c22d06e8fd7683776866c5abc1bf8f2 (patch) | |
tree | 7342fe1ebe57a08f59a16cc300a7da88821df550 /svtools/source | |
parent | 516455206510fe2ad928cde37e4adfae4a57859a (diff) |
Ruler: clear ruler elements at copying only when input is not empty
Change-Id: I633dcd452a0df426421eaccadf648ad06b8e124c
Diffstat (limited to 'svtools/source')
-rw-r--r-- | svtools/source/control/ruler.cxx | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx index 17c58752115a..494fe269d0d9 100644 --- a/svtools/source/control/ruler.cxx +++ b/svtools/source/control/ruler.cxx @@ -189,34 +189,45 @@ ImplRulerData& ImplRulerData::operator=( const ImplRulerData& rData ) bAutoPageWidth = rData.bAutoPageWidth; bTextRTL = rData.bTextRTL; - pLines.clear(); - pBorders.clear(); - pIndents.clear(); - pTabs.clear(); - if ( !rData.pLines.empty() ) { pLines.resize(rData.pLines.size()); std::copy(rData.pLines.begin(), rData.pLines.end(), pLines.begin()); } + else + { + pLines.clear(); + } if ( !rData.pBorders.empty() ) { pBorders.resize(rData.pBorders.size()); std::copy(rData.pBorders.begin(), rData.pBorders.end(), pBorders.begin()); } + else + { + pBorders.clear(); + } if ( !rData.pIndents.empty() ) { pIndents.resize(rData.pIndents.size()); std::copy(rData.pIndents.begin(), rData.pIndents.end(), pIndents.begin()); } + else + { + pIndents.clear(); + } if ( !rData.pTabs.empty() ) { pTabs.resize(rData.pTabs.size()); std::copy(rData.pTabs.begin(), rData.pTabs.end(), pTabs.begin()); } + else + { + pTabs.clear(); + } return *this; } |