Re: Changing Color::IsDark() to match MS Word
Hi, I have now submitted a patch for this: https://gerrit.libreoffice.org/2601 (BTW it seems to take a while for my emails to get through due to the need for moderation - is that normal or am I doing something wrong to trigger that?) Regards, Luke. On 08/03/13 16:55, Luke Deller wrote: I am a bit shy of proposing a change to core LibreOffice code to fix a doc/docx compatibility issue, so want to ask for opinions here. fdo#61993 doc/docx auto font color inverted in LibreOffice Do you think it is the right solution to change Color::IsDark() in tools/source/generic/color.cxx to match what Microsoft Word does? Neither the OpenDocument spec nor the Office Open XML spec define what background colour should be considered dark, leaving it up to the implementation. OpenDocument v1.2 section 20.385: http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1420234_253892949 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Changing Color::IsDark() to match MS Word
Hi, I am a bit shy of proposing a changing to core LibreOffice code to fix a doc/docx compatibility issue, so want to ask for opinions here. fdo#61993 doc/docx auto font color inverted in LibreOffice Do you think it is the right solution to change Color::IsDark() in tools/source/generic/color.cxx to match what Microsoft Word does? Neither the OpenDocument spec nor the Office Open XML spec define what background colour should be considered dark, leaving it up to the implementation. OpenDocument v1.2 section 20.385: http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1420234_253892949 Regards, Luke. ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice-commits] core.git: tools/inc tools/source
tools/inc/tools/color.hxx |4 ++-- tools/source/generic/color.cxx |2 +- 2 files changed, 3 insertions(+), 3 deletions(-) New commits: commit 77e21bb36a2cdaaa0f4049dee0d45c5b2325c6e9 Author: Luke Deller l...@deller.id.au Date: Sat Mar 9 01:26:56 2013 +1100 Change definition of dark colour for fdo#61993 - Increase the threshold for dark colours from Luminosity=38 to Luminosity=60. This makes LibreOffice align more closely with MS Word when considering whether automatic font colour should be black or white, a decision that is based on whether the background colour is dark. Beware that this also affects other areas. - Fix the coefficients for GetLuminosity which appeared to be off by one according to the Rec 601 coefficients for Luma quoted at http://en.wikipedia.org/wiki/Luma_%28video%29 Change-Id: I0af1f77909713e3db5ea8ee98456146569679594 Reviewed-on: https://gerrit.libreoffice.org/2601 Reviewed-by: Fridrich Strba fridr...@documentfoundation.org Tested-by: Fridrich Strba fridr...@documentfoundation.org diff --git a/tools/inc/tools/color.hxx b/tools/inc/tools/color.hxx index 823f341..911088b 100644 --- a/tools/inc/tools/color.hxx +++ b/tools/inc/tools/color.hxx @@ -198,9 +198,9 @@ inline sal_Bool Color::IsRGBEqual( const Color rColor ) const inline sal_uInt8 Color::GetLuminance() const { -return( (sal_uInt8) ( ( COLORDATA_BLUE( mnColor ) * 28UL + +return( (sal_uInt8) ( ( COLORDATA_BLUE( mnColor ) * 29UL + COLORDATA_GREEN( mnColor ) * 151UL + -COLORDATA_RED( mnColor ) * 77UL ) 8UL ) ); +COLORDATA_RED( mnColor ) * 76UL ) 8UL ) ); } inline void Color::Merge( const Color rMergeColor, sal_uInt8 cTransparency ) diff --git a/tools/source/generic/color.cxx b/tools/source/generic/color.cxx index 33e6aff..a6a8084 100644 --- a/tools/source/generic/color.cxx +++ b/tools/source/generic/color.cxx @@ -102,7 +102,7 @@ void Color::Invert() sal_Bool Color::IsDark() const { -return GetLuminance() = 38; +return GetLuminance() = 60; } sal_Bool Color::IsBright() const ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
when to backport
Hi, Newbie developer question: what is the convention around here for backporting fixes to branches? I see that the 3.6 release plan in wiki says only important bug fixes, but what counts as important? If a fix seems moderately important to me do I just repost my patch to gerrit against the release branch (perhaps a few days after it was committed to master to let it settle), and see if the reviewer agrees it is important? What about if my fix is not burningly important, but it seems small and safe - is that something I should resubmit for a release branch too? Should all fixes be submitted to both 3.6 and 4.0 branches at this stage, or are we more selective with the former branch? Thanks, Luke. ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: when to backport
On 13/12/12 08:17, Michael Meeks wrote: ... Does that help ? Yes thanks Michael :-) Luke. ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/svdoashp.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 15bbafaaed52182e80f1a24d716a2d181cdc0e17 Author: Luke Deller l...@deller.id.au Date: Thu Apr 25 00:00:54 2013 +1000 fix fdo#60910 FILESAVE loses fontwork/shape objects This reinstates one line of code which was removed by 7fec8dfcaca4efc92516f9af51a3157f1a11ccd7. Change-Id: Ie2af33914d17a46b7118b8b804aadc0aa3bc5d90 Reviewed-on: https://gerrit.libreoffice.org/3596 Reviewed-by: Fridrich Strba fridr...@documentfoundation.org Tested-by: Fridrich Strba fridr...@documentfoundation.org diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 67bd0a5..fd0c5c8 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -3217,6 +3217,7 @@ bool SdrObjCustomShape::doConstructOrthogonal(const OUString rName) void SdrObjCustomShape::InvalidateRenderGeometry() { mXRenderedCustomShape = 0L; +mxCustomShapeEngine = 0L; SdrObject::Free( mpLastShadowGeometry ); mpLastShadowGeometry = 0L; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/svdoashp.cxx |1 - svx/source/svdraw/svdobj.cxx | 12 2 files changed, 12 insertions(+), 1 deletion(-) New commits: commit 57082b1243e86694b72c5e4fad013bf207bfe81a Author: Luke Deller l...@deller.id.au Date: Sun Apr 28 07:06:11 2013 +1000 fdo#60910: discard UNO shape object in SdrObject::SetPage The creation of the UNO shape in SdrObject::getUnoShape is influenced by pPage, so when the page changes we need to discard the cached UNO shape so that a new one will be created with the new page. This replaces my first shot at a fix for fdo#60910 which reinstated a line to discard the custom shape engine (and consequently the UNO shape) in SdrObjCustomShape::InvalidateRenderGeometry. That worked but did more discarding than was necessary. Change-Id: I665fb6f9e1563bbc4eced046f027a53991a7e45f Reviewed-on: https://gerrit.libreoffice.org/3642 Reviewed-by: David Tardon dtar...@redhat.com Tested-by: David Tardon dtar...@redhat.com diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index fd0c5c8..67bd0a5 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -3217,7 +3217,6 @@ bool SdrObjCustomShape::doConstructOrthogonal(const OUString rName) void SdrObjCustomShape::InvalidateRenderGeometry() { mXRenderedCustomShape = 0L; -mxCustomShapeEngine = 0L; SdrObject::Free( mpLastShadowGeometry ); mpLastShadowGeometry = 0L; } diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 8385b07..fca7f2a 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -568,12 +568,24 @@ SdrObjList* SdrObject::GetObjList() const void SdrObject::SetPage(SdrPage* pNewPage) { +SdrModel* pOldModel = pModel; +SdrPage* pOldPage = pPage; + pPage=pNewPage; if (pPage!=NULL) { SdrModel* pMod=pPage-GetModel(); if (pMod!=pModel pMod!=NULL) { SetModel(pMod); }} + +// The creation of the UNO shape in SdrObject::getUnoShape is influenced +// by pPage, so when the page changes we need to discard the cached UNO +// shape so that a new one will be created. +// If the page is changing to another page with the same model, we +// assume they create compatible UNO shape objects so we shouldn't have +// to invalidate. +if (pOldPage != pPage !(pOldPage pPage pOldModel == pModel)) +setUnoShape(NULL); } SdrPage* SdrObject::GetPage() const ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - svx/source
svx/source/svdraw/svdobj.cxx | 12 1 file changed, 12 insertions(+) New commits: commit 879c36b01d3f806937cfc26b90ebac89e6df87c4 Author: Luke Deller l...@deller.id.au Date: Thu Apr 25 00:00:54 2013 +1000 fdo#60910: discard UNO shape object in SdrObject::SetPage The creation of the UNO shape in SdrObject::getUnoShape is influenced by pPage, so when the page changes we need to discard the cached UNO shape so that a new one will be created with the new page. Change-Id: Id37593fe5578afe06cd967bf0b0b7d56922fe4af Reviewed-on: https://gerrit.libreoffice.org/3662 Reviewed-by: David Tardon dtar...@redhat.com Tested-by: David Tardon dtar...@redhat.com diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 35b89c0..f7045fe 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -567,12 +567,24 @@ SdrObjList* SdrObject::GetObjList() const void SdrObject::SetPage(SdrPage* pNewPage) { +SdrModel* pOldModel = pModel; +SdrPage* pOldPage = pPage; + pPage=pNewPage; if (pPage!=NULL) { SdrModel* pMod=pPage-GetModel(); if (pMod!=pModel pMod!=NULL) { SetModel(pMod); }} + +// The creation of the UNO shape in SdrObject::getUnoShape is influenced +// by pPage, so when the page changes we need to discard the cached UNO +// shape so that a new one will be created. +// If the page is changing to another page with the same model, we +// assume they create compatible UNO shape objects so we shouldn't have +// to invalidate. +if (pOldPage != pPage !(pOldPage pPage pOldModel == pModel)) +setUnoShape(NULL); } SdrPage* SdrObject::GetPage() const ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
Fixing a .doc header regression
Hi, I am new to the LibreOffice code, and am trying to fix a regression I encountered with headers in a .doc file, reported as fdo#56513 Using gdb I traced the problem back to code in wwSectionManager::GetPageULData in sw/source/filter/ww8/ww8par6.cxx. This code checks whether the first page in the section has a header with the condition: (rSection.maSep.grpfIhdt WW8_HEADER_FIRST) !=0 From experimenting with Word 2010 output, I see that this bit is set only if the first page header does not have Link to Previous selected in Word. If Link to Previous is selected (the default for sections other than the first section), then this logic breaks, and the page top margin is calculated wrongly for the first page in the section. Consequently (re)export to .doc will decide that the two page styles in this section do not match, resulting in the headers from the second page style in the section not being exported to .doc Anyone know about this, or want to review the patch I attached to that item? Thanks, Luke. ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice-commits] core.git: sw/source
sw/source/filter/ww8/writerwordglue.cxx |2 ++ sw/source/filter/ww8/wrtw8sty.cxx | 26 +- 2 files changed, 27 insertions(+), 1 deletion(-) New commits: commit 2d3d942683d1cce738eab09b58e4fd693d5e7241 Author: Luke Deller l...@deller.id.au Date: Fri May 3 00:32:22 2013 +1000 Fix style renaming confusion in ww8 filter (solves fdo#63603) - Mapping LO default style to Word Normal style for docx output used a hard coded style name, so it broke when LO's default style was renamed in 4.0 (plus it would never have worked for non-English languages) - This renaming did not cater for nameclashes, leading to fdo#63603 - Similar renaming when importing doc styles did cater for nameclashes, but had a minor bug in that Change-Id: Id23f3021c6507b474c16e93abf43ba748606ebc7 Reviewed-on: https://gerrit.libreoffice.org/3743 Reviewed-by: LuboÅ¡ LuÅák l.lu...@suse.cz Tested-by: LuboÅ¡ LuÅák l.lu...@suse.cz diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx index 8ce8bd9..7de 100644 --- a/sw/source/filter/ww8/writerwordglue.cxx +++ b/sw/source/filter/ww8/writerwordglue.cxx @@ -300,11 +300,13 @@ namespace myImplHelpers aName.InsertAscii(WW- , 0); sal_Int32 nI = 1; +String aBaseName = aName; while ( 0 != (pColl = maHelper.GetStyle(aName)) (nI SAL_MAX_INT32) ) { +aName = aBaseName; aName += OUString::number(nI++); } } diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 8397093..5e3a2c4 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -527,8 +527,32 @@ void MSWordStyles::OutputStyle( SwFmt* pFmt, sal_uInt16 nPos ) GetStyleData( pFmt, bFmtColl, nBase, nWwNext ); String aName = pFmt-GetName(); -if ( aName.EqualsAscii( Default ) ) +// We want to map LO's default style to Word's Normal style. +// Word looks for this specific style name when reading docx files. +// (It must be the English word regardless of language settings) +if ( nPos == 0 ) { +assert( pFmt-GetPoolFmtId() == RES_POOLCOLL_STANDARD ); aName = OUString(Normal); +} else if (aName.EqualsIgnoreCaseAscii(Normal)) { +// If LO has a style named Normal(!) rename it to something unique +aName.InsertAscii(LO- , 0); +String aBaseName = aName; +// Check if we still have a clash, in which case we add a suffix +for ( int nSuffix = 0; ; ++nSuffix ) { +bool clash=false; +for ( int n = 1; n nUsedSlots; ++n ) +if ( pFmtA[n] + pFmtA[n]-GetName().EqualsIgnoreCaseAscii(aName) ) +{ +clash = true; +break; +} +if (!clash) +break; +aName = aBaseName; +aName += OUString::number(++nSuffix); +} +} m_rExport.AttrOutput().StartStyle( aName, bFmtColl, nBase, nWwNext, GetWWId( *pFmt ), nPos, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
Re: Fixing a .doc header regression
Thanks for the welcome Jan and Miklos. I have been reading this list for a few weeks since starting to look at this issue, and the way you treat each other here with kindness and consideration makes this community very attractive. On Mon, Nov 05, 2012 at 04:38:21PM +0100, Jan Holesovsky wrote: Generally it is best if you send the patch[es] directly to the mailing list, with [PATCH] in the subject, that way you'll get the fastest attention. The alternative is to use gerrit, the LibreOffice review system: Thanks, done with gerrit: https://gerrit.libreoffice.org/1170 Also - can you please send a mail to the mailing list approving that your patches are licensed under LGPL and MPL, like All of my past and future contributions to LibreOffice may be licensed under the MPL / LGPLv3+ dual license. Yes all my past and future contributions to LibreOffice may be licensed under the MPL/LGPLv3+ dual license. Regards, Luke. ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice-commits] core.git: sw/source
sw/source/filter/ww8/wrtw8sty.cxx | 33 + sw/source/filter/ww8/ww8atr.cxx |2 +- 2 files changed, 18 insertions(+), 17 deletions(-) New commits: commit 532e25f8b0ef1daeca1f9f84c7084812b72841d5 Author: Luke Deller l...@deller.id.au Date: Sun Feb 10 02:19:46 2013 +1100 export different first page header/footer to doc/docx Change-Id: Iba39bf12c2419bb480e91ccb45851ec869c40e01 Reviewed-on: https://gerrit.libreoffice.org/2062 Reviewed-by: Tor Lillqvist t...@iki.fi Tested-by: Tor Lillqvist t...@iki.fi diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index f002c1f..b0e4e92 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -1525,7 +1525,6 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo rSepInfo, WW8_PdAtt sal_uInt8 nBreakCode = 2;// default neue Seite beginnen bool bOutPgDscSet = true, bLeftRightPgChain = false; const SwFrmFmt* pPdFmt = pPd-GetMaster(); -const SwFrmFmt* pPdFirstPgFmt = pPdFmt; if ( rSepInfo.pSectionFmt ) { // ist pSectionFmt gesetzt, dann gab es einen SectionNode @@ -1584,7 +1583,15 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo rSepInfo, WW8_PdAtt } } -bool titlePage = false; +// Libreoffice 4.0 introduces support for page styles (SwPageDesc) with +// a different header/footer for the first page. The same effect can be +// achieved by chaining two page styles together (SwPageDesc::GetFollow) +// which are identical except for header/footer. +// The latter method is still used by the doc/docx import filter. +// In both of these cases, we emit a single Word section with different +// first page header/footer. +const SwFrmFmt* pPdFirstPgFmt = pPd-GetFirst(); +bool titlePage = !pPd-IsFirstShared(); if ( bOutPgDscSet ) { // es ist ein Follow gesetzt und dieser zeigt nicht auf sich @@ -1600,7 +1607,7 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo rSepInfo, WW8_PdAtt { const SwPageDesc *pFollow = pPd-GetFollow(); const SwFrmFmt rFollowFmt = pFollow-GetMaster(); -if ( sw::util::IsPlausableSingleWordSection( *pPdFmt, rFollowFmt ) ) +if ( sw::util::IsPlausableSingleWordSection( *pPdFirstPgFmt, rFollowFmt ) ) { if (rSepInfo.pPDNd) pPdFirstPgFmt = pPd-GetPageFmtOfNode( *rSepInfo.pPDNd ); @@ -1629,7 +1636,7 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo rSepInfo, WW8_PdAtt AttrOutput().SectionPageBorders( pPdFmt, pPdFirstPgFmt ); const SfxPoolItem* pItem; -if ( pPdFmt != pPdFirstPgFmt SFX_ITEM_SET == +if ( titlePage SFX_ITEM_SET == pPdFirstPgFmt-GetItemState( RES_PAPER_BIN, true, pItem ) ) { pISet = pPdFirstPgFmt-GetAttrSet(); @@ -1703,20 +1710,14 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo rSepInfo, WW8_PdAtt MSWordSections::SetHeaderFlag( nHeadFootFlags, *pPdFirstPgFmt, WW8_HEADER_FIRST ); MSWordSections::SetFooterFlag( nHeadFootFlags, *pPdFirstPgFmt, WW8_FOOTER_FIRST ); } -// write other headers/footers only if it's not on the first page - I'm not quite sure -// this is technically correct, but it avoids first-page headers/footers -// extending to all pages (bnc#654230) -if( !titlePage || pPdFmt != pPdFirstPgFmt ) -{ -MSWordSections::SetHeaderFlag( nHeadFootFlags, *pPdFmt, WW8_HEADER_ODD ); -MSWordSections::SetFooterFlag( nHeadFootFlags, *pPdFmt, WW8_FOOTER_ODD ); +MSWordSections::SetHeaderFlag( nHeadFootFlags, *pPdFmt, WW8_HEADER_ODD ); +MSWordSections::SetFooterFlag( nHeadFootFlags, *pPdFmt, WW8_FOOTER_ODD ); -if ( !pPd-IsHeaderShared() || bLeftRightPgChain ) -MSWordSections::SetHeaderFlag( nHeadFootFlags, *pPdLeftFmt, WW8_HEADER_EVEN ); +if ( !pPd-IsHeaderShared() || bLeftRightPgChain ) +MSWordSections::SetHeaderFlag( nHeadFootFlags, *pPdLeftFmt, WW8_HEADER_EVEN ); -if ( !pPd-IsFooterShared() || bLeftRightPgChain ) -MSWordSections::SetFooterFlag( nHeadFootFlags, *pPdLeftFmt, WW8_FOOTER_EVEN ); -} +if ( !pPd-IsFooterShared() || bLeftRightPgChain ) +MSWordSections::SetFooterFlag( nHeadFootFlags, *pPdLeftFmt, WW8_FOOTER_EVEN ); AttrOutput().SectionWW6HeaderFooterFlags( nHeadFootFlags ); } diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 003bde1..096f012 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -364,7 +364,7 @@ bool MSWordExportBase::SetAktPageDescFromNode(const SwNode rNd) bNewPageDesc = true; else
[Libreoffice-commits] core.git: sw/source
sw/source/filter/ww8/wrtw8sty.cxx |8 -- sw/source/filter/ww8/ww8par.cxx | 113 -- sw/source/filter/ww8/ww8par.hxx |8 +- sw/source/filter/ww8/ww8par6.cxx | 98 +++- 4 files changed, 76 insertions(+), 151 deletions(-) New commits: commit 1e113cb7604e1509e7d598a9be329f1f7b6e9322 Author: Luke Deller l...@deller.id.au Date: Sun Feb 10 02:31:47 2013 +1100 import different first page header/footer from doc When a Word section has a different first page header/footer, this used to be imported into LO as a chain of two page styles. Now that LO supports a single page style with different first page header/footer we can import to that. This change also incidentally fixes fdo#57908. bnc#654230 had the same underlying problem, so the workaround committed for that (which includes comments expressing lack of understanding) has been removed. Change-Id: I6df7e9abc8f2a327a3b33e06322ca943f6f24605 Reviewed-on: https://gerrit.libreoffice.org/2065 Reviewed-by: Tor Lillqvist t...@iki.fi Tested-by: Tor Lillqvist t...@iki.fi diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index b0e4e92..3d40f4e 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -1587,7 +1587,7 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo rSepInfo, WW8_PdAtt // a different header/footer for the first page. The same effect can be // achieved by chaining two page styles together (SwPageDesc::GetFollow) // which are identical except for header/footer. -// The latter method is still used by the doc/docx import filter. +// The latter method was previously used by the doc/docx import filter. // In both of these cases, we emit a single Word section with different // first page header/footer. const SwFrmFmt* pPdFirstPgFmt = pPd-GetFirst(); @@ -1622,12 +1622,6 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo rSepInfo, WW8_PdAtt } } -// The code above tries to detect if this is first page headers/footers, -// but it doesn't work even for quite trivial testcases. As I don't actually -// understand that code, I'll keep it. The simple and (at least for me) reliable way -// to detect for first page seems to be just RES_POOLPAGE_FIRST. -if( pPd-GetPoolFmtId() == RES_POOLPAGE_FIRST ) -titlePage = true; if( titlePage ) AttrOutput().SectionTitlePage(); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index fdef14c..2659624 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -1932,27 +1932,11 @@ bool SwWW8ImplReader::HasOwnHeaderFooter(sal_uInt8 nWhichItems, sal_uInt8 grpfIh return false; } -void SwWW8ImplReader::Read_HdFt(bool bIsTitle, int nSect, -const SwPageDesc *pPrev, const wwSection rSection) +void SwWW8ImplReader::Read_HdFt(int nSect, const SwPageDesc *pPrev, +const wwSection rSection) { -sal_uInt8 nWhichItems = 0; -SwPageDesc *pPD = 0; -if (!bIsTitle) -{ -nWhichItems = -rSection.maSep.grpfIhdt ~(WW8_HEADER_FIRST | WW8_FOOTER_FIRST); -pPD = rSection.mpPage; -} -else -{ -// Always read title page header/footer data - it could be used by following sections -nWhichItems = ( WW8_HEADER_FIRST | WW8_FOOTER_FIRST ); - -pPD = rSection.mpTitlePage; -} - sal_uInt8 grpfIhdt = rSection.maSep.grpfIhdt; - +SwPageDesc *pPD = rSection.mpPage; if( pHdFt ) { @@ -1962,7 +1946,7 @@ void SwWW8ImplReader::Read_HdFt(bool bIsTitle, int nSect, for( sal_uInt8 nI = 0x20; nI; nI = 1, nNumber-- ) { -if (nI nWhichItems) +if (nI grpfIhdt) { bool bOk = true; if( bVer67 ) @@ -1975,10 +1959,14 @@ void SwWW8ImplReader::Read_HdFt(bool bIsTitle, int nSect, bool bUseLeft = (nI ( WW8_HEADER_EVEN | WW8_FOOTER_EVEN )) ? true: false; +bool bUseFirst += (nI ( WW8_HEADER_FIRST | WW8_FOOTER_FIRST )) ? true: false; bool bFooter = (nI ( WW8_FOOTER_EVEN | WW8_FOOTER_ODD | WW8_FOOTER_FIRST )) ? true: false; -SwFrmFmt rFmt = bUseLeft ? pPD-GetLeft() : pPD-GetMaster(); +SwFrmFmt rFmt = bUseLeft ? pPD-GetLeft() +: bUseFirst ? pPD-GetFirst() +: pPD-GetMaster(); SwFrmFmt* pHdFtFmt; if (bFooter) @@ -1989,6 +1977,8 @@ void SwWW8ImplReader::Read_HdFt(bool bIsTitle, int nSect, pPD-GetMaster().SetFmtAttr(SwFmtFooter(true)); if (bUseLeft) pPD-GetLeft().SetFmtAttr
Re: [PATCH] import different first page header/footer from doc
Hi Kendy, On 12/02/13 00:37, Jan Holesovsky wrote: [...] Please - do you plan to continue in this direction, like fixes of .docx and .rtf first page handling too? Or do you have any other cool changes in Writer in mind? Thanks for the encouragement Kendy. I was very glad to see Miklos' work to add first page headers for a page style into the LO core, which now aligns more closely with Word and so allows the filters to be made simpler and more reliable. Yes next I would like to add similar support to the .docx import filter. I have already started looking at the code and have bumped into a few other issues with header and section handling, so there is some fun to be had there. Kind regards, Luke. ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sw/source
sw/source/filter/ww8/ww8par6.cxx | 12 1 file changed, 8 insertions(+), 4 deletions(-) New commits: commit d2c2bd5508f331f82bb77b40587d12040752eabf Author: Luke Deller l...@deller.id.au Date: Thu Feb 14 00:04:52 2013 +1100 minimal change to fix fdo#57908 for backport wwSectionManager::GetPageULData adjusts margins and header/footer heights according to whether there is a header/footer or not. It could be confused into thinking there was no header/footer when indeed there was, in the case where a first page header/footer was inherited from a previous section which contained but did not actually show that header. Change-Id: I7258bdc7bd004ab2b7fb0ac9090256b4028030c4 Reviewed-on: https://gerrit.libreoffice.org/2137 Reviewed-by: Miklos Vajna vmik...@suse.cz Tested-by: Miklos Vajna vmik...@suse.cz diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 761a68a..691b8f7 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -1115,10 +1115,14 @@ void wwSectionManager::CreateSep(const long nTxtPos, bool /*bMustHaveBreak*/) aNewSection.maSep.grpfIhdt = ReadBSprm(pSep, eVer = ww::eWW2 ? 128 : 153, 0); else if (mrReader.pHdFt) { -aNewSection.maSep.grpfIhdt = WW8_HEADER_ODD | WW8_FOOTER_ODD; - -if (aNewSection.HasTitlePage()) -aNewSection.maSep.grpfIhdt |= WW8_HEADER_FIRST | WW8_FOOTER_FIRST; +aNewSection.maSep.grpfIhdt = WW8_HEADER_ODD | WW8_FOOTER_ODD +| WW8_HEADER_FIRST | WW8_FOOTER_FIRST; + +// It is possible for a first page header to be provided +// for this section, but not actually shown in this section. In this +// case (aNewSection.maSep.grpfIhdt WW8_HEADER_FIRST) will be nonzero +// but aNewSection.HasTitlePage() will be false. +// Likewise for first page footer. if (mrReader.pWDop-fFacingPages) aNewSection.maSep.grpfIhdt |= WW8_HEADER_EVEN | WW8_FOOTER_EVEN; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source
sw/source/filter/xml/xmltbli.cxx | 26 ++ 1 file changed, 6 insertions(+), 20 deletions(-) New commits: commit 1834009c19946ab47de343deb97cbc50475fb96a Author: Luke Deller l...@deller.id.au Date: Thu May 23 02:05:36 2013 +1000 fix fdo#64872 infinite loop saving as doc When loading from odt, table cells which are covered (due to merging of cells) are replaced with an empty cell by SwXMLTableContext::ReplaceWithEmptyCell. However if there is a sequence of cells covered from above then their replacements are accidentally inserted in reverse order, which produces this infinite loop problem when saving as doc. The reverse ordering in SwXMLTableContext::ReplaceWithEmptyCell was because the insert position came from SwXMLTableContext::GetPrevStartNode which was very careful to skip previous covered cells. However those cells have already been replaced with an empty cell so they should not be skipped. Change-Id: I6a022cd1490afa181dbc3e4b2d6ed4af3077b363 Reviewed-on: https://gerrit.libreoffice.org/4028 Reviewed-by: David Tardon dtar...@redhat.com Tested-by: David Tardon dtar...@redhat.com diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index 5a367cd..617faf4 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -1804,29 +1804,15 @@ const SwStartNode *SwXMLTableContext::GetPrevStartNode( sal_uInt32 nRow, // The last cell is the right one here. pPrevCell = GetCell( pRows-size()-1U, GetColumnCount()-1UL ); } -else if( 0UL == nRow ) +else if( nCol 0UL ) { -// There are no vertically merged cells within the first row, so the -// previous cell is the right one always. -if( nCol 0UL ) -pPrevCell = GetCell( nRow, nCol-1UL ); +// The previous cell in this row. +pPrevCell = GetCell( nRow, nCol-1UL ); } -else +else if( nRow 0UL ) { -// If there is a previous cell in the current row that is not spanned -// from the previous row, its the right one. -const SwXMLTableRow_Impl *pPrevRow = (*pRows)[(sal_uInt16)nRow-1U]; -sal_uInt32 i = nCol; -while( !pPrevCell i 0UL ) -{ -i--; -if( 1UL == pPrevRow-GetCell( i )-GetRowSpan() ) -pPrevCell = GetCell( nRow, i ); -} - -// Otherwise, the last cell from the previous row is the right one. -if( !pPrevCell ) -pPrevCell = pPrevRow-GetCell( GetColumnCount()-1UL ); +// The last cell from the previous row. +pPrevCell = GetCell( nRow-1UL, GetColumnCount()-1UL ); } const SwStartNode *pSttNd = 0; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sw/source
sw/source/filter/ww8/writerwordglue.cxx |2 ++ sw/source/filter/ww8/wrtw8sty.cxx | 28 ++-- 2 files changed, 28 insertions(+), 2 deletions(-) New commits: commit d414e84c438f0b0dd935d1ba1d351f7af27d49a8 Author: Luke Deller l...@deller.id.au Date: Fri May 3 00:32:22 2013 +1000 Fix style renaming confusion in ww8 filter (solves fdo#63603) (cherry pick my fix from master 2d3d942683d1cce738eab09b58e4fd693d5e7241) - Mapping LO default style to Word Normal style for docx output used a hard coded style name, so it broke when LO's default style was renamed in 4.0 (plus it would never have worked for non-English languages) - This renaming did not cater for nameclashes, leading to fdo#63603 - Similar renaming when importing doc styles did cater for nameclashes, but had a minor bug in that Change-Id: Icd4f27fb1760f0c1ca068c742c48ebcd71d1eb15 Reviewed-on: https://gerrit.libreoffice.org/4039 Reviewed-by: LuboÅ¡ LuÅák l.lu...@suse.cz Tested-by: LuboÅ¡ LuÅák l.lu...@suse.cz diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx index 12e9a1c..663e1e1 100644 --- a/sw/source/filter/ww8/writerwordglue.cxx +++ b/sw/source/filter/ww8/writerwordglue.cxx @@ -296,11 +296,13 @@ namespace myImplHelpers aName.InsertAscii(WW- , 0); sal_Int32 nI = 1; +String aBaseName = aName; while ( 0 != (pColl = maHelper.GetStyle(aName)) (nI SAL_MAX_INT32) ) { +aName = aBaseName; aName += String::CreateFromInt32(nI++); } } diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index d837181..b0371ff 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -526,8 +526,32 @@ void MSWordStyles::OutputStyle( SwFmt* pFmt, sal_uInt16 nPos ) GetStyleData( pFmt, bFmtColl, nBase, nWwNext ); String aName = pFmt-GetName(); -if ( aName.EqualsAscii( Default ) ) -aName = rtl::OUString(Normal); +// We want to map LO's default style to Word's Normal style. +// Word looks for this specific style name when reading docx files. +// (It must be the English word regardless of language settings) +if ( nPos == 0 ) { +assert( pFmt-GetPoolFmtId() == RES_POOLCOLL_STANDARD ); +aName = OUString(Normal); +} else if (aName.EqualsIgnoreCaseAscii(Normal)) { +// If LO has a style named Normal(!) rename it to something unique +aName.InsertAscii(LO- , 0); +String aBaseName = aName; +// Check if we still have a clash, in which case we add a suffix +for ( int nSuffix = 0; ; ++nSuffix ) { +bool clash=false; +for ( int n = 1; n nUsedSlots; ++n ) +if ( pFmtA[n] + pFmtA[n]-GetName().EqualsIgnoreCaseAscii(aName) ) +{ +clash = true; +break; +} +if (!clash) +break; +aName = aBaseName; +aName += OUString::number(++nSuffix); +} +} m_rExport.AttrOutput().StartStyle( aName, bFmtColl, nBase, nWwNext, GetWWId( *pFmt ), nPos, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/source
sw/source/filter/xml/xmltbli.cxx | 26 ++ 1 file changed, 6 insertions(+), 20 deletions(-) New commits: commit e94c8521041259d36aaadcadb9e42ca729a3812b Author: Luke Deller l...@deller.id.au Date: Thu May 23 02:05:36 2013 +1000 fix fdo#64872 infinite loop saving as doc When loading from odt, table cells which are covered (due to merging of cells) are replaced with an empty cell by SwXMLTableContext::ReplaceWithEmptyCell. However if there is a sequence of cells covered from above then their replacements are accidentally inserted in reverse order, which produces this infinite loop problem when saving as doc. The reverse ordering in SwXMLTableContext::ReplaceWithEmptyCell was because the insert position came from SwXMLTableContext::GetPrevStartNode which was very careful to skip previous covered cells. However those cells have already been replaced with an empty cell so they should not be skipped. Change-Id: I6a022cd1490afa181dbc3e4b2d6ed4af3077b363 Reviewed-on: https://gerrit.libreoffice.org/4008 Reviewed-by: David Tardon dtar...@redhat.com Tested-by: David Tardon dtar...@redhat.com diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index 9cc801f..e0a214f 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -1804,29 +1804,15 @@ const SwStartNode *SwXMLTableContext::GetPrevStartNode( sal_uInt32 nRow, // The last cell is the right one here. pPrevCell = GetCell( pRows-size()-1U, GetColumnCount()-1UL ); } -else if( 0UL == nRow ) +else if( nCol 0UL ) { -// There are no vertically merged cells within the first row, so the -// previous cell is the right one always. -if( nCol 0UL ) -pPrevCell = GetCell( nRow, nCol-1UL ); +// The previous cell in this row. +pPrevCell = GetCell( nRow, nCol-1UL ); } -else +else if( nRow 0UL ) { -// If there is a previous cell in the current row that is not spanned -// from the previous row, its the right one. -const SwXMLTableRow_Impl *pPrevRow = (*pRows)[(sal_uInt16)nRow-1U]; -sal_uInt32 i = nCol; -while( !pPrevCell i 0UL ) -{ -i--; -if( 1UL == pPrevRow-GetCell( i )-GetRowSpan() ) -pPrevCell = GetCell( nRow, i ); -} - -// Otherwise, the last cell from the previous row is the right one. -if( !pPrevCell ) -pPrevCell = pPrevRow-GetCell( GetColumnCount()-1UL ); +// The last cell from the previous row. +pPrevCell = GetCell( nRow-1UL, GetColumnCount()-1UL ); } const SwStartNode *pSttNd = 0; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sw/source
sw/source/filter/ww8/wrtw8sty.cxx |2 +- sw/source/filter/xml/xmltbli.cxx | 26 ++ 2 files changed, 7 insertions(+), 21 deletions(-) New commits: commit b571605129426a1bf8eb7c9e9927785f8a9a5305 Author: Luke Deller l...@deller.id.au Date: Thu May 23 02:05:36 2013 +1000 fix fdo#64872 infinite loop saving as doc When loading from odt, table cells which are covered (due to merging of cells) are replaced with an empty cell by SwXMLTableContext::ReplaceWithEmptyCell. However if there is a sequence of cells covered from above then their replacements are accidentally inserted in reverse order, which produces this infinite loop problem when saving as doc. The reverse ordering in SwXMLTableContext::ReplaceWithEmptyCell was because the insert position came from SwXMLTableContext::GetPrevStartNode which was very careful to skip previous covered cells. However those cells have already been replaced with an empty cell so they should not be skipped. Change-Id: I6a022cd1490afa181dbc3e4b2d6ed4af3077b363 Signed-off-by: Miklos Vajna vmik...@suse.cz diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 36ee09b..f5370ea 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -531,7 +531,7 @@ void MSWordStyles::OutputStyle( SwFmt* pFmt, sal_uInt16 nPos ) // (It must be the English word regardless of language settings) if ( nPos == 0 ) { assert( pFmt-GetPoolFmtId() == RES_POOLCOLL_STANDARD ); -aName = OUString(Normal); +aName = rtl::OUString(Normal); } else if (aName.EqualsIgnoreCaseAscii(Normal)) { // If LO has a style named Normal(!) rename it to something unique aName.InsertAscii(LO- , 0); diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index 6cd2cdc..50d5e99 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -1807,29 +1807,15 @@ const SwStartNode *SwXMLTableContext::GetPrevStartNode( sal_uInt32 nRow, // The last cell is the right one here. pPrevCell = GetCell( pRows-size()-1U, GetColumnCount()-1UL ); } -else if( 0UL == nRow ) +else if( nCol 0UL ) { -// There are no vertically merged cells within the first row, so the -// previous cell is the right one always. -if( nCol 0UL ) -pPrevCell = GetCell( nRow, nCol-1UL ); +// The previous cell in this row. +pPrevCell = GetCell( nRow, nCol-1UL ); } -else +else if( nRow 0UL ) { -// If there is a previous cell in the current row that is not spanned -// from the previous row, its the right one. -const SwXMLTableRow_Impl *pPrevRow = (*pRows)[(sal_uInt16)nRow-1U]; -sal_uInt32 i = nCol; -while( !pPrevCell i 0UL ) -{ -i--; -if( 1UL == pPrevRow-GetCell( i )-GetRowSpan() ) -pPrevCell = GetCell( nRow, i ); -} - -// Otherwise, the last cell from the previous row is the right one. -if( !pPrevCell ) -pPrevCell = pPrevRow-GetCell( GetColumnCount()-1UL ); +// The last cell from the previous row. +pPrevCell = GetCell( nRow-1UL, GetColumnCount()-1UL ); } const SwStartNode *pSttNd = 0; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - sw/source
sw/source/filter/ww8/wrtw8sty.cxx |6 -- sw/source/filter/ww8/ww8par.cxx | 113 -- sw/source/filter/ww8/ww8par.hxx |8 +- sw/source/filter/ww8/ww8par6.cxx | 88 + 4 files changed, 68 insertions(+), 147 deletions(-) New commits: commit 4b1ec8ce97d465b409f98c200b865c851844a3c7 Author: Luke Deller l...@deller.id.au Date: Sun Feb 10 02:31:47 2013 +1100 import different first page header/footer from doc When a Word section has a different first page header/footer, this used to be imported into LO as a chain of two page styles. Now that LO supports a single page style with different first page header/footer we can import to that. This change also incidentally fixes fdo#57908. bnc#654230 had the same underlying problem, so the workaround committed for that (which includes comments expressing lack of understanding) has been removed. Reviewed-on: https://gerrit.libreoffice.org/2065 Reviewed-by: Tor Lillqvist t...@iki.fi Tested-by: Tor Lillqvist t...@iki.fi Signed-off-by: LuboÅ¡ LuÅák l.lu...@suse.cz Conflicts: sw/source/filter/ww8/wrtw8sty.cxx Change-Id: I6df7e9abc8f2a327a3b33e06322ca943f6f24605 diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index d837181..4c0c50f 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -1615,12 +1615,6 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo rSepInfo, WW8_PdAtt } } -// The code above tries to detect if this is first page headers/footers, -// but it doesn't work even for quite trivial testcases. As I don't actually -// understand that code, I'll keep it. The simple and (at least for me) reliable way -// to detect for first page seems to be just RES_POOLPAGE_FIRST. -if( pPd-GetPoolFmtId() == RES_POOLPAGE_FIRST ) -titlePage = true; if( titlePage ) AttrOutput().SectionTitlePage(); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 57ca4f5..2ff0fa7 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -1910,27 +1910,11 @@ bool SwWW8ImplReader::HasOwnHeaderFooter(sal_uInt8 nWhichItems, sal_uInt8 grpfIh return false; } -void SwWW8ImplReader::Read_HdFt(bool bIsTitle, int nSect, -const SwPageDesc *pPrev, const wwSection rSection) +void SwWW8ImplReader::Read_HdFt(int nSect, const SwPageDesc *pPrev, +const wwSection rSection) { -sal_uInt8 nWhichItems = 0; -SwPageDesc *pPD = 0; -if (!bIsTitle) -{ -nWhichItems = -rSection.maSep.grpfIhdt ~(WW8_HEADER_FIRST | WW8_FOOTER_FIRST); -pPD = rSection.mpPage; -} -else -{ -// Always read title page header/footer data - it could be used by following sections -nWhichItems = ( WW8_HEADER_FIRST | WW8_FOOTER_FIRST ); - -pPD = rSection.mpTitlePage; -} - sal_uInt8 grpfIhdt = rSection.maSep.grpfIhdt; - +SwPageDesc *pPD = rSection.mpPage; if( pHdFt ) { @@ -1940,7 +1924,7 @@ void SwWW8ImplReader::Read_HdFt(bool bIsTitle, int nSect, for( sal_uInt8 nI = 0x20; nI; nI = 1, nNumber-- ) { -if (nI nWhichItems) +if (nI grpfIhdt) { bool bOk = true; if( bVer67 ) @@ -1953,10 +1937,14 @@ void SwWW8ImplReader::Read_HdFt(bool bIsTitle, int nSect, bool bUseLeft = (nI ( WW8_HEADER_EVEN | WW8_FOOTER_EVEN )) ? true: false; +bool bUseFirst += (nI ( WW8_HEADER_FIRST | WW8_FOOTER_FIRST )) ? true: false; bool bFooter = (nI ( WW8_FOOTER_EVEN | WW8_FOOTER_ODD | WW8_FOOTER_FIRST )) ? true: false; -SwFrmFmt rFmt = bUseLeft ? pPD-GetLeft() : pPD-GetMaster(); +SwFrmFmt rFmt = bUseLeft ? pPD-GetLeft() +: bUseFirst ? pPD-GetFirst() +: pPD-GetMaster(); SwFrmFmt* pHdFtFmt; if (bFooter) @@ -1967,6 +1955,8 @@ void SwWW8ImplReader::Read_HdFt(bool bIsTitle, int nSect, pPD-GetMaster().SetFmtAttr(SwFmtFooter(true)); if (bUseLeft) pPD-GetLeft().SetFmtAttr(SwFmtFooter(true)); +if (bUseFirst) +pPD-GetFirst().SetFmtAttr(SwFmtFooter(true)); pHdFtFmt = const_castSwFrmFmt*(rFmt.GetFooter().GetFooterFmt()); } else @@ -1977,6 +1967,8 @@ void SwWW8ImplReader::Read_HdFt(bool bIsTitle, int nSect, pPD-GetMaster().SetFmtAttr(SwFmtHeader(true)); if (bUseLeft) pPD-GetLeft().SetFmtAttr(SwFmtHeader(true
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/docvw/HeaderFooterWin.cxx | 17 ++-- sw/source/uibase/docvw/docvw.hrc |8 ++- sw/source/uibase/docvw/docvw.src | 30 + 3 files changed, 52 insertions(+), 3 deletions(-) New commits: commit 7ec3da8bb6c82d78f4bfaa69c7c91d6fc99dfad4 Author: Luke Deller l...@deller.id.au Date: Fri Jul 11 22:39:34 2014 +1000 Improve header/footer UI label (fdo#81227) Indicate whether the header/footer being edited is only for the first page, left pages, or right pages if applicable. Change-Id: Ia38289503d0bae6cc6cef5917a47d5d25ca0f712 Reviewed-on: https://gerrit.libreoffice.org/10235 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx index 17d95ff..d16fb4e 100644 --- a/sw/source/uibase/docvw/HeaderFooterWin.cxx +++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx @@ -181,11 +181,24 @@ const SwPageFrm* SwHeaderFooterWin::GetPageFrame( ) void SwHeaderFooterWin::SetOffset( Point aOffset, long nXLineStart, long nXLineEnd ) { // Compute the text to show +const SwPageDesc* pDesc = GetPageFrame()-GetPageDesc(); +bool bIsFirst = !pDesc-IsFirstShared() GetPageFrame()-OnFirstPage(); +bool bIsLeft = !pDesc-IsHeaderShared() !GetPageFrame()-OnRightPage(); +bool bIsRight = !pDesc-IsHeaderShared() GetPageFrame()-OnRightPage(); m_sLabel = SW_RESSTR( STR_HEADER_TITLE ); if ( !m_bIsHeader ) -m_sLabel = SW_RESSTR( STR_FOOTER_TITLE ); +m_sLabel = bIsFirst ? SW_RESSTR( STR_FIRST_FOOTER_TITLE ) +: bIsLeft ? SW_RESSTR( STR_LEFT_FOOTER_TITLE ) +: bIsRight ? SW_RESSTR( STR_RIGHT_FOOTER_TITLE ) +: SW_RESSTR( STR_FOOTER_TITLE ); +else +m_sLabel = bIsFirst ? SW_RESSTR( STR_FIRST_HEADER_TITLE ) +: bIsLeft ? SW_RESSTR( STR_LEFT_HEADER_TITLE ) +: bIsRight ? SW_RESSTR( STR_RIGHT_HEADER_TITLE ) +: SW_RESSTR( STR_HEADER_TITLE ); + sal_Int32 nPos = m_sLabel.lastIndexOf( %1 ); -m_sLabel = m_sLabel.replaceAt( nPos, 2, GetPageFrame()-GetPageDesc()-GetName() ); +m_sLabel = m_sLabel.replaceAt( nPos, 2, pDesc-GetName() ); // Compute the text size and get the box position size from it Rectangle aTextRect; diff --git a/sw/source/uibase/docvw/docvw.hrc b/sw/source/uibase/docvw/docvw.hrc index 3347b18..35cd1cd 100644 --- a/sw/source/uibase/docvw/docvw.hrc +++ b/sw/source/uibase/docvw/docvw.hrc @@ -77,8 +77,14 @@ #define STR_FORMAT_HEADER (RC_DOCVW_BEGIN + 25) #define STR_DELETE_FOOTER (RC_DOCVW_BEGIN + 26) #define STR_FORMAT_FOOTER (RC_DOCVW_BEGIN + 27) +#define STR_FIRST_HEADER_TITLE (RC_DOCVW_BEGIN + 28) +#define STR_LEFT_HEADER_TITLE (RC_DOCVW_BEGIN + 29) +#define STR_RIGHT_HEADER_TITLE (RC_DOCVW_BEGIN + 30) +#define STR_FIRST_FOOTER_TITLE (RC_DOCVW_BEGIN + 31) +#define STR_LEFT_FOOTER_TITLE (RC_DOCVW_BEGIN + 32) +#define STR_RIGHT_FOOTER_TITLE (RC_DOCVW_BEGIN + 33) -#define DOCVW_ACT_END STR_SMARTTAG_CLICK +#define DOCVW_ACT_END STR_RIGHT_FOOTER_TITLE #if DOCVW_ACT_END RC_DOCVW_END #error Resource-Id Ueberlauf in #file, #line diff --git a/sw/source/uibase/docvw/docvw.src b/sw/source/uibase/docvw/docvw.src index ff10f36..71654f2 100644 --- a/sw/source/uibase/docvw/docvw.src +++ b/sw/source/uibase/docvw/docvw.src @@ -279,11 +279,41 @@ String STR_HEADER_TITLE Text [ en-US ] = Header (%1) ; }; +String STR_FIRST_HEADER_TITLE +{ +Text [ en-US ] = First Page Header (%1) ; +}; + +String STR_LEFT_HEADER_TITLE +{ +Text [ en-US ] = Left Page Header (%1) ; +}; + +String STR_RIGHT_HEADER_TITLE +{ +Text [ en-US ] = Right Page Header (%1) ; +}; + String STR_FOOTER_TITLE { Text [ en-US ] = Footer (%1) ; }; +String STR_FIRST_FOOTER_TITLE +{ +Text [ en-US ] = First Page Footer (%1) ; +}; + +String STR_LEFT_FOOTER_TITLE +{ +Text [ en-US ] = Left Page Footer (%1) ; +}; + +String STR_RIGHT_FOOTER_TITLE +{ +Text [ en-US ] = Right Page Footer (%1) ; +}; + String STR_DELETE_HEADER { Text [ en-US ] = Delete Header... ; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/first-header-footer.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 31 +- writerfilter/source/dmapper/DomainMapper_Impl.cxx |4 - writerfilter/source/dmapper/PropertyMap.cxx| 52 +++-- 4 files changed, 44 insertions(+), 43 deletions(-) New commits: commit b4ccde72b8e2e45e7276d5b08b182495a1b1a617 Author: Luke Deller l...@deller.id.au Date: Sat Jul 12 21:49:50 2014 +1000 Copy first-header-footer test from ww8 to ooxml The test document was converted from doc to docx using MS Word 2010. Several fixes were required to make this test pass: - Do not clear the FirstIsShared property on page styles, as the code instead uses the old fashioned method of translating a Word section with different first page header/footer: two page styles linked together, the first page style and the follow page style. (Also remove a wrong test case which checks the FirstIsShared property) - Do not clear the HeaderIsShared/FooterIsShared properties on the first page style, only on the follow page style. - Actually set the FollowStyle property on the first page style to link it to the follow page style. This didn't matter for the very first Word section because it was mapped to the default page styles First Page and Standard which are already linked, but it does matter for subsequent Word sections. - For some reason setting a new page style at a section break was excluded in the case where the following section had a title page. Remove this exclusion. - The exclusion mentioned in the last point was masking that bnc#751077 was not entirely fixed. To resolve that issue: When checking if the last paragraph of the section is empty, consider not just text content but also shapes. - Remove a workaround for bnc#780843 involving copying of headers and footers from the Standard (first section) page style in the case where the following section had a title page. This workaround is no longer needed as the test case passes without it. Change-Id: Iacc9bba0720c11414da3e852892cff301ebbc4fe diff --git a/sw/qa/extras/ooxmlexport/data/first-header-footer.docx b/sw/qa/extras/ooxmlexport/data/first-header-footer.docx new file mode 100755 index 000..d18eea5 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/first-header-footer.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index eac281a..1fdc15e 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -894,8 +894,14 @@ DECLARE_OOXMLEXPORT_TEST(testPageBorderSpacingExportCase2, page-borders-export- DECLARE_OOXMLEXPORT_TEST(testFdo66145, fdo66145.docx) { // The Writer ignored the 'First Is Shared' flag -uno::Referencebeans::XPropertySet xPropertySet(getStyles(PageStyles)-getByName(First Page), uno::UNO_QUERY); -CPPUNIT_ASSERT_EQUAL(false, bool(getPropertysal_Bool(xPropertySet, FirstIsShared))); +CPPUNIT_ASSERT_EQUAL(OUString(This is the FIRST page header.), +parseDump(/root/page[1]/header/txt/text())); +CPPUNIT_ASSERT_EQUAL( +OUString(This is the header for the REST OF THE FILE.), +parseDump(/root/page[2]/header/txt/text())); +CPPUNIT_ASSERT_EQUAL( +OUString(This is the header for the REST OF THE FILE.), +parseDump(/root/page[3]/header/txt/text())); } DECLARE_OOXMLEXPORT_TEST(testGrabBag, grabbag.docx) @@ -3430,6 +3436,27 @@ DECLARE_OOXMLEXPORT_TEST(testFdo80902, fdo80902.docx) assertXPath(pXmlDoc, /w:document/w:body/w:sectPr/w:docGrid, type, lines); } +DECLARE_OOXMLEXPORT_TEST(testFirstHeaderFooter, first-header-footer.docx) +{ +// Test import and export of a section's headerf/footerf properties. +// (copied from a ww8export test, with doc converted to docx using Word) + +// The document has 6 pages. Note that we don't test if 4 or just 2 page +// styles are created, the point is that layout should be correct. +CPPUNIT_ASSERT_EQUAL(OUString(First page header), parseDump(/root/page[1]/header/txt/text())); +CPPUNIT_ASSERT_EQUAL(OUString(First page footer), parseDump(/root/page[1]/footer/txt/text())); +CPPUNIT_ASSERT_EQUAL(OUString(Even page header), parseDump(/root/page[2]/header/txt/text())); +CPPUNIT_ASSERT_EQUAL(OUString(Even page footer), parseDump(/root/page[2]/footer/txt/text())); +CPPUNIT_ASSERT_EQUAL(OUString(Odd page header), parseDump(/root/page[3]/header/txt/text())); +CPPUNIT_ASSERT_EQUAL(OUString(Odd page footer), parseDump(/root/page[3]/footer/txt/text())); +CPPUNIT_ASSERT_EQUAL(OUString(First page header2), parseDump(/root/page[4]/header/txt/text())); +CPPUNIT_ASSERT_EQUAL(OUString(First page footer 2), parseDump(/root/page[4]/footer/txt
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/ww8import/data/fdo77844.doc |binary sw/qa/extras/ww8import/ww8import.cxx | 47 +++ sw/source/filter/ww8/ww8par.cxx | 15 - 3 files changed, 60 insertions(+), 2 deletions(-) New commits: commit f312ef98de57a5926be67421395544bb9d41b809 Author: Luke Deller l...@deller.id.au Date: Sun Jul 6 23:19:18 2014 +1000 fix fdo#77844: header wrongly enabled from .doc The LO page style needs page headers to be turned on if the corresponding .doc file section has a left (=even) page header or a first page header. However this should not be triggered in the case where a first page header is present but hidden due to the different first page header option being disabled. This case is fixed by this commit. Change-Id: If3de0df45378587fdbdecc6a091d2f4b60940b43 Reviewed-on: https://gerrit.libreoffice.org/10100 Reviewed-by: Michael Stahl mst...@redhat.com Tested-by: Michael Stahl mst...@redhat.com diff --git a/sw/qa/extras/ww8import/data/fdo77844.doc b/sw/qa/extras/ww8import/data/fdo77844.doc new file mode 100755 index 000..cd7368d Binary files /dev/null and b/sw/qa/extras/ww8import/data/fdo77844.doc differ diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx index 270d665..147fb88 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -415,6 +415,53 @@ DECLARE_WW8IMPORT_TEST(testBnc875715, bnc875715.doc) CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getPropertysal_Int32(xSections-getByIndex(0), SectionLeftMargin)); } +DECLARE_WW8IMPORT_TEST(testFdo77844, fdo77844.doc) +{ +uno::Referencecontainer::XNameAccess pageStyles = getStyles(PageStyles); + +// get a page cursor +uno::Referenceframe::XModel xModel(mxComponent, uno::UNO_QUERY); +uno::Referencetext::XTextViewCursorSupplier xTextViewCursorSupplier( +xModel-getCurrentController(), uno::UNO_QUERY); +uno::Referencetext::XPageCursor xCursor( +xTextViewCursorSupplier-getViewCursor(), uno::UNO_QUERY); + +// check that the first page has no header +xCursor-jumpToFirstPage(); +OUString pageStyleName = getPropertyOUString(xCursor, PageStyleName); +uno::Referencestyle::XStyle pageStyle( +pageStyles-getByName(pageStyleName), uno::UNO_QUERY); +bool headerIsOn = getPropertybool(pageStyle, HeaderIsOn); +CPPUNIT_ASSERT(!headerIsOn); + +// check that the second page has a header +xCursor-jumpToPage(2); +pageStyleName = getPropertyOUString(xCursor, PageStyleName); +pageStyle.set( +pageStyles-getByName(pageStyleName), uno::UNO_QUERY); +headerIsOn = getPropertybool(pageStyle, HeaderIsOn); +CPPUNIT_ASSERT(headerIsOn); + +// check that the third page has a header +xCursor-jumpToPage(3); +pageStyleName = getPropertyOUString(xCursor, PageStyleName); +pageStyle.set( +pageStyles-getByName(pageStyleName), uno::UNO_QUERY); +headerIsOn = getPropertybool(pageStyle, HeaderIsOn); +CPPUNIT_ASSERT(headerIsOn); + +// check that the fourth page has no header +// (#if'd out as this is not yet imported correctly) +#if 0 +xCursor-jumpToPage(4); +pageStyleName = getPropertyOUString(xCursor, PageStyleName); +pageStyle.set( +pageStyles-getByName(pageStyleName), uno::UNO_QUERY); +headerIsOn = getPropertybool(pageStyle, HeaderIsOn); +CPPUNIT_ASSERT(!headerIsOn); +#endif +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 9408e2c..885cf12 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -2378,6 +2378,9 @@ void SwWW8ImplReader::Read_HdFt(int nSect, const SwPageDesc *pPrev, long nLen; sal_uInt8 nNumber = 5; +// This loops through the 6 flags WW8_{FOOTER,HEADER}_{ODD,EVEN,FIRST} +// corresponding to bit fields in grpfIhdt indicating which +// header/footer(s) are present in this section for( sal_uInt8 nI = 0x20; nI; nI = 1, nNumber-- ) { if (nI grpfIhdt) @@ -2395,6 +2398,12 @@ void SwWW8ImplReader::Read_HdFt(int nSect, const SwPageDesc *pPrev, = (nI ( WW8_HEADER_EVEN | WW8_FOOTER_EVEN )) ? true: false; bool bUseFirst = (nI ( WW8_HEADER_FIRST | WW8_FOOTER_FIRST )) ? true: false; + +// If we are loading a first-page header/footer which is not +// actually enabled in this section (it still needs to be +// loaded as it may be inherited by a later section) +bool bDisabledFirst = bUseFirst !rSection.HasTitlePage(); + bool bFooter = (nI ( WW8_FOOTER_EVEN | WW8_FOOTER_ODD | WW8_FOOTER_FIRST )) ? true: false; @@ -2409,7 +2418,8 @@ void SwWW8ImplReader::Read_HdFt(int nSect, const SwPageDesc *pPrev
[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa sw/source
sw/qa/extras/ww8import/data/fdo77844.doc |binary sw/qa/extras/ww8import/ww8import.cxx | 47 +++ sw/source/filter/ww8/ww8par.cxx | 15 - 3 files changed, 60 insertions(+), 2 deletions(-) New commits: commit 025a9cf3a8ceba61d8424d7dcb029ab9607a0d73 Author: Luke Deller l...@deller.id.au Date: Sun Jul 6 23:19:18 2014 +1000 fix fdo#77844: header wrongly enabled from .doc The LO page style needs page headers to be turned on if the corresponding .doc file section has a left (=even) page header or a first page header. However this should not be triggered in the case where a first page header is present but hidden due to the different first page header option being disabled. This case is fixed by this commit. Change-Id: If3de0df45378587fdbdecc6a091d2f4b60940b43 Reviewed-on: https://gerrit.libreoffice.org/10100 Reviewed-by: Michael Stahl mst...@redhat.com Tested-by: Michael Stahl mst...@redhat.com (cherry picked from commit f312ef98de57a5926be67421395544bb9d41b809) Signed-off-by: Michael Stahl mst...@redhat.com diff --git a/sw/qa/extras/ww8import/data/fdo77844.doc b/sw/qa/extras/ww8import/data/fdo77844.doc new file mode 100755 index 000..cd7368d Binary files /dev/null and b/sw/qa/extras/ww8import/data/fdo77844.doc differ diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx index 270d665..147fb88 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -415,6 +415,53 @@ DECLARE_WW8IMPORT_TEST(testBnc875715, bnc875715.doc) CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getPropertysal_Int32(xSections-getByIndex(0), SectionLeftMargin)); } +DECLARE_WW8IMPORT_TEST(testFdo77844, fdo77844.doc) +{ +uno::Referencecontainer::XNameAccess pageStyles = getStyles(PageStyles); + +// get a page cursor +uno::Referenceframe::XModel xModel(mxComponent, uno::UNO_QUERY); +uno::Referencetext::XTextViewCursorSupplier xTextViewCursorSupplier( +xModel-getCurrentController(), uno::UNO_QUERY); +uno::Referencetext::XPageCursor xCursor( +xTextViewCursorSupplier-getViewCursor(), uno::UNO_QUERY); + +// check that the first page has no header +xCursor-jumpToFirstPage(); +OUString pageStyleName = getPropertyOUString(xCursor, PageStyleName); +uno::Referencestyle::XStyle pageStyle( +pageStyles-getByName(pageStyleName), uno::UNO_QUERY); +bool headerIsOn = getPropertybool(pageStyle, HeaderIsOn); +CPPUNIT_ASSERT(!headerIsOn); + +// check that the second page has a header +xCursor-jumpToPage(2); +pageStyleName = getPropertyOUString(xCursor, PageStyleName); +pageStyle.set( +pageStyles-getByName(pageStyleName), uno::UNO_QUERY); +headerIsOn = getPropertybool(pageStyle, HeaderIsOn); +CPPUNIT_ASSERT(headerIsOn); + +// check that the third page has a header +xCursor-jumpToPage(3); +pageStyleName = getPropertyOUString(xCursor, PageStyleName); +pageStyle.set( +pageStyles-getByName(pageStyleName), uno::UNO_QUERY); +headerIsOn = getPropertybool(pageStyle, HeaderIsOn); +CPPUNIT_ASSERT(headerIsOn); + +// check that the fourth page has no header +// (#if'd out as this is not yet imported correctly) +#if 0 +xCursor-jumpToPage(4); +pageStyleName = getPropertyOUString(xCursor, PageStyleName); +pageStyle.set( +pageStyles-getByName(pageStyleName), uno::UNO_QUERY); +headerIsOn = getPropertybool(pageStyle, HeaderIsOn); +CPPUNIT_ASSERT(!headerIsOn); +#endif +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 9224568..11fafbe 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -2377,6 +2377,9 @@ void SwWW8ImplReader::Read_HdFt(int nSect, const SwPageDesc *pPrev, long nLen; sal_uInt8 nNumber = 5; +// This loops through the 6 flags WW8_{FOOTER,HEADER}_{ODD,EVEN,FIRST} +// corresponding to bit fields in grpfIhdt indicating which +// header/footer(s) are present in this section for( sal_uInt8 nI = 0x20; nI; nI = 1, nNumber-- ) { if (nI grpfIhdt) @@ -2394,6 +2397,12 @@ void SwWW8ImplReader::Read_HdFt(int nSect, const SwPageDesc *pPrev, = (nI ( WW8_HEADER_EVEN | WW8_FOOTER_EVEN )) ? true: false; bool bUseFirst = (nI ( WW8_HEADER_FIRST | WW8_FOOTER_FIRST )) ? true: false; + +// If we are loading a first-page header/footer which is not +// actually enabled in this section (it still needs to be +// loaded as it may be inherited by a later section) +bool bDisabledFirst = bUseFirst !rSection.HasTitlePage(); + bool bFooter = (nI ( WW8_FOOTER_EVEN | WW8_FOOTER_ODD
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sw/qa sw/source
sw/qa/extras/ww8import/data/fdo77844.doc |binary sw/qa/extras/ww8import/ww8import.cxx | 47 +++ sw/source/filter/ww8/ww8par.cxx | 15 - 3 files changed, 60 insertions(+), 2 deletions(-) New commits: commit 7cae592e57d2cfccf55583f18e65fb0f67c7fa42 Author: Luke Deller l...@deller.id.au Date: Sun Jul 6 23:19:18 2014 +1000 fix fdo#77844: header wrongly enabled from .doc The LO page style needs page headers to be turned on if the corresponding .doc file section has a left (=even) page header or a first page header. However this should not be triggered in the case where a first page header is present but hidden due to the different first page header option being disabled. This case is fixed by this commit. Change-Id: If3de0df45378587fdbdecc6a091d2f4b60940b43 Reviewed-on: https://gerrit.libreoffice.org/10100 Reviewed-by: Michael Stahl mst...@redhat.com Tested-by: Michael Stahl mst...@redhat.com (cherry picked from commit f312ef98de57a5926be67421395544bb9d41b809) Signed-off-by: Michael Stahl mst...@redhat.com diff --git a/sw/qa/extras/ww8import/data/fdo77844.doc b/sw/qa/extras/ww8import/data/fdo77844.doc new file mode 100755 index 000..cd7368d Binary files /dev/null and b/sw/qa/extras/ww8import/data/fdo77844.doc differ diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx index 09467cd..0d360d8 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -278,6 +278,53 @@ DECLARE_WW8IMPORT_TEST(testBnc875715, bnc875715.doc) CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getPropertysal_Int32(xSections-getByIndex(0), SectionLeftMargin)); } +DECLARE_WW8IMPORT_TEST(testFdo77844, fdo77844.doc) +{ +uno::Referencecontainer::XNameAccess pageStyles = getStyles(PageStyles); + +// get a page cursor +uno::Referenceframe::XModel xModel(mxComponent, uno::UNO_QUERY); +uno::Referencetext::XTextViewCursorSupplier xTextViewCursorSupplier( +xModel-getCurrentController(), uno::UNO_QUERY); +uno::Referencetext::XPageCursor xCursor( +xTextViewCursorSupplier-getViewCursor(), uno::UNO_QUERY); + +// check that the first page has no header +xCursor-jumpToFirstPage(); +OUString pageStyleName = getPropertyOUString(xCursor, PageStyleName); +uno::Referencestyle::XStyle pageStyle( +pageStyles-getByName(pageStyleName), uno::UNO_QUERY); +bool headerIsOn = getPropertybool(pageStyle, HeaderIsOn); +CPPUNIT_ASSERT(!headerIsOn); + +// check that the second page has a header +xCursor-jumpToPage(2); +pageStyleName = getPropertyOUString(xCursor, PageStyleName); +pageStyle.set( +pageStyles-getByName(pageStyleName), uno::UNO_QUERY); +headerIsOn = getPropertybool(pageStyle, HeaderIsOn); +CPPUNIT_ASSERT(headerIsOn); + +// check that the third page has a header +xCursor-jumpToPage(3); +pageStyleName = getPropertyOUString(xCursor, PageStyleName); +pageStyle.set( +pageStyles-getByName(pageStyleName), uno::UNO_QUERY); +headerIsOn = getPropertybool(pageStyle, HeaderIsOn); +CPPUNIT_ASSERT(headerIsOn); + +// check that the fourth page has no header +// (#if'd out as this is not yet imported correctly) +#if 0 +xCursor-jumpToPage(4); +pageStyleName = getPropertyOUString(xCursor, PageStyleName); +pageStyle.set( +pageStyles-getByName(pageStyleName), uno::UNO_QUERY); +headerIsOn = getPropertybool(pageStyle, HeaderIsOn); +CPPUNIT_ASSERT(!headerIsOn); +#endif +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index e2e9080..21ba56d 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -2371,6 +2371,9 @@ void SwWW8ImplReader::Read_HdFt(int nSect, const SwPageDesc *pPrev, long nLen; sal_uInt8 nNumber = 5; +// This loops through the 6 flags WW8_{FOOTER,HEADER}_{ODD,EVEN,FIRST} +// corresponding to bit fields in grpfIhdt indicating which +// header/footer(s) are present in this section for( sal_uInt8 nI = 0x20; nI; nI = 1, nNumber-- ) { if (nI grpfIhdt) @@ -2388,6 +2391,12 @@ void SwWW8ImplReader::Read_HdFt(int nSect, const SwPageDesc *pPrev, = (nI ( WW8_HEADER_EVEN | WW8_FOOTER_EVEN )) ? true: false; bool bUseFirst = (nI ( WW8_HEADER_FIRST | WW8_FOOTER_FIRST )) ? true: false; + +// If we are loading a first-page header/footer which is not +// actually enabled in this section (it still needs to be +// loaded as it may be inherited by a later section) +bool bDisabledFirst = bUseFirst !rSection.HasTitlePage(); + bool bFooter = (nI ( WW8_FOOTER_EVEN | WW8_FOOTER_ODD
[Libreoffice-commits] core.git: sw/qa
sw/qa/extras/ww8export/ww8export.cxx |2 +- sw/qa/extras/ww8import/ww8import.cxx |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) New commits: commit 3c25c5f8d9021936bd29bc0a59a0fc2b2c59664f Author: Luke Deller l...@deller.id.au Date: Tue Jul 8 22:44:12 2014 +1000 enable ww8import/export tests for mac Change-Id: I6b29040a2cd4ad24f18dfafb51d95d2b7627dd27 Reviewed-on: https://gerrit.libreoffice.org/10144 Tested-by: LibreOffice gerrit bot ger...@libreoffice.org Reviewed-by: Miklos Vajna vmik...@collabora.co.uk Tested-by: Miklos Vajna vmik...@collabora.co.uk diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx index 5857559..397d760 100644 --- a/sw/qa/extras/ww8export/ww8export.cxx +++ b/sw/qa/extras/ww8export/ww8export.cxx @@ -8,7 +8,7 @@ #include swmodeltestbase.hxx -#if !defined(MACOSX) !defined(WNT) +#if !defined(WNT) #include com/sun/star/form/validation/XValidatableFormComponent.hpp #include com/sun/star/frame/XStorable.hpp diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx index 147fb88..ce23780 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -8,7 +8,7 @@ #include swmodeltestbase.hxx -#if !defined(MACOSX) !defined(WNT) +#if !defined(WNT) #include com/sun/star/awt/XBitmap.hpp #include com/sun/star/graphic/XGraphic.hpp ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-3-0' - sw/qa sw/source
sw/qa/extras/ww8import/data/fdo77844.doc |binary sw/qa/extras/ww8import/ww8import.cxx | 47 +++ sw/source/filter/ww8/ww8par.cxx | 15 - 3 files changed, 60 insertions(+), 2 deletions(-) New commits: commit 758acdd6082fe89a4bd96fe65a0d609d511ddda5 Author: Luke Deller l...@deller.id.au Date: Sun Jul 6 23:19:18 2014 +1000 fix fdo#77844: header wrongly enabled from .doc The LO page style needs page headers to be turned on if the corresponding .doc file section has a left (=even) page header or a first page header. However this should not be triggered in the case where a first page header is present but hidden due to the different first page header option being disabled. This case is fixed by this commit. Change-Id: If3de0df45378587fdbdecc6a091d2f4b60940b43 Reviewed-on: https://gerrit.libreoffice.org/10100 Reviewed-by: Michael Stahl mst...@redhat.com Tested-by: Michael Stahl mst...@redhat.com (cherry picked from commit f312ef98de57a5926be67421395544bb9d41b809) Signed-off-by: Michael Stahl mst...@redhat.com (cherry picked from commit 025a9cf3a8ceba61d8424d7dcb029ab9607a0d73) Reviewed-on: https://gerrit.libreoffice.org/10168 Reviewed-by: Miklos Vajna vmik...@collabora.co.uk Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sw/qa/extras/ww8import/data/fdo77844.doc b/sw/qa/extras/ww8import/data/fdo77844.doc new file mode 100755 index 000..cd7368d Binary files /dev/null and b/sw/qa/extras/ww8import/data/fdo77844.doc differ diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx index 270d665..147fb88 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -415,6 +415,53 @@ DECLARE_WW8IMPORT_TEST(testBnc875715, bnc875715.doc) CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getPropertysal_Int32(xSections-getByIndex(0), SectionLeftMargin)); } +DECLARE_WW8IMPORT_TEST(testFdo77844, fdo77844.doc) +{ +uno::Referencecontainer::XNameAccess pageStyles = getStyles(PageStyles); + +// get a page cursor +uno::Referenceframe::XModel xModel(mxComponent, uno::UNO_QUERY); +uno::Referencetext::XTextViewCursorSupplier xTextViewCursorSupplier( +xModel-getCurrentController(), uno::UNO_QUERY); +uno::Referencetext::XPageCursor xCursor( +xTextViewCursorSupplier-getViewCursor(), uno::UNO_QUERY); + +// check that the first page has no header +xCursor-jumpToFirstPage(); +OUString pageStyleName = getPropertyOUString(xCursor, PageStyleName); +uno::Referencestyle::XStyle pageStyle( +pageStyles-getByName(pageStyleName), uno::UNO_QUERY); +bool headerIsOn = getPropertybool(pageStyle, HeaderIsOn); +CPPUNIT_ASSERT(!headerIsOn); + +// check that the second page has a header +xCursor-jumpToPage(2); +pageStyleName = getPropertyOUString(xCursor, PageStyleName); +pageStyle.set( +pageStyles-getByName(pageStyleName), uno::UNO_QUERY); +headerIsOn = getPropertybool(pageStyle, HeaderIsOn); +CPPUNIT_ASSERT(headerIsOn); + +// check that the third page has a header +xCursor-jumpToPage(3); +pageStyleName = getPropertyOUString(xCursor, PageStyleName); +pageStyle.set( +pageStyles-getByName(pageStyleName), uno::UNO_QUERY); +headerIsOn = getPropertybool(pageStyle, HeaderIsOn); +CPPUNIT_ASSERT(headerIsOn); + +// check that the fourth page has no header +// (#if'd out as this is not yet imported correctly) +#if 0 +xCursor-jumpToPage(4); +pageStyleName = getPropertyOUString(xCursor, PageStyleName); +pageStyle.set( +pageStyles-getByName(pageStyleName), uno::UNO_QUERY); +headerIsOn = getPropertybool(pageStyle, HeaderIsOn); +CPPUNIT_ASSERT(!headerIsOn); +#endif +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index c3e29c3..21ee239 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -2375,6 +2375,9 @@ void SwWW8ImplReader::Read_HdFt(int nSect, const SwPageDesc *pPrev, long nLen; sal_uInt8 nNumber = 5; +// This loops through the 6 flags WW8_{FOOTER,HEADER}_{ODD,EVEN,FIRST} +// corresponding to bit fields in grpfIhdt indicating which +// header/footer(s) are present in this section for( sal_uInt8 nI = 0x20; nI; nI = 1, nNumber-- ) { if (nI grpfIhdt) @@ -2392,6 +2395,12 @@ void SwWW8ImplReader::Read_HdFt(int nSect, const SwPageDesc *pPrev, = (nI ( WW8_HEADER_EVEN | WW8_FOOTER_EVEN )) ? true: false; bool bUseFirst = (nI ( WW8_HEADER_FIRST | WW8_FOOTER_FIRST )) ? true: false; + +// If we are loading a first-page header/footer which is not +// actually enabled
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/ww8import/data/fdo81102.doc |binary sw/qa/extras/ww8import/ww8import.cxx | 16 sw/source/filter/ww8/ww8par.cxx |5 + 3 files changed, 17 insertions(+), 4 deletions(-) New commits: commit b5bb15013617c6b9f1cdd089acae0bfb7104fa3a Author: Luke Deller l...@deller.id.au Date: Wed Jul 9 22:39:41 2014 +1000 fdo#81102: fix .doc import of blank even page header Honour the different odd even pages header/footer setting from the doc file even if there is no content for an even page header or footer. Conflicts: sw/qa/extras/ww8import/ww8import.cxx Reviewed on: https://gerrit.libreoffice.org/10191 Change-Id: I963f7f7189e399b1d859db0788fbfd291e868c54 diff --git a/sw/qa/extras/ww8import/data/fdo81102.doc b/sw/qa/extras/ww8import/data/fdo81102.doc new file mode 100755 index 000..e8a5507 Binary files /dev/null and b/sw/qa/extras/ww8import/data/fdo81102.doc differ diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx index 58a3bc1..354e555 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -469,6 +469,22 @@ DECLARE_WW8IMPORT_TEST(testFdp80333, fdo80333.doc) CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_NONE, aShadow.Location); } +DECLARE_WW8IMPORT_TEST(testFdo81102, fdo81102.doc) +{ +// get page style at beginning of document +uno::Referencetext::XTextDocument textDocument( +mxComponent, uno::UNO_QUERY); +uno::Referencetext::XTextRange start( +textDocument-getText()-getStart(), uno::UNO_QUERY); +OUString pageStyleName = getPropertyOUString(start, PageStyleName); +uno::Referencestyle::XStyle pageStyle( +getStyles(PageStyles)-getByName(pageStyleName), uno::UNO_QUERY); + +// check that left and right pages do not share the same header +bool headerIsShared = getPropertybool(pageStyle, HeaderIsShared); +CPPUNIT_ASSERT(!headerIsShared); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 885cf12..029cce8 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -4318,15 +4318,12 @@ void wwSectionManager::SetSegmentToPageDesc(const wwSection rSection, void wwSectionManager::SetUseOn(wwSection rSection) { -bool bEven = (rSection.maSep.grpfIhdt (WW8_HEADER_EVEN|WW8_FOOTER_EVEN)) ? -true : false; - bool bMirror = mrReader.pWDop-fMirrorMargins || mrReader.pWDop-doptypography.f2on1; UseOnPage eUseBase = bMirror ? nsUseOnPage::PD_MIRROR : nsUseOnPage::PD_ALL; UseOnPage eUse = eUseBase; -if (!bEven) +if (!mrReader.pWDop-fFacingPages) eUse = (UseOnPage)(eUse | nsUseOnPage::PD_HEADERSHARE | nsUseOnPage::PD_FOOTERSHARE); if (!rSection.HasTitlePage()) eUse = (UseOnPage)(eUse | nsUseOnPage::PD_FIRSTSHARE); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/ww8import/data/bordercolours.doc |binary sw/qa/extras/ww8import/ww8import.cxx | 116 ++ sw/source/filter/ww8/ww8par6.cxx | 22 +++- 3 files changed, 132 insertions(+), 6 deletions(-) New commits: commit 92ad689bcb3ad16bd35302e6ff4ee45b872c05a0 Author: Luke Deller l...@deller.id.au Date: Wed Mar 26 21:58:19 2014 +1100 Unit test for .doc import of full colour borders This test exercises the import component of commit ad51d4952dc30e0d1cdcc6037556cd7c66a61542 which adds support for full colour borders in .doc import/export. Also this test showed that page border import was not actually covered by ad51d4952dc30e0d1cdcc6037556cd7c66a61542, so that omission is fixed here. Change-Id: I6272e9b22415b5af012145e99360c5765d5aec60 Reviewed-on: https://gerrit.libreoffice.org/8759 Tested-by: Michael Stahl mst...@redhat.com Reviewed-by: Michael Stahl mst...@redhat.com diff --git a/sw/qa/extras/ww8import/data/bordercolours.doc b/sw/qa/extras/ww8import/data/bordercolours.doc new file mode 100755 index 000..c442223 Binary files /dev/null and b/sw/qa/extras/ww8import/data/bordercolours.doc differ diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx index 17296e4..861a960 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -12,6 +12,7 @@ #include com/sun/star/table/BorderLine2.hpp #include com/sun/star/table/TableBorder.hpp +#include com/sun/star/table/TableBorder2.hpp #include com/sun/star/text/XDependentTextField.hpp #include com/sun/star/text/XTextFramesSupplier.hpp #include com/sun/star/text/XTextTablesSupplier.hpp @@ -256,6 +257,121 @@ DECLARE_WW8IMPORT_TEST(testCp139, cp139.doc) CPPUNIT_ASSERT_EQUAL(sal_Int16(RTL_TEXTENCODING_DONTKNOW), getPropertysal_Int16(getRun(getParagraph(1), 1), CharFontCharSet)); } +DECLARE_WW8IMPORT_TEST(testBorderColours, bordercolours.doc) +{ +// The following 6 colours can only be represented with WW9 (Word 2000) +// BRC (BoRder Control) structures. We can tell that they have been +// exported/imported using a WW8 (Word '97) BRC if they instead come +// through as one of the 16 colours listed at this link: +// http://msdn.microsoft.com/en-us/library/dd773060.aspx +table::BorderLine2 expectedTop(0xFA670C, 0, 53, 0, 1, 53); +table::BorderLine2 expectedLeft(0xD99594, 0, 79, 0, 0, 79); +table::BorderLine2 expectedRight(0xB2A1C7, 53, 53, 53, 3, 159); +table::BorderLine2 expectedBottom(0xB6DDE8, 0, 106, 0, 14, 106); +table::BorderLine2 expectedDashedRed(0xFA670C, 0, 53, 0, 2, 53); +table::BorderLine2 expectedDoubleGreen(0xC2D69B, 26, 106, 26, 4, 159); + +// Paragraph border +uno::Referencetext::XBookmarksSupplier bookmarksSupplier(mxComponent, +uno::UNO_QUERY); +uno::Referencecontainer::XNameAccess bookmarks( +bookmarksSupplier-getBookmarks(), uno::UNO_QUERY); +uno::Referencetext::XTextContent bookmark( +bookmarks-getByName(ParagraphBorder), uno::UNO_QUERY); +uno::Referencetext::XTextRange anchor(bookmark-getAnchor()); +table::BorderLine2 border; +border = getPropertytable::BorderLine2(anchor, TopBorder); +CPPUNIT_ASSERT_BORDER_EQUAL(expectedTop, border); +border = getPropertytable::BorderLine2(anchor, LeftBorder); +CPPUNIT_ASSERT_BORDER_EQUAL(expectedLeft, border); +border = getPropertytable::BorderLine2(anchor, RightBorder); +CPPUNIT_ASSERT_BORDER_EQUAL(expectedRight, border); +border = getPropertytable::BorderLine2(anchor, BottomBorder); +CPPUNIT_ASSERT_BORDER_EQUAL(expectedBottom, border); + +// Page border +OUString pageStyleName = getPropertyOUString(anchor, PageStyleName); +uno::Referencestyle::XStyle pageStyle( +getStyles(PageStyles)-getByName(pageStyleName), uno::UNO_QUERY); +border = getPropertytable::BorderLine2(pageStyle, TopBorder); +CPPUNIT_ASSERT_BORDER_EQUAL(expectedTop, border); +border = getPropertytable::BorderLine2(pageStyle, LeftBorder); +CPPUNIT_ASSERT_BORDER_EQUAL(expectedLeft, border); +border = getPropertytable::BorderLine2(pageStyle, RightBorder); +CPPUNIT_ASSERT_BORDER_EQUAL(expectedRight, border); +border = getPropertytable::BorderLine2(pageStyle, BottomBorder); +CPPUNIT_ASSERT_BORDER_EQUAL(expectedBottom, border); + +// Character border +bookmark.set(bookmarks-getByName(CharBorder), uno::UNO_QUERY); +anchor = bookmark-getAnchor(); +border = getPropertytable::BorderLine2(anchor, CharTopBorder); +CPPUNIT_ASSERT_BORDER_EQUAL(expectedTop, border); +border = getPropertytable::BorderLine2(anchor, CharLeftBorder); +CPPUNIT_ASSERT_BORDER_EQUAL(expectedTop, border); +border = getPropertytable::BorderLine2(anchor, CharRightBorder); +CPPUNIT_ASSERT_BORDER_EQUAL(expectedTop, border); +border = getPropertytable::BorderLine2(anchor
[Libreoffice-commits] core.git: editeng/source sw/source
editeng/source/items/borderline.cxx | 10 -- sw/source/filter/ww8/ww8atr.cxx |9 + 2 files changed, 17 insertions(+), 2 deletions(-) New commits: commit fe3dff30205d4b6b276e3687edda48c19de1547f Author: Luke Deller l...@deller.id.au Date: Fri Mar 28 22:51:36 2014 +1100 .doc support for recently-added border line types Some new border line types have been added recently to LibreOffice (FINE_DASHED, DASH_DOT, DASH_DOT_DOT) This change updates .doc import/export to support these. (Import of FINE_DASHED was already working, but not export). Change-Id: Id3bcb1d4e6e9ceb97b492f0c578fd5b885ab16ff Reviewed-on: https://gerrit.libreoffice.org/8780 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/editeng/source/items/borderline.cxx b/editeng/source/items/borderline.cxx index 3280988..1edc7d1 100644 --- a/editeng/source/items/borderline.cxx +++ b/editeng/source/items/borderline.cxx @@ -119,8 +119,6 @@ ConvertBorderStyleFromWord(int const nWordLineStyle) case 2: // thick line case 5: // hairline // and the unsupported special cases which we map to a single line -case 8: -case 9: case 20: return SOLID; case 6: @@ -129,6 +127,10 @@ ConvertBorderStyleFromWord(int const nWordLineStyle) return DASHED; case 22: return FINE_DASHED; +case 8: +return DASH_DOT; +case 9: +return DASH_DOT_DOT; // then the shading beams which we represent by a double line case 23: return DOUBLE; @@ -199,6 +201,8 @@ ConvertBorderWidthFromWord(SvxBorderStyle const eStyle, double const i_fWidth, case DOTTED: case DASHED: +case DASH_DOT: +case DASH_DOT_DOT: return fWidth; // Display a minimum effective border width of 1pt @@ -249,6 +253,8 @@ ConvertBorderWidthToWord(SvxBorderStyle const eStyle, double const fWidth) case DOTTED: case DASHED: case FINE_DASHED: +case DASH_DOT: +case DASH_DOT_DOT: return fWidth; // Double lines diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index bf92692..5fd495b 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -4266,6 +4266,15 @@ WW8_BRCVer9 WW8Export::TranslateBorderLine(const SvxBorderLine rLine, case table::BorderLineStyle::INSET: brcType = 27; break; +case table::BorderLineStyle::FINE_DASHED: +brcType = 22; +break; +case table::BorderLineStyle::DASH_DOT: +brcType = 8; +break; +case table::BorderLineStyle::DASH_DOT_DOT: +brcType = 9; +break; default: break; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: editeng/source include/editeng
editeng/source/items/borderline.cxx | 12 +--- editeng/source/items/svxitems.src | 16 include/editeng/editrids.hrc|9 - 3 files changed, 33 insertions(+), 4 deletions(-) New commits: commit 0b7c8569782ecc5023d221f2063a664d008beb7b Author: Luke Deller l...@deller.id.au Date: Fri Mar 28 23:01:44 2014 +1100 Presentation string for recently-added border types LibreOffice will show a textual description of a style in some contexts eg in the Organizer tab of the dialog for modifying a style. This change updates the description of border line types to support recently-added types: FINE_DASHED, DOUBLE_THIN, DASH_DOT, DASH_DOT_DOT Also this fixes an out-of-bounds array access in SvxBorderLine::GetValueString Change-Id: Ia354a05ab1455eb8bcc079c6e51419a0cc6429d6 Reviewed-on: https://gerrit.libreoffice.org/8781 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/editeng/source/items/borderline.cxx b/editeng/source/items/borderline.cxx index 1edc7d1..a2a77d1 100644 --- a/editeng/source/items/borderline.cxx +++ b/editeng/source/items/borderline.cxx @@ -653,13 +653,19 @@ OUString SvxBorderLine::GetValueString( SfxMapUnit eSrcUnit, RID_EMBOSSED, RID_ENGRAVED, RID_OUTSET, -RID_INSET +RID_INSET, +RID_FINE_DASHED, +RID_DOUBLE_THIN, +RID_DASH_DOT, +RID_DASH_DOT_DOT }; -sal_uInt16 nResId = aStyleIds[m_nStyle]; OUString aStr = ( + ::GetColorString( aColor ) + OUString(cpDelim); -if ( nResId ) +if ( m_nStyle sizeof(aStyleIds)/sizeof(*aStyleIds) ) +{ +sal_uInt16 nResId = aStyleIds[m_nStyle]; aStr += EE_RESSTR(nResId); +} else { OUString sMetric = EE_RESSTR(GetMetricId( eDestUnit )); diff --git a/editeng/source/items/svxitems.src b/editeng/source/items/svxitems.src index 94d2b8d..0cd0c08 100644 --- a/editeng/source/items/svxitems.src +++ b/editeng/source/items/svxitems.src @@ -588,6 +588,22 @@ String RID_OUTSET { Text [ en-US ] = Outset ; }; +String RID_FINE_DASHED +{ +Text [ en-US ] = Single, fine dashed; +}; +String RID_DOUBLE_THIN +{ +Text [ en-US ] = Double, fixed thin lines; +}; +String RID_DASH_DOT +{ +Text [ en-US ] = Single, dash-dot; +}; +String RID_DASH_DOT_DOT +{ +Text [ en-US ] = Single, dash-dot-dot; +}; String RID_SVXITEMS_METRIC_MM { Text [ en-US ] = mm ; diff --git a/include/editeng/editrids.hrc b/include/editeng/editrids.hrc index 89212c2..a17f5a0 100644 --- a/include/editeng/editrids.hrc +++ b/include/editeng/editrids.hrc @@ -282,6 +282,9 @@ #define RID_ENGRAVED(RID_EDIT_START + 245) #define RID_OUTSET (RID_EDIT_START + 246) #define RID_INSET (RID_EDIT_START + 247) +#define RID_FINE_DASHED (RID_EDIT_START + 248) +#define RID_DOUBLE_THIN (RID_EDIT_START + 249) +// border lines continue at RID_EDIT_START + 330 // Metric-Text #define RID_SVXITEMS_METRIC_MM (RID_EDIT_START + 250) @@ -385,7 +388,11 @@ #define RID_SVXSTR_A11Y_PARAGRAPH_DESCRIPTION (RID_EDIT_START + 328) #define RID_SVXSTR_A11Y_PARAGRAPH_NAME (RID_EDIT_START + 329) -#if 329 (RID_EDIT_END-RID_EDIT_START) +// Border lines (continued) +#define RID_DASH_DOT(RID_EDIT_START + 330) +#define RID_DASH_DOT_DOT(RID_EDIT_START + 331) + +#if 331 (RID_EDIT_END-RID_EDIT_START) #error Resource-Ueberlauf in #line, #file #endif ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 2 commits - include/filter sw/source
include/filter/msfilter/sprmids.hxx |3 +- sw/source/filter/ww8/wrtww8.cxx | 33 sw/source/filter/ww8/wrtww8.hxx |2 + sw/source/filter/ww8/ww8atr.cxx | 26 ++ sw/source/filter/ww8/ww8attributeoutput.hxx |3 ++ 5 files changed, 66 insertions(+), 1 deletion(-) New commits: commit c78f918a7cb267a713804b8feacc3425196d4428 Author: Luke Deller l...@deller.id.au Date: Fri Apr 4 21:58:16 2014 +1100 Full colour table borders in .doc export Currently LO writes table cell border information to .doc files as part of the sprmTDefTable property, but this only supports the WW8 (Word '97) BRC (BoRder Control) structure which can only select from 16 colours. There is no newer version of this property. This commit adds output of an alternate property sprmTSetBrc which specifies border details for a sequence of cells. There is a WW9 (Word 2000) version of this property supporting full colours. For LO I have used the constant name NS_sprm::LN_TSetBorder following the existing naming convention here, which is to use *Border for the WW9 version because *Brc is taken for the WW8 version. Conflicts: include/filter/msfilter/sprmids.hxx Change-Id: Ie091d91c6d187e1c2542f59f58cec9a373a23e11 diff --git a/include/filter/msfilter/sprmids.hxx b/include/filter/msfilter/sprmids.hxx index 213ae0c..b12d907 100644 --- a/include/filter/msfilter/sprmids.hxx +++ b/include/filter/msfilter/sprmids.hxx @@ -252,6 +252,7 @@ namespace NS_sprm { const sal_uInt16 LN_TFBiDi = 0x560b; const sal_uInt16 LN_THTMLProps = 0x740c; const sal_uInt16 LN_TSetBrc80 = 0xd620; +const sal_uInt16 LN_TSetBrc = 0xd62f; const sal_uInt16 LN_TInsert = 0x7621; const sal_uInt16 LN_TDelete = 0x5622; const sal_uInt16 LN_TDxaCol = 0x7623; diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 343e47c..1a666d0 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -1953,6 +1953,7 @@ void WW8AttributeOutput::TableInfoRow( ww8::WW8TableNodeInfoInner::Pointer_t pTa TableVerticalCell( pTableTextNodeInfoInner ); TableOrientation( pTableTextNodeInfoInner ); TableSpacing( pTableTextNodeInfoInner ); +TableCellBorders( pTableTextNodeInfoInner ); } } } @@ -2413,6 +2414,38 @@ void WW8AttributeOutput::TableDefaultBorders( ww8::WW8TableNodeInfoInner::Pointe } } +void WW8AttributeOutput::TableCellBorders( +ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) +{ +if (!m_rWW8Export.bWrtWW8) +return; + +const SwTableBox * pTabBox = pTableTextNodeInfoInner-getTableBox(); +const SwTableLine * pTabLine = pTabBox-GetUpper(); +const SwTableBoxes rTabBoxes = pTabLine-GetTabBoxes(); +sal_uInt8 nBoxes = std::minsize_t(rTabBoxes.size(), 255); +const SvxBoxItem * pLastBox = 0; +sal_uInt8 nSeqStart = 0; // start of sequence of cells with same borders + +// Detect sequences of cells which have the same borders, and output +// a border description for each such cell range. +for ( unsigned n = 0; n = nBoxes; ++n ) +{ +const SvxBoxItem * pBox = (n == nBoxes) ? 0 : +rTabBoxes[n]-GetFrmFmt()-GetBox(); +if( !pLastBox ) +pLastBox = pBox; +else if( !pBox || *pLastBox != *pBox ) +{ +// This cell has different borders than the previous cell, +// so output the borders for the preceding cell range. +m_rWW8Export.Out_CellRangeBorders(pLastBox, nSeqStart, n); +nSeqStart = n; +pLastBox = pBox; +} +} +} + void WW8AttributeOutput::TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) { const SwTableBox * pTabBox = pTableTextNodeInfoInner-getTableBox(); diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 5cd5b0a..8259875 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -1087,6 +1087,8 @@ public: void Out_SwFmtBox(const SvxBoxItem rBox, bool bShadow); void Out_SwFmtTableBox( ww::bytes rO, const SvxBoxItem * rBox ); +void Out_CellRangeBorders(const SvxBoxItem * pBox, sal_uInt8 nStart, +sal_uInt8 nLimit); sal_uInt8 TransCol( const Color rCol ); bool TransBrush(const Color rCol, WW8_SHD rShd); WW8_BRCVer9 TranslateBorderLine(const ::editeng::SvxBorderLine pLine, diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 5fd495b..c853be0 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -4442,6 +4442,32 @@ void WW8Export::Out_SwFmtTableBox( ww::bytes rO, const SvxBoxItem * pBox ) } } +void WW8Export::Out_CellRangeBorders( const SvxBoxItem * pBox, sal_uInt8
[Libreoffice-commits] core.git: include/filter sw/source
include/filter/msfilter/sprmids.hxx | 71 ++-- sw/source/filter/ww8/wrtww8.cxx |7 ++- sw/source/filter/ww8/ww8atr.cxx | 30 --- sw/source/filter/ww8/ww8par2.cxx| 59 - sw/source/filter/ww8/ww8par6.cxx| 68 +- sw/source/filter/ww8/ww8scan.cxx| 60 +++--- 6 files changed, 153 insertions(+), 142 deletions(-) New commits: commit 6a7d04a9cb82cee083cf83c7354b89fa42458396 Author: Luke Deller l...@deller.id.au Date: Sun Apr 6 21:31:49 2014 +1000 Rename .doc SPRM IDs to match current MS specs I understand that Libreoffice's names for SPRM IDs come from old documentation for WW8 (Word '97), plus some later additions named by OpenOffice developers as they encountered newer SPRMs in the wild. Meanwhile Microsoft has released newer documentation which supplies names for these previously undocumented SPRMs, plus it renames some WW8 properties to have the suffix 80 to make room for newer versions of those properties. This commit aims to bring LibreOffice's SPRM ID names in line with the current file format specification from Microsoft. http://msdn.microsoft.com/en-us/library/dd923581.aspx Change-Id: I904c1db17a776e2d9e6076f87369160e3b80f2e4 Reviewed-on: https://gerrit.libreoffice.org/8884 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/include/filter/msfilter/sprmids.hxx b/include/filter/msfilter/sprmids.hxx index b12d907..e3c3923 100644 --- a/include/filter/msfilter/sprmids.hxx +++ b/include/filter/msfilter/sprmids.hxx @@ -165,8 +165,9 @@ namespace NS_sprm { const sal_uInt16 LN_CDispFldRMark = 0xca62; const sal_uInt16 LN_CIbstRMarkDel = 0x4863; const sal_uInt16 LN_CDttmRMarkDel = 0x6864; -const sal_uInt16 LN_CBrc = 0x6865; -const sal_uInt16 LN_CShd = 0x4866; +const sal_uInt16 LN_CBrc80 = 0x6865; +const sal_uInt16 LN_CShd80 = 0x4866; +const sal_uInt16 LN_CShd = 0xca71; const sal_uInt16 LN_CIdslRMarkDel = 0x4867; const sal_uInt16 LN_CFUsePgsuSettings = 0x0868; const sal_uInt16 LN_CCpg = 0x486b; @@ -177,10 +178,10 @@ namespace NS_sprm { const sal_uInt16 LN_CIdctHint = 0x286f; const sal_uInt16 LN_PicBrcl = 0x2e00; const sal_uInt16 LN_PicScale = 0xce01; -const sal_uInt16 LN_PicBrcTop = 0x6c02; -const sal_uInt16 LN_PicBrcLeft = 0x6c03; -const sal_uInt16 LN_PicBrcBottom = 0x6c04; -const sal_uInt16 LN_PicBrcRight = 0x6c05; +const sal_uInt16 LN_PicBrcTop80 = 0x6c02; +const sal_uInt16 LN_PicBrcLeft80 = 0x6c03; +const sal_uInt16 LN_PicBrcBottom80 = 0x6c04; +const sal_uInt16 LN_PicBrcRight80 = 0x6c05; const sal_uInt16 LN_ScnsPgn = 0x3000; const sal_uInt16 LN_SiHeadingPgn = 0x3001; const sal_uInt16 LN_SOlstAnm = 0xd202; @@ -224,30 +225,31 @@ namespace NS_sprm { const sal_uInt16 LN_SFBiDi = 0x3228; const sal_uInt16 LN_SFFacingCol = 0x3229; const sal_uInt16 LN_SFRTLGutter = 0x322a; -const sal_uInt16 LN_SBrcTop = 0x702b; -const sal_uInt16 LN_SBrcLeft = 0x702c; -const sal_uInt16 LN_SBrcBottom = 0x702d; -const sal_uInt16 LN_SBrcRight = 0x702e; -const sal_uInt16 LN_SBorderTop = 0xd234; -const sal_uInt16 LN_SBorderLeft = 0xd235; -const sal_uInt16 LN_SBorderBottom = 0xd236; -const sal_uInt16 LN_SBorderRight = 0xd237; +const sal_uInt16 LN_SBrcTop80 = 0x702b; +const sal_uInt16 LN_SBrcLeft80 = 0x702c; +const sal_uInt16 LN_SBrcBottom80 = 0x702d; +const sal_uInt16 LN_SBrcRight80 = 0x702e; +const sal_uInt16 LN_SBrcTop = 0xd234; +const sal_uInt16 LN_SBrcLeft = 0xd235; +const sal_uInt16 LN_SBrcBottom = 0xd236; +const sal_uInt16 LN_SBrcRight = 0xd237; const sal_uInt16 LN_SPgbProp = 0x522f; const sal_uInt16 LN_SDxtCharSpace = 0x7030; const sal_uInt16 LN_SDyaLinePitch = 0x9031; const sal_uInt16 LN_SClm = 0x5032; const sal_uInt16 LN_STextFlow = 0x5033; -const sal_uInt16 LN_TJc = 0x5400; +const sal_uInt16 LN_TJc = 0x548A; +const sal_uInt16 LN_TJc90 = 0x5400; const sal_uInt16 LN_TDxaLeft = 0x9601; const sal_uInt16 LN_TDxaGapHalf = 0x9602; const sal_uInt16 LN_TFCantSplit = 0x3403; const sal_uInt16 LN_TTableHeader = 0x3404; -const sal_uInt16 LN_TTableBorders = 0xd605; +const sal_uInt16 LN_TTableBorders80 = 0xd605; const sal_uInt16 LN_TDefTable10 = 0xd606; const sal_uInt16 LN_TDyaRowHeight = 0x9407; const sal_uInt16 LN_TDefTable = 0xd608; -const sal_uInt16 LN_TDefTableShd = 0xd609; -const sal_uInt16 LN_TCellShd = 0xd612; +const sal_uInt16 LN_TDefTableShd80 = 0xd609; +const sal_uInt16 LN_TDefTableShd = 0xd612; const sal_uInt16 LN_TTlp = 0x740a; const sal_uInt16 LN_TFBiDi = 0x560b; const sal_uInt16 LN_THTMLProps = 0x740c; @@ -259,8 +261,8 @@ namespace
[Libreoffice-commits] core.git: sw/source
sw/source/filter/ww8/ww8par2.cxx | 27 +-- 1 file changed, 5 insertions(+), 22 deletions(-) New commits: commit 72ef0d88e916b320de85fe2ebf08cb7aea28ca08 Author: Luke Deller l...@deller.id.au Date: Mon Apr 7 22:20:15 2014 +1000 Ignore sprmTFCantSplit90 in .doc file per MS spec Microsoft's new .doc file format specification says to ignore sprmTFCantSplit90 in favour of (the older!) sprmTFCantSplit. This seems to have confused the OO developer who must have been trying to reverse engineer this without documentation: the table parsing code gets sprmTFCantSplit90 and sprmTFCantSplit the wrong way around. This commit removes handling of sprmTFCantSplit90 according to the instruction in the Microsoft file format specification. http://msdn.microsoft.com/en-us/library/dd951612.aspx Change-Id: Ic9d3dddf102d6af0a061d2e8b68de3cf5bd9bae1 Reviewed-on: https://gerrit.libreoffice.org/8885 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 6b1cde9..16aabb6 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -1552,11 +1552,10 @@ enum wwTableSprm { sprmNil, -sprmTTableWidth,sprmTTextFlow, sprmTFCantSplit, sprmTFCantSplit90,sprmTJc, sprmTFBiDi, sprmTDefTable, -sprmTDyaRowHeight, sprmTDefTableShd, sprmTDxaLeft, sprmTSetBrc, -sprmTSetBrc90, sprmTDxaCol, sprmTInsert, sprmTDelete, sprmTTableHeader, -sprmTDxaGapHalf, sprmTTableBorders, sprmTTableBorders90, - +sprmTTableWidth, sprmTTextFlow, sprmTFCantSplit, sprmTJc, sprmTFBiDi, +sprmTDefTable, sprmTDyaRowHeight, sprmTDefTableShd, sprmTDxaLeft, +sprmTSetBrc, sprmTSetBrc90, sprmTDxaCol, sprmTInsert, sprmTDelete, +sprmTTableHeader, sprmTDxaGapHalf, sprmTTableBorders, sprmTTableBorders90, sprmTDefTableNewShd, sprmTCellPadding, sprmTCellPaddingDefault }; @@ -1571,14 +1570,10 @@ wwTableSprm GetTableSprm(sal_uInt16 nId, ww::WordVersion eVer) return sprmTTableWidth; case NS_sprm::LN_TTextFlow: return sprmTTextFlow; -case NS_sprm::LN_TFCantSplit90: -// FIXME this code gets the names of sprmTFCantSplit and -// sprmTFCantSplit90 the wrong way around. -return sprmTFCantSplit; case NS_sprm::LN_TTableHeader: return sprmTTableHeader; case NS_sprm::LN_TFCantSplit: -return sprmTFCantSplit90; +return sprmTFCantSplit; case NS_sprm::LN_TJc90: return sprmTJc; case NS_sprm::LN_TFBiDi: @@ -1780,10 +1775,6 @@ WW8TabDesc::WW8TabDesc(SwWW8ImplReader* pIoClass, WW8_CP nStartCp) : pNewBand-bCantSplit = *pParams; bClaimLineFmt = true; break; -case sprmTFCantSplit90: -pNewBand-bCantSplit90 = *pParams; -bClaimLineFmt = true; -break; case sprmTTableBorders: pTableBorders = pParams; // process at end break; @@ -3068,15 +3059,7 @@ void WW8TabDesc::AdjustNewBand() //Word stores 1 for bCantSplit if the row cannot be split, we set true if //we can split the row -// bCantSplit: Always true for rows containing merged cells (Word = 2000 crashes otherwise) -// So in case bCantSplit is true, we check for bCantSplit90, which has been introduced for -// Word versions = 2002. -// FIXME the above comment is suspect because bCantSplit and bCantSplit90 -// have been populated the wrong way around. bool bSetCantSplit = pActBand-bCantSplit; -if(bSetCantSplit) -bSetCantSplit = pActBand-bCantSplit90; - pTabLine-GetFrmFmt()-SetFmtAttr(SwFmtRowSplit(!bSetCantSplit)); short i;// SW-Index ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 2 commits - sw/inc sw/qa sw/source
sw/inc/SwStyleNameMapper.hxx |1 sw/qa/extras/ww8export/data/bordercolours.odt |binary sw/qa/extras/ww8export/ww8export.cxx | 125 ++ sw/source/core/doc/SwStyleNameMapper.cxx | 173 -- 4 files changed, 157 insertions(+), 142 deletions(-) New commits: commit 19644e657d1ccfa6cd9f57524cb77beb47161ae7 Author: Luke Deller l...@deller.id.au Date: Mon Apr 7 23:58:58 2014 +1000 Unit test for .doc export of full colour borders This test exercises the *export* component of recent work to add support for full colour borders in .doc import/export. Change-Id: I2da0b8b488e399d0cd4791678fac6e1c85921c2c Reviewed-on: https://gerrit.libreoffice.org/8887 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sw/qa/extras/ww8export/data/bordercolours.odt b/sw/qa/extras/ww8export/data/bordercolours.odt new file mode 100644 index 000..f34d595 Binary files /dev/null and b/sw/qa/extras/ww8export/data/bordercolours.odt differ diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx index 2e3d200..d014dba 100644 --- a/sw/qa/extras/ww8export/ww8export.cxx +++ b/sw/qa/extras/ww8export/ww8export.cxx @@ -16,6 +16,7 @@ #include com/sun/star/beans/XPropertySet.hpp #include com/sun/star/view/XViewSettingsSupplier.hpp #include com/sun/star/table/ShadowFormat.hpp +#include com/sun/star/table/TableBorder2.hpp class Test : public SwModelTestBase { @@ -196,6 +197,130 @@ DECLARE_WW8EXPORT_TEST(testCommentsNested, comments-nested.doc) CPPUNIT_ASSERT_EQUAL(OUString(Inner), getPropertyOUString(xInner, Content)); } +DECLARE_WW8EXPORT_TEST(testBorderColoursExport, bordercolours.odt) +{ +// This is very close to testBorderColours in ww8import.cxx, but for export + +// The following 6 colours can only be represented with WW9 (Word 2000) +// BRC (BoRder Control) structures. We can tell that they have been +// exported/imported using a WW8 (Word '97) BRC if they instead come +// through as one of the 16 colours listed at this link: +// http://msdn.microsoft.com/en-us/library/dd773060.aspx +table::BorderLine2 expectedTop(0xFA670C, 0, 53, 0, 1, 53); +table::BorderLine2 expectedLeft(0xD99594, 0, 79, 0, 0, 79); +table::BorderLine2 expectedRight(0xB2A1C7, 53, 53, 53, 3, 159); +table::BorderLine2 expectedBottom(0xB6DDE8, 0, 106, 0, 14, 106); +table::BorderLine2 expectedDashedRed(0xFA670C, 0, 53, 0, 2, 53); +table::BorderLine2 expectedDoubleGreen(0xC2D69B, 26, 106, 26, 4, 159); + +// Paragraph border +uno::Referencetext::XBookmarksSupplier bookmarksSupplier(mxComponent, +uno::UNO_QUERY); +uno::Referencecontainer::XNameAccess bookmarks( +bookmarksSupplier-getBookmarks(), uno::UNO_QUERY); +uno::Referencetext::XTextContent bookmark( +bookmarks-getByName(ParagraphBorder), uno::UNO_QUERY); +uno::Referencetext::XTextRange anchor(bookmark-getAnchor()); +table::BorderLine2 border; +border = getPropertytable::BorderLine2(anchor, TopBorder); +CPPUNIT_ASSERT_BORDER_EQUAL(expectedTop, border); +border = getPropertytable::BorderLine2(anchor, LeftBorder); +CPPUNIT_ASSERT_BORDER_EQUAL(expectedLeft, border); +border = getPropertytable::BorderLine2(anchor, RightBorder); +CPPUNIT_ASSERT_BORDER_EQUAL(expectedRight, border); +border = getPropertytable::BorderLine2(anchor, BottomBorder); +CPPUNIT_ASSERT_BORDER_EQUAL(expectedBottom, border); + +// Page border +OUString pageStyleName = getPropertyOUString(anchor, PageStyleName); +uno::Referencestyle::XStyle pageStyle( +getStyles(PageStyles)-getByName(pageStyleName), uno::UNO_QUERY); +border = getPropertytable::BorderLine2(pageStyle, TopBorder); +CPPUNIT_ASSERT_BORDER_EQUAL(expectedTop, border); +border = getPropertytable::BorderLine2(pageStyle, LeftBorder); +CPPUNIT_ASSERT_BORDER_EQUAL(expectedLeft, border); +border = getPropertytable::BorderLine2(pageStyle, RightBorder); +CPPUNIT_ASSERT_BORDER_EQUAL(expectedRight, border); +border = getPropertytable::BorderLine2(pageStyle, BottomBorder); +CPPUNIT_ASSERT_BORDER_EQUAL(expectedBottom, border); + +// Character border +bookmark.set(bookmarks-getByName(CharBorder), uno::UNO_QUERY); +anchor = bookmark-getAnchor(); +border = getPropertytable::BorderLine2(anchor, CharTopBorder); +CPPUNIT_ASSERT_BORDER_EQUAL(expectedTop, border); +border = getPropertytable::BorderLine2(anchor, CharLeftBorder); +CPPUNIT_ASSERT_BORDER_EQUAL(expectedTop, border); +border = getPropertytable::BorderLine2(anchor, CharRightBorder); +CPPUNIT_ASSERT_BORDER_EQUAL(expectedTop, border); +border = getPropertytable::BorderLine2(anchor, CharBottomBorder); +CPPUNIT_ASSERT_BORDER_EQUAL(expectedTop, border); + +// Table border +uno::Referencetext::XTextTablesSupplier
[Libreoffice-commits] core.git: Changes to 'refs/changes/59/8759/3'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/59/8759/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/59/8759/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/85/8885/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/86/1386/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/85/8885/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/46/8646/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/08/4008/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/01/2601/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/08/4008/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/87/1387/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/62/3662/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/96/3596/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/62/2062/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/35/10235/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/62/3662/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/96/3596/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/46/8646/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/91/10191/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/62/2062/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/35/10235/3'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/80/8780/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/84/8884/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/84/8884/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/35/10235/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/62/2062/3'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/81/8781/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/37/2137/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/81/8781/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/65/2065/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/45/10145/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/35/10335/5'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/35/10335/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/35/10335/3'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/37/2137/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/65/2065/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/35/10335/4'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/35/10335/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/44/1244/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/68/10168/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/70/1170/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/55/4055/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/91/10291/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/51/1251/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/26/4026/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/38/8838/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/51/3451/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/38/8838/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/00/10100/3'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/44/10144/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/39/4039/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/39/4039/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/00/10100/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/00/10100/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/87/8887/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/42/3642/4'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/42/3642/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/42/3642/3'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/87/8887/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/42/3642/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/42/3642/5'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/43/3743/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/43/3743/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/43/3743/3'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/44/10144/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits