rpms/openoffice.org/devel openoffice.org-2.2.1.ooo7065.sw.titlepagedialog.patch, 1.2, 1.3 openoffice.org.spec, 1.1691, 1.1692

Caolan McNamara caolanm at fedoraproject.org
Thu Nov 13 13:21:35 UTC 2008


Author: caolanm

Update of /cvs/pkgs/rpms/openoffice.org/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv24421

Modified Files:
	openoffice.org-2.2.1.ooo7065.sw.titlepagedialog.patch 
	openoffice.org.spec 
Log Message:
rhbz#248401 extend the title page dialog to create title pages at arbitrary positions

openoffice.org-2.2.1.ooo7065.sw.titlepagedialog.patch:

Index: openoffice.org-2.2.1.ooo7065.sw.titlepagedialog.patch
===================================================================
RCS file: /cvs/pkgs/rpms/openoffice.org/devel/openoffice.org-2.2.1.ooo7065.sw.titlepagedialog.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- openoffice.org-2.2.1.ooo7065.sw.titlepagedialog.patch	1 Sep 2008 12:09:08 -0000	1.2
+++ openoffice.org-2.2.1.ooo7065.sw.titlepagedialog.patch	13 Nov 2008 13:21:35 -0000	1.3
@@ -14,21 +14,6 @@
  
  #define FN_TABLE_REP                (FN_FORMAT + 99)  /* TableRepresentation */
  #define FN_CONVERT_TEXT_TABLE		(FN_FORMAT + 100)  /* Konvertierung Text <-> Tabelle */
-Index: inc/doc.hxx
-===================================================================
-RCS file: /cvs/sw/sw/inc/doc.hxx,v
-retrieving revision 1.138
-diff -u -r1.138 doc.hxx
---- openoffice.org.orig/sw/inc/doc.hxx	27 Jun 2007 13:13:17 -0000	1.138
-+++ openoffice.org/sw/inc/doc.hxx	10 Jul 2007 12:55:02 -0000
-@@ -758,6 +758,7 @@
-     virtual void setPrinter(/*[in]*/ SfxPrinter* pP,/*[in]*/ bool bDeleteOld,/*[in]*/ bool bCallPrtDataChanged );
-     virtual VirtualDevice* getVirtualDevice(/*[in]*/ bool bCreate ) const;
-     virtual void setVirtualDevice(/*[in]*/ VirtualDevice* pVd,/*[in]*/ bool bDeleteOld, /*[in]*/ bool bCallVirDevDataChanged );
-+    VirtualDevice* ConstructVirtualDevice(bool bMSO_or_PDF=0) const;
-     virtual OutputDevice* getReferenceDevice(/*[in]*/ bool bCreate ) const;
-     virtual void setReferenceDeviceType(/*[in]*/ bool bNewVirtual,/*[in]*/ bool bNewHiRes );
-     virtual const JobSetup* getJobsetup() const;
 Index: inc/globals.hrc
 ===================================================================
 RCS file: /cvs/sw/sw/inc/globals.hrc,v
@@ -318,9 +303,24 @@
      $(SLO)$/linenum.obj \
      $(SLO)$/mailmrge.obj \
      $(SLO)$/multmrk.obj \
