Kaydet (Commit) ba395778 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Noel Grandin

fdo#84938: convert EPP_LAYOUT constants to enum

Change-Id: Ibf43bf9ca241c6286659a16906a45bbafa798748
Reviewed-on: https://gerrit.libreoffice.org/11961Tested-by: 's avatarLibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 9fef481f
...@@ -175,7 +175,7 @@ void PPTWriter::ImplWriteSlide( sal_uInt32 nPageNum, sal_uInt32 nMasterNum, sal_ ...@@ -175,7 +175,7 @@ void PPTWriter::ImplWriteSlide( sal_uInt32 nPageNum, sal_uInt32 nMasterNum, sal_
mpPptEscherEx->PtReplaceOrInsert( EPP_Persist_Slide | nPageNum, mpStrm->Tell() ); mpPptEscherEx->PtReplaceOrInsert( EPP_Persist_Slide | nPageNum, mpStrm->Tell() );
mpPptEscherEx->OpenContainer( EPP_Slide ); mpPptEscherEx->OpenContainer( EPP_Slide );
mpPptEscherEx->AddAtom( 24, EPP_SlideAtom, 2 ); mpPptEscherEx->AddAtom( 24, EPP_SlideAtom, 2 );
mpStrm->WriteInt32( rLayout.nLayout ); mpStrm->WriteInt32( static_cast<sal_Int32>(rLayout.nLayout) );
mpStrm->Write( rLayout.nPlaceHolder, 8 ); // placeholderIDs (8 parts) mpStrm->Write( rLayout.nPlaceHolder, 8 ); // placeholderIDs (8 parts)
mpStrm->WriteUInt32( (nMasterNum | 0x80000000) )// master ID (equals 0x80000000 on a master page) mpStrm->WriteUInt32( (nMasterNum | 0x80000000) )// master ID (equals 0x80000000 on a master page)
.WriteUInt32( nPageNum + 0x100 ) // notes ID (equals null if no notes are present) .WriteUInt32( nPageNum + 0x100 ) // notes ID (equals null if no notes are present)
...@@ -362,7 +362,7 @@ void PPTWriter::ImplWriteSlideMaster( sal_uInt32 nPageNum, Reference< XPropertyS ...@@ -362,7 +362,7 @@ void PPTWriter::ImplWriteSlideMaster( sal_uInt32 nPageNum, Reference< XPropertyS
mpPptEscherEx->PtReplaceOrInsert( EPP_Persist_MainMaster | nPageNum, mpStrm->Tell() ); mpPptEscherEx->PtReplaceOrInsert( EPP_Persist_MainMaster | nPageNum, mpStrm->Tell() );
mpPptEscherEx->OpenContainer( EPP_MainMaster ); mpPptEscherEx->OpenContainer( EPP_MainMaster );
mpPptEscherEx->AddAtom( 24, EPP_SlideAtom, 2 ); mpPptEscherEx->AddAtom( 24, EPP_SlideAtom, 2 );
mpStrm->WriteInt32( EPP_LAYOUT_TITLEANDBODYSLIDE ) // slide layout -> title and body slide mpStrm->WriteInt32( static_cast<sal_Int32>(EppLayout::TITLEANDBODYSLIDE) ) // slide layout -> title and body slide
.WriteUChar( 1 ).WriteUChar( 2 ).WriteUChar( 0 ).WriteUChar( 0 ).WriteUChar( 0 ).WriteUChar( 0 ).WriteUChar( 0 ).WriteUChar( 0 ) // placeholderID .WriteUChar( 1 ).WriteUChar( 2 ).WriteUChar( 0 ).WriteUChar( 0 ).WriteUChar( 0 ).WriteUChar( 0 ).WriteUChar( 0 ).WriteUChar( 0 ) // placeholderID
.WriteUInt32( 0 ) // master ID (equals null at a master page) .WriteUInt32( 0 ) // master ID (equals null at a master page)
.WriteUInt32( 0 ) // notes ID (equals null if no notes are present) .WriteUInt32( 0 ) // notes ID (equals null if no notes are present)
......
...@@ -38,25 +38,28 @@ ...@@ -38,25 +38,28 @@
#include "grouptable.hxx" #include "grouptable.hxx"
// PLACEMENT_ID // PLACEMENT_ID
#define EPP_LAYOUT_TITLESLIDE 0 /* The slide is a title slide */ enum class EppLayout
#define EPP_LAYOUT_TITLEANDBODYSLIDE 1 /* Title and body slide */ {
#define EPP_LAYOUT_TITLEMASTERSLIDE 2 /* Title master slide */ TITLESLIDE = 0, /* The slide is a title slide */
#define EPP_LAYOUT_MASTERSLIDE 3 /* Master slide layout */ TITLEANDBODYSLIDE = 1, /* Title and body slide */
#define EPP_LAYOUT_MASTERNOTES 4 /* Master notes layout */ TITLEMASTERSLIDE = 2, /* Title master slide */
#define EPP_LAYOUT_NOTESTITLEBODY 5 /* Notes title/body layout */ MASTERSLIDE = 3, /* Master slide layout */
#define EPP_LAYOUT_HANDOUTLAYOUT 6 /* Handout layout, therefore it doesn't have placeholders except header, footer, and date */ MASTERNOTES = 4, /* Master notes layout */
#define EPP_LAYOUT_ONLYTITLE 7 /* Only title placeholder */ NOTESTITLEBODY = 5, /* Notes title/body layout */
#define EPP_LAYOUT_2COLUMNSANDTITLE 8 /* Body of the slide has 2 columns and a title */ HANDOUTLAYOUT = 6, /* Handout layout, therefore it doesn't have placeholders except header, footer, and date */
#define EPP_LAYOUT_2ROWSANDTITLE 9 /* Slide's body has 2 rows and a title */ ONLYTITLE = 7, /* Only title placeholder */
#define EPP_LAYOUT_RIGHTCOLUMN2ROWS 10 /* Body contains 2 columns, right column has 2 rows */ TWOCOLUMNSANDTITLE = 8, /* Body of the slide has 2 columns and a title */
#define EPP_LAYOUT_LEFTCOLUMN2ROWS 11 /* Body contains 2 columns, left column has 2 rows */ TWOROWSANDTITLE = 9, /* Slide's body has 2 rows and a title */
#define EPP_LAYOUT_BOTTOMROW2COLUMNS 12 /* Body contains 2 rows, bottom row has 2 columns */ RIGHTCOLUMN2ROWS = 10, /* Body contains 2 columns, right column has 2 rows */
#define EPP_LAYOUT_TOPROW2COLUMN 13 /* Body contains 2 rows, top row has 2 columns */ LEFTCOLUMN2ROWS = 11, /* Body contains 2 columns, left column has 2 rows */
#define EPP_LAYOUT_4OBJECTS 14 /* 4 objects */ BOTTOMROW2COLUMNS = 12, /* Body contains 2 rows, bottom row has 2 columns */
#define EPP_LAYOUT_BIGOBJECT 15 /* Big object */ TOPROW2COLUMN = 13, /* Body contains 2 rows, top row has 2 columns */
#define EPP_LAYOUT_BLANCSLIDE 16 /* Blank slide */ FOUROBJECTS = 14, /* 4 objects */
#define EPP_LAYOUT_TITLERIGHTBODYLEFT 17 /* Vertical title on the right, body on the left */ BIGOBJECT = 15, /* Big object */
#define EPP_LAYOUT_TITLERIGHT2BODIESLEFT 18 /* Vertical title on the right, body on the left split into 2 rows */ BLANCSLIDE = 16, /* Blank slide */
TITLERIGHTBODYLEFT = 17, /* Vertical title on the right, body on the left */
TITLERIGHT2BODIESLEFT = 18 /* Vertical title on the right, body on the left split into 2 rows */
};
#define EPP_LAYOUT_SIZE 25 #define EPP_LAYOUT_SIZE 25
...@@ -64,7 +67,7 @@ class PptEscherEx; ...@@ -64,7 +67,7 @@ class PptEscherEx;
struct PHLayout struct PHLayout
{ {
sal_Int32 nLayout; EppLayout nLayout;
sal_uInt8 nPlaceHolder[ 8 ]; sal_uInt8 nPlaceHolder[ 8 ];
sal_uInt8 nUsedObjectPlaceHolder; sal_uInt8 nUsedObjectPlaceHolder;
......
...@@ -100,31 +100,31 @@ using ::com::sun::star::uno::UNO_QUERY; ...@@ -100,31 +100,31 @@ using ::com::sun::star::uno::UNO_QUERY;
static PHLayout pPHLayout[] = static PHLayout pPHLayout[] =
{ {
{ EPP_LAYOUT_TITLESLIDE, { 0x0d, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x10, true, true, false }, { EppLayout::TITLESLIDE, { 0x0d, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x10, true, true, false },
{ EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, true, true, false }, { EppLayout::TITLEANDBODYSLIDE, { 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, true, true, false },
{ EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x0d, 0x0e, true, true, false }, { EppLayout::TITLEANDBODYSLIDE, { 0x0d, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x0d, 0x0e, true, true, false },
{ EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x0e, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, true, true, true }, { EppLayout::TWOCOLUMNSANDTITLE, { 0x0d, 0x0e, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, true, true, true },
{ EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x0e, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x0d, 0x0e, true, true, false }, { EppLayout::TWOCOLUMNSANDTITLE, { 0x0d, 0x0e, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x0d, 0x0e, true, true, false },
{ EPP_LAYOUT_BLANCSLIDE, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, false, false, false }, { EppLayout::BLANCSLIDE, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, false, false, false },
{ EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x0e, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0d, 0x0e, true, true, false }, { EppLayout::TWOCOLUMNSANDTITLE, { 0x0d, 0x0e, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0d, 0x0e, true, true, false },
{ EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x14, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x0d, 0x0e, true, true, false }, { EppLayout::TWOCOLUMNSANDTITLE, { 0x0d, 0x14, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x0d, 0x0e, true, true, false },
{ EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x15, 0x0d, 0x0e, true, false, false }, { EppLayout::TITLEANDBODYSLIDE, { 0x0d, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x15, 0x0d, 0x0e, true, false, false },
{ EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x16, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0d, 0x0e, true, true, false }, { EppLayout::TWOCOLUMNSANDTITLE, { 0x0d, 0x16, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0d, 0x0e, true, true, false },
{ EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x0e, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, true, true, false }, { EppLayout::TWOCOLUMNSANDTITLE, { 0x0d, 0x0e, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, true, true, false },
{ EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, true, false, false }, { EppLayout::TITLEANDBODYSLIDE, { 0x0d, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, true, false, false },
{ EPP_LAYOUT_RIGHTCOLUMN2ROWS, { 0x0d, 0x0e, 0x13, 0x13, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, true, true, false }, { EppLayout::RIGHTCOLUMN2ROWS, { 0x0d, 0x0e, 0x13, 0x13, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, true, true, false },
{ EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, true, true, false }, { EppLayout::TWOCOLUMNSANDTITLE, { 0x0d, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, true, true, false },
{ EPP_LAYOUT_2ROWSANDTITLE, { 0x0d, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, true, true, false }, { EppLayout::TWOROWSANDTITLE, { 0x0d, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, true, true, false },
{ EPP_LAYOUT_LEFTCOLUMN2ROWS, { 0x0d, 0x13, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, true, true, false }, { EppLayout::LEFTCOLUMN2ROWS, { 0x0d, 0x13, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, true, true, false },
{ EPP_LAYOUT_TOPROW2COLUMN, { 0x0d, 0x13, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, true, true, false }, { EppLayout::TOPROW2COLUMN, { 0x0d, 0x13, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, true, true, false },
{ EPP_LAYOUT_2ROWSANDTITLE, { 0x0d, 0x0e, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, true, true, false }, { EppLayout::TWOROWSANDTITLE, { 0x0d, 0x0e, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, true, true, false },
{ EPP_LAYOUT_4OBJECTS, { 0x0d, 0x13, 0x13, 0x13, 0x13, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, true, false, false }, { EppLayout::FOUROBJECTS, { 0x0d, 0x13, 0x13, 0x13, 0x13, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, true, false, false },
{ EPP_LAYOUT_ONLYTITLE, { 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, true, false, false }, { EppLayout::ONLYTITLE, { 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, true, false, false },
{ EPP_LAYOUT_BLANCSLIDE, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, false, false, false }, { EppLayout::BLANCSLIDE, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, false, false, false },
{ EPP_LAYOUT_TITLERIGHT2BODIESLEFT, { 0x11, 0x12, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x11, 0x12, true, true, false }, { EppLayout::TITLERIGHT2BODIESLEFT, { 0x11, 0x12, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x11, 0x12, true, true, false },
{ EPP_LAYOUT_TITLERIGHTBODYLEFT, { 0x11, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x11, 0x12, true, true, false }, { EppLayout::TITLERIGHTBODYLEFT, { 0x11, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x11, 0x12, true, true, false },
{ EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x12, true, true, false }, { EppLayout::TITLEANDBODYSLIDE, { 0x0d, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x12, true, true, false },
{ EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x16, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0d, 0x12, true, true, false } { EppLayout::TWOCOLUMNSANDTITLE, { 0x0d, 0x16, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0d, 0x12, true, true, false }
}; };
PPTWriterBase::PPTWriterBase() PPTWriterBase::PPTWriterBase()
...@@ -471,7 +471,7 @@ PHLayout& PPTWriterBase::GetLayout( sal_Int32 nOffset ) const ...@@ -471,7 +471,7 @@ PHLayout& PPTWriterBase::GetLayout( sal_Int32 nOffset ) const
if( nOffset >= 0 && nOffset < EPP_LAYOUT_SIZE ) if( nOffset >= 0 && nOffset < EPP_LAYOUT_SIZE )
return pPHLayout[ nOffset ]; return pPHLayout[ nOffset ];
DBG(printf("asked %" SAL_PRIdINT32 " for layout outside of 0,%d array scope\n", nOffset, EPP_LAYOUT_SIZE )); DBG(printf("asked %" SAL_PRIdINT32 " for layout outside of 0,%d array scope\n", nOffset, EppLayout::SIZE ));
return pPHLayout[ 0 ]; return pPHLayout[ 0 ];
} }
......
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