summaryrefslogtreecommitdiff
path: root/sw
AgeCommit message (Collapse)AuthorFilesLines
2015-12-10loplugin:nullptr: More NULL -> nullptr automatic rewriteStephan Bergmann1-1/+1
Change-Id: Ie83819e2bcdc5fa160b39296b005ca9a5ff74b1d
2015-12-09coverity#1341777 Resource leak in objectCaolán McNamara1-0/+1
Change-Id: Ic8ca5764095699423d9a16cbbbcb7f085a006e0a
2015-12-09sw: RES_FLTR_RDFMARK always implies SwFltRDFMarkMiklos Vajna1-1/+5
Change-Id: Ic437cdbc6a21e84a0fa8f4ff68bc5d1202c9da7e
2015-12-09tdf#92623 Handle StartOfContent node for copying bookmarksJan-Marek Glogowski1-1/+9
For SwDoc::AppendDoc we use the StartOfContent node as the starting copy node to prevent merging of the first node in CopyRange and to get a 2nd node needed for CopyRange in case of single content node documents. This correctly counts StartOfContent as a non-copy node when adapting the bookmark ranges for copying. Change-Id: Ia3ee0328a1be5548f8751aa2240812c4662fb73f Reviewed-on: https://gerrit.libreoffice.org/20383 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2015-12-09DOC import: initialize RDF metadata before importing document propertiesMiklos Vajna4-0/+63
With this, it is possible to import part of the document as RDF statements later when SwFltControlStack::SetAttrInDoc() gets an SwFltRDFMark. Previously SfxBaseModel member functions like getMetadataGraphsWithType() and addMetadataFile() failed, as they tried to find the already imported document in UCB, which failed, as the import was still in progress. To prevent that, do the same as the ODT import in XMLReader::Read(), part "RDF metadata". One trick here is the call to comphelper::OStorageHelper::GetTemporaryStorage(), which gives an empty storage. Ideally a wrapper class would be needed that works on a SotStorage, but implements embed::XStorage, but that would be only used to find that the real storage doesn't provide a manifest.rdf stream, which is always the case. So instead of writing such a wrapper, just give loadMetadataFromStorage() an empty storage, which will have the same result without writing lots of dead code. Change-Id: Id1897838b1477eee0489b706d51cb6f59898877b
2015-12-09sw: implement addition of statements in SwRDFHelperMiklos Vajna1-1/+18
With this, the only thing that blocks the DOC import to handle smart tags is the lack of RDF metadata initialization in the filter. Change-Id: I33ab74c7d6ceaac42cc94fdf0b1dfcb0eaf61ab4
2015-12-09tdf#95755: Don't discard table properties in endOfRowAction()Mike Kaganski2-0/+15
In the beginning of endOfRowAction(), the current value of m_aTmpTableProperties.back( ) is stored in a temporary variable. Then, the width of table may be put into m_aTmpTableProperties.back( ). In the end, this temp variable is assigned to TableManager::mState.mTableProps and the m_aTmpTableProperties.back( ) is reset. In the middle, the m_aTmpTableProperties.back( ) may be replaced in endLevel()/startLevel() sequence (if new table is started). In that case, the width calculations go to a different object than stored in temp var. Consequently, that value will be discarded and replaced with initial stored in temp var. Fixed that by directly operating with temp var instead of m_aTmpTableProperties.back( ). Also, the value of m_nCell was not kept over endLevel()/startLevel() sequence and that prevented from calculating width. Fixed that. Also, removed leftovers from commit cbd0fbc287051f918e4adb32b3e9b58dfbf8059d. Change-Id: If85dbb715e7c60f60043f9d60d6a3c3d02277add Reviewed-on: https://gerrit.libreoffice.org/20052 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-12-09sw: handle RDF mark in SwFltControlStack::SetAttrInDoc()Miklos Vajna4-2/+35
Change-Id: I13e510e305c4aa24c37b1c25b4c3116ef3f06a8a
2015-12-09SwWW8ImplReader::GetSmartTagInfo: read from SmartTagDataMiklos Vajna3-4/+39
With this, SwWW8ImplReader::Read_FactoidBook() gets exactly the matching key/value strings for the smart-tag bookmark, so now only SwFltControlStack has to store the item and process it. Change-Id: If799d7d0bd1d69ddf8325d05f2b7c6e55112bba2
2015-12-09sw: initial SwFltRDFMarkMiklos Vajna2-0/+67
So that SwWW8ImplReader::Read_FactoidBook() can put this as an attribute on the import stack instead of CntUInt16Item. Change-Id: I1753bc4a94f49332a945a4c6de7f58768d35ff16
2015-12-09tdf#94377 RTF export: support comment formattingMiklos Vajna6-10/+56
The core of this change is that RtfAttributeOutput::PostitField() now uses WriteOutliner() to handle comment text, instead of trying to output the plain text as-is. To have working roundtrip of the comment text, a few more changes are needed: 1) When emptying the Styles buffer, also empty the StylesEnd one. 2) Annotations don't want a trailing \par, so don't write one for the last paragraph. 3) Inform the MSWord_SdrAttrIter about where the editeng content will end up, and make WriteOutliner() accessible outside RtfSdrExport. Change-Id: I9cbcf4ce5dc3a099d310c6f321ea8e52f8644f9b
2015-12-09Use unique_ptr out-arg to in SfxBindings::QueryState to avoid mem leaksStephan Bergmann2-13/+7
Change-Id: I35df02de675068478a36ef05266ffc2d3054b07f Reviewed-on: https://gerrit.libreoffice.org/20477 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2015-12-08sw: redundant condition, was checked previouslyMichael Stahl1-1/+1
Change-Id: I7934bc993e049169a08b835f922da8ef50ea05ee
2015-12-08consolidate MSO format ClassID magic numbers in msfilter/classids.hxxMichael Stahl1-4/+2
Change-Id: I673eeaa4168f769cb002995c43d986ee5f2030b2
2015-12-08sw: un-break DOCX formula exportMichael Stahl2-0/+8
(regression from 1dac99e7ea45f90bf39eb95eb7bc01f7d79093ef) Change-Id: Iffe3ec6c28f62b78a2b223144bfaad383d272802
2015-12-08WW8SmartTagData::Read: check seek resultMiklos Vajna1-1/+2
Change-Id: I0492c5b3018f59e4b783bb33f8b75ce67847dcf0
2015-12-08DOC import: read SmartTagDataMiklos Vajna5-0/+182
This only reads all the interesting info, SwWW8ImplReader::Read_FactoidBook() still has to put it on the filter stack in a later commit. Change-Id: Ic2e8b441367448b5bdf940bf8871f25afe8362c4
2015-12-08DOC import: tokenize smart-tag dataMiklos Vajna2-1/+11
Change-Id: I43e52c2c982ed553a53be9839feff591c99fdfca
2015-12-08SwWW8ImplReader: unused membersMiklos Vajna1-3/+0
Leftover from commit 0ec0ec267986644084baaa5bda5ba917dc5744df (i#93570 DOC import: handle commented text ranges via RES_FLTR_ANNOTATIONMARK, 2014-12-30). Change-Id: Ifc2547ccb6bc91687ad61896b72367320210a837
2015-12-08DOC import: handle smart tags via RES_FLTR_RDFMARKMiklos Vajna3-1/+15
The idea is that a subset of the smart tags will be mapped to RDF statements, as done already in the DOCX importer. Change-Id: I46e0dad37a3905fe591cba0f710156f27be05ff4
2015-12-08DOC import: tokenize PlcfBkfFactoid and PlcfBklFactoidMiklos Vajna2-4/+176
So that later SwWW8ImplReader can read these smart tag position structures in a way similar to bookmarks. Change-Id: I0e1dc30d48bbb6641a82d777f6569f59dd922e16
2015-12-08sw: add RES_FLTR_RDFMARKMiklos Vajna2-2/+13
This is similar to RES_FLTR_ANNOTATIONMARK, except that it'll be used for WW8 import's smart tag bookmark needs. First just add code so that WW8 import can put this this attribute on the import stack, the actual handling of the attribute has to be implemented later. Change-Id: I92e3fac02496e3f5e7a6ea27f0da91dcd47769cc
2015-12-08Related: tdf#94377 RTF export: support multiple paragraphs in editeng textMiklos Vajna1-1/+2
Write a \par at the end of each paragraph instead of writing one at the end of the whole text only. Change-Id: I984b31d4ae3d2e728c993b25bfde761dcad063ae
2015-12-07Avoid -fsanitize=signed-integer-overflowStephan Bergmann1-1/+1
...later on during loading of (a local copy of) <https://wiki.documentfoundation.org/images/5/50/BH40-BaseHandbook.odt> at > sw/inc/swrect.hxx:249:48: runtime error: signed integer overflow: 1080100 + 9223372036853697509 cannot be represented in type 'long' > SwRect::Bottom() const sw/inc/swrect.hxx:249:48 > SwTextFly::CalcMinBottom() const sw/source/core/text/txtfly.cxx:996:31 > SwTextFly::GetMinBottom() const sw/source/core/inc/txtfly.hxx:339:45 > SwTextFormatter::CalcBottomLine() const sw/source/core/text/itrform2.cxx:1917:20 > SwTextFrame::FormatAdjust(SwTextFormatter&, WidowsAndOrphans&, int, bool) sw/source/core/text/frmform.cxx:1092:26 > SwTextFrame::_Format(SwTextFormatter&, SwTextFormatInfo&, bool) sw/source/core/text/frmform.cxx:1552:13 > SwTextFrame::_Format(OutputDevice*, SwParaPortion*) sw/source/core/text/frmform.cxx:1662:5 > SwTextFrame::Format(OutputDevice*, SwBorderAttrs const*) sw/source/core/text/frmform.cxx:1809:17 > SwContentFrame::MakeAll(OutputDevice*) sw/source/core/layout/calcmove.cxx:1391:17 > SwFrame::PrepareMake(OutputDevice*) sw/source/core/layout/calcmove.cxx:307:21 > SwFrame::Calc(OutputDevice*) const sw/source/core/layout/trvlfrm.cxx:1798:9 > SwObjectFormatterTextFrame::FormatAnchorFrameAndItsPrevs(SwTextFrame&) sw/source/core/layout/objectformattertxtfrm.cxx:753:9 > SwFlyAtContentFrame::MakeAll(OutputDevice*) sw/source/core/layout/flycnt.cxx:419:21 > SwFrame::PrepareMake(OutputDevice*) sw/source/core/layout/calcmove.cxx:341:5 > SwFlyFrame::Calc(OutputDevice*) const sw/source/core/layout/fly.cxx:2665:9 > SwLayAction::FormatLayoutFly(SwFlyFrame*) sw/source/core/layout/layact.cxx:1428:9 > SwObjectFormatter::_FormatObj(SwAnchoredObject&) sw/source/core/layout/objectformatter.cxx:331:17 > SwObjectFormatterTextFrame::DoFormatObj(SwAnchoredObject&, bool) sw/source/core/layout/objectformattertxtfrm.cxx:134:9 > SwObjectFormatter::_FormatObjsAtFrame(SwTextFrame*) sw/source/core/layout/objectformatter.cxx:453:19 > SwObjectFormatterTextFrame::DoFormatObjs() sw/source/core/layout/objectformattertxtfrm.cxx:336:20 > SwObjectFormatter::FormatObjsAtFrame(SwFrame&, SwPageFrame const&, SwLayAction*) sw/source/core/layout/objectformatter.cxx:193:20 > SwLayAction::FormatContent(SwPageFrame const*) sw/source/core/layout/layact.cxx:1651:19 > SwLayAction::InternalAction(OutputDevice*) sw/source/core/layout/layact.cxx:572:31 > SwLayAction::Action(OutputDevice*) sw/source/core/layout/layact.cxx:352:5 > SwLayIdle::SwLayIdle(SwRootFrame*, SwViewShellImp*) sw/source/core/layout/layact.cxx:2159:13 > SwViewShell::LayoutIdle() sw/source/core/view/viewsh.cxx:728:19 > sw::DocumentTimerManager::DoIdleJobs(Idle*) sw/source/core/doc/DocumentTimerManager.cxx:119:17 > sw::DocumentTimerManager::LinkStubDoIdleJobs(void*, Idle*) sw/source/core/doc/DocumentTimerManager.cxx:81:1 > Link<Idle*, void>::Call(Idle*) const include/tools/link.hxx:84:45 > Idle::Invoke() vcl/source/app/idle.cxx:25:5 > ImplSchedulerData::Invoke() vcl/source/app/scheduler.cxx:40:5 > Scheduler::ProcessTaskScheduling(bool) vcl/source/app/scheduler.cxx:170:9 > ImplYield(bool, bool, unsigned long) vcl/source/app/svapp.cxx:519:5 > Application::Yield() vcl/source/app/svapp.cxx:535:5 > Application::Execute() vcl/source/app/svapp.cxx:471:9 > desktop::Desktop::DoExecute() desktop/source/app/app.cxx:1284:5 > desktop::Desktop::Main() desktop/source/app/app.cxx:1609:17 > ImplSVMain() vcl/source/app/svmain.cxx:170:19 > SVMain() vcl/source/app/svmain.cxx:207:16 > soffice_main desktop/source/app/sofficemain.cxx:96:12 > sal_main desktop/source/app/main.c:48:15 > main desktop/source/app/main.c:47 ...whatever those hardcoded odd values used here, the code is the same ever since 84a3db80b4fd66c6854b3135b5f69b61fd828e62 "initial import" Change-Id: I7f10034f97c52256d873b86a683c9204b944e704
2015-12-07DOC import: tokenize smart-tag bookmark offsets/sizesMiklos Vajna2-1/+30
Change-Id: I4a37651c3cf78ae818d1018abb6cc8e69ffd71b0
2015-12-07tdf#81475 Improvements to writer's toolbarsYousuf Philips6-7/+21
Hide entries in the standard and table toolbars and add useful entries into the formatting, object, and bullets toolbars. Also make bullets and table toolbars appear on a different line than the drawing toolbar. Change-Id: I307e8f289fc5b1d8c7dd074989ffc0500697073f Reviewed-on: https://gerrit.libreoffice.org/20279 Reviewed-by: Yousuf Philips <philipz85@hotmail.com> Tested-by: Yousuf Philips <philipz85@hotmail.com>
2015-12-07tdf#54584: allow backslash before field type in RTF and DOCXMike Kaganski2-0/+14
In some RTF and DOCX files, field type may be prepended with backslash. It seems not strictly standard-conformant (at least not to [MS-RTF]). Still, MS Word reads these fields OK. This patch allows LO to read them, too. Change-Id: I1f6bbdd9d57adbea8882d078761dd97298ca03b3 Reviewed-on: https://gerrit.libreoffice.org/20420 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-12-07Let LIBO_INTERNAL_ONLY imply LOK_USE_UNSTABLE_APIMiklos Vajna5-5/+0
Change-Id: Ifbed5e534ba79d32b7188bb7fb7108338b6e124d
2015-12-06tdf#91781 Add more shapes to the menu and additional tweaksYousuf Philips1-17/+27
Change-Id: I0f6bc69afce27d5e4dd7fab3c8e8b87e292d6217 Reviewed-on: https://gerrit.libreoffice.org/20167 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2015-12-05silence vcl release mouse warningCaolán McNamara1-1/+2
Change-Id: I12eb894d88c7b96f92e3d080ac3cf24ff2e025ec
2015-12-04sw: add doxygen comment for SwpHintsMiklos Vajna1-1/+1
Change-Id: I1f53c644120180c730706cab8b969f36fa4023be
2015-12-04Wingdi RGB macro handling improvedAshod Nakashian4-20/+121
Improved the isolation of windows headers. Specifically, RGB macro is better handled now. Change-Id: I0eeea16d0de9da3455810c80b0715f7b54ae8c3f Reviewed-on: https://gerrit.libreoffice.org/20039 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2015-12-04fix SwClient crash in SwXNumberingRules/SwXTableRows/SwXTableColumnsNoel Grandin4-33/+74
was generated a crash when running 'make check' on my Linux box. These classes need to hold the SolarMutex when destructing their SwClient base class. Change-Id: I448ea00978d003aa37d8663d37b4edf9e54a6a56 Reviewed-on: https://gerrit.libreoffice.org/20391 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-12-03tdf#34957 - don't push multi-page table to next page.Justin Luth3-2/+13
Removing an old hack that is no longer needed. A table marked as “keep with next” doesn't split and keeps with the following paragraph already. It doesn't require this old hack to function properly anymore. Preventing tables from splitting had forced large tables to always start on a new page. Removing the hack allows everything to lay out nicely now. There is a fairly large suite of tests in the bug report that prove the proper layout of various keep-with-next situations. Any document depending on the old behaviour can simply (and properly) insert a manual page-break before the table in order to force it to start on a new page. Change-Id: Ie2036c1a638009aaf95247574998077a1e55b5e5 Reviewed-on: https://gerrit.libreoffice.org/20216 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2015-12-03Silence warning in --disable-assert-always-abort buildsStephan Bergmann1-1/+1
Change-Id: I5bdc1585be07357597c0527dc303643242f1d727
2015-12-03sw: fix DOCX export of embedded OOXML objectsMichael Stahl2-14/+25
OOXML embedded objects are converted to ODF during export, which prevents the export from working, as it expects a stream, and ODF uses a storage. There is already a unit test in testEmbeddedXlsx, but it wrongly succeeds because the components necessary to convert from OOXML to ODF are missing in the test environment. Change-Id: Ib4df346e04ecfb54ec1a728535be876db921b884
2015-12-03sw: docx export: write something more specific for embedded PDFMichael Stahl1-0/+6
Doesn't really change anything, but looks nicer. Change-Id: I8f2dc41adaf22e11b1c15ba619ac00b6b72892fa
2015-12-03uno:Sequence->std::vector in SmartTagMgrNoel Grandin3-16/+9
Change-Id: I163f7d6c0f30ac2929df1cae202e695d21bb49fc
2015-12-03Resolves: tdf#94701 allow fully deleting illustration category in comboboxCaolán McNamara1-2/+2
Change-Id: Iaaefbe2311e61be3b9689c693481d149aa1355f5
2015-12-02DOCX export: handle <w:smartTag>Miklos Vajna7-40/+64
A Writer document can have multiple arbitrary RDF graphs, handle the following subset: - instead of handling all graphs, have a whitelist, look at the TSCP graph the DOCX importer creates - look for (paragraph, key, value) statements and export those Change-Id: I142c24fb4c8140bde5fc1efad2932886de167b90
2015-12-02sw: initial SwRDFHelperMiklos Vajna3-0/+83
The purpose of this class is to provide access to the subset of the RDF metadata that's interesting for core code and for internal filters. Change-Id: Ibecba302dd839b537a36b9f7a15f012c6ea26869
2015-12-02an empty string here seems no hardshipCaolán McNamara1-1/+0
Change-Id: I8c8589f6ff7a190556cc4aa016ae343a19378b18
2015-12-02loplugin:stringconcat: Also look through O[U]String ctorsStephan Bergmann7-82/+82
Change-Id: I4f07c7c61d324a85f9f5dee0f25a7358facebd41
2015-12-02DOCX import: handle <w:smartTag>Miklos Vajna3-0/+41
These can be sort of arbitrary key-value pairs around one or multiple runs, handle the following subset: - when they appear at a paragraph context -> we assume they are annotations on the paragraph - when the smart tag's URI/element is RDF -> we map these to RDF metadata statements on paragraphs - when the attribute name's namespace is known, because in ODF we need to specify both a path and a type (namespace) for the RDF graph, and OOXML only provides a namespace As a start, recognize the TSCP BAF namespace from <https://www.tscp.org/wp-content/uploads/2013/08/TSCP_BAFv1.pdf>. Change-Id: Ib188b1395e7ec7e0441b4f12f86cfef99fb9f096
2015-12-02tdf#94043 RTF filter: implement column separator handlingMiklos Vajna3-0/+29
Change-Id: I9d74642156d7bb79577671bae24346c75178c5c7
2015-12-02Remove some chained appendsWillian Briotto1-8/+8
Change-Id: I552432d7352e4ae4d6b0ef8fb72a6533407b46e4 Reviewed-on: https://gerrit.libreoffice.org/20124 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-12-01tdf#88443:percent value fixedOliver Specht1-1/+1
Change-Id: I221f07b930fa1f152b9bf379aa966c02b936abb2
2015-12-01tdf#88443: set relative width to objects with captions except formulasOliver Specht1-1/+13
a fix to aoo issue 51453 switched off relative with to all objects with captions to solve a problem related to formulas now all objects with captions get relative width except math formulas Change-Id: I39ccc292ff156c4c94a7a898a6a0602c72bbdd26 Reviewed-on: https://gerrit.libreoffice.org/20320 Reviewed-by: Oliver Specht <oliver.specht@cib.de> Tested-by: Oliver Specht <oliver.specht@cib.de>
2015-12-01Related: tdf#94043 DOCX import: fix column separator handlingMiklos Vajna2-0/+8
See wwSectionManager::SetCols() for the DOC import equivalent of this code, if line width is 0, then there will be still no visible line. Change-Id: Ifb0dc596e252a60cdac575fff2894aced1580c69
2015-11-30Move uses of SwFrame pointer-to-member after definition of class SwFrameStephan Bergmann1-92/+91
...to avoid trouble with MSVC's pointer-to-member model, where the details of a pointer-to-member depend on details of the pointed-to class type. Change-Id: Id5b3be1696794d23fbad96f047d114e27395b134