[Libreoffice-commits] core.git: sw/source
sw/source/core/doc/doc.cxx| 47 +- sw/source/uibase/uno/unotxdoc.cxx | 15 2 files changed, 61 insertions(+), 1 deletion(-) New commits: commit 3c1a343f6936f1dcefdf79a677f8c26ce29676e6 Author: Eilidh McAdam <eilidh.mca...@itomig.de> Date: Tue Sep 8 19:01:19 2015 +0100 tdf#89708 Adjust print page range for unprinted blank pages Depending on whether automatically inserted blank pages are to be printed or not, the range of pages to print is expressed differently to the pages displayed in the preview in the Print dialog - i.e. the page range includes blank pages, whereas the preview doesn't (if blank pages are not to be printed). This patch adapts the range so that if blank pages are ignored upon printing, the range can be expressed across printable pages only, same as the Print dialog preview. An example is a merged document of several records into a single page letter or document - blanks are automatically put in between documents but usually aren't displayed/printed. Previously, printing page 2 would print the blank page between the 1st and 2nd merged document. After this change, printing page 2 will print the 2nd merged document instead. The "Pages" (print range) text box in the Print dialog defaults to the current page - this patch adjusts this when blanks are not to be printed so that it is expressed as the current page minus any blanks since the start of the document. Change-Id: Ic1d4d374a82c6f921bb41a97130838757c6b74b1 Reviewed-on: https://gerrit.libreoffice.org/18420 Reviewed-by: Jan-Marek Glogowski <glo...@fbihome.de> Tested-by: Jan-Marek Glogowski <glo...@fbihome.de> diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 644588e..0022f2f 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -724,9 +724,54 @@ void SwDoc::CalculatePagesForPrinting( // get vector of pages to print according to PageRange and valid pages set from above // (result may be an empty vector, for example if the range string is not correct) -StringRangeEnumerator::getRangesFromString( +// If excluding empty pages, allow range to specify range of printable pages +if (bPrintEmptyPages || nContent == 0) +{ +// Use range enumerator directly +StringRangeEnumerator::getRangesFromString( aPageRange, rData.GetPagesToPrint(), 1, nDocPageCount, 0, () ); +} +else // not printing blanks and not printing all +{ +// Use range enumerator to adjust for empty pages - numbers in range are +// essentially indexes into the valid page number set +StringRangeEnumerator aEnum( aPageRange, 1, nDocPageCount, 0); +rData.GetPagesToPrint().clear(); +rData.GetPagesToPrint().reserve(static_cast(aEnum.size())); + +std::set::iterator valIt = rData.GetValidPagesSet().begin(); +sal_Int32 lastRangeValue = 1; +for (StringRangeEnumerator::Iterator it = aEnum.begin(); it != aEnum.end(); ++it) +{ +// Move valid page set iterator forward/back by diff between current +// and previous numbers expressed in range +if ((*it) - lastRangeValue > 0) +{ +// Fast-forward +for (sal_Int32 i = 0; + i < (*it) - lastRangeValue && valIt != rData.GetValidPagesSet().end(); + ++i, ++valIt) +; +} +else if (lastRangeValue - (*it) > 0) +{ +// Rewind +for (sal_Int32 i = 0; + i < lastRangeValue - (*it) && valIt != rData.GetValidPagesSet().begin(); + ++i, --valIt) +; +} + +// Range encompasses more values than are listed as valid +if (valIt == rData.GetValidPagesSet().end()) +break; + +rData.GetPagesToPrint().push_back(*valIt); + +lastRangeValue = *it; +} +} } void SwDoc::UpdatePagesForPrintingWithPostItData( diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 2a7d9d2..4a386fc 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -38,6 +38,8 @@ #include #include #include +#include +#include #include #include #include @@ -200,6 +202,19 @@ static SwPrintUIOptions * lcl_GetPrintUIOptions( if (pPreview) nCurrentPage = pPreview->GetSelectedPage(); } + +// If blanks are skipped, account for them in initial page range value +if (!rPrintData.IsPrintEmptyPages()) +{ +sal_uInt16 nMax = nCurrentPage; +SwPageFrame *pPage = dynamic_cast<SwPageF
[Libreoffice-commits] core.git: sw/source
sw/source/filter/ww8/docxattributeoutput.hxx |1 + sw/source/filter/ww8/docxexport.cxx |2 +- sw/source/filter/ww8/wrtw8sty.cxx|7 --- sw/source/filter/ww8/wrtww8.hxx | 12 4 files changed, 14 insertions(+), 8 deletions(-) New commits: commit f10ab3425f02a4caea22b2bdbf60a731bd059419 Author: Eilidh McAdam eilidh.mca...@itomig.de Date: Wed Mar 18 01:33:43 2015 + tdf#78606: Write DOCX header even if section is first paragraph Header flags are now set prior to export if a section is the first thing in the document (ODF - DOCX). Change-Id: I84ba61c11da78a012938163d986ee5fcd301d405 Reviewed-on: https://gerrit.libreoffice.org/15369 Reviewed-by: Miklos Vajna vmik...@collabora.co.uk Tested-by: Miklos Vajna vmik...@collabora.co.uk diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index 3acde5b..70f5cc3 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -974,6 +974,7 @@ public: void GetSdtEndBefore(const SdrObject* pSdrObj); void SetStartedParaSdt(bool bStartedParaSdt); bool IsStartedParaSdt(); +bool IsFirstParagraph() { return m_bIsFirstParagraph; } /// Stores the table export state to the passed context and resets own state. void pushToTableExportContext(DocxTableExportContext rContext); diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 2490066..cb48a7f 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -460,7 +460,7 @@ void DocxExport::ExportDocument_Impl() void DocxExport::AppendSection( const SwPageDesc *pPageDesc, const SwSectionFmt* pFmt, sal_uLong nLnNum ) { AttrOutput().SectionBreak( msword::PageBreak, m_pSections-CurrentSectionInfo() ); -m_pSections-AppendSection( pPageDesc, pFmt, nLnNum ); +m_pSections-AppendSection( pPageDesc, pFmt, nLnNum, m_pAttrOutput-IsFirstParagraph() ); } void DocxExport::OutputEndNode( const SwEndNode rEndNode ) diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index d3c0488..1b4a5d9 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -1157,12 +1157,12 @@ const WW8_SepInfo* MSWordSections::CurrentSectionInfo() } void MSWordSections::AppendSection( const SwPageDesc* pPd, -const SwSectionFmt* pSectionFmt, sal_uLong nLnNumRestartNo ) +const SwSectionFmt* pSectionFmt, sal_uLong nLnNumRestartNo, bool bIsFirstParagraph ) { if (HeaderFooterWritten()) { return; // #i117955# prevent new sections in endnotes } -aSects.push_back( WW8_SepInfo( pPd, pSectionFmt, nLnNumRestartNo ) ); +aSects.push_back( WW8_SepInfo( pPd, pSectionFmt, nLnNumRestartNo, boost::none, NULL, bIsFirstParagraph ) ); NeedsDocumentProtected( aSects.back() ); } @@ -1828,7 +1828,8 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo rSepInfo, WW8_PdAtt ? pPd-GetFollow()-GetMaster() : pPd-GetLeft(); -if ( nBreakCode != 0 ) +// Ensure that headers are written if section is first paragraph +if ( nBreakCode != 0 || ( rSepInfo.pSectionFmt rSepInfo.bIsFirstParagraph )) { if ( titlePage ) { diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 1a35a65..372789b 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -164,16 +164,19 @@ struct WW8_SepInfo const SwTxtNode* pNumNd; sal_uLong nLnNumRestartNo; ::boost::optionalsal_uInt16 oPgRestartNo; +bool bIsFirstParagraph; WW8_SepInfo() -: pPageDesc(0), pSectionFmt(0), pPDNd(0), pNumNd(0), nLnNumRestartNo(0) +: pPageDesc(0), pSectionFmt(0), pPDNd(0), pNumNd(0), nLnNumRestartNo(0), bIsFirstParagraph(false) {} WW8_SepInfo( const SwPageDesc* pPD, const SwSectionFmt* pFmt, -sal_uLong nLnRestart, ::boost::optionalsal_uInt16 oPgRestart = boost::none, const SwNode* pNd = NULL ) + sal_uLong nLnRestart, ::boost::optionalsal_uInt16 oPgRestart = boost::none, + const SwNode* pNd = NULL, bool bIsFirstPara = false ) : pPageDesc( pPD ), pSectionFmt( pFmt ), pPDNd( pNd ), pNumNd( 0 ), - nLnNumRestartNo( nLnRestart ), oPgRestartNo( oPgRestart ) + nLnNumRestartNo( nLnRestart ), oPgRestartNo( oPgRestart ), + bIsFirstParagraph( bIsFirstPara ) {} bool IsProtected() const; @@ -202,7 +205,8 @@ public: void AppendSection( const SwPageDesc* pPd, const SwSectionFmt* pSectionFmt = 0, -sal_uLong nLnNumRestartNo = 0 ); +sal_uLong nLnNumRestartNo = 0, +bool bIsFirstParagraph = false ); void AppendSection( const SwFmtPageDesc rPd, const SwNode rNd
[Libreoffice-commits] core.git: sw/qa
sw/qa/extras/ooxmlexport/data/sectionprot.odt |binary sw/qa/extras/ooxmlexport/ooxmlexport5.cxx |8 2 files changed, 8 insertions(+) New commits: commit 362c1b188d92b29bfcdad9e6c0bad50954131f11 Author: Eilidh McAdam eilidh.mca...@itomig.de Date: Fri Apr 17 22:33:59 2015 +0100 tdf#78606: unittest for docx section header export bug Checks that header is exported to DOCX when section is first paragraph. Change-Id: Ie8db2a372754208203f0df62137a3a0c3bbf39b9 Reviewed-on: https://gerrit.libreoffice.org/15370 Reviewed-by: Miklos Vajna vmik...@collabora.co.uk Tested-by: Miklos Vajna vmik...@collabora.co.uk diff --git a/sw/qa/extras/ooxmlexport/data/sectionprot.odt b/sw/qa/extras/ooxmlexport/data/sectionprot.odt index 5a98a0b..1effc19 100644 Binary files a/sw/qa/extras/ooxmlexport/data/sectionprot.odt and b/sw/qa/extras/ooxmlexport/data/sectionprot.odt differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx index 49a1d66..80c9c708 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx @@ -779,6 +779,14 @@ DECLARE_OOXMLEXPORT_TEST(testSectionProtection, sectionprot.odt) } } +DECLARE_OOXMLEXPORT_TEST(testSectionHeader, sectionprot.odt) +{ +if (xmlDocPtr pXmlDoc = parseExport(word/document.xml)) +{ +assertXPath(pXmlDoc, //w:headerReference, 1); +} +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/qa
sw/qa/extras/ooxmlexport/data/sectionprot.odt |binary sw/qa/extras/ooxmlexport/ooxmlexport5.cxx | 15 +++ 2 files changed, 15 insertions(+) New commits: commit 2813cfaae68af93b24bf4ecc1128f6647178f642 Author: Eilidh McAdam eilidh.mca...@itomig.de Date: Wed Mar 25 15:25:56 2015 + tdf#60060: unit test for docx section protection export Change-Id: I307466e7336bcf767ebb1ac3bb330cfb2130f84c Reviewed-on: https://gerrit.libreoffice.org/15003 Reviewed-by: Miklos Vajna vmik...@collabora.co.uk Tested-by: Miklos Vajna vmik...@collabora.co.uk diff --git a/sw/qa/extras/ooxmlexport/data/sectionprot.odt b/sw/qa/extras/ooxmlexport/data/sectionprot.odt new file mode 100644 index 000..5a98a0b Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/sectionprot.odt differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx index dd3e7cf..e2a21b5 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx @@ -741,6 +741,21 @@ DECLARE_OOXMLEXPORT_TEST(testTdf89774, tdf89774.fodt) assertXPathContent(pXmlDoc, /extended-properties:Properties/extended-properties:TotalTime, 1); } +DECLARE_OOXMLEXPORT_TEST(testSectionProtection, sectionprot.odt) +{ +if (xmlDocPtr pXmlDoc = parseExport(word/document.xml)) +{ +assertXPath(pXmlDoc, //w:formProt[1], val, true); +assertXPath(pXmlDoc, //w:formProt[2], val, false); +} + +if (xmlDocPtr pXmlSettings = parseExport(word/settings.xml)) +{ +assertXPath(pXmlSettings, /w:settings/w:documentProtection, enforcement, true); +assertXPath(pXmlSettings, /w:settings/w:documentProtection, edit, forms); +} +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ 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/ww8/docxattributeoutput.cxx |3 ++- sw/source/filter/ww8/docxexport.cxx |9 + 2 files changed, 11 insertions(+), 1 deletion(-) New commits: commit bb96ad0f9a24f92c8553da566f0ebedc064a1318 Author: Eilidh McAdam eilidh.mca...@itomig.de Date: Wed Mar 18 02:00:28 2015 + tdf#60060: DOCX export of section protection Initial implementation - no password protection is saved. Specific sections are protected in OOXML by using form protection; that is, only form elements may be edited in protected sections. Change-Id: I294064bbc4e3c307d17001ebd21f1bd6f07de42c Reviewed-on: https://gerrit.libreoffice.org/14895 Reviewed-by: Miklos Vajna vmik...@collabora.co.uk Tested-by: Miklos Vajna vmik...@collabora.co.uk diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index c0dbda7..45b7bbf 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -5401,7 +5401,8 @@ void DocxAttributeOutput::EndSection() void DocxAttributeOutput::SectionFormProtection( bool bProtected ) { if ( bProtected ) -m_pSerializer-singleElementNS( XML_w, XML_formProt, FSEND ); +m_pSerializer-singleElementNS( XML_w, XML_formProt, +FSNS( XML_w, XML_val ), true, FSEND ); else m_pSerializer-singleElementNS( XML_w, XML_formProt, FSNS( XML_w, XML_val ), false, FSEND ); diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 96c8c7c..30ea867 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -930,6 +930,15 @@ void DocxExport::WriteSettings() } } +// Section-specific write protection +if ( m_pSections-DocumentIsProtected() ) +{ +pFS-singleElementNS( XML_w, XML_documentProtection, + FSNS( XML_w, XML_enforcement ), true, + FSNS( XML_w, XML_edit ), forms, + FSEND ); +} + pFS-endElementNS( XML_w, XML_settings ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: vcl/qa vcl/source
vcl/qa/cppunit/wmf/wmfimporttest.cxx | 10 +- vcl/source/filter/wmf/enhwmf.cxx | 18 ++ vcl/source/filter/wmf/winmtf.cxx | 12 vcl/source/filter/wmf/winmtf.hxx |2 ++ 4 files changed, 29 insertions(+), 13 deletions(-) New commits: commit 0ca943155c04ee6272bba7ce957b8d87ae9442de Author: Eilidh McAdam eilidh.mca...@itomig.de Date: Fri Dec 12 00:45:11 2014 + EMF clip regions should be ignored sometimes. Specifically, the record EMR_EXTSELECTCLIPRGN specifies the default clip region if the RegionMode field is set to RGN_COPY. See EMF specification section 2.3.2.2 available from http://msdn.microsoft.com/en-us/library/cc230624.aspx A unit test had to be changed for this - instead of checking for a specific clip region, it now checks that no clip region is specified. This is under the assumption that the default clip region for our device context is show everything - i.e. no clip. Note also that RGN_COPY seems to be a common mode value for this record type. Change-Id: I7bd4fe305dda184d121465005fe09d3c113e3063 diff --git a/vcl/qa/cppunit/wmf/wmfimporttest.cxx b/vcl/qa/cppunit/wmf/wmfimporttest.cxx index f0d192c..6b1cec4 100644 --- a/vcl/qa/cppunit/wmf/wmfimporttest.cxx +++ b/vcl/qa/cppunit/wmf/wmfimporttest.cxx @@ -96,15 +96,7 @@ void WmfTest::testSine() CPPUNIT_ASSERT (pDoc); -assertXPath(pDoc, /metafile/sectrectclipregion[1], top, 0); -assertXPath(pDoc, /metafile/sectrectclipregion[1], left, 0); -assertXPath(pDoc, /metafile/sectrectclipregion[1], bottom, 1155947); -assertXPath(pDoc, /metafile/sectrectclipregion[1], right, 1155378); - -assertXPath(pDoc, /metafile/sectrectclipregion[2], top, 1411); -assertXPath(pDoc, /metafile/sectrectclipregion[2], left, 2962); -assertXPath(pDoc, /metafile/sectrectclipregion[2], bottom, 16651); -assertXPath(pDoc, /metafile/sectrectclipregion[2], right, 20698); +assertXPath(pDoc, /metafile/sectrectclipregion, 0); } void WmfTest::testEmfProblem() diff --git a/vcl/source/filter/wmf/enhwmf.cxx b/vcl/source/filter/wmf/enhwmf.cxx index 606a9f3..c314ef6 100644 --- a/vcl/source/filter/wmf/enhwmf.cxx +++ b/vcl/source/filter/wmf/enhwmf.cxx @@ -1149,10 +1149,20 @@ bool EnhWMFReader::ReadEnhWMF() pWMF-ReadInt32(cbRgnData); pWMF-ReadInt32(nClippingMode); -tools::PolyPolygon aPolyPoly; -if (cbRgnData) -ImplReadRegion(aPolyPoly, *pWMF, nRecSize); -pOut-SetClipPath(aPolyPoly, nClippingMode, false); +// This record's region data should be ignored if mode +// is RGN_COPY - see EMF spec section 2.3.2.2 +if (nClippingMode == RGN_COPY) +{ +pOut-SetDefaultClipPath(); +} +else +{ +tools::PolyPolygon aPolyPoly; +if (cbRgnData) +ImplReadRegion(aPolyPoly, *pWMF, nRecSize); +pOut-SetClipPath(aPolyPoly, nClippingMode, false); +} + } break; diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx index e15f2e0..8d40354 100644 --- a/vcl/source/filter/wmf/winmtf.cxx +++ b/vcl/source/filter/wmf/winmtf.cxx @@ -83,6 +83,12 @@ void WinMtfClipPath::moveClipRegion( const Size rSize ) maClip = basegfx::tools::B2DClipState( aCurrClip ); } +void WinMtfClipPath::setDefaultClipPath() +{ +// Empty clip region - everything visible +maClip = basegfx::tools::B2DClipState(); +} + basegfx::B2DPolyPolygon WinMtfClipPath::getClipPath() const { return maClip.getClipPoly(); @@ -797,6 +803,12 @@ void WinMtfOutput::SetClipPath( const tools::PolyPolygon rPolyPolygon, sal_Int3 aClipPath.setClipPath(aPolyPolygon, nClippingMode); } +void WinMtfOutput::SetDefaultClipPath() +{ +mbClipNeedsUpdate = true; +aClipPath.setDefaultClipPath(); +} + WinMtfOutput::WinMtfOutput( GDIMetaFile rGDIMetaFile ) : mnLatestTextAlign ( 0 ), mnTextAlign ( TA_LEFT | TA_TOP | TA_NOUPDATECP ), diff --git a/vcl/source/filter/wmf/winmtf.hxx b/vcl/source/filter/wmf/winmtf.hxx index 7d96353..7f7e781 100644 --- a/vcl/source/filter/wmf/winmtf.hxx +++ b/vcl/source/filter/wmf/winmtf.hxx @@ -249,6 +249,7 @@ public : voidintersectClipRect( const Rectangle rRect ); voidexcludeClipRect( const Rectangle rRect ); voidmoveClipRegion( const Size rSize ); +voidsetDefaultClipPath(); boolisEmpty() const { return maClip.isCleared(); } @@ -711,6 +712,7 @@ public: sal_Int32 nClippingMode, bool bIsMapped ); +void
[Libreoffice-commits] core.git: sw/source
sw/source/filter/ww8/docxattributeoutput.cxx | 16 +--- sw/source/filter/ww8/ww8atr.cxx |2 +- 2 files changed, 14 insertions(+), 4 deletions(-) New commits: commit a072b3533f44730565f42b45cfd9f77f44f506a9 Author: Eilidh McAdam eilidh.mca...@itomig.de Date: Tue Dec 9 19:53:56 2014 + fdo#59886 export fixed date and time fields to docx. Fixed date and time fields are supported in OOXML by adding the attribute fldLock=true to the fldChar element. This applies only to the first instance of fldChar in a field (i.e. when fldCharType is begin). Change-Id: Ibb84503b942ca20b53fe476e5006d64b2f3112e5 Reviewed-on: https://gerrit.libreoffice.org/13429 Reviewed-by: Miklos Vajna vmik...@collabora.co.uk Tested-by: Miklos Vajna vmik...@collabora.co.uk diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 4386d5b..87c193b 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -1443,9 +1443,19 @@ void DocxAttributeOutput::StartField_Impl( FieldInfos rInfos, bool bWriteRun ) else { // Write the field start -m_pSerializer-startElementNS( XML_w, XML_fldChar, -FSNS( XML_w, XML_fldCharType ), begin, -FSEND ); +if ( rInfos.pField rInfos.pField-GetSubType() FIXEDFLD ) +{ +m_pSerializer-startElementNS( XML_w, XML_fldChar, +FSNS( XML_w, XML_fldCharType ), begin, +FSNS( XML_w, XML_fldLock ), true, +FSEND ); +} +else +{ +m_pSerializer-startElementNS( XML_w, XML_fldChar, +FSNS( XML_w, XML_fldCharType ), begin, +FSEND ); +} if ( rInfos.pFieldmark ) WriteFFData( rInfos ); diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 4b7907f..be73977 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -2861,7 +2861,7 @@ void AttributeOutputBase::TextField( const SwFmtFld rField ) case RES_DATETIMEFLD: { OUString sStr; -if (FIXEDFLD nSubType || !GetExport().GetNumberFmt(*pFld, sStr)) +if (!GetExport().GetNumberFmt(*pFld, sStr)) bWriteExpand = true; else { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: writerfilter/source
writerfilter/source/dmapper/DomainMapper_Impl.cxx |9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) New commits: commit 3726737273e488ffab02f4a2dded5640521729cb Author: Eilidh McAdam eilidh.mca...@itomig.de Date: Tue Dec 9 19:55:18 2014 + Small fix for docx date field format import. The standard allows for arbitrary amounts of whitespace between tokens. MSO outputs with a space between \@ and , LO doesn't. To account for this, any whitespace between these tokens is stripped and parsing assumes a command looks like: DATE \@some format. Change-Id: I2620780da3ee873af6f35e236c7c34a073aebe73 Reviewed-on: https://gerrit.libreoffice.org/13430 Reviewed-by: Miklos Vajna vmik...@collabora.co.uk Tested-by: Miklos Vajna vmik...@collabora.co.uk diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 59fff49..d080ae8 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -2159,8 +2159,13 @@ style::NumberingType:: OUString lcl_ParseFormat( const OUString rCommand ) { -// The command looks like: DATE \@ dd -return msfilter::util::findQuotedText(rCommand, \\@ \, '\'); +// The command looks like: DATE \@dd +// Remove whitespace permitted by standard between \@ and +sal_Int32 delimPos = rCommand.indexOf(\\@); +sal_Int32 wsChars = rCommand.indexOf('\') - delimPos - 2; +OUString command = rCommand.replaceAt(delimPos+2, wsChars, ); + +return msfilter::util::findQuotedText(command, \\@\, '\'); } /*- extract a parameter (with or without quotes) between the command and the following backslash ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: writerfilter/source
writerfilter/source/dmapper/DomainMapper.cxx |4 writerfilter/source/dmapper/DomainMapper_Impl.cxx | 76 -- writerfilter/source/dmapper/DomainMapper_Impl.hxx |7 + writerfilter/source/ooxml/OOXMLFastContextHandler.cxx |9 ++ writerfilter/source/ooxml/OOXMLFastContextHandler.hxx |1 writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx| 20 writerfilter/source/ooxml/OOXMLPropertySetImpl.hxx| 14 +++ writerfilter/source/ooxml/factoryimpl_ns.py |8 + writerfilter/source/ooxml/model.xml |5 - 9 files changed, 137 insertions(+), 7 deletions(-) New commits: commit 8826934016d60d0a4a1e824e3f1cff814d915515 Author: Eilidh McAdam eilidh.mca...@itomig.de Date: Wed Dec 10 03:50:10 2014 + Support for docx import of fixed date and time fields. If a field is fixed, mark it as such and parse value to seed it. This is the other half of the docx filter improvement for fdo#59886. Reviewed on: https://gerrit.libreoffice.org/13431 Change-Id: Id00c454921cd386589e04b9572f4040898625a6f diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index ec5afab..2f0e43d 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -2826,6 +2826,10 @@ void DomainMapper::lcl_text(const sal_uInt8 * data_, size_t len) switch(*data_) { case 0x02: return; //footnote character +case 0x08: // Lock field if in field context +if (m_pImpl-IsOpenField()) +m_pImpl-SetFieldLocked(); +return; case 0x0c: //page break m_pImpl-deferBreak(PAGE_BREAK); return; diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index d080ae8..a3694bd 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -161,6 +161,7 @@ DomainMapper_Impl::DomainMapper_Impl( m_xComponentContext( xContext ), m_bSetUserFieldContent( false ), m_bSetCitation( false ), +m_bSetDateValue( false ), m_bIsFirstSection( true ), m_bIsColumnBreakDeferred( false ), m_bIsPageBreakDeferred( false ), @@ -2588,6 +2589,13 @@ bool DomainMapper_Impl::IsOpenField() const return !m_aFieldStack.empty(); } +// Mark top field context as containing a fixed field +void DomainMapper_Impl::SetFieldLocked() +{ +if (IsOpenField()) +m_aFieldStack.top()-SetFieldLocked(); +} + HeaderFooterContext::HeaderFooterContext(bool bTextInserted) : m_bTextInserted(bTextInserted) { @@ -2600,7 +2608,8 @@ bool HeaderFooterContext::getTextInserted() FieldContext::FieldContext(uno::Reference text::XTextRange const xStart) : m_bFieldCommandCompleted(false) -,m_xStartRange( xStart ) +, m_xStartRange( xStart ) +, m_bFieldLocked( false ) { m_pProperties.reset(new PropertyMap()); } @@ -3399,6 +3408,7 @@ void DomainMapper_Impl::CloseFieldCommand() { m_bSetUserFieldContent = false; m_bSetCitation = false; +m_bSetDateValue = false; FieldConversionMap_t aFieldConversionMap = lcl_GetFieldConversion(); try @@ -3509,10 +3519,19 @@ void DomainMapper_Impl::CloseFieldCommand() case FIELD_DATE: if (xFieldProperties.is()) { -//not fixed, -xFieldProperties-setPropertyValue( -rPropNameSupplier.GetName(PROP_IS_FIXED), -uno::makeAny( false )); +// Get field fixed property from the context handler +if (pContext-IsFieldLocked()) +{ +xFieldProperties-setPropertyValue( +rPropNameSupplier.GetName(PROP_IS_FIXED), +uno::makeAny( true )); +m_bSetDateValue = true; +} +else +xFieldProperties-setPropertyValue( +rPropNameSupplier.GetName(PROP_IS_FIXED), +uno::makeAny( false )); + xFieldProperties-setPropertyValue( rPropNameSupplier.GetName(PROP_IS_DATE), uno::makeAny( true )); @@ -3902,7 +3921,16 @@ void DomainMapper_Impl::CloseFieldCommand() case FIELD_SYMBOL : break; case FIELD_TEMPLATE: break; case FIELD_TIME : +{ +if (pContext-IsFieldLocked
[Libreoffice-commits] core.git: sw/qa
sw/qa/extras/ooxmlexport/data/fixed-date-field.docx |binary sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx | 22 2 files changed, 22 insertions(+) New commits: commit 8ab2b17015592a6cdc8247b8bc245ff5f88bfec9 Author: Eilidh McAdam eilidh.mca...@itomig.de Date: Thu Dec 11 00:26:41 2014 + fdo#59886 unit tests for DOCX fixed date field import/export. Checks fixed date fields are exported to docx and imported from docx with correct initial value. Change-Id: Ia6b6180b59806e624b03dc81a903ab1ac6d33307 Reviewed-on: https://gerrit.libreoffice.org/13432 Reviewed-by: Miklos Vajna vmik...@collabora.co.uk Tested-by: Miklos Vajna vmik...@collabora.co.uk diff --git a/sw/qa/extras/ooxmlexport/data/fixed-date-field.docx b/sw/qa/extras/ooxmlexport/data/fixed-date-field.docx new file mode 100644 index 000..960e2db Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fixed-date-field.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx index d2a4c7f..7d18e3e 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx @@ -649,6 +649,28 @@ DECLARE_OOXMLEXPORT_TEST(testSdtCompanyMultipara, sdt-company-multipara.docx) } } +DECLARE_OOXMLEXPORT_TEST(testFixedDateFields, fixed-date-field.docx) +{ +uno::Referencetext::XTextFieldsSupplier xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); +uno::Referencecontainer::XEnumerationAccess xFieldsAccess(xTextFieldsSupplier-getTextFields()); +uno::Referencecontainer::XEnumeration xFields(xFieldsAccess-createEnumeration()); +uno::Referencebeans::XPropertySet xField(xFields-nextElement(), uno::UNO_QUERY); + +// Check fixed property was imported and date value was parsed correctly +CPPUNIT_ASSERT_EQUAL(true, getPropertybool(xField, IsFixed)); +com::sun::star::util::DateTime date = getPropertycom::sun::star::util::DateTime(xField, DateTimeValue); +CPPUNIT_ASSERT_EQUAL((sal_uInt16)24, date.Day); +CPPUNIT_ASSERT_EQUAL((sal_uInt16)7, date.Month); +CPPUNIT_ASSERT_EQUAL((sal_Int16)2014, date.Year); + +if (xmlDocPtr pXmlDoc = parseExport(word/document.xml)) +{ +// Previously, fixed fields were exported as static text (Date (fixed)) +// Check they are now exported correctly as fldChar with fldLock attribute +assertXPath(pXmlDoc, /w:document/w:body/w:p/w:r[1]/w:fldChar, fldLock, true); +} +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ 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/23/1123/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/82/10982/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/82/10982/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/23/1123/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/02/702/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/82/10982/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/82/10982/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/02/702/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/82/10982/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/82/10982/6'
___ 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/66/9866/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/66/9866/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/81/10981/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/10981/6'
___ 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/31/6531/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/10981/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/93/3093/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/81/10981/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/04/704/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/32/6532/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/10981/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/81/10981/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/25/1125/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/49/649/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/25/1125/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/32/6532/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/48/648/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/55/1655/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/47/647/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/55/1655/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/24/1124/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/24/1124/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/09/709/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/03/703/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/03/703/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sd/source
sd/source/ui/view/DocumentRenderer.cxx | 33 - 1 file changed, 28 insertions(+), 5 deletions(-) New commits: commit 4bd844d6842becf495834bda997d2731bd49316d Author: Eilidh McAdam eil...@lanedo.com Date: Mon Jun 23 20:55:21 2014 +0100 Make Draw use paper size when printing - fdo#63905 Previously, Draw/Impress use the default size from the printer. Now Draw uses the paper size (specified in page formatting). Impress still uses the old method - not sure if this is correct but printing handouts etc probably complicate print/paper size. Reviewed-on: https://gerrit.libreoffice.org/9866 Reviewed-by: Matúš Kukan matus.ku...@collabora.com Tested-by: Matúš Kukan matus.ku...@collabora.com (cherry picked from commit 7b31e45ec7106d2cfbdbb7915d97667ba710f81c) Conflicts: sd/source/ui/view/DocumentRenderer.cxx Change-Id: If90bae4ac59cd95dd50fcd8deb25fd900756193e diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index 4136e89d8..52aa9c5 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -1418,7 +1418,19 @@ private: else if (rInfo.maPageSize.Width() rInfo.maPageSize.Height()) rInfo.meOrientation = ORIENTATION_LANDSCAPE; -const Size aPaperSize (rInfo.mpPrinter-GetPaperSize()); +// Draw should abide by specified paper size +Size aPaperSize; +if (mpOptions-IsDraw()) +{ +aPaperSize.setWidth(rInfo.maPageSize.Width()); +aPaperSize.setHeight(rInfo.maPageSize.Height()); +} +else +{ +aPaperSize.setWidth(rInfo.mpPrinter-GetPaperSize().Width()); +aPaperSize.setHeight(rInfo.mpPrinter-GetPaperSize().Height()); +} + if( (rInfo.meOrientation == ORIENTATION_LANDSCAPE (aPaperSize.Width() aPaperSize.Height())) || @@ -1483,10 +1495,21 @@ private: if (mpOptions-IsTime()) aInfo.msTimeDate += GetSdrGlobalData().GetLocaleData()-getTime( Time( Time::SYSTEM ), sal_False, sal_False ); -aInfo.maPrintSize = aInfo.mpPrinter-GetOutputSize(); -maPrintSize = awt::Size( -aInfo.mpPrinter-GetPaperSize().Width(), -aInfo.mpPrinter-GetPaperSize().Height()); + +// Draw should use specified paper size when printing +if (mpOptions-IsDraw()) +{ +aInfo.maPrintSize = mrBase.GetDocument()-GetSdPage(0, PK_STANDARD)-GetSize(); +maPrintSize = awt::Size(aInfo.maPrintSize.Width(), +aInfo.maPrintSize.Height()); +} +else +{ +aInfo.maPrintSize = aInfo.mpPrinter-GetOutputSize(); +maPrintSize = awt::Size( +aInfo.mpPrinter-GetPaperSize().Width(), +aInfo.mpPrinter-GetPaperSize().Height()); +} switch (mpOptions-GetOutputQuality()) { ___ 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' - sd/source
sd/source/ui/view/DocumentRenderer.cxx | 33 - 1 file changed, 28 insertions(+), 5 deletions(-) New commits: commit a7eed1e17cfb101210db8aa839171f00d0730582 Author: Eilidh McAdam eil...@lanedo.com Date: Mon Jun 23 20:55:21 2014 +0100 Make Draw use paper size when printing - fdo#63905 Previously, Draw/Impress use the default size from the printer. Now Draw uses the paper size (specified in page formatting). Impress still uses the old method - not sure if this is correct but printing handouts etc probably complicate print/paper size. Change-Id: If90bae4ac59cd95dd50fcd8deb25fd900756193e Reviewed-on: https://gerrit.libreoffice.org/9866 Reviewed-by: Matúš Kukan matus.ku...@collabora.com Tested-by: Matúš Kukan matus.ku...@collabora.com (cherry picked from commit 7b31e45ec7106d2cfbdbb7915d97667ba710f81c) diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index 59106a7..7080e9d 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -1418,7 +1418,19 @@ private: else if (rInfo.maPageSize.Width() rInfo.maPageSize.Height()) rInfo.meOrientation = ORIENTATION_LANDSCAPE; -const Size aPaperSize (rInfo.mpPrinter-GetPaperSize()); +// Draw should abide by specified paper size +Size aPaperSize; +if (mpOptions-IsDraw()) +{ +aPaperSize.setWidth(rInfo.maPageSize.Width()); +aPaperSize.setHeight(rInfo.maPageSize.Height()); +} +else +{ +aPaperSize.setWidth(rInfo.mpPrinter-GetPaperSize().Width()); +aPaperSize.setHeight(rInfo.mpPrinter-GetPaperSize().Height()); +} + if( (rInfo.meOrientation == ORIENTATION_LANDSCAPE (aPaperSize.Width() aPaperSize.Height())) || @@ -1483,10 +1495,21 @@ private: if (mpOptions-IsTime()) aInfo.msTimeDate += GetSdrGlobalData().GetLocaleData()-getTime( Time( Time::SYSTEM ), false, false ); -aInfo.maPrintSize = aInfo.mpPrinter-GetOutputSize(); -maPrintSize = awt::Size( -aInfo.mpPrinter-GetPaperSize().Width(), -aInfo.mpPrinter-GetPaperSize().Height()); + +// Draw should use specified paper size when printing +if (mpOptions-IsDraw()) +{ +aInfo.maPrintSize = mrBase.GetDocument()-GetSdPage(0, PK_STANDARD)-GetSize(); +maPrintSize = awt::Size(aInfo.maPrintSize.Width(), +aInfo.maPrintSize.Height()); +} +else +{ +aInfo.maPrintSize = aInfo.mpPrinter-GetOutputSize(); +maPrintSize = awt::Size( +aInfo.mpPrinter-GetPaperSize().Width(), +aInfo.mpPrinter-GetPaperSize().Height()); +} switch (mpOptions-GetOutputQuality()) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sd/source
sd/source/ui/view/DocumentRenderer.cxx | 33 - 1 file changed, 28 insertions(+), 5 deletions(-) New commits: commit 7b31e45ec7106d2cfbdbb7915d97667ba710f81c Author: Eilidh McAdam eil...@lanedo.com Date: Mon Jun 23 20:55:21 2014 +0100 Make Draw use paper size when printing - fdo#63905 Previously, Draw/Impress use the default size from the printer. Now Draw uses the paper size (specified in page formatting). Impress still uses the old method - not sure if this is correct but printing handouts etc probably complicate print/paper size. Change-Id: If90bae4ac59cd95dd50fcd8deb25fd900756193e Reviewed-on: https://gerrit.libreoffice.org/9866 Reviewed-by: Matúš Kukan matus.ku...@collabora.com Tested-by: Matúš Kukan matus.ku...@collabora.com diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index ba5445d..c370a69 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -1369,7 +1369,19 @@ private: else if (rInfo.maPageSize.Width() rInfo.maPageSize.Height()) rInfo.meOrientation = ORIENTATION_LANDSCAPE; -const Size aPaperSize (rInfo.mpPrinter-GetPaperSize()); +// Draw should abide by specified paper size +Size aPaperSize; +if (mpOptions-IsDraw()) +{ +aPaperSize.setWidth(rInfo.maPageSize.Width()); +aPaperSize.setHeight(rInfo.maPageSize.Height()); +} +else +{ +aPaperSize.setWidth(rInfo.mpPrinter-GetPaperSize().Width()); +aPaperSize.setHeight(rInfo.mpPrinter-GetPaperSize().Height()); +} + if( (rInfo.meOrientation == ORIENTATION_LANDSCAPE (aPaperSize.Width() aPaperSize.Height())) || @@ -1432,10 +1444,21 @@ private: if (mpOptions-IsTime()) aInfo.msTimeDate += GetSdrGlobalData().GetLocaleData()-getTime( Time( Time::SYSTEM ), false, false ); -aInfo.maPrintSize = aInfo.mpPrinter-GetOutputSize(); -maPrintSize = awt::Size( -aInfo.mpPrinter-GetPaperSize().Width(), -aInfo.mpPrinter-GetPaperSize().Height()); + +// Draw should use specified paper size when printing +if (mpOptions-IsDraw()) +{ +aInfo.maPrintSize = mrBase.GetDocument()-GetSdPage(0, PK_STANDARD)-GetSize(); +maPrintSize = awt::Size(aInfo.maPrintSize.Width(), +aInfo.maPrintSize.Height()); +} +else +{ +aInfo.maPrintSize = aInfo.mpPrinter-GetOutputSize(); +maPrintSize = awt::Size( +aInfo.mpPrinter-GetPaperSize().Width(), +aInfo.mpPrinter-GetPaperSize().Height()); +} switch (mpOptions-GetOutputQuality()) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/inc sc/source
sc/inc/pagepar.hxx |1 + sc/source/core/data/pagepar.cxx |2 +- sc/source/ui/view/printfun.cxx | 34 ++ 3 files changed, 36 insertions(+), 1 deletion(-) New commits: commit a37092075791ccbe6081e3e01990df6d9e6cdce6 Author: Eilidh McAdam eil...@lanedo.com Date: Sat Nov 2 21:05:12 2013 + Fix for Calc page scaling - see #i54993# If a print range's manual breaks forced it over more pages than specified by the sheet scale settings, the zoom calculation wasn't able to converge on a zoom level, so it bottomed out at ZOOM_MIN. This issue only appears if the Calc/Print/Page/ForceBreaks option is selected and simply ensures the minimum number of pages is at least the number required by the breaks in the sheet. Change-Id: Iba36e850081718b1aa43e5c3db3c883530885853 Reviewed-on: https://gerrit.libreoffice.org/6532 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com diff --git a/sc/inc/pagepar.hxx b/sc/inc/pagepar.hxx index a898d5a..581d08a 100644 --- a/sc/inc/pagepar.hxx +++ b/sc/inc/pagepar.hxx @@ -41,6 +41,7 @@ struct ScPageTableParam sal_BoolbScaleAll; sal_BoolbScaleTo; sal_BoolbScalePageNum; +sal_BoolbForceBreaks; sal_uInt16 nScaleAll; sal_uInt16 nScaleWidth; sal_uInt16 nScaleHeight; diff --git a/sc/source/core/data/pagepar.cxx b/sc/source/core/data/pagepar.cxx index 7cce7c7..cf4ef92 100644 --- a/sc/source/core/data/pagepar.cxx +++ b/sc/source/core/data/pagepar.cxx @@ -43,7 +43,7 @@ void ScPageTableParam::Reset() bCellContent = sal_True; bNotes=bGrid=bHeaders=bDrawings= bLeftRight=bScaleAll=bScaleTo=bScalePageNum= -bFormulas=bNullVals=bSkipEmpty = false; +bFormulas=bNullVals=bSkipEmpty=bForceBreaks = false; bTopDown=bScaleNone=bCharts=bObjects= sal_True; nScaleAll = 100; nScalePageNum = nScaleWidth = nScaleHeight = 0; diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index 6584bb8..6ab7d1e 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -924,6 +924,8 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions ) // If pPageData is set, only the breaks are interesting for the // pagebreak preview, empty pages are not addressed separately. +aTableParam.bForceBreaks = pOptions pOptions-GetForceBreaks(); + //-- // TabPage Parts: //-- @@ -2751,6 +2753,21 @@ void ScPrintFunc::CalcZoom( sal_uInt16 nRangeNo ) // calcu nZoom = 100; sal_uInt16 nPagesToFit = aTableParam.nScalePageNum; +// If manual breaks are forced, calculate minimum # pages required +if (aTableParam.bForceBreaks) +{ + sal_uInt16 nMinPages = 0; + std::setSCROW aRowBreaks; + std::setSCCOL aColBreaks; + pDoc-GetAllRowBreaks(aRowBreaks, nPrintTab, false, true); + pDoc-GetAllColBreaks(aColBreaks, nPrintTab, false, true); + nMinPages = (aRowBreaks.size() + 1) * (aColBreaks.size() + 1); + + // #i54993# use min forced by breaks if it's # pages in + // scale parameter to avoid bottoming out at = ZOOM_MIN + nPagesToFit = nMinPages nPagesToFit ? nMinPages : nPagesToFit; +} + sal_uInt16 nLastFitZoom = 0, nLastNonFitZoom = 0; while (true) { @@ -2793,6 +2810,23 @@ void ScPrintFunc::CalcZoom( sal_uInt16 nRangeNo ) // calcu sal_uInt16 nW = aTableParam.nScaleWidth; sal_uInt16 nH = aTableParam.nScaleHeight; +// If manual breaks are forced, calculate minimum # pages required +if (aTableParam.bForceBreaks) +{ + sal_uInt16 nMinPagesW = 0, nMinPagesH = 0; + std::setSCROW aRowBreaks; + std::setSCCOL aColBreaks; + pDoc-GetAllRowBreaks(aRowBreaks, nPrintTab, false, true); + pDoc-GetAllColBreaks(aColBreaks, nPrintTab, false, true); + nMinPagesW = aColBreaks.size() + 1; + nMinPagesH = aRowBreaks.size() + 1; + + // #i54993# use min forced by breaks if it's # pages in + // scale parameters to avoid bottoming out at = ZOOM_MIN + nW = nMinPagesW nW ? nMinPagesW : nW; + nH = nMinPagesH nH ? nMinPagesH : nH; +} + sal_uInt16 nLastFitZoom = 0, nLastNonFitZoom = 0; while (true) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: officecfg/registry sc/inc sc/source sc/uiconfig
officecfg/registry/schema/org/openoffice/Office/Calc.xcs |7 ++ sc/inc/printopt.hxx |3 + sc/inc/table.hxx |1 sc/source/core/data/table1.cxx |3 - sc/source/core/data/table5.cxx | 39 +-- sc/source/core/tool/printopt.cxx | 20 ++- sc/source/ui/inc/tpprint.hxx |1 sc/source/ui/optdlg/tpprint.cxx |7 ++ sc/uiconfig/scalc/ui/optdlg.ui | 16 ++ 9 files changed, 76 insertions(+), 21 deletions(-) New commits: commit 7e4f8eb5eff642c7fc8bfa665289d55a1c5b054b Author: Eilidh McAdam eil...@lanedo.com Date: Sat Nov 2 20:35:44 2013 + fdo#40788: Allow manual breaks in Calc to be forced If the scale settings specify that the print ranges must be scaled across a specific number of pages, the default behaviour is to ignore breaks to avoid the case where breaks force more pages than specified. Here, an option under Calc - Print - Pages is added so that the user can specify that manual row and column breaks should be forced. Change-Id: I445cd7ce9e16e4ec2d0c320f059edad62b40f22d Reviewed-on: https://gerrit.libreoffice.org/6531 Tested-by: Eike Rathke er...@redhat.com Reviewed-by: Eike Rathke er...@redhat.com diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs index 4c583a4..0cdb9d5 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs @@ -1659,6 +1659,13 @@ /info valuefalse/value /prop +prop oor:name=ForceBreaks oor:type=xs:boolean oor:nillable=false + info +descSpecifies whether manual row and column breaks should be forced, regardless of sheet scale settings./desc +labelForce manual breaks/label + /info + valuefalse/value +/prop /group group oor:name=Other info diff --git a/sc/inc/printopt.hxx b/sc/inc/printopt.hxx index 7148c68..ff1fd67 100644 --- a/sc/inc/printopt.hxx +++ b/sc/inc/printopt.hxx @@ -29,6 +29,7 @@ class SC_DLLPUBLIC ScPrintOptions private: sal_BoolbSkipEmpty; sal_BoolbAllSheets; +sal_BoolbForceBreaks; public: ScPrintOptions(); @@ -39,6 +40,8 @@ public: voidSetSkipEmpty( sal_Bool bVal ) { bSkipEmpty = bVal; } sal_BoolGetAllSheets() const{ return bAllSheets; } voidSetAllSheets( sal_Bool bVal ) { bAllSheets = bVal; } +sal_BoolGetForceBreaks() const { return bForceBreaks; } +voidSetForceBreaks( sal_Bool bVal ) { bForceBreaks = bVal; } voidSetDefaults(); diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 394847f..126b0ae 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -194,6 +194,7 @@ private: boolbPrintEntireSheet:1; boolbActiveScenario:1; boolmbPageBreaksValid:1; +boolmbForceBreaks:1; friend class ScDocument;// for FillInfo friend class ScValueIterator; diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index ca8a07c..4eed3b0 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -271,7 +271,8 @@ ScTable::ScTable( ScDocument* pDoc, SCTAB nNewTab, const OUString rNewName, bGlobalKeepQuery(false), bPrintEntireSheet(true), bActiveScenario(false), -mbPageBreaksValid(false) +mbPageBreaksValid(false), +mbForceBreaks(false) { if (bColInfo) diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx index 0392b21..8c8d6bf 100644 --- a/sc/source/core/data/table5.cxx +++ b/sc/source/core/data/table5.cxx @@ -38,11 +38,14 @@ #include segmenttree.hxx #include columniterator.hxx #include globalnames.hxx +#include scmod.hxx +#include printopt.hxx #include com/sun/star/sheet/TablePageBreakData.hpp #include algorithm #include limits +#include iostream using ::com::sun::star::uno::Sequence; using ::com::sun::star::sheet::TablePageBreakData; @@ -66,7 +69,8 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) if (!bPageSizeValid) return; -if (mbPageBreaksValid) +// Always update breaks if force breaks option has changed +if (mbPageBreaksValid mbForceBreaks == SC_MOD()-GetPrintOptions().GetForceBreaks()) return; } @@ -120,24 +124,29 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) } // get bSkipColBreaks/bSkipRowBreaks flags: - +// fdo#40788 - print range scale settings can cause manual breaks to be +// ignored (see below). This behaviour may now
[Libreoffice-commits] core.git: oox/source
oox/source/vml/vmlformatting.cxx | 107 ++- 1 file changed, 96 insertions(+), 11 deletions(-) New commits: commit 942b184d81f129309072ca973fc274c40bac67b8 Author: Eilidh McAdam eilidh.mca...@gmail.com Date: Wed Mar 27 13:40:32 2013 + fdo#36791 Added cases for unsupported VML commands Fixes crash on two-character VML path commands. Change-Id: Ia1abca37352b1feb20a41b4bac68ecb9e40ed8dc Reviewed-on: https://gerrit.libreoffice.org/3093 Tested-by: Miklos Vajna vmik...@suse.cz Reviewed-by: Eilidh McAdam eilidh.mca...@gmail.com Reviewed-by: Miklos Vajna vmik...@suse.cz diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx index 05940f9..b3cac88 100644 --- a/oox/source/vml/vmlformatting.cxx +++ b/oox/source/vml/vmlformatting.cxx @@ -273,8 +273,9 @@ bool lclExtractDouble( double orfValue, sal_Int32 ornEndPos, const OUString r sal_Int32 nTokenStart = 0; sal_Int32 nTokenLen = 0; sal_Int32 nParamCount = 0; +bool bCommand = false; enum VML_State { START, MOVE_REL, MOVE_ABS, BEZIER_REL, BEZIER_ABS, - LINE_REL, LINE_ABS, CLOSE, END }; + LINE_REL, LINE_ABS, CLOSE, END, UNSUPPORTED }; VML_State state = START; rPointLists.push_back( ::std::vector Point() ); @@ -288,7 +289,7 @@ bool lclExtractDouble( double orfValue, sal_Int32 ornEndPos, const OUString r else if ( rPath[ i ] != ' ' ) { // Store coordinate from current token -if ( state != START ) +if ( state != START state != UNSUPPORTED ) { if ( nTokenLen 0 ) aCoordList.push_back( rPath.copy( nTokenStart, nTokenLen ).toInt32() ); @@ -374,25 +375,109 @@ bool lclExtractDouble( double orfValue, sal_Int32 ornEndPos, const OUString r break; case START: +case UNSUPPORTED: break; } aCoordList.clear(); } -// Move on to current command state +// Allow two-char commands to peek ahead to the next character +char nextChar = '\0'; +if (i+1 rPath.getLength()) +nextChar = rPath[i+1]; + +// Move to relevant state upon finding a command +bCommand = true; switch ( rPath[ i ] ) { -case 't': state = MOVE_REL; nTokenLen = 0; nParamCount = 2 * 2; break; -case 'm': state = MOVE_ABS; nTokenLen = 0; nParamCount = 2 * 2; break; -case 'v': state = BEZIER_REL; nTokenLen = 0; nParamCount = 2 * 6; break; -case 'c': state = BEZIER_ABS; nTokenLen = 0; nParamCount = 2 * 6; break; -case 'r': state = LINE_REL; nTokenLen = 0; nParamCount = 2 * 2; break; -case 'l': state = LINE_ABS; nTokenLen = 0; nParamCount = 2 * 2; break; -case 'x': state = CLOSE; nTokenLen = 0; break; -case 'e': state = END; break; +// Single-character commands +case 't': // rmoveto +state = MOVE_REL; nParamCount = 2 * 2; break; +case 'm': // moveto +state = MOVE_ABS; nParamCount = 2 * 2; break; +case 'v': // rcurveto +state = BEZIER_REL; nParamCount = 2 * 6; break; +case 'c': // curveto +state = BEZIER_ABS; nParamCount = 2 * 6; break; +case 'r': // rlineto +state = LINE_REL; nParamCount = 2 * 2; break; +case 'l': // lineto +state = LINE_ABS; nParamCount = 2 * 2; break; +case 'x': // close +state = CLOSE; break; +case 'e': // end +state = END; break; + +// Two-character commands +case 'n': +{ +switch ( nextChar ) +{ +case 'f': // nf - nofill +case 's': // ns - nostroke +state = UNSUPPORTED; i++; break; +} +break; +} +case 'a': // Elliptical curves +{ +switch ( nextChar ) +{ +case 'e': // ae - angleellipseto +case 'l': // al - angleellipse +state = UNSUPPORTED; i++; break; +case 't': // at - arcto +case 'r': // ar - arc +state = UNSUPPORTED; i++; break; +} +break; +} +case 'w': // Clockwise elliptical arcs +{ +switch ( nextChar ) +{ +case 'a': // wa - clockwisearcto +case 'r': // wr - clockwisearc +state = UNSUPPORTED; i++; break; +} +break; +} +case 'q
[PATCH] fdo#35791 Added cases for unsupported VML commands
) +{ +case 'a': // ha - AutoLine +case 'b': // hb - AutoCurve +case 'c': // hc - CornerLine +case 'd': // hd - CornerCurve +case 'e': // he - SmoothLine +case 'f': // hf - SmoothCurve +case 'g': // hg - SymmetricLine +case 'h': // hh - SymmetricCurve +case 'i': // hi - Freeform +state = UNSUPPORTED; i++; break; +} +break; +} +default: +bCommand = false; +break; } +if (bCommand) nTokenLen = 0; nTokenStart = i+1; } } -- To view, visit https://gerrit.libreoffice.org/3093 To unsubscribe, visit https://gerrit.libreoffice.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia1abca37352b1feb20a41b4bac68ecb9e40ed8dc Gerrit-PatchSet: 1 Gerrit-Project: core Gerrit-Branch: master Gerrit-Owner: Eilidh McAdam eilidh.mca...@gmail.com ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[PATCH] Fixes image drop shadow export to DOCX.
Hi, I have submitted a patch for review: https://gerrit.libreoffice.org/1655 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/55/1655/1 Fixes image drop shadow export to DOCX. Word has problems if the effect extent element is omitted. This gets the minimum required extent using the shadow position. Change-Id: I69d0d7a694c34f50289253e5cb7c4265198deaa8 --- M sw/source/filter/ww8/docxattributeoutput.cxx 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index b97b368..2669b5f 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2141,9 +2141,35 @@ XML_cx, aWidth.getStr(), XML_cy, aHeight.getStr(), FSEND ); -// TODO - the right effectExtent, extent including the effect + +// effectExtent, extent including the effect (shadow only for now) +SvxShadowItem aShadowItem = pFrmFmt-GetShadow(); +OString aLeftExt(0), aRightExt(0), aTopExt(0), aBottomExt(0); +if ( aShadowItem.GetLocation() != SVX_SHADOW_NONE ) +{ +OString aShadowWidth( OString::valueOf( TwipsToEMU( aShadowItem.GetWidth() ) ) ); +switch ( aShadowItem.GetLocation() ) +{ +case SVX_SHADOW_TOPLEFT: +aTopExt = aLeftExt = aShadowWidth; +break; +case SVX_SHADOW_TOPRIGHT: +aTopExt = aRightExt = aShadowWidth; +break; +case SVX_SHADOW_BOTTOMLEFT: +aBottomExt = aLeftExt = aShadowWidth; +break; +case SVX_SHADOW_BOTTOMRIGHT: +aBottomExt = aRightExt = aShadowWidth; +break; +case SVX_SHADOW_NONE: +case SVX_SHADOW_END: +break; +} +} + m_pSerializer-singleElementNS( XML_wp, XML_effectExtent, -XML_l, 0, XML_t, 0, XML_r, 0, XML_b, 0, +XML_l, aLeftExt, XML_t, aTopExt, XML_r, aRightExt, XML_b, aBottomExt, FSEND ); if( isAnchor ) @@ -2275,7 +2301,6 @@ m_pSerializer-endElementNS( XML_a, XML_ln ); // Output effects -SvxShadowItem aShadowItem = pFrmFmt-GetShadow(); if ( aShadowItem.GetLocation() != SVX_SHADOW_NONE ) { // Distance is measured diagonally from corner -- To view, visit https://gerrit.libreoffice.org/1655 To unsubscribe, visit https://gerrit.libreoffice.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I69d0d7a694c34f50289253e5cb7c4265198deaa8 Gerrit-PatchSet: 1 Gerrit-Project: core Gerrit-Branch: master Gerrit-Owner: Eilidh McAdam eilidh.mca...@gmail.com ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[PATCH] docx fine dashed table border import test case.
Hi, I have submitted a patch for review: https://gerrit.libreoffice.org/1125 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/25/1125/1 docx fine dashed table border import test case. Change-Id: I27ee8e360b8fd530f8cfefc58c8a0f96d706b979 --- A sw/qa/extras/ooxmlimport/data/tableborder-finedash.docx M sw/qa/extras/ooxmlimport/ooxmlimport.cxx 2 files changed, 16 insertions(+), 1 deletion(-) -- To view, visit https://gerrit.libreoffice.org/1125 To unsubscribe, visit https://gerrit.libreoffice.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I27ee8e360b8fd530f8cfefc58c8a0f96d706b979 Gerrit-PatchSet: 1 Gerrit-Project: core Gerrit-Branch: master Gerrit-Owner: Eilidh McAdam eilidh.mca...@gmail.com ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[PATCH] Export finely dashed borders to docx.
Hi, I have submitted a patch for review: https://gerrit.libreoffice.org/1124 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/24/1124/1 Export finely dashed borders to docx. Change-Id: I4a65f8e874abe406a9cd2d3a088ea52f0850088f --- M sw/source/filter/ww8/docxattributeoutput.cxx 1 file changed, 3 insertions(+), 0 deletions(-) -- To view, visit https://gerrit.libreoffice.org/1124 To unsubscribe, visit https://gerrit.libreoffice.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4a65f8e874abe406a9cd2d3a088ea52f0850088f Gerrit-PatchSet: 1 Gerrit-Project: core Gerrit-Branch: master Gerrit-Owner: Eilidh McAdam eilidh.mca...@gmail.com ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[PATCH] Export image shadow effects to docx.
Hi, I have submitted a patch for review: https://gerrit.libreoffice.org/709 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/09/709/1 Export image shadow effects to docx. Change-Id: Ic8be107eeaeed286359869fd7e6712c3f740fba5 --- M sw/source/filter/ww8/docxattributeoutput.cxx 1 file changed, 32 insertions(+), 0 deletions(-) -- To view, visit https://gerrit.libreoffice.org/709 To unsubscribe, visit https://gerrit.libreoffice.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic8be107eeaeed286359869fd7e6712c3f740fba5 Gerrit-PatchSet: 1 Gerrit-Project: core Gerrit-Branch: master Gerrit-Owner: Eilidh McAdam eilidh.mca...@gmail.com ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[PATCH] Import shadow effect properties for shapes in docx.
Hi, I have submitted a patch for review: https://gerrit.libreoffice.org/702 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/02/702/1 Import shadow effect properties for shapes in docx. Change-Id: I0cfd6b45be268d688b7389c79c5e9ad7f48eb12d --- M oox/Library_oox.mk M oox/inc/oox/drawingml/drawingmltypes.hxx A oox/inc/oox/drawingml/effectproperties.hxx A oox/inc/oox/drawingml/effectpropertiescontext.hxx M oox/inc/oox/drawingml/shape.hxx M oox/inc/oox/drawingml/shapepropertymap.hxx A oox/source/drawingml/effectproperties.cxx A oox/source/drawingml/effectpropertiescontext.cxx M oox/source/drawingml/shape.cxx M oox/source/drawingml/shapepropertiescontext.cxx M oox/source/token/properties.txt 11 files changed, 274 insertions(+), 0 deletions(-) -- To view, visit https://gerrit.libreoffice.org/702 To unsubscribe, visit https://gerrit.libreoffice.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0cfd6b45be268d688b7389c79c5e9ad7f48eb12d Gerrit-PatchSet: 1 Gerrit-Project: core Gerrit-Branch: master Gerrit-Owner: Eilidh McAdam eilidh.mca...@gmail.com ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[PATCH] DOCX image drop shadow testcase.
Hi, I have submitted a patch for review: https://gerrit.libreoffice.org/704 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/04/704/1 DOCX image drop shadow testcase. Change-Id: I27fdf0abff997d31ae8814812f7af1ec15af --- A sw/qa/extras/ooxmlimport/data/imgshadow.docx M sw/qa/extras/ooxmlimport/ooxmlimport.cxx 2 files changed, 19 insertions(+), 1 deletion(-) -- To view, visit https://gerrit.libreoffice.org/704 To unsubscribe, visit https://gerrit.libreoffice.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I27fdf0abff997d31ae8814812f7af1ec15af Gerrit-PatchSet: 1 Gerrit-Project: core Gerrit-Branch: master Gerrit-Owner: Eilidh McAdam eilidh.mca...@gmail.com ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[PATCH] Apply shadow effect to graphics when importing from docx.
Hi, I have submitted a patch for review: https://gerrit.libreoffice.org/703 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/03/703/1 Apply shadow effect to graphics when importing from docx. Graphical objects imported into a text document do not seem to support differing X and Y distances for shadows, so the distance has been approximated by using the average of the two components. Change-Id: Ifd0c6d73b618cb2836837348d6f48c0efc0a9dc3 --- M writerfilter/source/dmapper/GraphicImport.cxx M writerfilter/source/dmapper/PropertyIds.cxx M writerfilter/source/dmapper/PropertyIds.hxx 3 files changed, 48 insertions(+), 0 deletions(-) -- To view, visit https://gerrit.libreoffice.org/703 To unsubscribe, visit https://gerrit.libreoffice.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifd0c6d73b618cb2836837348d6f48c0efc0a9dc3 Gerrit-PatchSet: 1 Gerrit-Project: core Gerrit-Branch: master Gerrit-Owner: Eilidh McAdam eilidh.mca...@gmail.com ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[PATCH] Add VML path parsing to .docx import filter.
Hi, I have submitted a patch for review: https://gerrit.libreoffice.org/648 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/48/648/1 Add VML path parsing to .docx import filter. Change-Id: Ibb90ff437f6de1cab98b64deeccfa38e0e30756b --- M oox/inc/oox/vml/vmlformatting.hxx M oox/source/vml/vmlformatting.cxx 2 files changed, 142 insertions(+), 0 deletions(-) -- To view, visit https://gerrit.libreoffice.org/648 To unsubscribe, visit https://gerrit.libreoffice.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibb90ff437f6de1cab98b64deeccfa38e0e30756b Gerrit-PatchSet: 1 Gerrit-Project: core Gerrit-Branch: master Gerrit-Owner: Eilidh McAdam eilidh.mca...@gmail.com ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[PATCH] Correctly import multiple-point curves from RTF document.
Hi, I have submitted a patch for review: https://gerrit.libreoffice.org/646 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/46/646/1 Correctly import multiple-point curves from RTF document. The RTF segment specifier seems to indicate the type of segment with the first two bytes and how many points the specifier applies to with the last two bytes. Note that without further test docs, this hypothesis is yet to be thoroughly tested. Change-Id: I6f85435f52ef244b9c417e67d54c236ef4c7f149 --- M writerfilter/source/rtftok/rtfsdrimport.cxx 1 file changed, 11 insertions(+), 2 deletions(-) -- To view, visit https://gerrit.libreoffice.org/646 To unsubscribe, visit https://gerrit.libreoffice.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6f85435f52ef244b9c417e67d54c236ef4c7f149 Gerrit-PatchSet: 1 Gerrit-Project: core Gerrit-Branch: master Gerrit-Owner: Eilidh McAdam eilidh.mca...@gmail.com ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice-commits] .: 3 commits - setup_native/source solenv/bin
setup_native/source/win32/wintools/msidb/msidb.c | 20 +--- solenv/bin/make_installer.pl |4 ++-- solenv/bin/modules/installer/windows/msiglobal.pm |5 - solenv/bin/modules/installer/windows/msp.pm |3 +++ solenv/bin/modules/installer/windows/update.pm|3 +++ 5 files changed, 25 insertions(+), 10 deletions(-) New commits: commit 73ec8371d797b5be564381d8982977696444ffa6 Author: Eilidh McAdam eil...@lanedo.com Date: Thu Aug 2 12:05:42 2012 +0100 Installer logic changed call msi functions on request Change-Id: Ic73825cab20bd9e56be69531cba6452fe0202b72 diff --git a/solenv/bin/make_installer.pl b/solenv/bin/make_installer.pl index ea77d9f..38b4793 100644 --- a/solenv/bin/make_installer.pl +++ b/solenv/bin/make_installer.pl @@ -604,7 +604,7 @@ for ( my $n = 0; $n = $#installer::globals::languageproducts; $n++ ) my $allupdatelastsequences = ; my $allupdatediskids = ; -if ( $installer::globals::iswindowsbuild ) +if ( $installer::globals::iswindowsbuild || $installer::globals::packageformat eq 'msi' ) { if ( $allvariableshashref-{'UPDATE_DATABASE'} ) { @@ -625,7 +625,7 @@ for ( my $n = 0; $n = $#installer::globals::languageproducts; $n++ ) if (!($installer::globals::is_copy_only_project)) { -if (( $installer::globals::iswindowsbuild ) ( $installer::globals::packageformat ne archive ) ( $installer::globals::packageformat ne installed )) +if ((( $installer::globals::iswindowsbuild ) ( $installer::globals::packageformat ne archive ) ( $installer::globals::packageformat ne installed ) ) || $insaller::globals::packageformat eq 'msi' ) { installer::windows::msiglobal::set_global_code_variables($languagesarrayref, $languagestringref, $allvariableshashref, $alloldproperties); } commit 013d1e01c33ad41d16427470ac151192ea52adec Author: Eilidh McAdam eil...@lanedo.com Date: Thu Aug 2 12:01:05 2012 +0100 Ensure correct import of msi tables using wildcard character Change-Id: I3e1800d73250a8a630dd37329189b13cfae311e9 diff --git a/setup_native/source/win32/wintools/msidb/msidb.c b/setup_native/source/win32/wintools/msidb/msidb.c index 6916423..c492ba2 100644 --- a/setup_native/source/win32/wintools/msidb/msidb.c +++ b/setup_native/source/win32/wintools/msidb/msidb.c @@ -279,15 +279,15 @@ static BOOL msidbExportStream(LPCWSTR dbfile, LPCWSTR wdir, LPCWSTR streamName) /*** * msidbImportTables * - * Takes a list of tables or '*' (for all) to export to text archive + * Takes a list of tables or '*' (for all) to import from text archive * files in specified folder * - * For each table, a file called tablename.idt is exported containing + * For each table, a file called tablename.idt is imported containing * tab separated ASCII. * * Examples (note wildcard escape for *nix/bash): - * msidb -d pathtomsi.msi -f workdir -e \* - * msidb -d pathtomsi.msi -f workdir -e File Directory Binary + * msidb -d pathtomsi.msi -f workdir -i \* + * msidb -d pathtomsi.msi -f workdir -i File Directory Binary **/ static BOOL msidbImportTables(LPCWSTR dbfile, LPCWSTR wdir, LPWSTR tables[], BOOL create) { @@ -323,13 +323,17 @@ static BOOL msidbImportTables(LPCWSTR dbfile, LPCWSTR wdir, LPWSTR tables[], BOO { while ((ent = readdir(dir)) != NULL) { +if (ent-d_type != DT_REG) continue; fileName = ent-d_name; +if (strcmp(fileName+strlen(fileName)-4*sizeof(fileName[0]), .idt) != 0) continue; if (strcmp(fileName, .) == 0 || strcmp(fileName, ..) == 0) continue; tableFile = strdupAtoW(CP_ACP, fileName); r = MsiDatabaseImportW(dbhandle, wdir, tableFile); free(tableFile); } } +else +return FALSE; closedir(dir); free(dirNameA); } @@ -343,7 +347,6 @@ static BOOL msidbImportTables(LPCWSTR dbfile, LPCWSTR wdir, LPWSTR tables[], BOO lstrcpyW(tableFile, tables[i]); lstrcatW(tableFile, ext); - r = MsiDatabaseImportW(dbhandle, wdir, tableFile); free(tableFile); @@ -353,6 +356,7 @@ static BOOL msidbImportTables(LPCWSTR dbfile, LPCWSTR wdir, LPWSTR tables[], BOO } } } + MsiDatabaseCommit(dbhandle); MsiCloseHandle(dbhandle); return TRUE; @@ -476,10 +480,9 @@ int wmain(int argc, WCHAR *argv[]) i = 0; while (argv[2] argv[2][0] != '-' i 10) { -argv++; argc--; i++; iTables[i] = argv[2]; +argv++; argc--; i++; } - break; case 'e': /* Export tables
[Libreoffice-commits] .: Branch 'feature/crossmsi' - setup_native/source
setup_native/source/win32/wintools/makecab/makecab.c | 66 ++- 1 file changed, 35 insertions(+), 31 deletions(-) New commits: commit e47b6388eed41616e36fff139d45ec19c63350fa Author: Eilidh McAdam eil...@lanedo.com Date: Fri Jul 13 14:41:17 2012 +0100 Use lcab to generate cabinets for now. lcab is expected in the sys. path. Change-Id: Ie1cd8a45966bbd84ce84f2ad1d86da492eafa321 diff --git a/setup_native/source/win32/wintools/makecab/makecab.c b/setup_native/source/win32/wintools/makecab/makecab.c index b822cd6..3cca945 100644 --- a/setup_native/source/win32/wintools/makecab/makecab.c +++ b/setup_native/source/win32/wintools/makecab/makecab.c @@ -298,6 +298,8 @@ int main(int argc, char *argv[]) DDFSRCFILE *srcListCurr = NULL; HFCI fci = NULL; ERF erf; +char * cmd = NULL; +unsigned int cmdSize = 0; while (argv[1] (argv[1][0] == '-' || argv[1][0] == '/')) { @@ -324,44 +326,45 @@ int main(int argc, char *argv[]) } CabVerb = v; -srcList = srcListCurr; -if (ddfFile != NULL) +if (ddfFile == NULL) { -cabLog(CABLOG_MSG, === Parsing directive file \%s\===, ddfFile); -switch(ParseDdf(ddfFile, ddfVars, srcListCurr, v)) -{ -case DDFERR_UNREAD: cabLog(CABLOG_ERR, Could not open directive file.); break; -} -getcwd(ddfVars.szCabPath, MAX_PATH-1); -strcat(ddfVars.szCabPath, /); +cabLog(CABLOG_ERR, No DDF file specified.); +return 1; } -if (srcListCurr != NULL) +cabLog(CABLOG_MSG, === Parsing directive file \%s\===, ddfFile); +switch(ParseDdf(ddfFile, ddfVars, srcListCurr, v)) { -cabLogCCAB(ddfVars); -fci = FCICreate(erf, fnFilePlaced, fnMemAlloc, fnMemFree, fnOpen, fnRead, -fnWrite, fnClose, fnSeek, fnDelete, fnGetTempFile, ddfVars, NULL); +case DDFERR_UNREAD: cabLog(CABLOG_ERR, Could not open directive file.); break; +} +getcwd(ddfVars.szCabPath, MAX_PATH-1); +strcat(ddfVars.szCabPath, /); -if (fci != NULL) -{ -cabLog(CABLOG_MSG, === Adding files to cabinet ===); -for (;srcListCurr != NULL; srcListCurr = srcListCurr-next) -{ -cabLog(CABLOG_MSG, Adding file: %s%s (%s), ddfVars.szCabPath, srcListCurr-fileName, srcListCurr-cabName); -if (!FCIAddFile(fci, srcListCurr-fileName, srcListCurr-cabName, srcListCurr-extract, fnGetNextCab, fnStatus, fnGetOpenInfo, srcListCurr-cmpType)) -cabLogErr(erf, A problem occurred while adding a file); -} +srcList = srcListCurr; +if (srcList == NULL) +{ +cabLog(CABLOG_ERR, No input files were specified.); +return 2; +} -cabLog(CABLOG_MSG, === Flushing the cabinet ===); -if (!FCIFlushCabinet(fci, FALSE, fnGetNextCab, fnStatus)) -cabLogErr(erf, A problem occurred while flushing the cabinet); -FCIDestroy(fci); -} -else -{ -cabLogErr(erf, Could not get FCI context); -} +/* Construct system call to lcab */ +for(srcListCurr = srcList; srcListCurr != NULL; srcListCurr = srcListCurr-next) +cmdSize += strlen(srcListCurr-fileName) + 1; +cmdSize += strlen(ddfVars.szCabPath) + strlen(ddfVars.szCab); +cmdSize += 6; /* room for lcab and \0 */ +cmd = malloc(cmdSize); +strcpy(cmd, lcab ); +for (srcListCurr = srcList; srcListCurr != NULL; srcListCurr = srcListCurr-next) +{ +strcat(cmd, srcListCurr-fileName); +strcat(cmd, ); } +strcat(cmd, ddfVars.szCabPath); +strcat(cmd, ddfVars.szCab); + +cabLog(CABLOG_MSG, syscall: %s\n, cmd); +system(cmd); +free(cmd); cabLog(CABLOG_MSG, === Cleaning up resources ===); /* Free list of cab source files */ @@ -371,5 +374,6 @@ int main(int argc, char *argv[]) free(srcListCurr); srcListCurr = next; } +cabLog(CABLOG_MSG, Cabinet file %s/%s created., ddfVars.szCabPath, ddfVars.szCab); return 0; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] Changes to 'feature/crossmsi'
New branch 'feature/crossmsi' available with the following commits: commit d0050183b20a4859c70dda896837b5c66da7571f Author: Eilidh McAdam eil...@lanedo.com Date: Mon Jul 2 18:53:12 2012 +0100 Initial makecab implementation to parse .ddf files. Currently, makecab does not output .cab files. A subset of the ddf format is interpreted. Change-Id: Iae11aefb4759a0eb76f9455b2206b59864086af5 commit fe17bccbcd6de9c2252c6272d5aef2587a881d11 Author: Eilidh McAdam eil...@lanedo.com Date: Mon Jul 2 18:52:16 2012 +0100 Initial implementation of msiinfo. Msiinfo supports the change of most summary information. Unsupported: -b, -d Change-Id: I51466c9acea54fe151db966c4ce47b29f90ab937 commit 727ab5601ac302c69c8768227582b00c9b7adb62 Author: Eilidh McAdam eil...@lanedo.com Date: Mon Jul 2 18:48:02 2012 +0100 Initial crossmsi branch with first msidb implementation. Msidb is a subset of MS msidb. Currently unsupported options are: -m, -t, -j, -k, -w, -s Change-Id: Ice5f646f70b2f797266ce3fabce12ae9f689b1c8 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits