summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsu_v <suv-sf@users.sourceforge.net>2014-07-19 21:22:12 +0000
committer~suv <suv-sf@users.sourceforge.net>2014-07-19 21:22:12 +0000
commitdb8282d8518263885625d9c19aefad1bdbb175d4 (patch)
tree911a397de0ac4588c2475e6bc3d9310ad3e92d2a
parentupdate to trunk (r13425) (diff)
parentWarnings cleaup. (diff)
downloadinkscape-db8282d8518263885625d9c19aefad1bdbb175d4.tar.gz
inkscape-db8282d8518263885625d9c19aefad1bdbb175d4.zip
update to trunk (r13454)
(bzr r13398.1.4)
-rw-r--r--Makefile.am5
-rwxr-xr-xautogen.sh14
-rw-r--r--build-x64.xml4
-rw-r--r--build.xml2
-rw-r--r--packaging/wix/files.py7
-rw-r--r--packaging/wix/inkscape.wxs32
-rw-r--r--packaging/wix/version.py61
-rw-r--r--packaging/wix/wixenv.bat4
-rw-r--r--po/de.po18
-rw-r--r--share/extensions/colors.xml1
-rwxr-xr-xshare/extensions/render_barcode_datamatrix.py2
-rw-r--r--share/extensions/scour.py1
-rw-r--r--share/extensions/simplestyle.py1
-rw-r--r--share/palettes/svg.gpl1
-rw-r--r--src/2geom/path.cpp2
-rw-r--r--src/box3d-side.cpp2
-rw-r--r--src/display/drawing-text.cpp23
-rw-r--r--src/display/nr-filter-blend.cpp9
-rw-r--r--src/display/nr-filter-blend.h2
-rw-r--r--src/extension/internal/emf-print.cpp4
-rw-r--r--src/extension/internal/wmf-inout.cpp1
-rw-r--r--src/extension/prefdialog.cpp3
-rw-r--r--src/filter-enums.cpp8
-rw-r--r--src/filters/blend.cpp8
-rw-r--r--src/inkscape.rc2
-rw-r--r--src/inkview.rc2
-rw-r--r--src/knot-holder-entity.cpp16
-rw-r--r--src/libavoid/connector.cpp18
-rw-r--r--src/libcroco/cr-rgb.c1
-rw-r--r--src/live_effects/lpe-knot.cpp24
-rw-r--r--src/live_effects/lpe-knot.h1
-rw-r--r--src/live_effects/parameter/powerstrokepointarray.cpp5
-rw-r--r--src/selection-chemistry.cpp11
-rw-r--r--src/seltrans.cpp6
-rw-r--r--src/sp-ellipse.cpp2
-rw-r--r--src/sp-item-group.cpp39
-rw-r--r--src/sp-item-group.h2
-rw-r--r--src/sp-item.cpp5
-rw-r--r--src/sp-item.h1
-rw-r--r--src/sp-lpe-item.cpp26
-rw-r--r--src/sp-path.cpp2
-rw-r--r--src/sp-spiral.cpp2
-rw-r--r--src/sp-star.cpp2
-rw-r--r--src/sp-use.cpp3
-rw-r--r--src/style-internal.cpp16
-rw-r--r--src/svg/svg-color.cpp1
-rw-r--r--src/ui/dialog/clonetiler.cpp18
-rw-r--r--src/ui/dialog/layers.cpp12
-rw-r--r--src/ui/tools/pen-tool.cpp35
-rw-r--r--src/ui/widget/filter-effect-chooser.cpp13
-rw-r--r--src/widgets/desktop-widget.cpp3
-rw-r--r--src/xml/helper-observer.cpp13
-rw-r--r--src/xml/helper-observer.h1
53 files changed, 270 insertions, 227 deletions
diff --git a/Makefile.am b/Makefile.am
index 9fe21a72f..1ed5e4d0f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -53,7 +53,7 @@ EXTRA_DIST = \
inkscape.spec \
Info.plist.in \
Info.plist \
- buildtool.cpp build.xml \
+ buildtool.cpp build.xml build-x64.xml \
README README.ca.txt README.de.txt README.es.txt README.fr.txt README.it.txt README.osx.txt README.pt_BR.txt README.sk.txt README.sr.txt \
TRANSLATORS \
inkscape.png \
@@ -62,6 +62,7 @@ EXTRA_DIST = \
src/helper/sp-marshal.cpp.mingw src/helper/sp-marshal.h.mingw \
src/2geom/angle.h \
src/inkscape-manifest.xml src/inkview-manifest.xml \
+ src/inkscape-manifest-x64.xml src/inkview-manifest-x64.xml \
cxxtest/COPYING \
cxxtest/cxxtestgen.pl \
cxxtest/cxxtestgen.py \
@@ -227,7 +228,7 @@ EXTRA_DIST = \
packaging/wix/Bitmaps/dialog.svg \
po/inkscape.pot \
po/update_po_files.sh \
- src/inkscape.rc src/inkview.rc
+ src/inkscape.rc src/inkview.rc src/inkscape-x64.rc src/inkview-x64.rc
# We want the built inkscape.1 to go in the distributed .tar.gz so
# that .tar.gz users don't need a full perl distribution to get a man
diff --git a/autogen.sh b/autogen.sh
index fcac2d4de..0a9cb7924 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -15,18 +15,24 @@ test -n "$srcdir" || srcdir=.
olddir=`pwd`
cd $srcdir
-AUTORECONF=`which autoreconf`
-if test -z $AUTORECONF; then
+WHICH_AUTORECONF=`which autoreconf`
+if test -z $WHICH_AUTORECONF; then
echo "*** No autoreconf found, please install it ***"
exit 1
fi
-INTLTOOLIZE=`which intltoolize`
-if test -z $INTLTOOLIZE; then
+WHICH_INTLTOOLIZE=`which intltoolize`
+if test -z $WHICH_INTLTOOLIZE; then
echo "*** No intltoolize found, please install the intltool package ***"
exit 1
fi
+WHICH_AUTOPOINT=`which autopoint`
+if test -z $WHICH_AUTOPOINT; then
+ echo "*** No autopoint found, please install the autopoint package ***"
+ exit 1
+fi
+
autopoint --force
AUTOPOINT='intltoolize --automake --copy' autoreconf --force --install --verbose
diff --git a/build-x64.xml b/build-x64.xml
index 117c8ea41..9d1e4ab7d 100644
--- a/build-x64.xml
+++ b/build-x64.xml
@@ -461,7 +461,7 @@
stripcommand="${archutil}strip"
objcopycommand="${archutil}objcopy">
<flags>
- -mconsole -m64
+ -mwindows -m64
-mthreads
</flags>
<fileset dir="${build}/obj">
@@ -548,7 +548,7 @@
stripcommand="${archutil}strip"
objcopycommand="${archutil}objcopy">
<flags>
- -mconsole -m64
+ -mwindows -m64
-mthreads
</flags>
<fileset dir="${build}/obj">
diff --git a/build.xml b/build.xml
index 743151660..ce27f8bb8 100644
--- a/build.xml
+++ b/build.xml
@@ -453,7 +453,7 @@
stripcommand="${archutil}strip"
objcopycommand="${archutil}objcopy">
<flags>
- -mconsole
+ -mwindows
-mthreads
</flags>
<fileset dir="${build}/obj">
diff --git a/packaging/wix/files.py b/packaging/wix/files.py
index 93a7c8dd1..ada4d62f2 100644
--- a/packaging/wix/files.py
+++ b/packaging/wix/files.py
@@ -27,7 +27,7 @@ def directory(root, breadcrumb, level, exclude=[]):
file_key = os.path.join(root, file)
_id = '_%06d' % (len(file_ids.keys()) + 1)
file_ids[file_key] = 'component' + _id
- wxs.write(indent(level)+ "<Component Id='component" + _id + "' Guid='" + str(uuid.uuid4()) + "' DiskId='1'>\n")
+ wxs.write(indent(level)+ "<Component Id='component" + _id + "' Guid='" + str(uuid.uuid4()) + "' DiskId='1' Win64='$(var.Win64)'>\n")
if file == 'inkscape.exe':
# we refenrence inkscape.exe in inkscape.wxs
_id = '_inkscape_exe'
@@ -62,10 +62,11 @@ def ComponentGroup(name, condition, level):
with open('files.wxs', 'w') as wxs:
wxs.write("<!-- do not edit, this file is created by files.py tool any changes will be lost -->\n")
wxs.write("<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>\n")
+ wxs.write(indent(1) + "<?include version.wxi?>\n")
wxs.write(indent(1) + "<Fragment>\n")
wxs.write(indent(2) + "<!-- Step 1: Define the directory structure -->\n")
wxs.write(indent(2) + "<Directory Id='TARGETDIR' Name='SourceDir'>\n")
- wxs.write(indent(3) + "<Directory Id='ProgramFilesFolder' Name='PFiles'>\n")
+ wxs.write(indent(3) + "<Directory Id='$(var.ProgramFilesFolder)' Name='PFiles'>\n")
wxs.write(indent(4) + "<Directory Id='INSTALLDIR' Name='Inkscape'>\n")
print "start parsing ..\..\inkscape"
directory('..\..\inkscape', 'inkscape', 5, ['inkscape.dbg', 'inkview.dbg', 'gdb.exe'])
@@ -74,7 +75,7 @@ with open('files.wxs', 'w') as wxs:
wxs.write(indent(3) + "</Directory>\n")
# link to ProgrmMenu
wxs.write(indent(3) + "<Directory Id='ProgramMenuFolder'>\n")
- wxs.write(indent(4) + "<Directory Id='ApplicationProgramsFolder' Name='Inkscape 0.48'/>\n")
+ wxs.write(indent(4) + "<Directory Id='ApplicationProgramsFolder' Name='$(var.FullProductName)'/>\n")
wxs.write(indent(3) + "</Directory>\n")
wxs.write(indent(3) + "<Directory Id='DesktopFolder' Name='Desktop' />\n")
wxs.write(indent(2) + "</Directory>\n")
diff --git a/packaging/wix/inkscape.wxs b/packaging/wix/inkscape.wxs
index dfe61defd..3b4152a5f 100644
--- a/packaging/wix/inkscape.wxs
+++ b/packaging/wix/inkscape.wxs
@@ -1,10 +1,10 @@
<?xml version='1.0' encoding='windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<?include version.wxi?>
-
- <Product Name="$(var.FullProductName)" Id='81922150-317e-4bb0-a31d-ff1c14f707c5' UpgradeCode='4d5fedaa-84a0-48be-bd2a-08246398361a' Language='1033' Codepage='1252' Version='0.48' Manufacturer='inkscape.org'>
- <Package Id='*' Keywords='Installer' Description="Inkscape Installer" Comments='inkscape is registered trademark of inkscape.org' Manufacturer='inkscape.org' InstallerVersion='100' Languages='1033' Compressed='yes' SummaryCodepage='1252' />
+ <Product Name="$(var.FullProductName)" Id='81922150-317e-4bb0-a31d-ff1c14f707c5' UpgradeCode='4d5fedaa-84a0-48be-bd2a-08246398361a' Language='1033' Codepage='1252' Version='$(var.ProductVersion)' Manufacturer='inkscape.org'>
+
+ <Package Id='*' Keywords='Installer' Description="Inkscape Installer" Comments='inkscape is registered trademark of inkscape.org' Manufacturer='inkscape.org' InstallerVersion='$(var.InstallerVersion)' Platform='$(var.Platform)' Languages='1033' Compressed='yes' SummaryCodepage='1252' />
<Media Id='1' Cabinet='Sample.cab' EmbedCab='yes' DiskPrompt="CD-ROM #1" />
<Property Id='DiskPrompt' Value="inkscape Installation [1]" />
@@ -12,7 +12,7 @@
<Property Id='ALLUSERS' Value="2" />
<DirectoryRef Id="ApplicationProgramsFolder">
- <Component Id="ApplicationShortcut" Guid="37de8ea4-e83a-4e40-8f9c-c6066b78d935">
+ <Component Id="ApplicationShortcut" Guid="37de8ea4-e83a-4e40-8f9c-c6066b78d935" Win64='$(var.Win64)' >
<Shortcut Id="ApplicationStartMenuShortcut"
Name="$(var.FullProductName)"
Description="Inkscape Vector Graphics Application"
@@ -27,16 +27,16 @@
</DirectoryRef>
<DirectoryRef Id="DesktopFolder">
- <Component Id="DesktopShortcut" Guid="3afc08a7-05a1-40cf-90c2-0d6c042bfc41">
- <!-- Shortcut Id="desktopFoobar10" Directory="DesktopFolder" Target="[INSTALLDIR]inkscape.exe" Name="Inkscape 0.48" WorkingDirectory='INSTALLDIR' Icon="file_inkscape_exe" IconIndex="0" / -->
+ <Component Id="DesktopShortcut" Guid="3afc08a7-05a1-40cf-90c2-0d6c042bfc41" Win64='$(var.Win64)'>
+ <!-- Shortcut Id="desktopFoobar10" Directory="DesktopFolder" Target="[INSTALLDIR]inkscape.exe" Name="$(var.FullProductName)" WorkingDirectory='INSTALLDIR' Icon="file_inkscape_exe" IconIndex="0" / -->
<Shortcut Id="desktopFoobar10" Directory="DesktopFolder" Target="[INSTALLDIR]inkscape.exe" Name="$(var.FullProductName)" WorkingDirectory='INSTALLDIR' />
<RemoveFolder Id="DesktopFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\Microsoft\MyApplicationName" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
-
+
<DirectoryRef Id="INSTALLDIR">
- <Component Id="RegisterExtension" Guid="d544e040-573e-4ea8-983e-4bcae6b87f3d">
+ <Component Id="RegisterExtension" Guid="d544e040-573e-4ea8-983e-4bcae6b87f3d" Win64='$(var.Win64)'>
<ProgId Id="inkscape.svg" Description='scalable vector graphics file' Icon='file_inkscape_exe'>
<Extension Id='svg' ContentType='application/svg'>
<Verb Id='edit' Command='Edit with Inkscape' TargetFile='file_inkscape_exe' Argument='"%1"' />
@@ -44,15 +44,15 @@
<Extension Id='svgz' ContentType='application/svgz'>
<Verb Id='open' Command='Open with Inkscape' TargetFile='file_inkscape_exe' Argument='"%1"' />
</Extension>
-
+
</ProgId>
</Component>
</DirectoryRef>
-
+
<Feature Id='Complete' Title="$(var.FullProductName)" Description='The complete Package' Display='expand' Level='1' ConfigurableDirectory='INSTALLDIR' Absent="disallow" AllowAdvertise='no'>
-<!--
+ <!--
<Feature Id='MainProgram' Level='1' Title='inkscape Application' Description='the inkscape Application' Absent="disallow" AllowAdvertise='no'>
<ComponentRef Id='MainExecutable' />
</Feature>
@@ -60,20 +60,20 @@
<!--
<Feature Id='MainProgram' Level='1' Title='inkscape Application' Description='the inkscape Application' Absent="disallow" AllowAdvertise='no'>
-->
- <ComponentGroupRef Id='AllOther' />
+ <ComponentGroupRef Id='AllOther' />
<!--
</Feature>
-->
-
+
<!-- shortcuts -->
<Feature Id='ApplicationShortcut' Level='1' Title='Start Menu entry' Description='an entry in the start Menu' AllowAdvertise='no'>
<ComponentRef Id='ApplicationShortcut' />
</Feature>
-
+
<Feature Id='DesktopShortcut' Level='1' Title='Desktop link' Description='an link on the desktop' AllowAdvertise='no'>
<ComponentRef Id='DesktopShortcut' />
</Feature>
-
+
<Feature Id='RegisterExtension' Level='1' Title='register file extension' Description='register .svg and .svgz file extension to explorer context menu' AllowAdvertise='no'>
<ComponentRef Id='RegisterExtension' />
</Feature>
@@ -89,7 +89,7 @@
<Feature Id='Tutorials' Level='1' Title='Tutorials' Description='tutorials as svg' AllowAdvertise='no'>
<ComponentGroupRef Id='Tutorials' />
</Feature>
-<!--
+ <!--
<ComponentRef Id='ProgramMenuDir' />
-->
</Feature>
diff --git a/packaging/wix/version.py b/packaging/wix/version.py
index 46968c90c..dc5e06de9 100644
--- a/packaging/wix/version.py
+++ b/packaging/wix/version.py
@@ -1,20 +1,59 @@
#!/usr/bin/python
import os
+import struct
version = ''
+versionstr = ''
+architecture = ''
+
+def is64bitArchitecture(filename):
+ ''' test if a executable is of x64 format @see http://stackoverflow.com/questions/1001404/check-if-unmanaged-dll-is-32-bit-or-64-bit/1002672#1002672
+ @see http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx
+ //offset to PE header is always at 0x3C
+ //PE header starts with "PE\0\0" = 0x50 0x45 0x00 0x00
+ //followed by 2-byte machine type field (see document above for enum)
+ '''
+ with open(filename, 'rb') as cofffile:
+ cofffile.seek(0x3c)
+ peOffset = struct.unpack('H', cofffile.read(2))[0]
+ cofffile.seek(peOffset)
+ peHead = struct.unpack('I', cofffile.read(4))[0]
+ if peHead != 0x00004550: # "PE\0\0", little-endian
+ # throw new Exception("Can't find PE header")
+ pass
+ machineType = struct.unpack('H', cofffile.read(2))[0]
+ if machineType in (0x8664, 0x200):
+ return True
+ return False
+
+if is64bitArchitecture('..\..\inkscape\inkscape.exe'):
+ architecture = '-x64'
+else:
+ architecture = ''
# retrieve the version information from the inkscape.rc file
# VALUE "ProductVersion", "0.48+devel"
with open('..\..\src\inkscape.rc', 'r') as rc:
+ isversioninfo = False
+
for line in rc.readlines():
if 'productversion' in line.lower() and 'value' in line.lower():
items = line.split()
- version = items[2]
- version = version.replace('"', '')
- version = version.replace("'", "")
+ versionstr = items[2]
+ versionstr = versionstr.replace('"', '')
+ versionstr = versionstr.replace("'", "")
# version = version.replace("+", "_")
- print version
+ print versionstr + architecture
+ if 'versioninfo' in line.lower():
+ isversioninfo = True
+ if 'begin' in line.lower():
+ isversioninfo = False
+ if isversioninfo and 'productversion' in line.lower():
+ items = line.split()
+ ''' the second element contains now version info in the form major,minor,fix,build'''
+ veritems = items[1].split(',')
+ version = veritems[0] + '.' + veritems[1]
with open('version.wxi', 'w') as wxi:
@@ -22,8 +61,16 @@ with open('version.wxi', 'w') as wxi:
wxi.write("<!-- do not edit, this file is created by version.py tool any changes will be lost -->\n")
wxi.write("<Include>\n")
wxi.write("<?define ProductVersion='" + version + "' ?>\n")
- wxi.write("<?define FullProductName='Inkscape " + version + "' ?>\n")
+ wxi.write("<?define FullProductName='Inkscape " + versionstr + "' ?>\n")
+ if 'x64' in architecture:
+ wxi.write("<?define ProgramFilesFolder='ProgramFiles64Folder' ?>\n")
+ wxi.write("<?define Win64='yes' ?>\n")
+ wxi.write("<?define InstallerVersion='200' ?>\n")
+ wxi.write("<?define Platform='x64' ?>\n")
+ else:
+ wxi.write("<?define ProgramFilesFolder='ProgramFilesFolder' ?>\n")
+ wxi.write("<?define Win64='no' ?>\n")
+ wxi.write("<?define InstallerVersion='100' ?>\n")
+ wxi.write("<?define Platform='x86' ?>\n")
wxi.write("</Include>\n")
-
-
diff --git a/packaging/wix/wixenv.bat b/packaging/wix/wixenv.bat
index 5f1f7e90c..c798a9ce1 100644
--- a/packaging/wix/wixenv.bat
+++ b/packaging/wix/wixenv.bat
@@ -5,12 +5,12 @@ ver | findstr /i "6\.1\." > nul
IF %ERRORLEVEL% EQU 0 goto win7
@rem all other cases
-IF "%WIX_PATH%"=="" set WIX_PATH=C:\Programme\WiX Toolset v3.7\bin
+IF "%WIX_PATH%"=="" set WIX_PATH=C:\Programme\WiX Toolset v3.8\bin
IF "%DEVLIBS_PATH%"=="" set DEVLIBS_PATH=c:\devlibs
goto setpath
:win7
-IF "%WIX_PATH%"=="" set WIX_PATH=C:\Program Files (x86)\WiX Toolset v3.7\bin
+IF "%WIX_PATH%"=="" set WIX_PATH=C:\Program Files (x86)\WiX Toolset v3.8\bin
IF "%DEVLIBS_PATH%"=="" set DEVLIBS_PATH=c:\devlibs
:setpath
diff --git a/po/de.po b/po/de.po
index 77a366205..1bdb32376 100644
--- a/po/de.po
+++ b/po/de.po
@@ -18,15 +18,15 @@ msgstr ""
"Project-Id-Version: inkscape\n"
"Report-Msgid-Bugs-To: inkscape-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2013-11-07 15:09+0100\n"
-"PO-Revision-Date: 2013-12-21 12:02+0100\n"
-"Last-Translator: Uwe Schoeler <uwesch@gmail.com>\n"
+"PO-Revision-Date: 2014-06-23 20:15+0100\n"
+"Last-Translator: Uwe Schoeler <UweSch@gmail.com>\n"
"Language-Team: <de@li.org>\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Poedit 1.6.1\n"
+"X-Generator: Poedit 1.6.5\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SourceCharset: utf-8\n"
@@ -9435,9 +9435,8 @@ msgid "Scale:"
msgstr "Skalierung:"
#: ../src/live_effects/lpe-path_length.cpp:26
-#, fuzzy
msgid "Scaling factor"
-msgstr "Saklierungs-Faktor"
+msgstr "Saklierungsfaktor"
#: ../src/live_effects/lpe-path_length.cpp:28
#: ../src/live_effects/lpe-ruler.cpp:42
@@ -9454,9 +9453,8 @@ msgid "Unit"
msgstr "Einheit"
#: ../src/live_effects/lpe-path_length.cpp:29
-#, fuzzy
msgid "Display unit"
-msgstr "Anzeige Anpassungen"
+msgstr "Anzeige-Einheit"
#: ../src/live_effects/lpe-path_length.cpp:29
#, fuzzy
@@ -12213,14 +12211,12 @@ msgid "Flow Excluded Region"
msgstr "Ausgeschlossenen Bereich umfließen"
#: ../src/sp-flowtext.cpp:289
-#, fuzzy
msgid "Flowed Text"
msgstr "Fließtext"
#: ../src/sp-flowtext.cpp:291
-#, fuzzy
msgid "Linked Flowed Text"
-msgstr "Fließtext"
+msgstr "Verknüpfter Fließtext"
#: ../src/sp-flowtext.cpp:298 ../src/sp-text.cpp:357
#: ../src/text-context.cpp:1597
@@ -22862,7 +22858,7 @@ msgstr "Zur nächste Ebene wechseln"
#: ../src/verbs.cpp:1228
msgid "Switched to next layer."
-msgstr "Zur nächsten Ebene gewächselt."
+msgstr "Zur nächsten Ebene gewechselt."
#: ../src/verbs.cpp:1230
msgid "Cannot go past last layer."
diff --git a/share/extensions/colors.xml b/share/extensions/colors.xml
index 51167fdd7..7ed8592d5 100644
--- a/share/extensions/colors.xml
+++ b/share/extensions/colors.xml
@@ -119,6 +119,7 @@
<color name="plum" hex="#dda0dd" rgb="221,160,221" />
<color name="powderblue" hex="#b0e0e6" rgb="176,224,230" />
<color name="purple" hex="#800080" rgb="128,0,128" />
+<color name="rebeccapurple" hex="#663399" rgb="102,51,153" />
<color name="red" hex="#ff0000" rgb="255,0,0" />
<color name="rosybrown" hex="#bc8f8f" rgb="188,143,143" />
<color name="royalblue" hex="#4169e1" rgb="65,105,225" />
diff --git a/share/extensions/render_barcode_datamatrix.py b/share/extensions/render_barcode_datamatrix.py
index bca1d2241..83d009db8 100755
--- a/share/extensions/render_barcode_datamatrix.py
+++ b/share/extensions/render_barcode_datamatrix.py
@@ -140,7 +140,7 @@ def get_parameters(nrow, ncol):
elif ( nrow == 20 and ncol == 20 ):
return 18, 18, 1, 1, 22, 18, 1
elif ( nrow == 22 and ncol == 22 ):
- return 18, 18, 1, 1, 30, 20, 1
+ return 20, 20, 1, 1, 30, 20, 1
elif ( nrow == 24 and ncol == 24 ):
return 22, 22, 1, 1, 36, 24, 1
elif ( nrow == 26 and ncol == 26 ):
diff --git a/share/extensions/scour.py b/share/extensions/scour.py
index be40a27bd..236529daa 100644
--- a/share/extensions/scour.py
+++ b/share/extensions/scour.py
@@ -250,6 +250,7 @@ colors = {
'plum': 'rgb(221, 160, 221)',
'powderblue': 'rgb(176, 224, 230)',
'purple': 'rgb(128, 0, 128)',
+ 'rebeccapurple': 'rgb(102, 51, 153)',
'red': 'rgb(255, 0, 0)',
'rosybrown': 'rgb(188, 143, 143)',
'royalblue': 'rgb( 65, 105, 225)',
diff --git a/share/extensions/simplestyle.py b/share/extensions/simplestyle.py
index 99b5938dd..806b81813 100644
--- a/share/extensions/simplestyle.py
+++ b/share/extensions/simplestyle.py
@@ -141,6 +141,7 @@ svgcolors={
'plum':'#dda0dd',
'powderblue':'#b0e0e6',
'purple':'#800080',
+ 'rebeccapurple':'#663399',
'red':'#ff0000',
'rosybrown':'#bc8f8f',
'royalblue':'#4169e1',
diff --git a/share/palettes/svg.gpl b/share/palettes/svg.gpl
index b0893cd82..d8b868b5d 100644
--- a/share/palettes/svg.gpl
+++ b/share/palettes/svg.gpl
@@ -139,3 +139,4 @@ Name: SVG
220 20 60 crimson (#DC143C)
255 192 203 pink (#FFC0CB)
255 182 193 lightpink (#FFB6C1)
+102 51 153 rebeccapurple (#663399)
diff --git a/src/2geom/path.cpp b/src/2geom/path.cpp
index fc4d72028..3558af3b3 100644
--- a/src/2geom/path.cpp
+++ b/src/2geom/path.cpp
@@ -110,7 +110,7 @@ Path &Path::operator*=(Translate const &m) {
Sequence::iterator it;
Point prev;
for (it = get_curves().begin() ; it != last ; ++it) {
- //*(const_cast<Curve*>(&**it)) *= m;
+ // *(const_cast<Curve*>(&**it)) *= m;
const_cast<Curve*>(it->get())->operator*=(m);
if ( it != get_curves().begin() && (*it)->initialPoint() != prev ) {
THROW_CONTINUITYERROR();
diff --git a/src/box3d-side.cpp b/src/box3d-side.cpp
index a5e7eaa94..dfccb63bf 100644
--- a/src/box3d-side.cpp
+++ b/src/box3d-side.cpp
@@ -213,8 +213,6 @@ void Box3DSide::set_shape() {
bool success = this->performPathEffect(c_lpe);
if (success) {
- sp_lpe_item_apply_to_mask(this);
- sp_lpe_item_apply_to_clippath(this);
this->setCurveInsync(c_lpe, TRUE);
}
diff --git a/src/display/drawing-text.cpp b/src/display/drawing-text.cpp
index 05a2c3c2a..9f3b447df 100644
--- a/src/display/drawing-text.cpp
+++ b/src/display/drawing-text.cpp
@@ -150,25 +150,26 @@ unsigned DrawingGlyphs::_updateItem(Geom::IntRect const &/*area*/, UpdateContext
return STATE_ALL;
}
-DrawingItem *
-DrawingGlyphs::_pickItem(Geom::Point const &p, double delta, unsigned /*flags*/)
+DrawingItem *DrawingGlyphs::_pickItem(Geom::Point const &p, double /*delta*/, unsigned /*flags*/)
{
DrawingText *ggroup = dynamic_cast<DrawingText *>(_parent);
if (!ggroup) {
throw InvalidItemException();
}
+ DrawingItem *result = NULL;
bool invisible = (ggroup->_nrstyle.fill.type == NRStyle::PAINT_NONE) &&
(ggroup->_nrstyle.stroke.type == NRStyle::PAINT_NONE);
- if (!_font || !_bbox || (!_drawing.outline() && invisible) ) {
- return NULL;
- }
- // With text we take a simple approach: pick if the point is in a character bbox
- Geom::Rect expanded(_pick_bbox);
- // FIXME, why expand by delta? When is the next line needed?
- // expanded.expandBy(delta);
- if (expanded.contains(p)) return this;
- return NULL;
+ if (_font && _bbox && (_drawing.outline() || !invisible) ) {
+ // With text we take a simple approach: pick if the point is in a character bbox
+ Geom::Rect expanded(_pick_bbox);
+ // FIXME, why expand by delta? When is the next line needed?
+ // expanded.expandBy(delta);
+ if (expanded.contains(p)) {
+ result = this;
+ }
+ }
+ return result;
}
diff --git a/src/display/nr-filter-blend.cpp b/src/display/nr-filter-blend.cpp
index 099816bce..25aea6f13 100644
--- a/src/display/nr-filter-blend.cpp
+++ b/src/display/nr-filter-blend.cpp
@@ -83,8 +83,7 @@ void FilterBlend::render_cairo(FilterSlot &slot)
case BLEND_LIGHTEN:
cairo_set_operator(out_ct, CAIRO_OPERATOR_LIGHTEN);
break;
-#ifdef WITH_CSSBLEND
- // NEW
+ // New in CSS Compositing and Blending Level 1
case BLEND_OVERLAY:
cairo_set_operator(out_ct, CAIRO_OPERATOR_OVERLAY);
break;
@@ -118,7 +117,6 @@ void FilterBlend::render_cairo(FilterSlot &slot)
case BLEND_LUMINOSITY:
cairo_set_operator(out_ct, CAIRO_OPERATOR_HSL_LUMINOSITY);
break;
-#endif
case BLEND_NORMAL:
default:
@@ -167,15 +165,12 @@ void FilterBlend::set_input(int input, int slot) {
void FilterBlend::set_mode(FilterBlendMode mode) {
if (mode == BLEND_NORMAL || mode == BLEND_MULTIPLY ||
mode == BLEND_SCREEN || mode == BLEND_DARKEN ||
- mode == BLEND_LIGHTEN
-#ifdef WITH_CSSBLEND
- || mode == BLEND_OVERLAY ||
+ mode == BLEND_LIGHTEN || mode == BLEND_OVERLAY ||
mode == BLEND_COLORDODGE || mode == BLEND_COLORBURN ||
mode == BLEND_HARDLIGHT || mode == BLEND_SOFTLIGHT ||
mode == BLEND_DIFFERENCE || mode == BLEND_EXCLUSION ||
mode == BLEND_HUE || mode == BLEND_SATURATION ||
mode == BLEND_COLOR || mode == BLEND_LUMINOSITY
-#endif
)
{
_blend_mode = mode;
diff --git a/src/display/nr-filter-blend.h b/src/display/nr-filter-blend.h
index 0a2927d87..c0504993b 100644
--- a/src/display/nr-filter-blend.h
+++ b/src/display/nr-filter-blend.h
@@ -28,7 +28,6 @@ enum FilterBlendMode {
BLEND_SCREEN,
BLEND_DARKEN,
BLEND_LIGHTEN,
-#ifdef WITH_CSSBLEND
// New in CSS Compositing and Blending Level 1
BLEND_OVERLAY,
BLEND_COLORDODGE,
@@ -41,7 +40,6 @@ enum FilterBlendMode {
BLEND_SATURATION,
BLEND_COLOR,
BLEND_LUMINOSITY,
-#endif
BLEND_ENDMODE,
};
diff --git a/src/extension/internal/emf-print.cpp b/src/extension/internal/emf-print.cpp
index 9c68e40a4..0bdfd45b9 100644
--- a/src/extension/internal/emf-print.cpp
+++ b/src/extension/internal/emf-print.cpp
@@ -977,8 +977,8 @@ unsigned int PrintEmf::fill(
using Geom::X;
using Geom::Y;
- SPItem *item = SP_ITEM(style->object);
- SPClipPath *scp = (item->clip_ref ? item->clip_ref->getObject() : NULL);
+ //SPItem *item = SP_ITEM(style->object);
+ //SPClipPath *scp = (item->clip_ref ? item->clip_ref->getObject() : NULL);
Geom::Affine tf = m_tr_stack.top();
diff --git a/src/extension/internal/wmf-inout.cpp b/src/extension/internal/wmf-inout.cpp
index 85060470b..2b05c6d2c 100644
--- a/src/extension/internal/wmf-inout.cpp
+++ b/src/extension/internal/wmf-inout.cpp
@@ -63,7 +63,6 @@ namespace Extension {
namespace Internal {
-static U_RECT16 rc_old;
static bool clipset = false;
static uint32_t BLTmode=0;
diff --git a/src/extension/prefdialog.cpp b/src/extension/prefdialog.cpp
index 1b657f644..d1f83701f 100644
--- a/src/extension/prefdialog.cpp
+++ b/src/extension/prefdialog.cpp
@@ -212,6 +212,9 @@ PrefDialog::preview_toggle (void) {
void
PrefDialog::param_change (void) {
if (_exEnv != NULL) {
+ if (!_effect->loaded()) {
+ _effect->set_state(Extension::STATE_LOADED);
+ }
_timersig.disconnect();
_timersig = Glib::signal_timeout().connect(sigc::mem_fun(this, &PrefDialog::param_timer_expire),
250, /* ms */
diff --git a/src/filter-enums.cpp b/src/filter-enums.cpp
index 7ee57f7fa..09a1a7614 100644
--- a/src/filter-enums.cpp
+++ b/src/filter-enums.cpp
@@ -53,7 +53,6 @@ const EnumData<Inkscape::Filters::FilterBlendMode> BlendModeData[Inkscape::Filte
{Inkscape::Filters::BLEND_SCREEN, _("Screen"), "screen"},
{Inkscape::Filters::BLEND_DARKEN, _("Darken"), "darken"},
{Inkscape::Filters::BLEND_LIGHTEN, _("Lighten"), "lighten"},
-#ifdef WITH_CSSBLEND
// New in Compositing and Blending Level 1
{Inkscape::Filters::BLEND_OVERLAY, _("Overlay"), "overlay"},
{Inkscape::Filters::BLEND_COLORDODGE, _("Color Dodge"), "color-dodge"},
@@ -66,10 +65,13 @@ const EnumData<Inkscape::Filters::FilterBlendMode> BlendModeData[Inkscape::Filte
{Inkscape::Filters::BLEND_SATURATION, _("Saturation"), "saturation"},
{Inkscape::Filters::BLEND_COLOR, _("Color"), "color"},
{Inkscape::Filters::BLEND_LUMINOSITY, _("Luminosity"), "luminosity"}
-#endif
};
+#ifdef WITH_CSSBLEND
const EnumDataConverter<Inkscape::Filters::FilterBlendMode> BlendModeConverter(BlendModeData, Inkscape::Filters::BLEND_ENDMODE);
-
+#else
+// Disable new blend modes in GUI until widely implemented.
+const EnumDataConverter<Inkscape::Filters::FilterBlendMode> BlendModeConverter(BlendModeData, Inkscape::Filters::BLEND_OVERLAY);
+#endif
const EnumData<Inkscape::Filters::FilterColorMatrixType> ColorMatrixTypeData[Inkscape::Filters::COLORMATRIX_ENDTYPE] = {
{Inkscape::Filters::COLORMATRIX_MATRIX, _("Matrix"), "matrix"},
diff --git a/src/filters/blend.cpp b/src/filters/blend.cpp
index 5c78f4f9f..fd5a9871e 100644
--- a/src/filters/blend.cpp
+++ b/src/filters/blend.cpp
@@ -96,23 +96,18 @@ static Inkscape::Filters::FilterBlendMode sp_feBlend_readmode(gchar const *value
case 's':
if (strncmp(value, "screen", 6) == 0)
return Inkscape::Filters::BLEND_SCREEN;
-#ifdef WITH_CSSBLEND
if (strncmp(value, "saturation", 6) == 0)
return Inkscape::Filters::BLEND_SATURATION;
-#endif
break;
case 'd':
if (strncmp(value, "darken", 6) == 0)
return Inkscape::Filters::BLEND_DARKEN;
-#ifdef WITH_CSSBLEND
if (strncmp(value, "difference", 10) == 0)
return Inkscape::Filters::BLEND_DIFFERENCE;
-#endif
break;
case 'l':
if (strncmp(value, "lighten", 7) == 0)
return Inkscape::Filters::BLEND_LIGHTEN;
-#ifdef WITH_CSSBLEND
if (strncmp(value, "luminosity", 10) == 0)
return Inkscape::Filters::BLEND_LUMINOSITY;
break;
@@ -137,7 +132,6 @@ static Inkscape::Filters::FilterBlendMode sp_feBlend_readmode(gchar const *value
case 'e':
if (strncmp(value, "exclusion", 10) == 0)
return Inkscape::Filters::BLEND_EXCLUSION;
-#endif
default:
std::cout << "Inkscape::Filters::FilterBlendMode: Unimplemented mode: " << value << std::endl;
// do nothing by default
@@ -244,7 +238,6 @@ Inkscape::XML::Node* SPFeBlend::write(Inkscape::XML::Document *doc, Inkscape::XM
mode = "darken"; break;
case Inkscape::Filters::BLEND_LIGHTEN:
mode = "lighten"; break;
-#ifdef WITH_CSSBLEND
// New
case Inkscape::Filters::BLEND_OVERLAY:
mode = "overlay"; break;
@@ -268,7 +261,6 @@ Inkscape::XML::Node* SPFeBlend::write(Inkscape::XML::Document *doc, Inkscape::XM
mode = "color"; break;
case Inkscape::Filters::BLEND_LUMINOSITY:
mode = "luminosity"; break;
-#endif
default:
mode = 0;
}
diff --git a/src/inkscape.rc b/src/inkscape.rc
index efa360c8d..395ef39e1 100644
--- a/src/inkscape.rc
+++ b/src/inkscape.rc
@@ -15,7 +15,7 @@ BEGIN
VALUE "FileDescription", "Inkscape"
VALUE "FileVersion", "0.48+devel"
VALUE "InternalName", "Inkscape"
- VALUE "LegalCopyright", "© 2012 Inkscape"
+ VALUE "LegalCopyright", "© 2014 Inkscape"
VALUE "ProductName", "Inkscape"
VALUE "ProductVersion", "0.48+devel"
END
diff --git a/src/inkview.rc b/src/inkview.rc
index f1fa92247..fd7eb50a1 100644
--- a/src/inkview.rc
+++ b/src/inkview.rc
@@ -15,7 +15,7 @@ BEGIN
VALUE "FileDescription", "Inkview"
VALUE "FileVersion", "0.48+devel"
VALUE "InternalName", "Inkview"
- VALUE "LegalCopyright", "© 2012 Inkscape"
+ VALUE "LegalCopyright", "© 2014 Inkscape"
VALUE "ProductName", "Inkview"
VALUE "ProductVersion", "0.48+devel"
END
diff --git a/src/knot-holder-entity.cpp b/src/knot-holder-entity.cpp
index 6471124ec..6af5c6a56 100644
--- a/src/knot-holder-entity.cpp
+++ b/src/knot-holder-entity.cpp
@@ -80,13 +80,17 @@ KnotHolderEntity::~KnotHolderEntity()
void
KnotHolderEntity::update_knot()
{
- Geom::Affine const i2dt(item->i2dt_affine());
+ Geom::Point knot_pos(knot_get());
+ if (knot_pos.isFinite()) {
+ Geom::Point dp(knot_pos * item->i2dt_affine());
- Geom::Point dp(knot_get() * i2dt);
-
- _moved_connection.block();
- knot->setPosition(dp, SP_KNOT_STATE_NORMAL);
- _moved_connection.unblock();
+ _moved_connection.block();
+ knot->setPosition(dp, SP_KNOT_STATE_NORMAL);
+ _moved_connection.unblock();
+ } else {
+ // knot coords are non-finite, hide knot
+ knot->hide();
+ }
}
Geom::Point
diff --git a/src/libavoid/connector.cpp b/src/libavoid/connector.cpp
index 8dcb66f2d..b8c99a48c 100644
--- a/src/libavoid/connector.cpp
+++ b/src/libavoid/connector.cpp
@@ -442,11 +442,11 @@ void ConnRef::makeActive(void)
void ConnRef::makeInactive(void)
{
- COLA_ASSERT(_active);
-
- // Remove from connRefs list.
- _router->connRefs.erase(_pos);
- _active = false;
+ if (_active) {
+ // Remove from connRefs list.
+ _router->connRefs.erase(_pos);
+ _active = false;
+ }
}
@@ -553,8 +553,12 @@ void ConnRef::unInitialise(void)
void ConnRef::removeFromGraph(void)
{
- _srcVert->removeFromGraph();
- _dstVert->removeFromGraph();
+ if (_srcVert) {
+ _srcVert->removeFromGraph();
+ }
+ if (_dstVert) {
+ _dstVert->removeFromGraph();
+ }
}
diff --git a/src/libcroco/cr-rgb.c b/src/libcroco/cr-rgb.c
index 06e61ba41..537343579 100644
--- a/src/libcroco/cr-rgb.c
+++ b/src/libcroco/cr-rgb.c
@@ -150,6 +150,7 @@ static const CRRgb gv_standard_colors[] = {
{(const guchar*)"plum", 221, 160, 221, FALSE, FALSE, FALSE, {0,0,0}},
{(const guchar*)"powderblue", 176, 224, 230, FALSE, FALSE, FALSE, {0,0,0}},
{(const guchar*)"purple", 128, 0, 128, FALSE, FALSE, FALSE, {0,0,0}},
+ {(const guchar*)"rebeccapurple", 102, 51, 153, FALSE, FALSE, FALSE, {0,0,0}},
{(const guchar*)"red", 255, 0, 0, FALSE, FALSE, FALSE, {0,0,0}},
{(const guchar*)"rosybrown", 188, 143, 143, FALSE, FALSE, FALSE, {0,0,0}},
{(const guchar*)"royalblue", 65, 105, 225, FALSE, FALSE, FALSE, {0,0,0}},
diff --git a/src/live_effects/lpe-knot.cpp b/src/live_effects/lpe-knot.cpp
index 581c632f5..cac3a9347 100644
--- a/src/live_effects/lpe-knot.cpp
+++ b/src/live_effects/lpe-knot.cpp
@@ -353,7 +353,11 @@ LPEKnot::LPEKnot(LivePathEffectObject *lpeobject) :
add_other_stroke_width(_("_Crossing path stroke width"), _("Add crossed stroke width to the interruption size"), "add_other_stroke_width", &wr, this, true),
switcher_size(_("S_witcher size:"), _("Orientation indicator/switcher size"), "switcher_size", &wr, this, 15),
crossing_points_vector(_("Crossing Signs"), _("Crossings signs"), "crossing_points_vector", &wr, this),
- gpaths(),gstroke_widths()
+ crossing_points(),
+ gpaths(),
+ gstroke_widths(),
+ selectedCrossing(0),
+ switcher(0.,0.)
{
// register all your parameters here, so Inkscape knows which parameters this effect has:
registerParameter( dynamic_cast<Parameter *>(&interruption_width) );
@@ -363,10 +367,6 @@ LPEKnot::LPEKnot(LivePathEffectObject *lpeobject) :
registerParameter( dynamic_cast<Parameter *>(&switcher_size) );
registerParameter( dynamic_cast<Parameter *>(&crossing_points_vector) );
- crossing_points = LPEKnotNS::CrossingPoints();
- selectedCrossing = 0;
- switcher = Geom::Point(0,0);
-
_provides_knotholder_entities = true;
}
@@ -386,9 +386,7 @@ LPEKnot::updateSwitcher(){
//std::cout<<"placing switcher at "<<switcher<<" \n";
}else{
//std::cout<<"hiding switcher!\n";
- //TODO: is there a way to properly hide the helper.
- //switcher = Geom::Point(Geom::infinity(),Geom::infinity());
- switcher = Geom::Point(1e10,1e10);
+ switcher = Geom::Point(Geom::infinity(),Geom::infinity());
}
}
@@ -539,8 +537,9 @@ LPEKnot::doBeforeEffect (SPLPEItem const* lpeitem)
using namespace Geom;
original_bbox(lpeitem);
- gpaths = std::vector<Geom::Path>();
- gstroke_widths = std::vector<double>();
+ gpaths.clear();
+ gstroke_widths.clear();
+
collectPathsAndWidths(lpeitem, gpaths, gstroke_widths);
// std::cout<<"\nPaths on input:\n";
@@ -586,7 +585,10 @@ LPEKnot::doBeforeEffect (SPLPEItem const* lpeitem)
// std::cout<<crossing_points[toto].sign<<"),";
// }
crossing_points.inherit_signs(old_crdata);
- crossing_points_vector.param_set_and_write_new_value(crossing_points.to_vector());
+
+ // Don't write to XML here, only store it in the param itself. Will be written to SVG later
+ crossing_points_vector.param_setValue(crossing_points.to_vector());
+
updateSwitcher();
}
diff --git a/src/live_effects/lpe-knot.h b/src/live_effects/lpe-knot.h
index b937f9021..f926bf085 100644
--- a/src/live_effects/lpe-knot.h
+++ b/src/live_effects/lpe-knot.h
@@ -74,7 +74,6 @@ private:
BoolParam add_stroke_width;
BoolParam add_other_stroke_width;
ScalarParam switcher_size;
- double stroke_width;
ArrayParam<double> crossing_points_vector;//svg storage of crossing_points
LPEKnotNS::CrossingPoints crossing_points;//topology representation of the knot.
diff --git a/src/live_effects/parameter/powerstrokepointarray.cpp b/src/live_effects/parameter/powerstrokepointarray.cpp
index fecdfeda8..647986da6 100644
--- a/src/live_effects/parameter/powerstrokepointarray.cpp
+++ b/src/live_effects/parameter/powerstrokepointarray.cpp
@@ -176,7 +176,10 @@ PowerStrokePointArrayParamKnotHolderEntity::knot_get() const
Piecewise<D2<SBasis> > const & n = _pparam->get_pwd2_normal();
Point offset_point = _pparam->_vector.at(_index);
-
+ if (offset_point[X] > pwd2.size() || offset_point[X] < 0) {
+ g_warning("Broken powerstroke point at %f, I won't try to add that", offset_point[X]);
+ return Geom::Point(infinity(), infinity());
+ }
Point canvas_point = pwd2.valueAt(offset_point[X]) + offset_point[Y] * n.valueAt(offset_point[X]);
return canvas_point;
}
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index a350dd7a7..f058189d3 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -1621,10 +1621,13 @@ void sp_selection_apply_affine(Inkscape::Selection *selection, Geom::Affine cons
item->doWriteTransform(item->getRepr(), item->transform, NULL, compensate);
}
- // if we're moving the actual object, not just updating the repr, we can transform the
+ // if we're transforming the actual object, not just updating the repr, we can transform the
// center by the same matrix (only necessary for non-translations)
if (set_i2d && item->isCenterSet() && !(affine.isTranslation() || affine.isIdentity())) {
- item->setCenter(old_center * affine);
+ // If there's a viewbox, we might have an affine with a translation component;
+ // we will only apply the scaling/skewing components, not the translations
+ // because otherwise the center will move relative to the item
+ item->setCenter(old_center * affine.withoutTranslation());
item->updateRepr();
}
}
@@ -3950,10 +3953,6 @@ void sp_selection_unset_mask(SPDesktop *desktop, bool apply_clip_path) {
for ( SPObject *child = obj->firstChild() ; child; child = child->getNext() ) {
// Collect all clipped paths and masks within a single group
Inkscape::XML::Node *copy = SP_OBJECT(child)->getRepr()->duplicate(xml_doc);
- if(copy->attribute("inkscape:original-d"))
- {
- copy->setAttribute("d", copy->attribute("inkscape:original-d"));
- }
items_to_move = g_slist_prepend(items_to_move, copy);
}
diff --git a/src/seltrans.cpp b/src/seltrans.cpp
index d6f31f073..4b1a3a5fa 100644
--- a/src/seltrans.cpp
+++ b/src/seltrans.cpp
@@ -377,12 +377,6 @@ void Inkscape::SelTrans::transform(Geom::Affine const &rel_affine, Geom::Point c
g_return_if_fail(_grabbed);
g_return_if_fail(!_empty);
- // E.g. scaling a perfectly vertical line in horizontal direction will not work, and will produce an identity affine
-
- if (rel_affine.isIdentity()) {
- return;
- }
-
Geom::Affine const affine( Geom::Translate(-norm) * rel_affine * Geom::Translate(norm) );
if (_show == SHOW_CONTENT) {
diff --git a/src/sp-ellipse.cpp b/src/sp-ellipse.cpp
index 428e0e3dd..cda59e057 100644
--- a/src/sp-ellipse.cpp
+++ b/src/sp-ellipse.cpp
@@ -467,8 +467,6 @@ void SPGenericEllipse::set_shape()
bool success = this->performPathEffect(c_lpe);
if (success) {
- sp_lpe_item_apply_to_mask(this);
- sp_lpe_item_apply_to_clippath(this);
this->setCurveInsync(c_lpe, TRUE);
}
diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp
index b3db0c1d7..7af4e3320 100644
--- a/src/sp-item-group.cpp
+++ b/src/sp-item-group.cpp
@@ -664,7 +664,8 @@ void SPGroup::scaleChildItemsRec(Geom::Scale const &sc, Geom::Point const &p)
Geom::Point old_center(0,0);
if (item->isCenterSet()) {
- old_center = item->getCenter();
+ item->scaleCenter(sc.inverse()); // Convert the old relative center position to the new coordinates already now
+ old_center = item->getCenter(); // because getCenter() will use the bbox midpoint, which is also already in the new coordinates
}
gchar const *conn_type = NULL;
@@ -778,31 +779,17 @@ void SPGroup::update_patheffect(bool write) {
}
}
-
-void
-sp_gslist_update_by_clip_or_mask(GSList *item_list,SPItem * item)
-{
- if(item->mask_ref->getObject()) {
- SPObject * clipormask = item->mask_ref->getObject()->firstChild();
- item_list = g_slist_append(item_list,clipormask);
- }
- if(item->clip_ref->getObject()) {
- SPObject * clipormask = item->clip_ref->getObject()->firstChild();
- item_list = g_slist_append(item_list,clipormask);
- }
-}
-
static void
sp_group_perform_patheffect(SPGroup *group, SPGroup *topgroup, bool write)
{
- GSList *item_list = sp_item_group_item_list(group);
- sp_gslist_update_by_clip_or_mask(item_list,group);
- for ( GSList *iter = item_list; iter; iter = iter->next ) {
+ GSList const *item_list = sp_item_group_item_list(SP_GROUP(group));
+
+ for ( GSList const *iter = item_list; iter; iter = iter->next ) {
SPObject *subitem = static_cast<SPObject *>(iter->data);
+
if (SP_IS_GROUP(subitem)) {
sp_group_perform_patheffect(SP_GROUP(subitem), topgroup, write);
} else if (SP_IS_SHAPE(subitem)) {
- sp_gslist_update_by_clip_or_mask(item_list,SP_ITEM(subitem));
SPCurve * c = NULL;
if (SP_IS_PATH(subitem)) {
@@ -813,17 +800,9 @@ sp_group_perform_patheffect(SPGroup *group, SPGroup *topgroup, bool write)
// only run LPEs when the shape has a curve defined
if (c) {
- if(SP_IS_MASK(subitem->parent) || SP_IS_CLIPPATH(subitem->parent)) {
- c->transform(i2anc_affine(group, topgroup));
- } else {
- c->transform(i2anc_affine(subitem, topgroup));
- }
+ c->transform(i2anc_affine(subitem, topgroup));
SP_LPE_ITEM(topgroup)->performPathEffect(c);
- if(SP_IS_MASK(subitem->parent) || SP_IS_CLIPPATH(subitem->parent)) {
- c->transform(i2anc_affine(group, topgroup).inverse());
- } else {
- c->transform(i2anc_affine(subitem, topgroup).inverse());
- }
+ c->transform(i2anc_affine(subitem, topgroup).inverse());
SP_SHAPE(subitem)->setCurve(c, TRUE);
if (write) {
@@ -831,7 +810,7 @@ sp_group_perform_patheffect(SPGroup *group, SPGroup *topgroup, bool write)
gchar *str = sp_svg_write_path(c->get_pathvector());
repr->setAttribute("d", str);
#ifdef GROUP_VERBOSE
- g_message("sp_group_perform_patheffect writes 'd' attribute");
+g_message("sp_group_perform_patheffect writes 'd' attribute");
#endif
g_free(str);
}
diff --git a/src/sp-item-group.h b/src/sp-item-group.h
index adec35571..2004a72b8 100644
--- a/src/sp-item-group.h
+++ b/src/sp-item-group.h
@@ -88,7 +88,7 @@ public:
void sp_item_group_ungroup (SPGroup *group, GSList **children, bool do_done = true);
-void sp_gslist_update_by_clip_or_mask(GSList *item_list, SPItem * item);
+
GSList *sp_item_group_item_list (SPGroup *group);
SPObject *sp_item_group_get_child_by_name (SPGroup *group, SPObject *ref, const gchar *name);
diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index b10aae1c6..0cdff6546 100644
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
@@ -271,6 +271,11 @@ Geom::Point SPItem::getCenter() const {
}
}
+void
+SPItem::scaleCenter(Geom::Scale const &sc) {
+ transform_center_x *= sc[Geom::X];
+ transform_center_y *= sc[Geom::Y];
+}
namespace {
diff --git a/src/sp-item.h b/src/sp-item.h
index d605c99b9..ce93b1d40 100644
--- a/src/sp-item.h
+++ b/src/sp-item.h
@@ -159,6 +159,7 @@ public:
void unsetCenter();
bool isCenterSet() const;
Geom::Point getCenter() const;
+ void scaleCenter(Geom::Scale const &sc);
bool isVisibleAndUnlocked() const;
diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp
index bfecdcf98..321d2fc42 100644
--- a/src/sp-lpe-item.cpp
+++ b/src/sp-lpe-item.cpp
@@ -339,16 +339,8 @@ lpeobject_ref_modified(SPObject */*href*/, guint /*flags*/, SPLPEItem *lpeitem)
static void
sp_lpe_item_create_original_path_recursive(SPLPEItem *lpeitem)
{
- SPMask * mask = lpeitem->mask_ref->getObject();
- if(mask)
- {
- sp_lpe_item_create_original_path_recursive(SP_LPE_ITEM(mask->firstChild()));
- }
- SPClipPath * clipPath = lpeitem->clip_ref->getObject();
- if(clipPath)
- {
- sp_lpe_item_create_original_path_recursive(SP_LPE_ITEM(clipPath->firstChild()));
- }
+ g_return_if_fail(lpeitem != NULL);
+
if (SP_IS_GROUP(lpeitem)) {
GSList const *item_list = sp_item_group_item_list(SP_GROUP(lpeitem));
for ( GSList const *iter = item_list; iter; iter = iter->next ) {
@@ -369,16 +361,7 @@ sp_lpe_item_create_original_path_recursive(SPLPEItem *lpeitem)
static void
sp_lpe_item_cleanup_original_path_recursive(SPLPEItem *lpeitem)
{
- SPMask * mask = lpeitem->mask_ref->getObject();
- if(mask)
- {
- sp_lpe_item_cleanup_original_path_recursive(SP_LPE_ITEM(mask->firstChild()));
- }
- SPClipPath * clipPath = lpeitem->clip_ref->getObject();
- if(clipPath)
- {
- sp_lpe_item_cleanup_original_path_recursive(SP_LPE_ITEM(clipPath->firstChild()));
- }
+ g_return_if_fail(lpeitem != NULL);
if (SP_IS_GROUP(lpeitem)) {
GSList const *item_list = sp_item_group_item_list(SP_GROUP(lpeitem));
@@ -625,6 +608,9 @@ bool SPLPEItem::hasPathEffectRecursive() const
}
}
+//The next 3 functions are because the revert of the bug 1241902
+//for the moment not used
+
void
sp_lpe_item_apply_to_clippath(SPItem * item)
{
diff --git a/src/sp-path.cpp b/src/sp-path.cpp
index 4a68b82c7..cbb61b0f6 100644
--- a/src/sp-path.cpp
+++ b/src/sp-path.cpp
@@ -310,8 +310,6 @@ g_message("sp_path_update_patheffect");
bool success = this->performPathEffect(curve);
if (success && write) {
- sp_lpe_item_apply_to_mask(this);
- sp_lpe_item_apply_to_clippath(this);
// could also do this->getRepr()->updateRepr(); but only the d attribute needs updating.
#ifdef PATH_VERBOSE
g_message("sp_path_update_patheffect writes 'd' attribute");
diff --git a/src/sp-spiral.cpp b/src/sp-spiral.cpp
index 8d4a37bf0..9ef73d56d 100644
--- a/src/sp-spiral.cpp
+++ b/src/sp-spiral.cpp
@@ -385,8 +385,6 @@ void SPSpiral::set_shape() {
bool success = this->performPathEffect(c_lpe);
if (success) {
- sp_lpe_item_apply_to_mask(this);
- sp_lpe_item_apply_to_clippath(this);
this->setCurveInsync( c_lpe, TRUE);
}
diff --git a/src/sp-star.cpp b/src/sp-star.cpp
index 170a863b5..eac33ed7b 100644
--- a/src/sp-star.cpp
+++ b/src/sp-star.cpp
@@ -465,8 +465,6 @@ void SPStar::set_shape() {
bool success = this->performPathEffect(c_lpe);
if (success) {
- sp_lpe_item_apply_to_mask(this);
- sp_lpe_item_apply_to_clippath(this);
this->setCurveInsync( c_lpe, TRUE);
}
diff --git a/src/sp-use.cpp b/src/sp-use.cpp
index e8fe3687f..7d908a66a 100644
--- a/src/sp-use.cpp
+++ b/src/sp-use.cpp
@@ -37,6 +37,7 @@
#include "sp-symbol.h"
#include "sp-use.h"
#include "sp-use-reference.h"
+#include "sp-shape.h"
namespace {
SPObject* createUse() {
@@ -176,6 +177,8 @@ Inkscape::XML::Node* SPUse::write(Inkscape::XML::Document *xml_doc, Inkscape::XM
g_free(uri_string);
}
+ if (SP_IS_SHAPE(this->child))
+ SP_SHAPE(this->child)->set_shape(); // evaluate SPCurve of child
return repr;
}
diff --git a/src/style-internal.cpp b/src/style-internal.cpp
index c686a1807..6a56d75c0 100644
--- a/src/style-internal.cpp
+++ b/src/style-internal.cpp
@@ -1390,9 +1390,8 @@ SPIFilter::read( gchar const *str ) {
}
}
-const Glib::ustring
-SPIFilter::write( guint const flags, SPIBase const *const base) const {
-
+const Glib::ustring SPIFilter::write( guint const flags, SPIBase const *const /*base*/) const
+{
// TODO: fix base
//SPILength const *const my_base = dynamic_cast<const SPILength*>(base);
if ( (flags & SP_STYLE_FLAG_ALWAYS) ||
@@ -1440,7 +1439,7 @@ SPIFilter::cascade( const SPIBase* const parent ) {
void
SPIFilter::merge( const SPIBase* const parent ) {
if( const SPIFilter* p = dynamic_cast<const SPIFilter*>(parent) ) {
- // The "correct" thing to due is to combine the filter primitives.
+ // The "correct" thing to do is to combine the filter primitives.
// The next best thing is to keep any filter on this object. If there
// is no filter on this object, then use any filter on the parent.
if( (!set || inherit) && p->href && p->href->getObject() ) { // is the getObject() needed?
@@ -1453,9 +1452,11 @@ SPIFilter::merge( const SPIBase* const parent ) {
}
} else {
// If we don't have an href, create it
- if( &style->document ) { // FIXME
+ if( style->document ) { // FIXME
href = new SPFilterReference(style->document);
//href->changedSignal().connect(sigc::bind(sigc::ptr_fun(sp_style_filter_ref_changed), style));
+ } else if (style->object) {
+ href = new SPFilterReference(style->object);
}
}
if( href ) {
@@ -1921,9 +1922,8 @@ SPIFont::read( gchar const *str ) {
}
}
-const Glib::ustring
-SPIFont::write( guint const flags, SPIBase const *const base) const {
-
+const Glib::ustring SPIFont::write( guint const /*flags*/, SPIBase const *const /*base*/) const
+{
// At the moment, do nothing. We could add a preference to write out
// 'font' shorthand rather than longhand properties.
diff --git a/src/svg/svg-color.cpp b/src/svg/svg-color.cpp
index 57f542373..ca94c241f 100644
--- a/src/svg/svg-color.cpp
+++ b/src/svg/svg-color.cpp
@@ -173,6 +173,7 @@ static SPSVGColor const sp_svg_color_named[] = {
{ 0xDDA0DD, "plum" },
{ 0xB0E0E6, "powderblue" },
{ 0x800080, "purple" },
+ { 0x663399, "rebeccapurple" },
{ 0xFF0000, "red" },
{ 0xBC8F8F, "rosybrown" },
{ 0x4169E1, "royalblue" },
diff --git a/src/ui/dialog/clonetiler.cpp b/src/ui/dialog/clonetiler.cpp
index fb131d8da..e5f18216c 100644
--- a/src/ui/dialog/clonetiler.cpp
+++ b/src/ui/dialog/clonetiler.cpp
@@ -2242,6 +2242,8 @@ void CloneTiler::clonetiler_apply(GtkWidget */*widget*/, GtkWidget *dlg)
clonetiler_remove (NULL, dlg, false);
+ double scale_units = Inkscape::Util::Quantity::convert(1, "px", sp_desktop_document(desktop)->getDefaultUnit());
+
double shiftx_per_i = 0.01 * prefs->getDoubleLimited(prefs_path + "shiftx_per_i", 0, -10000, 10000);
double shifty_per_i = 0.01 * prefs->getDoubleLimited(prefs_path + "shifty_per_i", 0, -10000, 10000);
double shiftx_per_j = 0.01 * prefs->getDoubleLimited(prefs_path + "shiftx_per_j", 0, -10000, 10000);
@@ -2311,8 +2313,8 @@ void CloneTiler::clonetiler_apply(GtkWidget */*widget*/, GtkWidget *dlg)
int jmax = prefs->getInt(prefs_path + "jmax", 2);
bool fillrect = prefs->getBool(prefs_path + "fillrect");
- double fillwidth = prefs->getDoubleLimited(prefs_path + "fillwidth", 50, 0, 1e6);
- double fillheight = prefs->getDoubleLimited(prefs_path + "fillheight", 50, 0, 1e6);
+ double fillwidth = scale_units*prefs->getDoubleLimited(prefs_path + "fillwidth", 50, 0, 1e6);
+ double fillheight = scale_units*prefs->getDoubleLimited(prefs_path + "fillheight", 50, 0, 1e6);
bool dotrace = prefs->getBool(prefs_path + "dotrace");
int pick = prefs->getInt(prefs_path + "pick");
@@ -2358,11 +2360,11 @@ void CloneTiler::clonetiler_apply(GtkWidget */*widget*/, GtkWidget *dlg)
SPItem::VISUAL_BBOX : SPItem::GEOMETRIC_BBOX );
Geom::OptRect r = item->documentBounds(bbox_type);
if (r) {
- w = r->dimensions()[Geom::X];
- h = r->dimensions()[Geom::Y];
- x0 = r->min()[Geom::X];
- y0 = r->min()[Geom::Y];
- center = desktop->dt2doc(item->getCenter());
+ w = scale_units*r->dimensions()[Geom::X];
+ h = scale_units*r->dimensions()[Geom::Y];
+ x0 = scale_units*r->min()[Geom::X];
+ y0 = scale_units*r->min()[Geom::Y];
+ center = scale_units*desktop->dt2doc(item->getCenter());
sp_repr_set_svg_double(obj_repr, "inkscape:tile-cx", center[Geom::X]);
sp_repr_set_svg_double(obj_repr, "inkscape:tile-cy", center[Geom::Y]);
@@ -2578,7 +2580,7 @@ void CloneTiler::clonetiler_apply(GtkWidget */*widget*/, GtkWidget *dlg)
Geom::Point new_center;
bool center_set = false;
if (obj_repr->attribute("inkscape:transform-center-x") || obj_repr->attribute("inkscape:transform-center-y")) {
- new_center = desktop->dt2doc(item->getCenter()) * t;
+ new_center = scale_units*desktop->dt2doc(item->getCenter()) * t;
center_set = true;
}
diff --git a/src/ui/dialog/layers.cpp b/src/ui/dialog/layers.cpp
index b5dac0595..65351cb68 100644
--- a/src/ui/dialog/layers.cpp
+++ b/src/ui/dialog/layers.cpp
@@ -926,9 +926,8 @@ LayersPanel::LayersPanel() :
// -------------------------------------------------------
{
- _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_RENAME, 0, "Rename", (int)BUTTON_RENAME ) );
- _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_DUPLICATE, 0, "Duplicate", (int)BUTTON_DUPLICATE ) );
_watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_NEW, 0, "New", (int)BUTTON_NEW ) );
+ _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_RENAME, 0, "Rename", (int)BUTTON_RENAME ) );
_popupMenu.append(*Gtk::manage(new Gtk::SeparatorMenuItem()));
@@ -944,9 +943,14 @@ LayersPanel::LayersPanel() :
_popupMenu.append(*Gtk::manage(new Gtk::SeparatorMenuItem()));
- _watchingNonTop.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_RAISE, INKSCAPE_ICON("go-up"), "Up", (int)BUTTON_UP ) );
- _watchingNonBottom.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_LOWER, INKSCAPE_ICON("go-down"), "Down", (int)BUTTON_DOWN ) );
+ _watchingNonTop.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_RAISE, INKSCAPE_ICON("layer-raise"), "Up", (int)BUTTON_UP ) );
+ _watchingNonBottom.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_LOWER, INKSCAPE_ICON("layer-lower"), "Down", (int)BUTTON_DOWN ) );
+ _popupMenu.append(*Gtk::manage(new Gtk::SeparatorMenuItem()));
+
+ _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_DUPLICATE, 0, "Duplicate", (int)BUTTON_DUPLICATE ) );
+ _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_DELETE, 0, "Delete", (int)BUTTON_DELETE ) );
+
_popupMenu.show_all_children();
}
// -------------------------------------------------------
diff --git a/src/ui/tools/pen-tool.cpp b/src/ui/tools/pen-tool.cpp
index b089065e8..70cbcaf0d 100644
--- a/src/ui/tools/pen-tool.cpp
+++ b/src/ui/tools/pen-tool.cpp
@@ -55,15 +55,15 @@ static bool pen_within_tolerance = false;
static int pen_last_paraxial_dir = 0; // last used direction in horizontal/vertical mode; 0 = horizontal, 1 = vertical
namespace {
- ToolBase* createPenContext() {
- return new PenTool();
- }
+ ToolBase* createPenContext() {
+ return new PenTool();
+ }
- bool penContextRegistered = ToolFactory::instance().registerObject("/tools/freehand/pen", createPenContext);
+ bool penContextRegistered = ToolFactory::instance().registerObject("/tools/freehand/pen", createPenContext);
}
const std::string& PenTool::getPrefsPath() {
- return PenTool::prefsPath;
+ return PenTool::prefsPath;
}
const std::string PenTool::prefsPath = "/tools/freehand/pen";
@@ -277,7 +277,7 @@ bool PenTool::item_handler(SPItem* item, GdkEvent* event) {
}
if (!ret) {
- ret = FreehandBase::item_handler(item, event);
+ ret = FreehandBase::item_handler(item, event);
}
return ret;
@@ -315,7 +315,7 @@ bool PenTool::root_handler(GdkEvent* event) {
}
if (!ret) {
- ret = FreehandBase::root_handler(event);
+ ret = FreehandBase::root_handler(event);
}
return ret;
@@ -1061,8 +1061,9 @@ bool PenTool::_handleKeyPress(GdkEvent *event) {
this->red_curve->reset();
// Destroy topmost green bpath
if (this->green_bpaths) {
- if (this->green_bpaths->data)
+ if (this->green_bpaths->data) {
sp_canvas_item_destroy(SP_CANVAS_ITEM(this->green_bpaths->data));
+ }
this->green_bpaths = g_slist_remove(this->green_bpaths, this->green_bpaths->data);
}
// Get last segment
@@ -1078,11 +1079,21 @@ bool PenTool::_handleKeyPress(GdkEvent *event) {
} else {
this->p[1] = this->p[0];
}
- Geom::Point const pt(( this->npoints < 4
- ? (Geom::Point)(crv->finalPoint())
- : this->p[3] ));
+ Geom::Point const pt( (this->npoints < 4) ? crv->finalPoint() : this->p[3] );
this->npoints = 2;
- this->green_curve->backspace();
+ // delete the last segment of the green curve
+ if (this->green_curve->get_segment_count() == 1) {
+ this->npoints = 5;
+ if (this->green_bpaths) {
+ if (this->green_bpaths->data) {
+ sp_canvas_item_destroy(SP_CANVAS_ITEM(this->green_bpaths->data));
+ }
+ this->green_bpaths = g_slist_remove(this->green_bpaths, this->green_bpaths->data);
+ }
+ this->green_curve->reset();
+ } else {
+ this->green_curve->backspace();
+ }
sp_canvas_item_hide(this->c0);
sp_canvas_item_hide(this->c1);
sp_canvas_item_hide(this->cl0);
diff --git a/src/ui/widget/filter-effect-chooser.cpp b/src/ui/widget/filter-effect-chooser.cpp
index 65706a9dc..78988a041 100644
--- a/src/ui/widget/filter-effect-chooser.cpp
+++ b/src/ui/widget/filter-effect-chooser.cpp
@@ -56,15 +56,12 @@ const Glib::ustring SimpleFilterModifier::get_blend_mode()
if (!(_flags & BLEND)) {
return "normal";
}
- if (_blend.get_active_row_number() == 5) {
+
+ const Util::EnumData<Inkscape::Filters::FilterBlendMode> *d = _blend.get_active_data();
+ if (d) {
+ return _blend.get_active_data()->key;
+ } else
return "normal";
- } else {
- const Util::EnumData<Inkscape::Filters::FilterBlendMode> *d = _blend.get_active_data();
- if (d) {
- return _blend.get_active_data()->key;
- } else
- return "normal";
- }
}
void SimpleFilterModifier::set_blend_mode(const int val)
diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp
index 583dbec85..1b4648286 100644
--- a/src/widgets/desktop-widget.cpp
+++ b/src/widgets/desktop-widget.cpp
@@ -1246,6 +1246,9 @@ SPDesktopWidget::shutdown()
*/
void
SPDesktopWidget::requestCanvasUpdate() {
+ // ^^ also this->desktop != 0
+ g_return_if_fail(this->desktop != NULL);
+ g_return_if_fail(this->desktop->main != NULL);
gtk_widget_queue_draw (GTK_WIDGET (SP_CANVAS_ITEM (this->desktop->main)->canvas));
}
diff --git a/src/xml/helper-observer.cpp b/src/xml/helper-observer.cpp
index c54dd8e74..957f3df0a 100644
--- a/src/xml/helper-observer.cpp
+++ b/src/xml/helper-observer.cpp
@@ -5,25 +5,34 @@ namespace XML {
// Very simple observer that just emits a signal if anything happens to a node
SignalObserver::SignalObserver()
- : _oldsel(0)
+ : _oldsel(NULL)
{}
+SignalObserver::~SignalObserver()
+{
+ set(NULL); // if _oldsel!=nullptr, remove observer and decrease refcount
+}
+
// Add this observer to the SPObject and remove it from any previous object
void SignalObserver::set(SPObject* o)
{
// XML Tree being used direcly in this function in the following code
// while it shouldn't be
+ // Pointer to object is stored, so refcounting should be increased/decreased
if(_oldsel) {
if (_oldsel->getRepr()) {
_oldsel->getRepr()->removeObserver(*this);
}
+ sp_object_unref(_oldsel);
+ _oldsel = NULL;
}
if(o) {
if (o->getRepr()) {
o->getRepr()->addObserver(*this);
+ sp_object_ref(o);
+ _oldsel = o;
}
}
- _oldsel = o;
}
void SignalObserver::notifyChildAdded(XML::Node&, XML::Node&, XML::Node*)
diff --git a/src/xml/helper-observer.h b/src/xml/helper-observer.h
index e7881cd4d..2f70ba792 100644
--- a/src/xml/helper-observer.h
+++ b/src/xml/helper-observer.h
@@ -17,6 +17,7 @@ namespace Inkscape {
{
public:
SignalObserver();
+ ~SignalObserver();
// Add this observer to the SPObject and remove it from any previous object
void set(SPObject* o);