Commit Graph

2234 Commits

Author SHA1 Message Date
794d5ac4ac vcl: use enum for complex text layout constants
Since these constants are bitfield flags, we define some methods to make
working with them reasonably type safe.

Move the definitions to outdevstate.hxx, since we need the values there,
and that appears to be the "root most" header file.

Also dump TEXT_LAYOUT_BIDI_LTR constant, since it means the same thing
as TEXT_LAYOUT_DEFAULT (ie. 0), and leaving it in causes people to write
weird code thinking that it's a real flag.

Change-Id: Iddab86cd6c78181ceb8caa48e77e1f5a8e526343
Reviewed-on: https://gerrit.libreoffice.org/10676
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-08-20 09:01:26 -05:00
15295ab6db Refactored SwDoc::GetEditShell .
Removed its output paramater as GetCurrentViewShell should be
used instead and added a const version.

Change-Id: Iad8b57553b6e93e3472ce8c6905d08e8d49af770
2014-08-19 21:57:06 +02:00
d21d5a7261 drop unnecessary shl.hxx includes
Change-Id: Ieb984987c4a4f888a563377e0500444b12f43506
2014-08-18 12:59:49 +01:00
eb8d716fb5 warning C4800: 'int' : forcing value to bool 'true' or 'false'
Change-Id: Iae7dd3944d1d01020c8a3ab1ac4bb2e94e01541e
2014-08-17 05:15:22 +02:00
5494954b26 Refactored IDocumentLayoutAccess out of SwDoc.
Into the new class DocumentLayoutManager.

Change-Id: I02d0cfcc63633d0bdab380508b2ef563187fd269
2014-08-12 23:26:38 +02:00
9d43f6d2c4 Refactored IDocumentLineNumberAccess.
This interface is obsolete and was deleted.

Change-Id: I56d37814f6e43f083ab3d199237ade06db287e18
2014-08-12 23:26:37 +02:00
69e5f335ab Refactored IDocumentFieldsAccess out of SwDoc.
Into the new class DocumentFieldsManager.
Removed SwDoc::_MakeFldList because it is not defined anywhere.
Also moved a few non interface methods that belong to the manager.

Change-Id: Icefd7ca7adcbb05a18d6fae0529fc54150b862fd
2014-08-12 23:26:36 +02:00
274f1811b9 Refactored IDocumentRedlineAccess out of SwDoc.
Into the new class DocumentRedlineManager.
Added an non const version of GetRedlineTbl to the interface.
Also Moved SetAutoFmtRedlineComment which is not part of interface.

Change-Id: I600d5821d5d5831557f5fc5375fb1203fe67a295
2014-08-12 23:26:36 +02:00
3dafed2ede -Werror,-Wundefined-bool-conversion
Change-Id: Iff8db4c82abeeed0789d7012223a846f1058c353
2014-08-12 12:19:43 +02:00
14e81a12b0 Not every SwGluePortion is an SwFlyPortion
Change-Id: Ia14993cc511cb2569b7110ad5169a977cbf7a200
2014-08-06 18:31:58 +02:00
32de046e05 Move SwTxtFrm specific code from ~SwCntntFrm down to ~SwTxtFrm
...to be executed while this is still a SwTxtFrm, not merely a SwCntntFrm.

Change-Id: Ia2ce9fff7d7e2562deb4bd099975976312cad6c4
2014-08-05 18:33:56 +02:00
c3916303eb fdo#81502: sw: fix spurious "[" being painted for field marks
There is a special SwFieldMarkPortion sub-class that is supposed to be
created for these, which overrides Paint() to do nothing; unfortunately
at least for the CH_TXT_ATR_FIELDSTART at beginning of a paragraph
a plain SwTxtPortion is created, because the check of rInf.Len() is
checking the length of the _previous_ text portion; the call to
rInf.SetLen() only happens after creation, in last line of
SwTxtFormatter::NewTxtPortion().

This problem affects RTF and DOCX files since commit
c6b99eedda03461202f9bf012a422dfd81da72ec.

Change-Id: I447b21e841d22558d689f0f244d811c32e4923ec
2014-07-24 23:24:04 +02:00
c8aa822696 fdo#80721: Use the old way of drawing the pilcrow (but with changed color).
This fixes the reported problem (that the pilcrow stopped showning for
centered paragraphs), and additionally makes the pilcrow large for large
paragraphs (like titles) again.

Change-Id: I78d9986c0da6abfb9936984bb8b72d5eba88c9d7
2014-07-24 12:15:49 +02:00
5f0967a634 Do not include txttypes.hxx unnecessarily
Change-Id: I557019995975b24062fd346a7cc0cae872cab308
2014-07-22 23:50:44 +02:00
2a6b9c93af Massive KSHORT/MSHORT to sal_uInt16
Change-Id: I82a899ef0cad19d62c41753ffdce07d8e33d6c9d
2014-07-22 23:50:43 +02:00
05dda9a913 SwpHintsArray/SwpHints and related: sal_uInt16 to size_t
Change-Id: I9a7674109b05683287e12cbce6bc417b40ca5084
2014-07-22 23:50:42 +02:00
f11701d27f sal_uInt16/MSHORT to SwTwips/sal_Int32
Change-Id: Ie069f5203591e90210850bc7e5d3f03609df144c
2014-07-22 23:50:40 +02:00
3858f7ef25 use consistant color for non displayable characters
Change-Id: Ib4a569fc299325982b6e0da02311acc55fe18760
2014-07-20 22:33:16 +02:00
cd3d26b7ed vcl consitent use of long for corrdinate
most of length in vcl are calculated in 'long'
but array of X position tend to be in sal_Int32.
As a prep work to be able to support 'double'
as the base type of Device Coordinate, harmonize
the use of 'long' for non-float coordinate.

Change-Id: I7cb33301ff6a5e2c62247b36a4e07e168a58a323
2014-07-20 22:10:59 +02:00
bc9c7e4217 fix debug=t build
Change-Id: Ibc81d1677e9eb297797c7fa9e7c77c9437f65b15
2014-07-19 21:26:03 +01:00
8416a65af1 fix spelling structur -> structure
Change-Id: I7aa4a9bf72732db95a67cee368f3a83a0d71bb9c
2014-07-17 14:49:41 +02:00
6c8de2b107 Revert "fdo#79673 revert to old NPC for MacOSX only"
This reverts commit 3a2010c711b0ca4d762681dd0967ad08bc1e23fc.
Prep to apply a full fix.

Change-Id: I3b71ad79f65e48456d9fd9d257bf471faa0f3482
2014-07-15 21:42:37 +02:00
3fed83524d Refactored IDocumentOutlineNodes out of SwDoc.
Into the new class DocumentOutlineNodesManager.

Change-Id: I05581391a1474872113ae91d6429709d181cabfe
2014-07-15 15:44:04 +02:00
3a2010c711 fdo#79673 revert to old NPC for MacOSX only
Change-Id: I83cfa2f11e76e03b919216e8dd04d1121ea6afd8
2014-07-15 00:08:23 +02:00
dac4ca5f68 new loplugin: externalandnotdefined
Find "missing headers," where a function is declared directly in the
.cxx (as extern) and not defined, and should arguably instead be declared
in an include file.

Change-Id: I6d83ee432b2ab0cd050aec2b27c3658d32ac02a2
2014-07-11 14:12:25 +02:00
4228f08d60 use assert when followed by deref
Change-Id: I8405e4d8f9fa1de3ef6ee474321b4ac2b4ce1624
2014-07-03 12:49:38 +01:00
0459e43ae6 fdo#79838 : DOCX : File crashes on open
Issue :
	DOCX containing nested form fields FORMCHECKBOX inside
	FORMTEXT crashes at open.

	Implementation :
	- Handled case for FORMTEXT.
	- Added issue file isnide sw/qa/core/data/ooxml/pass/

NOTE : This is a due to regression. Issue file opened
       successfully on LO-3.5 and LO-4.1.
       Code changes that caused regression is : https://gerrit.libreoffice.org/gitweb?p=core.git;a=commitdiff;h=a52ee51269a47e52d68405caf8507e1abaa6fd8f

Change-Id: I59dbe7bb2d58c1bcb0ddd144cf7891cbec5cdb24
Reviewed-on: https://gerrit.libreoffice.org/9932
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
2014-07-02 21:51:20 +00:00
7d9bb549d4 Related: #i124638# Second step of DrawingLayer FillAttributes...
for Writer objects, now added support for Paragraph and PageStyle (including
Header and Footer) for direct attributes and style attributes

(cherry picked from commit cc25c58f7052827bfebdc9fbeec668c8fa29ed1b)