---- /dev/null	2007-07-10 08:03:57.022658051 +0100
-+++ openoffice.org/sw/source/ui/inc/titlepage.hxx	2007-07-10 10:43:39.000000000 +0100
-@@ -0,0 +1,117 @@
+diff -ru openoffice.org/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu openoffice.org/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+--- openoffice.org.orig/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu	2007-07-10 14:35:38.000000000 +0100
++++ openoffice.org/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu	2007-07-09 12:03:44.000000000 +0100
+@@ -802,6 +802,11 @@
+                     <value xml:lang="en-US">~Page...</value>
+                 </prop>
+             </node>
++			<node oor:name=".uno:TitlePageDialog" oor:op="replace">
++				<prop oor:name="Label" oor:type="xs:string">
++					<value xml:lang="en-US">Title Page...</value>
++				</prop>
++			</node>
+ 			<node oor:name=".uno:FormatColumns" oor:op="replace">
+ 				<prop oor:name="Label" oor:type="xs:string">
+                     <value xml:lang="en-US">Co~lumns...</value>
+--- /dev/null	2008-10-28 16:28:18.200260089 +0000
++++ openoffice.org.orig/sw/source/ui/inc/titlepage.hxx	2008-11-13 12:48:59.000000000 +0000
+@@ -0,0 +1,129 @@
 +/*************************************************************************
 + *
 + *  OpenOffice.org - a multi-platform office productivity suite
@@ -401,6 +401,11 @@
 +	NumericField	aPageCountNF;
 +	FixedText	aPagePagesFT;
 +
++	FixedText	aPageStartFT;
++	RadioButton	aDocumentStartRB;
++	RadioButton	aPageStartRB;
++	NumericField	aPageStartNF;
++
 +	FixedLine	aNumberingFL;
 +	CheckBox	aRestartNumberingCB;
 +	FixedText	aRestartNumberingFT;
@@ -418,6 +423,8 @@
 +        CancelButton	aCancelPB;
 +        HelpButton	aHelpPB;
 +
++        SwWrtShell *mpSh;
++
 +	const SwFmtPageDesc *mpPageFmtDesc;
 +
 +        SwPageDesc *mpTitleDesc;
@@ -426,21 +433,26 @@
 +
 +	void FillList();
 +
++        USHORT GetInsertPosition() const;
++
 +	DECL_LINK( OKHdl, Button * );
 +	DECL_LINK( EditHdl, Button * );
 +	DECL_LINK( RestartNumberingHdl, CheckBox* );
 +	DECL_LINK( SetPageNumberHdl, CheckBox* );
 +        DECL_LINK( UpHdl, NumericField * );
 +        DECL_LINK( DownHdl, NumericField * );
++        DECL_LINK( StartPageHdl, RadioButton * );
 +public:
 +	SwTitlePageDlg( Window *pParent );
 +	~SwTitlePageDlg();
 +};
 +
 +#endif
---- /dev/null	2007-07-10 08:03:57.022658051 +0100
-+++ openoffice.org/sw/source/ui/misc/titlepage.src	2007-07-10 09:58:33.000000000 +0100
-@@ -0,0 +1,222 @@
++
++/* vi:set tabstop=4 shiftwidth=4 expandtab: */
+--- /dev/null	2008-10-28 16:28:18.200260089 +0000
++++ openoffice.org/sw/source/ui/misc/titlepage.src	2008-11-13 12:03:28.000000000 +0000
+@@ -0,0 +1,260 @@
 +/*************************************************************************
 + *
 + *  OpenOffice.org - a multi-platform office productivity suite
@@ -495,7 +507,7 @@
 +	HelpID = HID_TITLEPAGE ;
 +	OutputSize = TRUE ;
 +	SVLook = TRUE ;
-+	Size = MAP_APPFONT ( 216 , 169 ) ;
++	Size = MAP_APPFONT ( 216 , 201 ) ;
 +	Text [ en-US ] = "Title Pages" ;
 +	Moveable = TRUE ;
 +
@@ -512,7 +524,7 @@
 +		Size = MAP_APPFONT ( 150 , 10 ) ;
 +		Text [ en-US ] = "Convert existing pages to title pages" ;
 +		TabStop = TRUE ;
-+		Group = TRUE ;
++		Check = TRUE ;
 +		Text [ x-comment ] = " ";
 +	};
 +	RadioButton RB_INSERT_NEW_PAGES
@@ -539,9 +551,9 @@
 +		Repeat = TRUE ;
 +		Spin = TRUE ;
 +		Minimum = 1 ;
-+		Maximum = 1000 ;
++		Maximum = 65535;
 +		First = 1 ;
-+		Last = 1000 ;
++		Last = 65535;
 +		SpinSize = 1 ;
 +	};
 +	FixedText FT_PAGE_PAGES
@@ -551,16 +563,54 @@
 +		Text [ en-US ] = "pages" ;
 +		Text [ x-comment ] = " ";
 +	};
++	FixedText FT_PAGE_START
++	{
++		Pos = MAP_APPFONT ( 12 , 66 ) ;
++		Size = MAP_APPFONT ( 58 , 8 ) ;
++		Text [ en-US ] = "Place title pages at" ;
++		Text [ x-comment ] = " ";
++	};
++	RadioButton RB_DOCUMENT_START
++	{
++		Pos = MAP_APPFONT ( 70 , 66 ) ;
++		Size = MAP_APPFONT ( 80 , 10 ) ;
++		Text [ en-US ] = "Document Start" ;
++		TabStop = TRUE ;
++		Check = TRUE ;
++		Text [ x-comment ] = " ";
++	};
++	RadioButton RB_PAGE_START
++	{
++		Pos = MAP_APPFONT ( 70 , 78 ) ;
++		Size = MAP_APPFONT ( 30 , 10 ) ;
++		Text [ en-US ] = "Page" ;
++		Text [ x-comment ] = " ";
++	};
++	NumericField NF_PAGE_START
++	{
++		Pos = MAP_APPFONT ( 95 , 78 ) ;
++		Size = MAP_APPFONT ( 30 , 12 ) ;
++		Border = TRUE ;
++		TabStop = TRUE ;
++		Left = TRUE ;
++		Repeat = TRUE ;
++		Spin = TRUE ;
++		Minimum = 1 ;
++		Maximum = 65535;
++		First = 1 ;
++		Last = 65535;
++		SpinSize = 1 ;
++	};
 +	FixedLine FL_NUMBERING
 +	{
-+		Pos = MAP_APPFONT ( 6 , 66 ) ;
++		Pos = MAP_APPFONT ( 6 , 98 ) ;
 +		Size = MAP_APPFONT ( 204 , 8 ) ;
 +		Text [ en-US ] = "Page Numbering" ;
 +		Text [ x-comment ] = " ";
 +	};
 +	CheckBox CB_RESTART_NUMBERING
 +	{
-+		Pos = MAP_APPFONT ( 12, 79 ) ;
++		Pos = MAP_APPFONT ( 12, 111  ) ;
 +		Size = MAP_APPFONT ( 150 , 10 ) ;
 +		TabStop = TRUE ;
 +		Text [ en-US ] = "Reset Page Numbering after title pages" ;
@@ -568,14 +618,14 @@
 +	};
 +	FixedText FT_RESTART_NUMBERING
 +	{
-+		Pos = MAP_APPFONT ( 140 , 79 ) ;
++		Pos = MAP_APPFONT ( 140 , 111 ) ;
 +		Size = MAP_APPFONT ( 50 , 10 ) ;
 +		Text [ en-US ] = "Page Number" ;
 +		Text [ x-comment ] = " ";
 +	};
 +	NumericField NF_RESTART_NUMBERING
 +	{
-+		Pos = MAP_APPFONT ( 180 , 79 ) ;
++		Pos = MAP_APPFONT ( 180 , 111 ) ;
 +		Size = MAP_APPFONT ( 30 , 12 ) ;
 +		Border = TRUE ;
 +		TabStop = TRUE ;
@@ -583,14 +633,14 @@
 +		Repeat = TRUE ;
 +		Spin = TRUE ;
 +		Minimum = 1 ;
-+		Maximum = 1000 ;
++		Maximum = 65535;
 +		First = 1 ;
-+		Last = 1000 ;
++		Last = 65535;
 +		SpinSize = 1 ;
 +	};
 +	CheckBox CB_SET_PAGE_NUMBER
 +	{
-+		Pos = MAP_APPFONT ( 12 , 93 ) ;
++		Pos = MAP_APPFONT ( 12 , 125 ) ;
 +		Size = MAP_APPFONT ( 150 , 10 ) ;
 +		TabStop = TRUE ;
 +		Text [ en-US ] = "Set Page Number for first title page" ;
@@ -598,14 +648,14 @@
 +	};
 +	FixedText FT_SET_PAGE_NUMBER
 +	{
-+		Pos = MAP_APPFONT ( 140 , 93 ) ;
++		Pos = MAP_APPFONT ( 140 , 125 ) ;
 +		Size = MAP_APPFONT ( 50 , 10 ) ;
 +		Text [ en-US ] = "Page Number" ;
 +		Text [ x-comment ] = " ";
 +	};
 +	NumericField NF_SET_PAGE_NUMBER
 +	{
-+		Pos = MAP_APPFONT ( 180 , 93 ) ;
++		Pos = MAP_APPFONT ( 180 , 125 ) ;
 +		Size = MAP_APPFONT ( 30 , 12 ) ;
 +		Border = TRUE ;
 +		TabStop = TRUE ;
@@ -613,14 +663,14 @@
 +		Repeat = TRUE ;
 +		Spin = TRUE ;
 +		Minimum = 1 ;
-+		Maximum = 1000 ;
++		Maximum = 65535;
 +		First = 1 ;
-+		Last = 1000 ;
++		Last = 65535;
 +		SpinSize = 1 ;
 +	};
 +	FixedLine FL_PAGE_PROPERTIES
 +	{
-+		Pos = MAP_APPFONT ( 6 , 109 ) ;
++		Pos = MAP_APPFONT ( 6 , 141 ) ;
 +		Size = MAP_APPFONT ( 204 , 8 ) ;
 +		Text [ en-US ] = "Edit Page Properties" ;
 +		Text [ x-comment ] = " ";
@@ -628,7 +678,7 @@
 +	ListBox LB_PAGE_PROPERTIES
 +	{
 +		Border = TRUE ;
-+		Pos = MAP_APPFONT ( 12 , 122 ) ;
++		Pos = MAP_APPFONT ( 12 , 154 ) ;
 +		Size = MAP_APPFONT ( 150 , 80 ) ;
 +		TabStop = TRUE ;
 +		DropDown = TRUE ;
@@ -636,93 +686,36 @@
 +	};
 +	PushButton PB_PAGE_PROPERTIES
 +	{
-+                Pos = MAP_APPFONT ( 170 , 122 ) ;
++                Pos = MAP_APPFONT ( 170 , 154 ) ;
 +		Size = MAP_APPFONT ( 30 , 12 ) ;
 +		Text [ en-US ] = "Edit..." ;
 +	};
 +	FixedLine FL_BOTTOM
 +	{
-+		Pos = MAP_APPFONT ( 6 , 138 ) ;
++		Pos = MAP_APPFONT ( 6 , 170 ) ;
 +		Size = MAP_APPFONT ( 204 , 8 ) ;
 +	};
 +	OKButton PB_OK
 +	{
-+		Pos = MAP_APPFONT ( 54 , 149 ) ;
++		Pos = MAP_APPFONT ( 54 , 181 ) ;
 +		Size = MAP_APPFONT ( 50 , 14 ) ;
 +		DefButton = TRUE ;
 +	};
 +	CancelButton PB_CANCEL
 +	{
-+		Pos = MAP_APPFONT ( 107 , 149 ) ;
++		Pos = MAP_APPFONT ( 107 , 181 ) ;
 +		Size = MAP_APPFONT ( 50 , 14 ) ;
 +		DefButton = TRUE ;
 +	};
 +	HelpButton PB_HELP
 +	{
-+		Pos = MAP_APPFONT ( 160 , 149 ) ;
++		Pos = MAP_APPFONT ( 160 , 181 ) ;
 +		Size = MAP_APPFONT ( 50 , 14 ) ;
 +	};
 +};
---- /dev/null	2007-07-10 08:03:57.022658051 +0100
-+++ openoffice.org/sw/source/ui/misc/titlepage.hrc	2007-07-10 10:00:43.000000000 +0100
-@@ -0,0 +1,54 @@
-+/*************************************************************************
-+ *
-+ *  OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ *  $RCSfile$
-+ *
-+ *  $Revision$
-+ *
-+ *  last change: $Author$ $Date$
-+ *
-+ *  The Contents of this file are made available subject to
-+ *  the terms of GNU Lesser General Public License Version 2.1.
-+ *
-+ *
-+ *    GNU Lesser General Public License Version 2.1
-+ *    =============================================
-+ *    Copyright 2005 by Sun Microsystems, Inc.
-+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
-+ *
-+ *    This library is free software; you can redistribute it and/or
-+ *    modify it under the terms of the GNU Lesser General Public
-+ *    License version 2.1, as published by the Free Software Foundation.
-+ *
-+ *    This library is distributed in the hope that it will be useful,
-+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+ *    Lesser General Public License for more details.
-+ *
-+ *    You should have received a copy of the GNU Lesser General Public
-+ *    License along with this library; if not, write to the Free Software
-+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-+ *    MA  02111-1307  USA
-+ *
-+ ************************************************************************/
-+#define FL_MAKEINSERT         1
-+#define RB_USE_EXISTING_PAGES 2
-+#define RB_INSERT_NEW_PAGES   3
-+#define FT_PAGE_COUNT         4
-+#define NF_PAGE_COUNT         5
-+#define FT_PAGE_PAGES         6
-+#define FL_NUMBERING          7
-+#define CB_RESTART_NUMBERING  8
-+#define FT_RESTART_NUMBERING  9
-+#define NF_RESTART_NUMBERING 10
-+#define CB_SET_PAGE_NUMBER   11
-+#define FT_SET_PAGE_NUMBER   12
-+#define NF_SET_PAGE_NUMBER   13
-+#define FL_PAGE_PROPERTIES   13
-+#define LB_PAGE_PROPERTIES   14
-+#define PB_PAGE_PROPERTIES   15
-+#define FL_BOTTOM            16
-+#define PB_OK                17
-+#define PB_CANCEL            18
-+#define PB_HELP              19
---- /dev/null	2007-07-10 08:03:57.022658051 +0100
-+++ openoffice.org/sw/source/ui/misc/titlepage.cxx	2007-07-10 14:18:25.000000000 +0100
-@@ -0,0 +1,368 @@
+--- /dev/null	2008-10-28 16:28:18.200260089 +0000
++++ openoffice.org/sw/source/ui/misc/titlepage.cxx	2008-11-13 12:58:11.000000000 +0000
+@@ -0,0 +1,401 @@
 +/*************************************************************************
 + *
 + *  OpenOffice.org - a multi-platform office productivity suite
@@ -832,42 +825,43 @@
 +		return bRet;
 +	}
 +
-+        void lcl_ChangePage(SwWrtShell *pSh, USHORT nNoPages, USHORT nNewNumber, const SwPageDesc *pNewDesc)
-+	{
-+		pSh->SttDoc();
-+		FASTBOOL bAllOk = true;
-+		
-+		for (USHORT nI = 0; nI < nNoPages; ++nI)
++    bool lcl_SkipNPages(SwWrtShell *pSh, USHORT nNoPages)
++    {
++		bool bAllOk = true;
++		for (USHORT nI = 0; nI < nNoPages && bAllOk; ++nI)
 +			bAllOk = pSh->SttNxtPg();
-+		
-+		if (bAllOk);
-+		{
-+		    const USHORT nCurIdx = pSh->GetCurPageDesc();
-+		    const SwPageDesc &rCurrentDesc = pSh->GetPageDesc( nCurIdx );
++        return bAllOk;
++    }
++
++    void lcl_ChangePage(SwWrtShell *pSh, USHORT nNewNumber,
++        const SwPageDesc *pNewDesc)
++	{
++	    const USHORT nCurIdx = pSh->GetCurPageDesc();
++	    const SwPageDesc &rCurrentDesc = pSh->GetPageDesc( nCurIdx );
 +
-+		    const SwFmtPageDesc *pPageFmtDesc(0);
-+		    USHORT nDontCare;
-+		    lcl_GetPageDesc(pSh, nDontCare, &pPageFmtDesc);
-+
-+		    //If we want a new number then set it, otherwise reuse the existing one
-+		    USHORT nPgNo = nNewNumber ? nNewNumber : ( pPageFmtDesc ? pPageFmtDesc->GetNumOffset() : 0 );
-+
-+		    //If we want a new descriptior then set it, otherwise reuse the existing one
-+		    if (!pNewDesc)
-+		    {
-+			SwFmtPageDesc aPageFmtDesc(pPageFmtDesc ? *pPageFmtDesc : &rCurrentDesc);
-+			if (nPgNo) aPageFmtDesc.SetNumOffset(nPgNo);
-+			pSh->SetAttr(aPageFmtDesc);
-+		    }
-+		    else
-+		    {
-+			SwFmtPageDesc aPageFmtDesc(pNewDesc);
-+			if (nPgNo) aPageFmtDesc.SetNumOffset(nPgNo);
-+			pSh->SetAttr(aPageFmtDesc);
-+		    }
++	    const SwFmtPageDesc *pPageFmtDesc(0);
++	    USHORT nDontCare;
++	    lcl_GetPageDesc(pSh, nDontCare, &pPageFmtDesc);
++
++	    //If we want a new number then set it, otherwise reuse the existing one
++	    USHORT nPgNo = nNewNumber ?
++            nNewNumber : ( pPageFmtDesc ? pPageFmtDesc->GetNumOffset() : 0 );
++
++	    //If we want a new descriptior then set it, otherwise reuse the existing one
++	    if (!pNewDesc)
++	    {
++		    SwFmtPageDesc aPageFmtDesc(pPageFmtDesc ? *pPageFmtDesc : &rCurrentDesc);
++		    if (nPgNo) aPageFmtDesc.SetNumOffset(nPgNo);
++		    pSh->SetAttr(aPageFmtDesc);
++	    }
++	    else
++	    {
++		    SwFmtPageDesc aPageFmtDesc(pNewDesc);
++		    if (nPgNo) aPageFmtDesc.SetNumOffset(nPgNo);
++		    pSh->SetAttr(aPageFmtDesc);
++	    }
 +
-+		    delete pPageFmtDesc;
-+		}
++	    delete pPageFmtDesc;
 +	}
 +
 +	void lcl_PushCursor(SwWrtShell *pSh)
@@ -875,15 +869,22 @@
 +		pSh->LockView( TRUE );
 +		pSh->StartAllAction();
 +		pSh->SwCrsrShell::Push();
-+    		pSh->SttDoc();
 +	}
 +
 +	void lcl_PopCursor(SwWrtShell *pSh)
 +	{
 +		pSh->SwCrsrShell::Pop( FALSE );
 +		pSh->EndAllAction();
-+        	pSh->LockView( FALSE );
++        pSh->LockView( FALSE );
 +	}
++
++    USHORT lcl_GetCurrentPage(SwWrtShell *pSh)
++    {
++        String sDummy;
++        USHORT nPhyNum=1, nVirtNum=1;
++        pSh->GetPageNumber(0, true, nPhyNum, nVirtNum, sDummy);
++        return nPhyNum;
++    }
 +}
 +
 +/*
@@ -900,13 +901,21 @@
 +		aPagePropertiesLB.InsertEntry(mpIndexDesc->GetName());
 +	if (mpNormalDesc)
 +		aPagePropertiesLB.InsertEntry(mpNormalDesc->GetName());
-+        aPagePropertiesLB.SelectEntryPos(0);
++    aPagePropertiesLB.SelectEntryPos(0);
 +}
 +
 +/*--------------------------------------------------------------------
 +	Beschreibung:
 + --------------------------------------------------------------------*/
 +
