summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/ui/view/tabview.cxx32
1 files changed, 28 insertions, 4 deletions
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 1cb869cbd432..ab77b47bed0c 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -2351,14 +2351,38 @@ OUString ScTabView::getRowColumnHeaders(const Rectangle& rRectangle)
}
boost::property_tree::ptree aCols;
+ nTotal = 0;
+ nTotalPixels = 0;
for (SCCOL nCol = 0; nCol <= nEndCol; ++nCol)
{
- boost::property_tree::ptree aCol;
sal_uInt16 nSize = pDoc->GetColWidth(nCol, aViewData.GetTabNo());
- aCol.put("size", OString::number(nSize).getStr());
OUString aText = pColBar[SC_SPLIT_LEFT]->GetEntryText(nCol);
- aCol.put("text", aText.toUtf8().getStr());
- aCols.push_back(std::make_pair("", aCol));
+
+ bool bSkip = false;
+ if (!rRectangle.IsEmpty())
+ {
+ long nLeft = std::max(rRectangle.Left(), nTotal);
+ long nRight = std::min(rRectangle.Right(), nTotal + nSize);
+ if (nRight < nLeft)
+ // They do not intersect.
+ bSkip = true;
+ }
+ if (!bSkip)
+ {
+ if (aCols.empty())
+ {
+ boost::property_tree::ptree aCol;
+ aCol.put("size", OString::number(long((nTotalPixels + 0.5) / aViewData.GetPPTX())).getStr());
+ aCol.put("text", "");
+ aCols.push_back(std::make_pair("", aCol));
+ }
+ boost::property_tree::ptree aCol;
+ aCol.put("size", OString::number(nSize).getStr());
+ aCol.put("text", aText.toUtf8().getStr());
+ aCols.push_back(std::make_pair("", aCol));
+ }
+ nTotal += nSize;
+ nTotalPixels += long(nSize * aViewData.GetPPTX());
}
boost::property_tree::ptree aTree;