r15386 by craig -
scribus-commit
scribus-commit at lists.scribus.net
Mon Jul 26 23:54:28 CEST 2010
Author: craig
Date: Mon Jul 26 21:54:28 2010
New Revision: 15386
Log:
Commit avox's text style patch
Modified:
trunk/Scribus/scribus/text/storytext.cpp
Modified: trunk/Scribus/scribus/text/storytext.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/Scribus/scribus/text/storytext.cpp (original)
+++ trunk/Scribus/scribus/text/storytext.cpp Mon Jul 26 21:54:28 2010
@@ -629,15 +629,26 @@
if (len =3D=3D 0)
return;
=
+ int lastParStart =3D pos =3D=3D 0? 0 : -1;
ScText* itText;
for (uint i=3Dpos; i < pos+len; ++i) {
itText =3D d->at(i);
- // #6165 : applying style on last character applies style on whole text =
on next open =
- /*if (itText->ch =3D=3D SpecialChars::PARSEP && itText->parstyle !=3D NU=
LL)
- itText->parstyle->charStyle().applyCharStyle(style);*/
+ // #6165 : applying style on last character applies style on whole text =
on next open
+ // #9173 et. al.: move charstyle to parstyle if whole paragraph is affec=
ted
+ if (itText->ch =3D=3D SpecialChars::PARSEP && itText->parstyle !=3D NULL=
&& lastParStart >=3D 0)
+ {
+ eraseCharStyle(lastParStart, i - lastParStart, style);
+ itText->parstyle->charStyle().applyCharStyle(style);
+ lastParStart =3D i + 1;
+ }
itText->applyCharStyle(style);
}
-
+ if (pos + signed(len) =3D=3D length() && lastParStart >=3D 0)
+ {
+ eraseCharStyle(lastParStart, length() - lastParStart, style);
+ d->trailingStyle.charStyle().applyCharStyle(style);
+ }
+ =
invalidate(pos, pos + len);
}
=
@@ -661,6 +672,10 @@
if (itText->ch =3D=3D SpecialChars::PARSEP && itText->parstyle !=3D NULL)
itText->parstyle->charStyle().eraseCharStyle(style);
itText->eraseCharStyle(style);
+ }
+ if (pos + signed(len) =3D=3D length())
+ {
+ d->trailingStyle.charStyle().eraseCharStyle(style);
}
=
invalidate(pos, pos + len);
More information about the scribus-commit
mailing list