++USHORT SwTitlePageDlg::GetInsertPosition() const
++{
++    USHORT nPage = 1;
++    if (aPageStartNF.IsEnabled())
++        nPage = aPageStartNF.GetValue();
++    return nPage;
++}
++
 +SwTitlePageDlg::SwTitlePageDlg( Window *pParent ) :
 +	SfxModalDialog( pParent, SW_RES(DLG_TITLEPAGE) ),
 +#pragma warning (disable : 4355)
@@ -916,6 +925,10 @@
 +	aPageCountFT		( this, SW_RES( FT_PAGE_COUNT )),
 +	aPageCountNF		( this, SW_RES( NF_PAGE_COUNT )),
 +	aPagePagesFT		( this, SW_RES( FT_PAGE_PAGES )),
++	aPageStartFT		( this, SW_RES( FT_PAGE_START )),
++	aDocumentStartRB	( this, SW_RES( RB_DOCUMENT_START )),
++	aPageStartRB		( this, SW_RES( RB_PAGE_START )),
++	aPageStartNF		( this, SW_RES( NF_PAGE_START )),
 +	aNumberingFL		( this, SW_RES( FL_NUMBERING )),
 +	aRestartNumberingCB	( this, SW_RES( CB_RESTART_NUMBERING )),
 +	aRestartNumberingFT	( this, SW_RES( FT_RESTART_NUMBERING )),