Conflicts:
	cui/source/factory/dlgfact.cxx
	cui/source/factory/dlgfact.hxx
	cui/source/inc/bbdlg.hxx
	cui/source/inc/cuires.hrc
	cui/source/tabpages/bbdlg.cxx
	cui/source/tabpages/bbdlg.src
	cui/source/tabpages/page.cxx
	cui/source/tabpages/tparea.cxx
	include/svx/pagectrl.hxx
	include/svx/svxdlg.hxx
	include/svx/svxids.hrc
	include/xmloff/PageMasterStyleMap.hxx
	include/xmloff/prstylei.hxx
	include/xmloff/txtprmap.hxx
	svx/Package_inc.mk
	svx/inc/svx/hdft.hxx
	svx/source/dialog/hdft.cxx
	svx/source/dialog/pagectrl.cxx
	svx/source/tbxctrls/tbxcolorupdate.cxx
	svx/source/unodraw/unobrushitemhelper.cxx
	sw/Library_sw.mk
	sw/inc/fillattributes.hxx
	sw/inc/format.hxx
	sw/inc/frmatr.hxx
	sw/inc/frmfmt.hxx
	sw/inc/hintids.hxx
	sw/inc/hints.hxx
	sw/inc/ndtxt.hxx
	sw/inc/node.hxx
	sw/inc/swunohelper.hxx
	sw/inc/unobrushitemhelper.hxx
	sw/inc/unoprnms.hxx
	sw/source/core/attr/format.cxx
	sw/source/core/attr/hints.cxx
	sw/source/core/doc/docdesc.cxx
	sw/source/core/doc/docdraw.cxx
	sw/source/core/doc/docfmt.cxx
	sw/source/core/doc/docnew.cxx
	sw/source/core/doc/docredln.cxx
	sw/source/core/doc/poolfmt.cxx
	sw/source/core/doc/visiturl.cxx
	sw/source/core/docnode/node.cxx
	sw/source/core/inc/frame.hxx
	sw/source/core/inc/frmtool.hxx
	sw/source/core/inc/rolbck.hxx
	sw/source/core/layout/atrfrm.cxx
	sw/source/core/layout/fillattributes.cxx
	sw/source/core/layout/findfrm.cxx
	sw/source/core/layout/paintfrm.cxx
	sw/source/core/txtnode/ndtxt.cxx
	sw/source/core/txtnode/thints.cxx
	sw/source/core/txtnode/txtedt.cxx
	sw/source/core/undo/rolbck.cxx
	sw/source/core/unocore/swunohelper.cxx
	sw/source/core/unocore/unoframe.cxx
	sw/source/core/unocore/unomap.cxx
	sw/source/core/unocore/unoparagraph.cxx
	sw/source/core/unocore/unoprnms.cxx
	sw/source/core/unocore/unostyle.cxx
	sw/source/ui/chrdlg/paradlg.src
	sw/source/ui/chrdlg/pardlg.cxx
	sw/source/ui/fmtui/tmpdlg.cxx
	sw/source/ui/fmtui/tmpdlg.src
	sw/source/uibase/app/docst.cxx
	sw/source/uibase/app/docstyle.cxx
	sw/source/uibase/frmdlg/colex.cxx
	sw/source/uibase/shells/basesh.cxx
	sw/source/uibase/shells/textsh1.cxx
	sw/source/uibase/uiview/viewstat.cxx
	sw/source/uibase/utlui/uitool.cxx
	xmloff/inc/PageMasterImportContext.hxx
	xmloff/inc/xmloff/XMLShapeStyleContext.hxx
	xmloff/source/draw/XMLShapeStyleContext.cxx
	xmloff/source/draw/sdpropls.hxx
	xmloff/source/style/PageMasterExportPropMapper.cxx
	xmloff/source/style/PageMasterImportContext.cxx
	xmloff/source/style/PageMasterPropHdlFactory.cxx
	xmloff/source/style/PageMasterStyleMap.cxx
	xmloff/source/style/prstylei.cxx
	xmloff/source/text/txtexppr.cxx
	xmloff/source/text/txtprhdl.cxx
	xmloff/source/text/txtprmap.cxx
	xmloff/source/text/txtstyli.cxx

Conflicts:
	svx/source/dialog/hdft.cxx
	sw/source/core/doc/visiturl.cxx
	sw/source/core/txtnode/thints.cxx
	sw/source/core/txtnode/txtatr2.cxx
	sw/source/core/unocore/unostyle.cxx

