summaryrefslogtreecommitdiffstats
path: root/lotuswordpro
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-03-02 11:22:21 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-03-02 11:22:40 +0000
commit7d2ec4c0136c054923947093e35f4ab074f2b550 (patch)
tree0a67e82c7e536299bdac0f8336943423c4cfd9fb /lotuswordpro
parent-Werror,-Wimplicit-fallthrough (diff)
downloadcore-7d2ec4c0136c054923947093e35f4ab074f2b550.tar.gz
core-7d2ec4c0136c054923947093e35f4ab074f2b550.zip
dig out lotuswordpros table limits
Change-Id: Iea7d436a78336de150b3d3ae317b99b554fb8657
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/lwptable.hxx3
-rw-r--r--lotuswordpro/source/filter/lwptablelayout.cxx8
2 files changed, 11 insertions, 0 deletions
diff --git a/lotuswordpro/source/filter/lwptable.hxx b/lotuswordpro/source/filter/lwptable.hxx
index 6c8847127f18..fce2172e1e3b 100644
--- a/lotuswordpro/source/filter/lwptable.hxx
+++ b/lotuswordpro/source/filter/lwptable.hxx
@@ -170,7 +170,10 @@ protected:
LwpObjectID cDefaultLeftColumnStyle;
LwpObjectID cDefaultRightColumnStyle;
};
+
#define MAX_NUM_ROWS 8192
+#define MAX_NUM_COLS 255
+
class LwpGlossary : public LwpParallelColumns
{
public:
diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx
index 5e42c10408ba..f44544fc3eaa 100644
--- a/lotuswordpro/source/filter/lwptablelayout.cxx
+++ b/lotuswordpro/source/filter/lwptablelayout.cxx
@@ -700,6 +700,14 @@ void LwpTableLayout::RegisterStyle()
// get row/column number of this table
m_nRows = pTable->GetRow();
m_nCols = pTable->GetColumn();
+ //http://www.danielsays.com/ss-gallery-win1x2x3x-lotus-word-pro-96.html
+ //tables with up to 255 rows and 8192 columns
+ //the row limit tallies with the casting of m_nCols to an unsigned char
+ //elsewhere
+ if (m_nRows > MAX_NUM_ROWS)
+ throw std::runtime_error("max legal row exceeded");
+ if (m_nCols > MAX_NUM_COLS)
+ throw std::runtime_error("max legal column exceeded");
// get default cell layout of current table
LwpObjectID& rID= pTable->GetDefaultCellStyle();