@@ -926,89 +939,96 @@
 +	aPagePropertiesFL	( this, SW_RES( FL_PAGE_PROPERTIES )),
 +	aPagePropertiesLB	( this, SW_RES( LB_PAGE_PROPERTIES )),
 +	aPagePropertiesPB	( this, SW_RES( PB_PAGE_PROPERTIES )),
-+        aBottomFL		( this, SW_RES( FL_BOTTOM )),
-+        aOkPB			( this, SW_RES( PB_OK )),
-+        aCancelPB		( this, SW_RES( PB_CANCEL )),
-+        aHelpPB			( this, SW_RES( PB_HELP )),
++    aBottomFL			( this, SW_RES( FL_BOTTOM )),
++    aOkPB				( this, SW_RES( PB_OK )),
++    aCancelPB			( this, SW_RES( PB_CANCEL )),
++    aHelpPB				( this, SW_RES( PB_HELP )),
 +	mpPageFmtDesc		(0)
 +#pragma warning (default : 4355)
 +{
 +	FreeResource();
 +
-+        aOkPB.SetClickHdl(LINK(this, SwTitlePageDlg, OKHdl));
-+        aRestartNumberingCB.SetClickHdl(LINK(this, SwTitlePageDlg, RestartNumberingHdl));
++    aOkPB.SetClickHdl(LINK(this, SwTitlePageDlg, OKHdl));
++    aRestartNumberingCB.SetClickHdl(LINK(this, SwTitlePageDlg, RestartNumberingHdl));
 +	aSetPageNumberCB.SetClickHdl(LINK(this, SwTitlePageDlg, SetPageNumberHdl));
 +
 +	USHORT nSetPage = 1;
 +	USHORT nResetPage = 1;
 +	USHORT nTitlePages = 1;
-+	SwWrtShell* pSh = ::GetActiveView()->GetWrtShellPtr();
-+	lcl_PushCursor(pSh);
++	mpSh = ::GetActiveView()->GetWrtShellPtr();
++	lcl_PushCursor(mpSh);
 +
-+	SwView& rView = pSh->GetView();
++	SwView& rView = mpSh->GetView();
 +	rView.InvalidateRulerPos();
 +
 +	bool bMaybeResetNumbering = false;
 +
-+	mpTitleDesc = pSh->GetPageDescFromPool(RES_POOLPAGE_FIRST);
-+	mpIndexDesc = pSh->GetPageDescFromPool(RES_POOLPAGE_REGISTER);
-+	mpNormalDesc = pSh->GetPageDescFromPool(RES_POOLPAGE_STANDARD);
-+
-+	if (lcl_GetPageDesc( pSh, nSetPage, &mpPageFmtDesc ))
-+	{
-+    		if (mpPageFmtDesc->GetPageDesc() == mpTitleDesc)
-+    		{
-+			while (pSh->SttNxtPg())
++	mpTitleDesc = mpSh->GetPageDescFromPool(RES_POOLPAGE_FIRST);
++	mpIndexDesc = mpSh->GetPageDescFromPool(RES_POOLPAGE_REGISTER);
++	mpNormalDesc = mpSh->GetPageDescFromPool(RES_POOLPAGE_STANDARD);
++
++    mpSh->SttDoc();
++	if (lcl_GetPageDesc( mpSh, nSetPage, &mpPageFmtDesc ))
++	{
++   		if (mpPageFmtDesc->GetPageDesc() == mpTitleDesc)
++   		{
++			while (mpSh->SttNxtPg())
 +			{
-+                               	const USHORT nCurIdx = pSh->GetCurPageDesc();
-+                               	const SwPageDesc &rPageDesc = pSh->GetPageDesc( nCurIdx );
++                const USHORT nCurIdx = mpSh->GetCurPageDesc();
++                const SwPageDesc &rPageDesc = mpSh->GetPageDesc( nCurIdx );
 +					
-+        			if (mpIndexDesc != &rPageDesc)
++                if (mpIndexDesc != &rPageDesc)
 +				{
-+					mpNormalDesc = &rPageDesc;
-+        				bMaybeResetNumbering = lcl_GetPageDesc(pSh, nResetPage, NULL);
-+       					break;
++                    mpNormalDesc = &rPageDesc;
++                    bMaybeResetNumbering = lcl_GetPageDesc(mpSh, nResetPage, NULL);
++                    break;
 +				}
 +				++nTitlePages;
 +			}
-+    			pSh->SttDoc();
-+    		}
-+        }
-+	lcl_PopCursor(pSh);
-+
-+        aUseExistingPagesRB.Check();
-+        aPageCountNF.SetValue(nTitlePages);
-+        aPageCountNF.SetUpHdl(LINK(this, SwTitlePageDlg, UpHdl));
-+        aPageCountNF.SetDownHdl(LINK(this, SwTitlePageDlg, DownHdl));
++    	}
++    }
++	lcl_PopCursor(mpSh);
++
++    aUseExistingPagesRB.Check();
++    aPageCountNF.SetValue(nTitlePages);
++    aPageCountNF.SetUpHdl(LINK(this, SwTitlePageDlg, UpHdl));
++    aPageCountNF.SetDownHdl(LINK(this, SwTitlePageDlg, DownHdl));
++
++    aDocumentStartRB.Check();
++    aPageStartNF.Enable(false);
++    aPageStartNF.SetValue(lcl_GetCurrentPage(mpSh));
++    Link aStartPageHdl = LINK(this, SwTitlePageDlg, StartPageHdl);
++    aDocumentStartRB.SetClickHdl(aStartPageHdl);
++    aPageStartRB.SetClickHdl(aStartPageHdl);
 +
 +	if (bMaybeResetNumbering && nResetPage > 0)
 +	{
-+        	aRestartNumberingCB.Check();
-+        	aRestartNumberingNF.SetValue(nResetPage);
++        aRestartNumberingCB.Check();
++        aRestartNumberingNF.SetValue(nResetPage);
 +	}
 +	aRestartNumberingNF.Enable(aRestartNumberingCB.IsChecked());
 +
-+        aSetPageNumberNF.SetValue(nSetPage);
++    aSetPageNumberNF.SetValue(nSetPage);
 +	if (nSetPage > 1)
-+        	aSetPageNumberCB.Check();
++        aSetPageNumberCB.Check();
 +	aSetPageNumberNF.Enable(aSetPageNumberCB.IsChecked());
 +
 +	FillList();
-+        aPagePropertiesPB.SetClickHdl(LINK(this, SwTitlePageDlg, EditHdl));
++    aPagePropertiesPB.SetClickHdl(LINK(this, SwTitlePageDlg, EditHdl));
 +}
 +
 +IMPL_LINK(SwTitlePageDlg, UpHdl, NumericField *, EMPTYARG)
 +{
 +	if (aPageCountNF.GetValue() == 2)
 +		FillList();
-+        return 0;
++    return 0;
 +}
 +
 +IMPL_LINK(SwTitlePageDlg, DownHdl, NumericField *, EMPTYARG)
 +{
 +	if (aPageCountNF.GetValue() == 1)
 +		FillList();
-+        return 0;
++    return 0;
 +}
 +
 +IMPL_LINK(SwTitlePageDlg, RestartNumberingHdl, CheckBox*, EMPTYARG)
@@ -1023,34 +1043,31 @@
 +    return 0;
 +}
 +
-+/*--------------------------------------------------------------------
-+	Beschreibung:
-+ --------------------------------------------------------------------*/
++IMPL_LINK(SwTitlePageDlg, StartPageHdl, RadioButton*, EMPTYARG)
++{
++    aPageStartNF.Enable(aPageStartRB.IsChecked());
++    return 0;
++}
 +
 +__EXPORT SwTitlePageDlg::~SwTitlePageDlg()
 +{
 +	delete mpPageFmtDesc;
 +}
 +
-+/*--------------------------------------------------------------------
-+	 Beschreibung:
-+ --------------------------------------------------------------------*/
-+
-+IMPL_LINK( SwTitlePageDlg, EditHdl, Button *, pBtn )
++IMPL_LINK( SwTitlePageDlg, EditHdl, Button *, /*pBtn*/ )
 +{
-+    SwWrtShell* pSh = ::GetActiveView()->GetWrtShellPtr();
-+    SwView& rView = pSh->GetView();
-+    rView.GetDocShell()->FormatPage(aPagePropertiesLB.GetSelectEntry(), false, pSh);
++    SwView& rView = mpSh->GetView();
++    rView.GetDocShell()->FormatPage(aPagePropertiesLB.GetSelectEntry(), false, mpSh);
 +    rView.InvalidateRulerPos();
 +
 +    return 0;
 +}
 +
-+IMPL_LINK( SwTitlePageDlg, OKHdl, Button *, pBtn )
++IMPL_LINK( SwTitlePageDlg, OKHdl, Button *, /*pBtn*/ )
 +{
-+    SwWrtShell* pSh = ::GetActiveView()->GetWrtShellPtr();
-+    lcl_PushCursor(pSh);
-+    pSh->StartUndo();
++    lcl_PushCursor(mpSh);
++
++    mpSh->StartUndo();
 +
 +    SwFmtPageDesc aTitleDesc(mpTitleDesc);
 +
@@ -1062,47 +1079,102 @@
 +    USHORT nNoPages = aPageCountNF.GetValue();
 +    if (!aUseExistingPagesRB.IsChecked())
 +    {
++        mpSh->GotoPage(GetInsertPosition(), false);
 +        for (USHORT nI=0; nI < nNoPages; ++nI)
-+        	pSh->InsertPageBreak();
++        	mpSh->InsertPageBreak();
 +    }
++
++    mpSh->GotoPage(GetInsertPosition(), false);
 +    for (USHORT nI=1; nI < nNoPages; ++nI)
-+        lcl_ChangePage(pSh, nI, 0, mpIndexDesc);
++    {
++        if (mpSh->SttNxtPg())
++            lcl_ChangePage(mpSh, 0, mpIndexDesc);
++    }
 +
-+    pSh->SttDoc();
-+    pSh->SetAttr(aTitleDesc);
++    mpSh->GotoPage(GetInsertPosition(), false);
++    mpSh->SetAttr(aTitleDesc);
 +
-+    if (nNoPages > 1 && pSh->GotoPage(nNoPages, false))
++    if (nNoPages > 1 && mpSh->GotoPage(GetInsertPosition() + nNoPages, false))
 +    {
-+	SwFmtPageDesc aPageFmtDesc(mpNormalDesc);
-+    	pSh->SetAttr(aPageFmtDesc);
++	    SwFmtPageDesc aPageFmtDesc(mpNormalDesc);
++    	mpSh->SetAttr(aPageFmtDesc);
 +    }
 +
 +    if (aRestartNumberingCB.IsChecked() || nNoPages > 1)
 +    {
 +        USHORT nPgNo = aRestartNumberingCB.IsChecked() ? aRestartNumberingNF.GetValue() : 0;
 +        const SwPageDesc *pNewDesc = nNoPages > 1 ? mpNormalDesc : 0;
-+        lcl_ChangePage(pSh, nNoPages, nPgNo, pNewDesc);
++        mpSh->GotoPage(GetInsertPosition() + nNoPages, false);
++        lcl_ChangePage(mpSh, nPgNo, pNewDesc);
 +    }
 +
-+    pSh->EndUndo();
-+    lcl_PopCursor(pSh);
++    mpSh->EndUndo();
++    lcl_PopCursor(mpSh);
 +    if (!aUseExistingPagesRB.IsChecked())
-+        pSh->SttDoc();
++        mpSh->GotoPage(GetInsertPosition(), false);
 +    EndDialog( RET_OK );
 +    return 0;
 +}