Change-Id: I7e8779db6c0cbd1e242b63eab888f468f2de509a
2014-07-01 13:30:09 +02:00
5ace3f3b4f clang scan-build: various warnings
Change-Id: I4bdfb074b3cf6fcb49765322308dfa4b9ed67713
2014-07-01 10:56:14 +01:00
05f5c4d4d6 DBG_ASSERT->assert
Change-Id: Ic2933fc686d3bb030291756bd94127ee7583c833
2014-06-27 08:55:56 +01:00
e2080e70fe new compilerplugin returnbyref
Find places where we are returning a pointer to something, where we can
be returning a reference.
e.g.
   class A {
     struct X x;
     public X* getX() { return &x; }
   }
which can be:
     public X& getX() { return x; }

Change-Id: I796fd23fd36a18aedf6e36bc28f8fab4f518c6c7
2014-06-24 11:34:21 +02:00
7c97720c2e coverity#706103 Unintended sign extension
Change-Id: Icc0161f80982a9cab5776981a4848ea48709ecd2
2014-06-19 10:26:49 +01:00
887b3a3562 loplugin:staticcall
Change-Id: I26e1e0f66dad5ed4e8351fc7509449b312559166
2014-06-13 17:54:35 +02:00
f8455332dc Removed IDocumentDeviceAccess.hxx include in SwDoc.hxx
Because it is not needed there anymore in that class.
I added it as an include in all files that need it.

Change-Id: I3eb2e1da9d153017968b286e1a0250f145ca7cfe
2014-06-03 19:12:03 +02:00
4161070eb2 Removed IDocumentSettingAccess.hxx include in SwDoc.hxx
Because it is not needed there anymore with IDocumentSettingManager.

Change-Id: Iad5e0a03f2628c9d26698d23e691b3e6228eee0b
2014-06-03 19:12:02 +02:00
df07d6cb9f handle direct formatting for numbering in .docx (bnc#875717)
Change-Id: I3ed0f926e79f3878c5702c2becae97d99d00e201
2014-05-29 14:34:50 +02:00
9fa68f05e1 SwFlyCntPortion::SetBase: adjust position of the textbox if necessary
In case of inline shapes, it's not possible to just copy the AnchorType
property of the shape to the textbox, as we want the textbox at the
expected position, not inline. OTOH, an inline shape has an implicit
position, so we can't position its textbox at import-time.

Solve the problem by setting the position of the textbox as we create
the layout of the inline shape.

Change-Id: I425ff5e0760858ebcbe457ed0ce9e4977ae8bc74
2014-05-28 15:57:12 +02:00
0a3fe4c281 Remove ASCII art and useless comments from sw module
Change-Id: I3ba4ac78fd4810e006b1034bbe7c28b1803895d2
Reviewed-on: https://gerrit.libreoffice.org/9494
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-05-27 01:46:44 -05:00
3b24dcc8a8 Remove unnecessary semicolons
A simplified version of the semantic match that finds this problem is
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r1@
statement S;
position p,p1;
@@
S@p1;@p

@script:python r2@
p << r1.p;
p1 << r1.p1;
@@
if p[0].line != p1[0].line_end:
    cocci.include_match(False)
@@
position r1.p;
@@
-;@p
// </smpl>

Change-Id: Ib9708d37fbb4c6060f88d5dae3814a2d37b2091e
Reviewed-on: https://gerrit.libreoffice.org/9493
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-05-27 01:19:00 -05:00
2e30212c1b coverity#704936 Unchecked dynamic_cast
Change-Id: I92e1f95aef32a9d0431ce3fbca0a7ab6ce5cadd0
2014-05-26 17:00:58 +01:00
06afd4067f Resolves: fdo#79139 Crash in SwDropCapCache::CalcFontSize
Minimum of nMaxFontHeight must be at least 1

Change-Id: I35462fc069c7026958e597c2e0605345ed009c91
2014-05-23 22:55:41 +02:00
3c1e30b77d Correct common misspellings, and remove some ASCII art along the way.
Change-Id: I42787db31769e8bde984c5f4f0aa90335e889b1c
Reviewed-on: https://gerrit.libreoffice.org/9356
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
2014-05-17 12:38:38 +00:00
44c81ce218 sw: try to fix a valgrind warning
Invalid read of size 1
   at SwParaPortion::SetPrep(bool) (porlay.hxx:299)
   by SwTxtFrm::Prepare(PrepareHint, void const*, bool) (txtfrm.cxx:1756)
   by SwTxtFrm::Prepare(PrepareHint, void const*, bool) (txtfrm.cxx:1663)
   by SwCntntFrm::MakeAll() (calcmove.cxx:1310)
   by SwFrm::OptPrepareMake() (calcmove.cxx:356)
   by SwFrm::OptCalc() const (frame.hxx:1037)
   by SwLayAction::_FormatCntnt(SwCntntFrm const*, SwPageFrm const*) (layact.cxx:1829)
   by SwLayAction::FormatCntnt(SwPageFrm const*) (layact.cxx:1660)
   by SwLayAction::InternalAction() (layact.cxx:597)
   by SwLayAction::Action() (layact.cxx:376)
   by SwLayIdle::SwLayIdle(SwRootFrm*, SwViewImp*) (layact.cxx:2179)
 Address 0x1f9507e0 is 832 bytes inside a block of size 840 free'd
   by FixedMemPool::Free(void*) (mempool.cxx:48)
   by SwParaPortion::operator delete(void*, unsigned long) (in /work/lo/master/instdir/program/libswlo.so)
   by SwParaPortion::~SwParaPortion() (porlay.cxx:1972)
   by SwTxtFrm::ClearPara() (txtcache.cxx:102)
   by SwTxtFrm::Init() (txtfrm.cxx:329)
   by SwTxtFrm::CalcLineSpace() (txtfrm.cxx:746)
   by SwTxtFrm::Prepare(PrepareHint, void const*, bool) (txtfrm.cxx:1680)
   by SwTxtFrm::Prepare(PrepareHint, void const*, bool) (txtfrm.cxx:1663)
   by SwCntntFrm::MakeAll() (calcmove.cxx:1310)
   by SwFrm::OptPrepareMake() (calcmove.cxx:356)
   by SwFrm::OptCalc() const (frame.hxx:1037)
   by SwLayAction::_FormatCntnt(SwCntntFrm const*, SwPageFrm const*) (layact.cxx:1829)
   by SwLayAction::FormatCntnt(SwPageFrm const*) (layact.cxx:1660)
   by SwLayAction::InternalAction() (layact.cxx:597)
   by SwLayAction::Action() (layact.cxx:376)
   by SwLayIdle::SwLayIdle(SwRootFrm*, SwViewImp*) (layact.cxx:2179)

Change-Id: I64a1cc6ea301b653af951ba0e00e28d4655d2d97
2014-05-17 00:43:25 +02:00
c1cad9bbc3 Resolves: fdo#78204 adjust note icons on comments-in-margins case
the page has been scaled by 75% and vertically centered so the page positions
need to be also adjusted.

Change-Id: I7ab6b4956933ba444441c857e78aee8e5c1cf97a
2014-05-15 12:40:04 +01:00
f7b88a2b03 fdo#78608 SwTxtFrm::Paint: fix missing repaint problem on the left edge
Change-Id: Iba66a82e4a92a0afe1ad923cf4e0922730bd03de
2014-05-12 17:25:57 +02:00
0fd4cc8ba7 fdo#78444 sw: avoid incorrect right shrinking of repaint rectangle
The old condition was: set the right edge of the repaint rectangle, in
case the result would be wider than the original (if we repaint more,
that can't hurt regarding the end result) or in case the left edge was
set.

But that's problematic, the reproducer situation described in the bug
triggers a case when the right edge is shrunk too much, so part of the
painted letter is missing.

Fix that by only setting the right edge of the repaint rectangle when we
know that it won't shrink.

Change-Id: I33b78a929021b284d5283fc2c35e0b3c999fa224
2014-05-08 18:56:08 +02:00
794f09f195 simplify ternary conditions "xxx ? true : yyy"
Look for code like:
   xxx ? true : yyy;
Which can be simplified to:
   xxx || yyy

Change-Id: Ib7ca86580bfd0cf04674328a3c0cf3747de4758d
2014-05-06 07:45:25 +02:00
5d0272772a consistent percent sign in comments
Change-Id: I9906b4e58fd8672e51f6aa2e56ec68bb28772500
2014-05-06 07:19:08 +02:00
4f9b21248f simplify ternary conditions "xxx ? yyy : false"
Look for code like:
   xxx ? yyy : false;
Which can be simplified to:
   xxx && yyy

Change-Id: Ia33c0e452aa28af3f0658a5382895aaad0246b4d
2014-05-05 12:47:48 +02:00
cedbbe2f78 fdo#78153 SwTxtFrm::ManipOfst() requires a valid position
At least it seems that after setting the offset to the largest possible
value (instead of COMPLETE_STRING), things get back to normal.

Change-Id: I25fafd277eaf480f9ae232254ced3946589aa562
2014-05-01 15:27:35 +02:00