-diff -ru openoffice.org/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu openoffice.org/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
---- openoffice.org.orig/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu	2007-07-10 14:35:38.000000000 +0100
-+++ openoffice.org/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu	2007-07-09 12:03:44.000000000 +0100
-@@ -802,6 +802,11 @@
-                     <value xml:lang="en-US">~Page...</value>
-                 </prop>
-             </node>
-+			<node oor:name=".uno:TitlePageDialog" oor:op="replace">
-+				<prop oor:name="Label" oor:type="xs:string">
-+					<value xml:lang="en-US">Title Page...</value>
-+				</prop>
-+			</node>
- 			<node oor:name=".uno:FormatColumns" oor:op="replace">
- 				<prop oor:name="Label" oor:type="xs:string">
-                     <value xml:lang="en-US">Co~lumns...</value>
++
++/* vi:set tabstop=4 shiftwidth=4 expandtab: */
+--- /dev/null	2008-10-28 16:28:18.200260089 +0000
++++ openoffice.org/sw/source/ui/misc/titlepage.hrc	2008-11-13 10:21:32.000000000 +0000
+@@ -0,0 +1,58 @@
++/*************************************************************************
++ *
++ *  OpenOffice.org - a multi-platform office productivity suite
++ *
++ *  $RCSfile$
++ *
++ *  $Revision$
++ *
++ *  last change: $Author$ $Date$
++ *
++ *  The Contents of this file are made available subject to
++ *  the terms of GNU Lesser General Public License Version 2.1.
++ *
++ *
++ *    GNU Lesser General Public License Version 2.1
++ *    =============================================
++ *    Copyright 2005 by Sun Microsystems, Inc.
++ *    901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ *    This library is free software; you can redistribute it and/or
++ *    modify it under the terms of the GNU Lesser General Public
++ *    License version 2.1, as published by the Free Software Foundation.
++ *
++ *    This library is distributed in the hope that it will be useful,
++ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ *    Lesser General Public License for more details.
++ *
++ *    You should have received a copy of the GNU Lesser General Public
++ *    License along with this library; if not, write to the Free Software
++ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ *    MA  02111-1307  USA
++ *
++ ************************************************************************/
++#define FL_MAKEINSERT         1
++#define RB_USE_EXISTING_PAGES 2
++#define RB_INSERT_NEW_PAGES   3
++#define FT_PAGE_COUNT         4
++#define NF_PAGE_COUNT         5
++#define FT_PAGE_PAGES         6
++#define FT_PAGE_START         7
++#define RB_DOCUMENT_START     8
++#define RB_PAGE_START         9
++#define NF_PAGE_START        10
++#define FL_NUMBERING         11
++#define CB_RESTART_NUMBERING 12
++#define FT_RESTART_NUMBERING 13
++#define NF_RESTART_NUMBERING 14
++#define CB_SET_PAGE_NUMBER   15
++#define FT_SET_PAGE_NUMBER   16
++#define NF_SET_PAGE_NUMBER   17
++#define FL_PAGE_PROPERTIES   18
++#define LB_PAGE_PROPERTIES   19
++#define PB_PAGE_PROPERTIES   20
++#define FL_BOTTOM            21
++#define PB_OK                22
++#define PB_CANCEL            23
++#define PB_HELP              24


Index: openoffice.org.spec
===================================================================
RCS file: /cvs/pkgs/rpms/openoffice.org/devel/openoffice.org.spec,v
retrieving revision 1.1691
retrieving revision 1.1692
diff -u -r1.1691 -r1.1692
--- openoffice.org.spec	12 Nov 2008 14:36:31 -0000	1.1691
+++ openoffice.org.spec	13 Nov 2008 13:21:35 -0000	1.1692
@@ -3747,7 +3747,9 @@
     unopkg list --shared > /dev/null 2>&1 || :
 
 %changelog
-* Mon Nov 10 2008 Caolán McNamara <caolanm at redhat.com> - 1:3.0.0-9.10
+* Thu Nov 13 2008 Caolán McNamara <caolanm at redhat.com> - 1:3.0.0-9.10
+- rhbz#248401 extend the title page dialog to create title pages at
+  arbitrary positions
 - rhbz#470302 g_file_input_stream_query_info doesn't do anything remotely
 - window manager hatred
 




More information about the fedora-extras-commits mailing list