r16895 by jghali - merge trunk revisions up to r16872

scribus-commit scribus-commit at lists.scribus.net
Sat Oct 8 20:25:30 UTC 2011


Author: jghali
Date: Sat Oct  8 20:25:29 2011
New Revision: 16895

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16895
Log:
merge trunk revisions up to r16872

Added:
    branches/ScribusOIF/doc/en/color5.html
      - copied unchanged from r16872, trunk/Scribus/doc/en/color5.html
    branches/ScribusOIF/doc/en/images/resene-pal.png
      - copied unchanged from r16872, trunk/Scribus/doc/en/images/resene-pal.png
    branches/ScribusOIF/doc/en/images/tb-libreoffice.png
      - copied unchanged from r16872, trunk/Scribus/doc/en/images/tb-libreoffice.png
    branches/ScribusOIF/doc/en/images/tb-pdf-imp.png
      - copied unchanged from r16872, trunk/Scribus/doc/en/images/tb-pdf-imp.png
    branches/ScribusOIF/doc/en/toolbox18.html
      - copied unchanged from r16872, trunk/Scribus/doc/en/toolbox18.html
    branches/ScribusOIF/scribus/canvasmode_editmeshpatch.cpp
      - copied unchanged from r16872, trunk/Scribus/scribus/canvasmode_editmeshpatch.cpp
    branches/ScribusOIF/scribus/canvasmode_editmeshpatch.h
      - copied unchanged from r16872, trunk/Scribus/scribus/canvasmode_editmeshpatch.h
Modified:
    branches/ScribusOIF/doc/en/about1.html
    branches/ScribusOIF/doc/en/cms.html
    branches/ScribusOIF/doc/en/color2.html
    branches/ScribusOIF/doc/en/pdf_form.html
    branches/ScribusOIF/doc/en/pdfexport1.html
    branches/ScribusOIF/doc/en/pdfexport2.html
    branches/ScribusOIF/doc/en/pdfexport3.html
    branches/ScribusOIF/doc/en/pdfexport4.html
    branches/ScribusOIF/doc/en/pdflavor.html
    branches/ScribusOIF/doc/en/pdfx3.html
    branches/ScribusOIF/doc/en/toolbox2.html
    branches/ScribusOIF/scribus/CMakeLists.txt
    branches/ScribusOIF/scribus/canvas.cpp
    branches/ScribusOIF/scribus/canvas.h
    branches/ScribusOIF/scribus/canvasmode.cpp
    branches/ScribusOIF/scribus/canvasmode_editmeshgradient.cpp
    branches/ScribusOIF/scribus/canvasmode_editmeshgradient.h
    branches/ScribusOIF/scribus/cellarea.h
    branches/ScribusOIF/scribus/mesh.cpp
    branches/ScribusOIF/scribus/mesh.h
    branches/ScribusOIF/scribus/pageitem.cpp
    branches/ScribusOIF/scribus/pageitem.h
    branches/ScribusOIF/scribus/pageitem_table.h
    branches/ScribusOIF/scribus/pageitem_textframe.cpp
    branches/ScribusOIF/scribus/pdflib_core.cpp
    branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
    branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.h
    branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
    branches/ScribusOIF/scribus/plugins/import/pdf/slaoutput.cpp
    branches/ScribusOIF/scribus/pslib.cpp
    branches/ScribusOIF/scribus/pslib.h
    branches/ScribusOIF/scribus/scpainter.cpp
    branches/ScribusOIF/scribus/scribusdoc.cpp
    branches/ScribusOIF/scribus/scribusdoc.h
    branches/ScribusOIF/scribus/scribusstructs.h
    branches/ScribusOIF/scribus/scribusview.cpp
    branches/ScribusOIF/scribus/scribusview.h
    branches/ScribusOIF/scribus/styles/charstyle.h
    branches/ScribusOIF/scribus/styles/paragraphstyle.h
    branches/ScribusOIF/scribus/styles/tablestyle.cpp
    branches/ScribusOIF/scribus/styles/tablestyle.h
    branches/ScribusOIF/scribus/ui/colorcombo.cpp
    branches/ScribusOIF/scribus/ui/colorlistbox.cpp
    branches/ScribusOIF/scribus/ui/colorlistbox.h
    branches/ScribusOIF/scribus/ui/cpalette.cpp
    branches/ScribusOIF/scribus/ui/cpalette.h
    branches/ScribusOIF/scribus/ui/gradientvectorbase.ui
    branches/ScribusOIF/scribus/ui/gradientvectordialog.cpp
    branches/ScribusOIF/scribus/ui/gradientvectordialog.h
    branches/ScribusOIF/scribus/ui/outlinepalette.cpp
    branches/ScribusOIF/scribus/ui/propertiespalette.cpp
    branches/ScribusOIF/scribus/ui/propertiespalette.h
    branches/ScribusOIF/win32/vc9/Scribus.vcproj

Modified: branches/ScribusOIF/doc/en/about1.html
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/doc/en/about1.html
==============================================================================
--- branches/ScribusOIF/doc/en/about1.html (original)
+++ branches/ScribusOIF/doc/en/about1.html Sat Oct  8 20:25:29 2011
@@ -1,7 +1,8 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html><head>
 
-	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>About the Scribus Team</title></head><body>
+	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+	<title>About the Scribus Team</title>
+</head><body>
 <h2>About the Scribus Team (in order of joining)</h2>
 
 <p><b>Franz Schmid (fschmid):</b> “Our Linus …”. The original author and main coder; software developer for a manufacturing company.</p>
@@ -15,7 +16,7 @@
 
 <p><b>Riku Leino (Tsoots):</b> Started with 1.1.5; wrote the Document Template plug-in and the OpenOffice.org/HTML importers for 1.2.2; IT manager for a large non-profit organization in Finland.</p>
 
-<p><b>Andreas Vox – pronounced [fox] – (avox):</b> Started with 1.3.0; developed the original Mac OS X native port, font and PostScript specialist, hates C++, likes good layout and has a stupid comment for anything; software developer.</p>
+<p><b>Andreas Vox – pronounced [fox] – (avox):</b> Started with 1.3.0; developed the original Mac OS X native port, font and PostScript specialist, hates C++ and likes good layout; software developer.</p>
 
 <p><b>Jean Ghali (jghali):</b> Handles the Windows native port and much of the color management coding, gifted bughunter; pre-press and software engineer.</p>
 
@@ -27,20 +28,20 @@
 
 <p><b>Hermann Kraus (Herm):</b> Wrote the Render Frame plug-in for 1.4 and GraphicsMagick and UniConvertor integration in 1.5.</p>
 
-<p><b>Jain Basil Aliyas (jainbasil)</b>: Wrote the XTG and IDML import filters, and worked on the next generation of the Scribus Scripter.</p>
+<p><b>Jain Basil Aliyas (jainbasil)</b>: Wrote the XTG and IDML import filters, and worked on the next generation ofUntitled 1 the Scribus Scripter.</p>
 
-<p><b>Paul Smedley:</b> Maintainer of the OS/2 port.</p>
+<p><b>Paul Smedley (smedles):</b> Maintainer of the OS/2 port.</p>
 
 
 <h2>The Supporting Cast and Former Developers (in no particular order):</h2>
 
-<p><b>Paul F. Johnson (Nodoid):</b> Started with sending patches for 0.8, did code review and code optimizing. </p>
+<p><b>Paul F. Johnson (Nodoid):</b> Started with sending patches for 0.8, did code review and code optimizing, wrote the “Coding Standards” document. </p>
 
 <p><b>Steve Callcott (sjc):</b> Wrote the Python plug-in “Font Sampler”, which showed the real power of the Python Scripter in Scribus; works on systems control and consumer electronics, custom software and support.</p>
 
 <p><b>Alessandro Rimoldi:</b> Added fixes for the Scripter and code clean-ups, GSoC mentor.</p>
 
-<p><b>J.J. Sarton:</b> Added some key patches for improving image handling and other improvements. Added the launcher for external image editors to Scribus.</p>
+<p><b>Jean-Jacques Sarton:</b> Added some key patches for improving image handling and other improvements. Added the launcher for external image editors to Scribus.</p>
 
 <p><b>Alistair Robinson:</b> Added some important fixes for font handling in early Scribus versions. Also wrote the clever hack for GIMP to create CMYK TIFFs.</p>
 
@@ -56,7 +57,7 @@
 
 <p><b>Marti Maria:</b> Answered tons of our questions on color management and provided littleCMS to the the Open Source world.</p>
 
-<p><b>Johannes Rüschel:</b> Excellent bug finder, former German translator.</p>
+<p><b>Johannes Rüschel:</b> Excellent bug finder, former German translator.</p>
 
 <p><b>Alexandre Prokoudine:</b> Russian Translator, has helped a bunch with internationalization issues, as well as designing UI improvements; professional technical writer.</p>
 
@@ -69,4 +70,35 @@
 <p><b>Gregory Pittman:</b> One of the primary contributors to the Scribus wiki and the documentation, one of the main authors of the Official Manual and the Scribus Online Help; author of several useful Scribus scripts; neurologist.</p>
 
 <p><b>Volker Ribbert:</b> Started with the German translation of the docs.</p>
+
+<p><b>Louis Desjardins:</b> LGM organizer, testing, feedback. Translator of the original documentation to French.</p>
+
+<p><b>Frederic Dubuy:</b> Translator of the original documentation to French</p>
+
+<p><b>François Lanctôt:</b> Translator of the original documentation to French</p>
+
+<p><b>Eirik Øverby:</b> Continues to mainatin our servers.</p>
+
+<p><b>Gora Mohanty:</b> Wrote the spellcheck plug-in.</p>
+
+<p><b>Elvis Stansvik:</b> Wrote the “Search” for the Document Outline and implemented tables in 1.5svn.</p>
+
+<p><b>Tomas Mecir:</b> Orphans and widows control implementation and other improvements in 1.5svn.</p>
+
+<p><b>Michael Doubez</b></p>
+
+<p><b>Cezary Grabski:</b> Lots of fixes and improvements to the text system.</p>
+
+<p><b>Marcus Holland-Moritz:</b> Performance improvents for documents with large images.</p>
+
+<p><b>Christian Töpp</b></p>
+
+<p><b>Andy Fitzsimon:</b> Creator of the Scribus splashscreen.</p>
+
+<p><b>Andreas Nilsson:</b> Tango Project icons.</p>
+
+<p><b>Jakub Steiner:</b> Tango Project icons.</p>
+
+<p><b>Antoine Cailliau:</b> Tango Project icons.</p>
+<p><b></b></p>
 </body></html>

Modified: branches/ScribusOIF/doc/en/cms.html
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/doc/en/cms.html
==============================================================================
--- branches/ScribusOIF/doc/en/cms.html (original)
+++ branches/ScribusOIF/doc/en/cms.html Sat Oct  8 20:25:29 2011
@@ -1,47 +1,50 @@
 <html>
 <head>
 	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-	<title>Color management with Scribus, an Introduction</title>
+	<title>Color Management with Scribus</title>
 </head>
 <body>
-<h2>Color management with Scribus, an Introduction</h2>
+<h2>Color Management with Scribus</h2>
+<h3>Overview</h3>
 
-<h4>Activating Color Management</h4>
-<p>For color management to function properly you need the following to be installed to be active and usable:</p>
-<ul><li>Littlecms libraries installed and Scribus compiled with lcms support. You can tell by looking at <strong>Help > About Scribus</strong> and looking for C-C-T. The first C means Scribus is compiled with littlecms support. This is standard with MacOSX and Windows.</li>
-<li>You need a <strong>minimum</strong> of 1 RGB and 1 CMYK profile. Scribus  provides two basic profiles to ensure CMS can be enabled immediately.  In practical terms, you need more. One sRGB for most RGB colors and one for each color device. One for your monitor which is created with monitor profiling tools. Several CMYK profiles for printing. Some CMYK profiles are known as "press-standards", in that they represent common commercial print standards used in North America and Europe. The best bet is to download the "Windows" version of the Adobe ICC profile package and unzip it into a directory like $home/.colors/icc. Linux users can also download freely distributable profiles from the <a href="http://www.scribus.net/modules.php?op=modload&name=Downloads&file=index&req=viewdownload&cid=16">ICC downloads</a> section on <a href="http://www.scribus.net">www.scribus.net</a> </li>
-<li>Scribus, by default on Linux, will look in:
- <pre>$home/.color/icc</pre> and <pre>/usr/share/color/icc/</pre>
-for both personal icc profiles or system wide ones. There is a small, but growing collection of freely available icc profiles for download on <a href="http://www.scribus.net">www.scribus.net</a>. Look in the Downloads > ICC section. Scribus on Windows or MacOSX will look in the default system directories. Earlier versions of Scribus will look in the directory specified in preferences.</li>
-<li>If you are new to color management, please look over the <A href="http://www.scribus.net/index.php?name=Web_Links&req=viewlink&cid=4" id="links and documentation" onclick="links and documentation">links and documentation</A> on color management listed on www.scribus.net. These explain the theory and concepts far better than I could here.</li></ul>
-<h4>Overview</h4>
-<p>The objective of a color management system is to reduce the differences between the on-screen colors and final printing, as well as showing colors which are out of gamut, beyond the color range of your selected printer. The caveat is you need to provide a profile of the printer and one for your monitor which is reasonably accurate. For users of other applications, the default settings and descriptions can be quite confusing to new users. Without prior knowledge of the terminology, it is <strong>very</strong> easy to choose the wrong settings. This can often makes images look worse on screen or print. Then, the first time user simply says enough and disables color management.</p>
+<p>The objective of a color management system is to reduce the differences between the on-screen colors and final printing, as well as showing colors which are “out of gamut,” i.e., beyond the color range of your selected printer. The caveat is that you need a profile of the printer and one for your monitor which is reasonably accurate. The whole concept, the options and descriptions can be quite confusing to new users. Without prior knowledge of the terminology, it is <strong>very</strong> easy to choose the wrong settings. This can often make images look worse on screen or print, or both. Then, the first time user simply says “enough!” – and disables color management.</p>
 
-<p>In a word <strong>don't</strong>. Once you understand some basic concepts and know your final print destination, you will be able to predict - and - control more reliably how your document will look when printed. This is especially helpful when you will be sending files for later reproduction with four color printing or sending hi-resolution PDFs. The type of color management support within Scribus, I believe, is the first for an open source program. Future enhancements will bring even more exact control over color reproduction. The latest CUPS versions since 1.1.15+ now have support for true CMYK color printing. The newest version of little cms 1.15 has many new features which enhance the capabilities of Scribus to more accurately display color, along with much better performance. .</p>
+<p>In a word <strong>don’t</strong>. Once you understand some basic concepts and know your final print destination, you will be able to predict and control more reliably how your document will look when printed. This is especially helpful when you will be sending files for later reproduction with four color printing.</p>
 
-<p>The steps to making color management work reliably (what you see on screen is what you print) :</p>
+<p>The steps to making color management work reliably (what you see on screen is what will be printed):</p>
 
 <ol>
-	<li>Learn a little bit about color management concepts and terminology. </li>
-	<li>Get the profiles setup properly. Below is a listing of color tools available for Linux. The most important is getting a good accurate monitor profile. The prof profilers do an excellent job at creating monitor profiles. <a href="moncal.html">Here</a> is a how to for creating ICC profiles for your monitor with the lprof profile tools. <strong>Without a properly created monitor profile, enabling color management will give you unsatisfactory results in printing and inaccurate previews on screen.</strong> </li>
-	<li>Embed the image profiles properly in image editing applications where possible.</li>
-
+	<li>Learn a little bit about color management concepts and terminology. There are many good books and websites about color management. (See, for example, <a href="http://www.poynton.com">here</a>.)</li>
+	<li>Get profiles set up properly. The most important is getting a good accurate monitor profile. The <a href="toolbox14.html">Lprof profiler</a> does an excellent job at creating monitor profiles. <i>Without a properly created monitor profile, enabling color management will give you unsatisfactory results in printing and inaccurate previews on screen.</i> </li>
+	<li>Embed the color profiles properly in image editing applications. Nowadays, not only closed source graphics software supports color management, but also all major Open Source programs, like GIMP, Krita, digiKam, Inkscape, or sK1.</li>
 </ol>
 
-<p>The color management system within Scribus is designed foremost for enabling color managed "soft proofs" of the images within the document. Scribus can also show "out of gamut" warnings for colors which might not be accurately reproduced by printing. (Most printers, have a narrower range of colors which can be printed, when compared to most monitors.) It does not embed or alter the profiles within your images. Some image files, png and Tiff, helpfully, can have an embedded ICM or ICC profile within the file header - also known as <strong><em>tagged</em></strong>, with a color profile. Later on, we will describe how and when it might be appropriate to use littlecms or Photopaint to apply a <strong>tag</strong> or embed a profile. If a file is <strong>tagged</strong>, Scribus will work with littlecms to read that profile within the image and use that profile to more accurately display the colors within an image. If an image does not have a tag but you know the device profile which should be assigned to the image, you can still use the CMS settings to preview with the profile temporarily assigned within the document. Caution is advised not to assign the wrong profile unless you are absolutely sure of the image source.</p>
-
-<p>The <strong>littlecms</strong> package has developed into a stable mature library. Independent tests vouch for its accuracy and littlecms is used within the printer firmware of some the most exotic and high end printers available. Given that this has come from a very small group of folks is really remarkably accurate  considering the amount of development work done by large companies such as Kodak, Adobe, Agfa and others. </p>
+<p>The color management system within Scribus is currently designed for enabling color managed “soft proofs” of your documents. Scribus can also show “out of gamut” warnings for colors which may not be accurately reproduced by a commercial printing device. (Most printers have a narrower range of printable colors, when compared to most monitors.) It does not embed or alter the profiles embedded in your images. (Some image formats, like EPS, JPEG, PNG or TIFF, can have an ICM or ICC profile embedded.)</p>
 
 <p><strong>What are color or device profiles?</strong></p>
 
-<p><strong>ICC</strong> or <strong>ICM</strong> profiles are a special type of file which describes the color characteristic of a device like a scanner, monitor or printer - basically any device which can create or display manipulate the color of a digital image. There are also color profiles which are known as <strong>device independent</strong> or <strong>working space</strong> profiles. These special files can be thought of as translators which are used to convert from one type of color profile to another. An icc or icm file is a set of tables which describes the mathematical values by which devices measure and describe color. Fortunately, these are set by open international standards and work the same way on a Mac, Windows PC, Linux or Solaris.</p>
+<p><strong>ICC</strong> or <strong>ICM</strong> profiles are a special type of file which describes the color characteristic of a device like a scanner, monitor or printer – basically any device which can create, display or manipulate the color of a digital image, hence the name <b>device profiles</b>.</p>
+<p>There also color profiles which are known as <strong>device independent</strong> or <strong>working space</strong> profiles. These special files can be thought of as translators which are used to convert from one type of color profile to another.</p>
+<p>An ICC or ICM file is a set of tables which describes the mathematical values by which devices measure and describe color. Fortunately, these are set by <a href="http://www.color.org ">open international standards</a> and work the same way on Mac OS X, OS/2, eCS, Windows, Linux or UNIX.</p>
 
-<p><strong>Device Profiles</strong> - are separate files which describe the way a device creates (scanner or digital camera), displays (monitor) or outputs (printer) colors. Users of of Photoshop will be familiar with the choice of <strong>Working Profiles</strong> or <strong>Working Space</strong> - which are color profiles not related to a particular device, but to assist in the conversion of color from one device to another. Well known RGB "working spaces" Include sRGB, Adobe® RGB 1998, Colormatch,Bruce RGB or CIERGB. Users of Photoshop or other color may be wondering if this is a missing feature, but littlecms uses its own internal color conversion process to make the transformation between color spaces. One less setting to worry about!</p>
 
-<table width="100%"><tr><td align="center"><img src="images/cmsmodify1.png" align="center" title="Color Management Preferences" alt="Color Management Preferences"/></td></tr></table>
+<h3>Activating Color Management</h3>
+<p>For color management to function properly you need the following to be installed to be active and usable:</p>
+<ul>
+<li>The littleCMS library. This is standard with builds for Mac OS X, OS/2, eComStation and Windows and a dependency on Linux and UNIX.</li>
+<li>You need at least 1 RGB and 1 CMYK profile. Scribus  provides two basic profiles to ensure that Color management can be enabled immediately after installation.  In practical terms, you need more: one sRGB profile for most RGB colors and one for each color device; one for your monitor which should be created with a monitor profiling tool; several CMYK profiles for commercial printing. <br>Some CMYK profiles are known as “press-standards,” in that they represent standardized commercial printing conditions used in Europe, Japan and North America. There are several websites that provide reliable ICC profiles for download. One standard set in the industry is “Adobe ICC Profiles,” as these are shipped with Adobe applications. You can download them from <a href="http://www.adobe.com/support/downloads/iccprofiles">Adobe’s website</a>. A set of profiles that has been found to be of excellent quality is the one from <a href="http://www.basiccolor.de">basICColor GmbH</a>, a German company specialized in color management. The profiles, which are covered by a CC license, can be downloaded <a href="http://www.colormanagement.org">here</a>.</li>
+<li>A more recent development on the Linux desktop is the implementation of color management almost everywhere, at least where it makes sense. As a result, not only bitmap editing, vector drawing or DTP programs started to use color management, but also web browsers or simple image viewers. Thus, many modern Linux distributions provide a lot of high-quality ICC profile sets as additional packagages for easy installation via your package manager, among them the Adobe ICC and basICColor profiles mentioned above. Due to the licensing policy of some distributions you may have to add or activate the “non-free” repository, or whatever the name for non-(L)GPL/BSD packages for your distribution is.</li>
+</ul>
 
-<table width="100%"><tr><td align="center"></td></tr></table>
-<p>Why "soft proofing" ? With the proper setup of device profiles, Scribus can adjust the colors of your monitor to more accurately represent how your document will actually look when finally printed., This can be doubly helpful if you are sending it to be printed commercially or for service bureau output. Moreover, each image can be individually modified by Scribus to assign profiles in an image, so that it can be properly color managed in document production, such as preparing film, a PDF/X-3 or direct to plate technologies. This does not however, alter the image file internally. Preview profiles <strong>assigned</strong> to an image are part of the setting retained in a Scribus document or in the creation of a PDF. There is also are command line tools in littlecms to embed profiles with <strong>tifficc</strong> and <strong>jpegicc</strong>. See the littlecms docs for exact options. You can also embed ICC profiles using Cinepaint, Imagemagick, Krita along with Adobe Photoshop.</p>
+<h3>Locations for Color Profiles</h3>
+<ul>
+<li><b>Linux/UNIX:</b> <code>/usr/share/color/icc</code> (system) and <code>/home/username/.color/icc</code> (user).</li>
+<li><b>Mac OS X:</b> <code>/Library/ColorSync/Profiles</code>.</li>
+<li><b>Windows:</b>: <code>C:\WINNT\system32\spool\drivers\color</code> (Windows 2000) and <code>C:\Windows\system32\spool\drivers\color</code> (Windows XP, Vista, 7).</li>
+<i><b>OS/2 and eComStation:</b> <code>X:\scribus\lib\scribus\profiles</code>. <br>
+<i>Note that there is no system-wide color management available on OS/2 and eComStation, so every program that uses color management, like Scribus or GIMP, needs the profiles in its own directory. However, it’s possible to create a single directory that comprises all profiles and then set this directory as an additional source for profiles, e.g.</i> <code>X:\ICC</code>. <i>In Scribus you can add this path in the “General” tab of the <a href="settings1.html#1">Preferences</a>.</i></li>
+</ul>
+
 <br />
 </body>
 </html>

Modified: branches/ScribusOIF/doc/en/color2.html
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/doc/en/color2.html
==============================================================================
--- branches/ScribusOIF/doc/en/color2.html (original)
+++ branches/ScribusOIF/doc/en/color2.html Sat Oct  8 20:25:29 2011
@@ -6,36 +6,36 @@
 <body>
 <h2>Editing and Managing Solid Colors (2)</h2>
 <h3>Changing the Default Color Palette</h3>
-<p>To change the default color palette, make sure that no Scribus document is open. Then open the Color Manager (<i>Edit > Colors</i>):</p>
+<p>To change the default colour palette, make sure that no Scribus document is open. Then open the Color Manager (<i>Edit > Colors</i>):</p>
 
 <table width="100%"><tr><td align="center"><img src="images/colrs-mgt1.png" title="Scribus Color Manager" alt="Scribus Color Manager" /></td></tr></table><br/>
 
 <p>In the dialog you can select a new default palette for <i>new</i> documents. Any change you make here will not affect existing documents, as the color palette in such a document has been <a href="color1.html">stored</a> in the document itself. Some of the color palettes shipped with Scribus have been created for special purposes, so before you select another default palette, you should learn something about the color sets from the descriptions provided in subsequent sections. In some cases, your printer or a client may insist on the use of certain colors.</p>
 <p>What you will notice immediately when you open the dialog is that you can’t edit any color in one of the palettes that are shipped with Scribus. This is a feature, not a bug, as the very purpose of standardized colors is to work across documents, computers or platforms with identical colors, which in turn have unique color values and color names. Thus, all color palettes that have been installed to directories to which you have read-only access are “locked”, i.e. prevented from editing.</p>
-<p>Sometimes, however, there are good reasons to edit a locked palette anyway, for example, if you need to reduce the number of colors in a palette for a certain project, i.e. if you need to create a “project palette”. In such a case you can  click on the “Save Color Set” button in the Color Manager. This will save the palette to the folder <code>~/swatches</code> in your Scribus settings directory (e.g. <code>~.scribus/swatches</code> on Linux/UNIX) and will add the copy to the list of available color sets. If you select the copy of the palette, you will notice that the editing options are now available. Be aware, though, that clicking “OK” will make all changes to the copy permanent!</p><br>
+<p>Sometimes, however, there are good reasons to edit a locked palette anyway, for example, if you need to reduce the number of colors in a palette for a certain project, i.e. if you need to create a “project palette”. In such a case you can  click on the “Save Color Set” icon in the Color Manager. This will save the palette to your home directory and will add the copy to the list of available color sets. If you select the copy of the palette, you will notice that the editing options are now available. Be aware, though, that clicking “OK” will make all changes to the copy permanent!</p><br>
 <table width="100%"><tr><td align="center"><img src="images/colrs-mgt2.png" title="Saving an editable copy of a locked palette" alt="Saving an editable copy of a locked palette" /></td></tr></table><br/>
 
 <h3>Installing or Importing New Color Palettes</h3>
-<p>If you have bought or downloaded standardized palettes from a third party vendor and you can’t acquire root/Administrator priviliges on the system you are working on, you are advised to copy the palette files into a special folder in your home directory. If you have root/Administrator permissions, you can also copy the sets into a folder in the install directory. Please read the licensing conditions for the files you wish to install, as they may limit the number of permitted users per palette.</p>
+<p>If you have bought or downloaded standardized palettes from a third party vendor and you can’t acquire root/Administrator privileges on the system you are working on, you are advised to copy the palette files into a special folder in your home directory. If you have root/Administrator permissions, you can also copy the sets into a folder in the install directory. Please read the licensing conditions for the files you wish to install, as they may limit the number of permitted users per palette.</p>
 <p>Here are the relevant paths for the supported operating systems:</p>
 
 
-<h4>Linux/UNIX:</h4>
+<h4>Linux/UNIX</h4>
 <p>If you have installed Scribus with a package management system like RPM, DEB or BSD Ports, the palette files need to be copied to either <code>/usr/lib/scribus/swatches</code> or <code>/usr/local/lib/scribus/swatches</code>. The respective location depends on the configuration of a distribution’s package manager.</p>
 <p>Those who compiled Scribus themselves need to copy the palette files to <code>installation_directory/lib/scribus/swatches</code>.</p>
 <p>If you don’t have root permissions, you can also copy the files to <code>/home/user_name/.scribus/swatches/locked</code>.</p>
-<p>In case the folder <code>locked</code> doesn’t yet exist, you have to create it.</p>
+<p>You have to create the folder <code>locked</code> if doesn’t exist.</p>
 <h4>Mac OS X</h4>
 <p>Copy the palettes into the directory <code>/Library/Preferences/Scribus/swatches/locked</code> in your Home directory.</p>
-<p>If the folder <code>locked</code> doesn’t yet exist, you have to create it.</p>
+<p>If the folder <code>locked</code> doesn’t exist, you have to create it.</p>
+<h4>OS/2 Warp 4 and eComStation</h4>
+<p>Copy the palettes to the directory <code>X:\scribus\lib\swatches\locked</code>.</p>
+<p>If the folder <code>locked</code> doesn’t exist, you have to create it.</p>
 <h4>Windows</h4>
 <p>Copy the files to the folder <code>C:\Program Files\Scribus{version}\share\swatches</code>.</p>
 <p>If you don’t have Administrator permissions, you can copy the files to your user directory. On Windows 2000, XP and 2003 this is
-<code>C:\Documents and Settings\username\.scribus\swatches\locked</code> and on Windows Vista and 7 it’s <code>
+<code>C:\Documents and Settings\username\.scribus\swatches\locked</code>, and on Windows Vista and 7 it’s <code>
 C:\Users\username\.scribus\swatches\locked</code>.</p> 
-<p>In case the folder <code>locked</code> doesn’t yet exist, you have to create it.</p>
-<h4>OS/2 Warp 4 and eComStation</h4>
-<p>Copy the palettes to the directory <code>%HOME%\.scribus\swatches\locked</code>.</p>
-<p>If the folder <code>locked</code> doesn’t yet exist, you have to create it.</p>
+<p>If the folder <code>locked</code> doesn’t exist, you have to create it.</p>
 </body>
 </html>

Modified: branches/ScribusOIF/doc/en/pdf_form.html
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/doc/en/pdf_form.html
==============================================================================
--- branches/ScribusOIF/doc/en/pdf_form.html (original)
+++ branches/ScribusOIF/doc/en/pdf_form.html Sat Oct  8 20:25:29 2011
@@ -4,98 +4,56 @@
 	<title>How To Create Your First PDF Web Form with Scribus</title>
 </head>
 <body>
-<h2>How To Create Your First PDF Web Form with Scribus</h2>
-<p><em><strong>With many thanks to Maciej Hanski</strong>, who kindly translated this from the Polish original, licenced under the FDL.</em></p>
-<p><strong>The sample files, <code>scribusformphp.tar.gz</code>, a tarball of a php file and a sample doc, are available from http://docs.scribus.net</a></p>
+<h2>PDF Forms</h2>
+<i>Thanks to Maciej Hanski, who kindly translated the original file from Polish to English. The content of this page is licenced under the Free Documentation Licence.</i></p>
+<!--<p>The sample files, <code>scribusformphp.tar.gz</code>, a tarball of a php file and a sample doc, are available from http://docs.scribus.net</a></p>-->
 
-<p>One of the biggest advantages of Scribus is the possibility to create PDF forms with embedded JavaScript scripts (in Adobe's own version, as described in the Adobe JavaScript Reference at http://partners.adobe.com/asn/developer/pdfs/tn/5186AcroJS.pdf</p>
+<p>One of the advantages of Scribus is the possibility to create PDF forms with embedded JavaScript scripts (as described in the <a href="http://partners.adobe.com/asn/developer/pdfs/tn/5186AcroJS.pdf">Adobe JavaScript Reference</a>).</p>
 
-<p>Its rather simple to create a new form with Scribus. We start with clicking on the "New Document" icon or choosing <strong>New</strong> from the <strong>File</strong> menu.</p>
+<p>It’s quite simple to create a new form with Scribus. Start by clicking on the “New Document” icon or choosing <i>New</i> from the <i>File</i> menu.</p>
 
-<table width="100%"><tr><td align="center"><img src="images/formularz_nowy.png" alt="Create a new doc" title="Create a new doc" /></a></td></tr></table>
+<p>Next, activate the grid (<i>Page > Snap to Grid</i>) and make it visible (<i>View > Show Grid</i>). This will help you to correctly place your form fields on the page. Then create some <a href="WwText.html">text frames</a> as field descriptions.</p>
+<table width="100%"><tr><td align="center"><img src="images/pdf-form-ht1.png" /></td></tr></table>
 
-<br />
-<p>Let us activate the grid then (menu <strong>View</strong> -> <strong>Show Grid</strong>), it will help us to correctly locate our form fields on the page. We need some text frames to make a nice title and field descriptions - a few clicks on the <strong>[ab]</strong> icon and all the text frames are there in no time.</p>
+<div>Now you can start adding form elements. The toolbox for form elements is available in the Toolbar:
+<table width="100%"><tr><td align="center"><img src="images/pdf-form-ht2.png" /></td></tr></table>
 
-<table width="100%"><tr><td align="center"><img src="images/siatka_menu.png" border="0" alt="null" /></td></tr></table>
+To add a PDF text field, click on the second button from the left and create a text frame. In this sample form, you will need one PDF text field for each entry: “Name,” “Street/No” and “ZIP Code/Town.”. To create a PDF button, use the button at the left of the Toolbar.
 
-<p>Having filled our frames with text, we can change their properties with the <strong>Properties</strong> palette, which can be found in the <strong>Tools</strong> menu.</p>
+<table width="100%"><tr><td align="center"><img src="images/pdf-form-ht3.png" /></td></tr></table>
 
-<table width="100%"><tr><td align="center"><img src="images/siatka_jednostki_miar.png"  alt="" /></td></tr></table>
+<p>As you can see in the screenshot above, all PDF form items use <i>blue</i> lines to indicate frame borders. To edit the PDF form properties of a field, right-click and select “PDF Options > Field Properties”:</p>
+<table width="100%"><tr><td align="center"><img src="images/pdf-form-ht4.png" /></td></tr></table>
+
+<p>The “Field Properties” dialog is mostly self-explanatory, and it’s impossible to explain all options in detail here. For the purpose of this introduction it’s important that you assign a unique name to each PDF text field and that the field type is “Text.” The name is important, as it can be used by external scripts to process the form data. e.g. if you use your form to send data to a website. You can also let Scribus validate the correctness of the data inserted by the user of the PDF, e.g. if a field requires a numerical value. If Scribus’s limited validation options are insufficient for your purposes, you can use JavaScript to create more sophisticated ones.</p>
+
+<table width="100%"><tr><td align="center"><img src="images/pdf-form-ht5.png" /></td></tr></table>
+
+<p>To send inserted data from your PDF viewer, you need to add a “Submit” button to your form. Create a button as described above and open the field properties dialog from the Context Menu:</p>
+
+<table width="100%"><tr><td align="center"><img src="images/pdf-form-ht6.png" /></td></tr></table>
+
+<p>Note that the “Action” tab allows for much more than just “submit” actions, as you can see from the drop-down list “Type.”</p>
+
+<p>When you export your form to PDF, you are advised to choose at least PDF 1.4 in the PDF Export dialog.</p>
 
 
-<br />
-
-<div>Now we can start adding form elements: some text fields and one button for submitting our form to an URL. To add a field simply click on the arrow on the right side of the <strong>OK</strong> icon and select a type from the displayed options: button, text field, check box, combo box, and list box.</div>
-
-<br />
-<table width="100%"><tr><td align="center"><img src="images/symbole.png" alt="null" /></td></tr></table>
-
-<p>The current active element of the form has a red frame border; you can activate an element in choosing the "Select" icon (the one with crossed arrows) and clicking on the item to be chosen.</p>
-<br />
-
-<table width="100%"><tr><td align="center"><img src="images/ulica.png" alt="null" /></td></tr></table>
-
-<br />
- 
-<p>The right click on an element activates a new menu. We choose <strong>Field Properties</strong> and define field names (we will need the field names in our PHP script, to which we'll send the form), types (e.g., number, time, date), and actions to be performed on different events (Mouse Enter, Mouse Exit, On Blur, and so on).</p>
-
-<br /><br />
-
-<table width="100%"><tr><td align="center"><img src="images/wlasciwosci_pola.png" alt="null"  border="0" /></td></tr></table>
-
-<br />
-
-<p>Here we are defining the <strong>No</strong> field as a number. Acrobat Reader won't accept anything else as a valid entry, then.</p>
-
-<br />
-
-<table width="100%"><tr><td align="center"><img src="images/formularz_pole_num.png" border="0" alt="null" /></td></tr></table>
-
-<br />
-
-<p>Here, we are defining a custom validation script for the <strong>Name</strong> field - after changing the field contents there will be a beep sound and an alert will be showed (not very sophisticated, I know, but it still demonstrates the possibilities of PDF). Scribus has its own simple text editor, which enables us to save the script to a separate file. Custom scripts can be defined not only on the form field level, but as global scripts as well (<strong>Edit</strong> -> <strong>JavaScripts</strong>).</p>
-
-<br />
-
-<table width="100%"><tr><td align="center"><img src="images/formularz_js_skrypt.png" alt="null" /></td></tr></table>
-<br />
-
-<p>After saving the script and closing the editor, the script contents is shown in the <strong>Field Properties</strong>.</p>
-<br />
-
-<table width="100%"><tr><td align="center"><img src="images/formularz_js_sprawdzanie.png" border="0" alt="null" /></td></tr></table>
-
-<br />
-
-<p>We have still to define, to which URL the form contents will be sent (there is a simple PHP script at the destination address, which will format and display the received form data). We choose in the button properties as the action type <strong>Submit form</strong> and enter the address of our PHP script: <strong>scribus_test.php</strong>. We match the <strong>Submit Data as HTML</strong> option to end with (the other option would be the FDF data, but this is a very different story) and we are done now.</p>
-
-<br />
-
-<table width="100%"><tr><td align="center"><img src="images/wyslij_formularz.png" alt="null" /></td></tr></table>
-
-<br />
-
-<p>The only thing else to do is to export the document to PDF: menu <strong>File -> Export... ->; Export to PDF...</strong>.<br />We select <strong>Acrobat 5.0</strong> as the file format and save the file.</p>
-
-<br />
-<table width="100%"><tr><td align="center"><img src="images/formularz_export_PDF.png" border="0" alt="null" /></td></tr></table>
-<br />
-
-<p>The result of our work can be downloaded from http://docs.scribus.net and tested. In order to submit the form we must open it from within a browser, Netscape 4.* or Mozilla are the safe choices (check the Mozilla plug-ins to see, if the Acrobat Reader plug-in is enabled. If not, you have to symlink it into the Mozilla's plug-in directory. In my particular case, the Mozilla's plug-in directory is  <strong>/usr/lib/mozilla-1.3/plug-in</strong>, and the plug-in to be symlinked into it is <strong>/usr/local/Acrobat5/Browsers/intellinux/nppdf.so</strong>).</p>
+<!--<p>The result of our work can be downloaded from http://docs.scribus.net and tested. In order to submit the form we must open it from within a browser, Netscape 4.* or Mozilla are the safe choices (check the Mozilla plug-ins to see, if the Acrobat Reader plug-in is enabled. If not, you have to symlink it into the Mozilla's plug-in directory. In my particular case, the Mozilla's plug-in directory is  <strong>/usr/lib/mozilla-1.3/plug-in</strong>, and the plug-in to be symlinked into it is <strong>/usr/local/Acrobat5/Browsers/intellinux/nppdf.so</strong>).</p>
 
 <p><strong>My very own impression:</strong> Scribus as a tool for working with PDF forms seems to be more comfortable in use than Adobe Acrobat 5.0 (the only version, I've worked with). It's a lot easier to layout documents with Scribus, since Acrobat only allows you to edit existing documents, but not to create a new document from  scratch. Scribus provides us with the full control over the final results and allows us much more freedom in changing the document's layout. More over, Scribus files can be edited even with a simple text editor, since its file format is entirely XML
-based.</p>
-<p><em>Maciej Hanski</em> - 22:10:2003</p>
+based.</p>-->
+<p>Maciej Hanski, October 2003</br>
+Updated by Christoph Schäfer, September 2011
+</p>
 
-<p><strong>Some useful PDF/JavaScript Links:</strong></p>
+
+<h4>Some useful PDF/JavaScript Links</h4>
 <ul>
 	<li><a href="http://www.planetpdf.com/mainpage.asp?WebPageID=229" target="_blank">Planet PDF</a></li>
 	<li><a href="http://partners.adobe.com/asn/developer/pdfs/tn/5186AcroJS.pdf" target="_blank">Acrobat JavaScript Object Specification</a></li>
-	<li><a href="http://ahnews.music.salford.ac.uk/scribus/documentation/pdfs/javascriptpdfa4.pdf" target="_blank">JavaScript and Scribus</a></li>
 </ul>
 
-<p><strong>Some useful CGI/PHP links:</strong></p>
+<h4>Some useful CGI/PHP links</h4>
 <ul>
 	<li><a href="http://www.cgi101.com/book/ch4/text.html">http://www.cgi101.com/book/ch4/text.html</a></li>
 	<li><a href="http://www.cgi101.com/book/ch4/post-cgi.html">http://www.cgi101.com/book/ch4/post-cgi.html</a></li>

Modified: branches/ScribusOIF/doc/en/pdfexport1.html
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/doc/en/pdfexport1.html
==============================================================================
--- branches/ScribusOIF/doc/en/pdfexport1.html (original)
+++ branches/ScribusOIF/doc/en/pdfexport1.html Sat Oct  8 20:25:29 2011
@@ -8,17 +8,10 @@
 
 <h3>Overview</h3>
 
-<p>The power and versatility with the PDF Export in Scribus is one of its notable features. Documenting all its features requires almost a chapter by itself. I encourage you to read this introductory part thoroughly to become familiar with all the PDF features and options, along with viewing some of the PDFs created with Scribus on-line at <a href="http://www.scribus.net">www.scribus.net</a> in the download section.</p>
-<p>The platform neutral nature of PDF enables Scribus users to overcome a number of potential barriers to Linux and DTP. Scribus reliably exports high quality, "press-ready" PDF including advanced PDF 1.4 features, ISO compliant PDF/X-3 and ICC color managed PDFs, thanks to <a href="http://www.littlecms.com">little cms</a>. If your printer is skeptical, point them to <a href="prepress.html">Scribus Pre Press</a>. This is a downloadable PDF which outlines pre-press tests on Scribus, along with other supplementary info.</p> 
-<p>If Scribus only created high resolution commercial grade PDFs, that alone would make Scribus a great application. The bonus is all the easy to use versatility such as: creating presentations á la Powerpoint or creating web-enabled PDF interactive forms which can be used with electronic document exchange, the ability to use JavaScript to control elements within the PDF. Scribus provides other user friendly touches like annotations, bookmarks and optionally, document security, if needed.</p>
-<p>While PDF in one sense is a proprietary standard, it is also widely available on most every computing platform. It is also extremely well documented. The PDF 1.5 reference manual is a <em>mere</em> 1100 pages. The PDF abilities in Scribus enables for <strong>repurposing</strong> a document. One document can be produced for printing, web download or for presentation like StarOffice Impress or MS Power point. That this is a future trend in publishing is indicated by the same strategy in Adobe's InDesign 2.0+ and the new PDF capabilities in Quark Xpress 6 and Adobe Illustrator 10+. In electronic publishing and pre-press production, both have seen many enhancements to PDF, which often overcome the limitations of HTML and traditional PostScript, respectively.</p>
-<p>Your best viewing / printing results will be with the newest version of Acrobat Reader 5.0.10 or Adobe Reader 7.0.8 for Linux and version 6.0+ on other platforms, where it is available. Please also note, <strong>gv and derivatives are not suitable viewers</strong> for Scribus EPS or PDFs. Similarly, Adobe Reader on MacOSX is given preference over the built-in Preview app.</p>
-<p>One of the challenges with PDF and EPS viewers on Linux, is that Scribus creates high end PS level 3 and PDF 1.4, with capabilities beyond most of the open source viewers. Some of these features are only supported in commercial pre-press or DTP tools. Moreover, none of the open source viewers are capable of correctly interpreting color managed PDF. Two plus years of working with Scribus has led me to the current conclusion that the following three viewers are the most reliable at displaying PS/EPS/PDF created by Scribus:</p>
-<ul>
-<li><strong>Adobe Reader 5.0.10+ for Linux</strong> - The best and sometimes the only choice for PDF viewing. Detailed notes and hints: <a href="toolbox1.html">Adobe Reader</a>.</li>
-<li><strong>GSview 4.8+</strong> - with the latest version of Ghostscript available. This combination is your best choice for viewing EPS files, PS files and most PDFs. In addition, GSview has many other very useful capabilities with add-ons like <code>pstoedit</code> and <code>epstool</code>. For more detailed notes and hints: <a href="toolbox6.html">GSview</a>. I consider it an essential tool for DTP on Linux.</li>
-<li><strong>Kpdf 3.5+</strong> - This updated PDF viewer from KDE 3.5 has a new rendering engine and is capable of viewing PDF 1.5 files.</li>
-</ul>
-<p><strong>If any other PDF or EPS viewer you choose cannot display PDFs from Scribus, but they do view properly in Acrobat Reader, file a bug with the upstream author. In virtually all cases I have tested, it is a limitation of the viewing application. Scribus PDFs are tested daily with specialist pre-press software to validate their adherence to the published PDF specifications.</strong></p>
+<p>The power and versatility of the PDF (Portable Document Format) export in Scribus is one of its notable features. The platform-neutral nature of PDF enables Scribus users to overcome a number of potential barriers between Open Source and “traditional” print workflows. Scribus reliably exports high-quality, “press-ready” PDF, including advanced PDF features, ISO-compliant PDF/X-3 and ICC color-managed PDFs.</p> 
+<p>If Scribus would only be capable of creating high resolution PDFs for commercial printing, that alone would make Scribus a great application. The bonus is all the easy-to-use versatility, such as: creating presentations à la PowerPoint or creating web-enabled interactive PDF forms, which can be used in electronic document exchange, or the ability to use JavaScript to control elements within the PDF. Scribus also provides other useful features, like annotations, bookmarks and optionally document encryption.</p>
+<p>The PDF abilities of Scribus enable for “repurposing” a document. A single document can be exported for printing, web download or for slide presentations. That this is a future trend in publishing is indicated by the same strategy in Adobe’s InDesign, the new PDF capabilities in QuarkXPress or in Adobe Illustrator. New requirements in publishing have resulted in many enhancements to the PDF standard, which often overcome the limitations of HTML and traditional PostScript, respectively.</p>
+<p>Your best PDF viewing/printing results will be with the newest version of <a href="toolbox1.html">Adobe Reader</a>.</p>
+
 </body>
 </html>

Modified: branches/ScribusOIF/doc/en/pdfexport2.html
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/doc/en/pdfexport2.html
==============================================================================
--- branches/ScribusOIF/doc/en/pdfexport2.html (original)
+++ branches/ScribusOIF/doc/en/pdfexport2.html Sat Oct  8 20:25:29 2011
@@ -1,26 +1,26 @@
 <html>
 <head>
 	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-	<title>PDF Exporting from Scribus</title>
+	<title>PDF Export Targets</title>
 </head>
 <body>
-<h2>PDF Exporting from Scribus</h2>
-<h3>Scribus PDF Export Workflow</h3>
+<h2>PDF Export Targets</h2>
 
-<p>Aside from interactive PDF creation explained later, for a given document, there are basically four paths to follow in creating your PDF:</p>
+<p>There are basically four kinds of PDF export targets. It’s important that you consider the hints below <i>before</i> you start creating your documents.</p>
 <ol>
 <li>
-<p><strong>Web download - Screen Reading - Interactive Forms</strong> - Follow this work flow when you want the smallest file size and high resolution printing is not required.</p>
+<p><strong>Press Optimized:</strong> All <a href="importhints.html">bitmap images</a> brought into to Scribus as placed images should have a minimum resolution of 200 dpi and preferably 300 dpi or more for photos or TIFFs. For line art or vector graphics converted to a bitmap image, an even higher resolution may be necessary for best results. Most vector files can be <a href="importhints2.html">imported directly</a> as native Scribus objects, which is recommended if possible. Output target in the PDF Export dialog: “Printer,” unless you export to <a href="pdfx3.html">PDF/X-3</a>.</p>
 </li>
 <li>
-<p><strong>Presentation Effects</strong> - the recommended settings are down-sample all images to 72, 96 or 120 dpi, depending on the resolution of the display screen. Embed all fonts and landscape page layouts will give you maximum image area on the screen if you plan on using a display projector. More hints on Presentation PDFs further on.</p>
+<p><strong>Print Optimized:</strong> This would mean targeting the PDF for printing on an office laser-jet or ink-jet. Recommended settings: Down-sample all images to 300 dpi or less, embed fonts and keep your page margins with enough tolerance for margin limits on desktop and common office printers (approx. 6/10th of an inch or 1.5 cm). <b>Do not choose “Printer” as an output target, but use “Screen/Web” instead, as ink-jet and laser-jet printers expect RGB input.</b></p>
 </li>
 <li>
-<p><strong>Press Optimized</strong> - Clear all down-sampling or compression of images where image quality is of utmost importance. All images brought into to Scribus as placed images should be a minimum of 200 dpi and preferably 300 dpi or more for photos or TIFFs. Line art or vector graphics converted to an EPS in a program like Illustrator should have a minimum of 800 dpi for best results. Most vector EPS can be imported directly as native Scribus objects and recommended where possible. <strong>If your printer supports color managed PDF/X-3, This is the recommended method for optimal results. However, only the latest printing technology can support PDF/X-3. You should only enable this when your printer advises. </strong>.</p>
+<p><strong>Web download, screen reading, interactive forms:</strong> See the section on <a href="pdfexport3.html">Screen/Web export</a>.</p>
 </li>
 <li>
-<p><strong>Print Optimized</strong> - This would mean targeting the PDF for printing on an office laser jet or ink jet. Recommended settings: down-sample all images to 300 dpi or less, embed fonts and keep your page margins with enough tolerance for margin limits on desktop and common office laser printers (approx. 6/10th of an inch or 1.5 cm.)</p>
+<p><strong>Presentation Effects:</strong> See the section on <a href="pdfexport4.html">PDF presentations</a>.</p>
 </li>
+
 </ol>
 </body>
 </html>

Modified: branches/ScribusOIF/doc/en/pdfexport3.html
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/doc/en/pdfexport3.html
==============================================================================
--- branches/ScribusOIF/doc/en/pdfexport3.html (original)
+++ branches/ScribusOIF/doc/en/pdfexport3.html Sat Oct  8 20:25:29 2011
@@ -1,30 +1,29 @@
 <html>
 <head>
 	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-	<title>PDF Exporting from Scribus</title>
+	<title>PDF Export for Screen/Web</title>
 </head>
-<body>
-<h2>PDF Exporting from Scribus</h2>
-<h3>Screen Display and On-line PDF Forms</h3>
-<p>Choose these settings when downloading speed or small size is important.</p>
+<ul>
+<h2>PDF Export for Screen/Web</h2>
 
-<p><b>Recommended Settings and Hints:</b></p>
+<p>Recommended settings and hints:</p>
 
 <ul>
-<li>Down-sample all images to 72-96DPI.</li>
-<li>Reduce the number of font faces to the minimum needed.</li>
-<li>Choose the lowest quality setting for compression which has acceptable on-screen viewing results.</li>
-<li>You can often substitute Arial for Helvetica, as later viewers will often have this as an included font.</li>
-<li>Avoid importing EPS or PDFs into your document - instead convert them to a low resolution PNG with GSview, then place in your Scribus document. Why? They will render faster on your screen and often make for a smaller file size.</li>
-<li>Avoid using the Nimbus fonts, if they are not at least sub-set. Acrobat Reader on other platforms does a poor job of substitution using its included fonts. One other issue which can trip you up is Helvetica is often aliased to Nimbus Sans L on many distributions.</li>
+<li>Down-sample all images to 72–96 dpi.</li>
+<li>Reduce the number of font faces to the minimum needed (see below).</li>
+<li>Choose the lowest quality setting for compression that has acceptable on-screen viewing results (you may have to experiment to see what’s acceptable for you).</li>
+<li>You can often substitute Arial for Helvetica, as some viewers may have this as an included font.</li>
+<li>Avoid importing EPS or PDFs into your document – instead, convert them to a low-resolution PNG with GSview, Inkscape or GIMP, then place them in your Scribus document. Why? They will render faster on your screen and often make for a smaller file size.</li>
+<li>If possible, replace bitmap images with vector artwork. Vector artwork is far more compact in terms of size in PDF.</li>
+<li>Avoid using the Nimbus fonts. Adobe Reader does a poor job of substituting them by using its included fonts.</li>
 <li>Unless transparency in artwork is needed, select PDF 1.3 output for the greatest compatibility with other users.</li>
-<li>Where possible replace bitmap images with vector artwork. Vector artwork is far more compact in terms of size in PDF.</li>
+<li>Always use “Screen/Web” as your output target in the PDF Export dialog. The exception is files with only black/white or greyscale content. In such a case you can also choose “Greyscale,” which will reduce the file size even further.</li>
 </ul>
-<h4>When addressing PDF optimization for web sites there are two issues:</h4>
-
-<p>Global size of the file. Which can partly be reduced by carefully choosing fonts and not using too many font faces. You can if space is
-really an issue not embedding fonts and using only the 'base 14" fonts which all PDF readers should have. Those fonts include bold and italic variants of Courier, Helvetica or ArialMT, and Times. </p>
-
-<p>The second is the perceived download times when the PDF is visible in the viewer. Ghostscript has a command line utility,<strong> pdfopt</strong>,  which can 'linearize' a PDF and allow a PDF reader to display the first page of the PDF, then subsequent pages to load in the background. This is very useful for longer documents. Note this tool does not shrink the PDF, but actually may increase the size as it undoes the non-linear way objects are stored in PDF. The use.html in the Ghostscript documentation for details. Note also that the apache web server needs to be set up with a feature which is call 'byte-serving'. </p>
+<p>When addressing PDF optimization for websites, there are two issues:</p>
+<ul>
+<li>If space is really an issue, it will help not to embed fonts and to use only the “standard 14 fonts,” which all PDF readers should be able to display reliably. These fonts include regular, bold, italic and bold italic variants of Courier, Helvetica, and Times, as well as “Symbol” and “Zapf Dingbats” (or equivalents).</li>
+</br>
+<li>The second is the perceived download time when the PDF is visible in the viewer or a browser plug-in. Ghostscript has a command line utility called <strong> pdfopt</strong>,  which can “linearize” a PDF and allow a PDF reader to display the first page of the PDF while loading subsequent pages in the background. This is very useful for longer documents. Note that this tool does not shrink the PDF, but actually may increase the size, as it undoes the non-linear way objects are stored in a PDF file. See the <a href="toolbox5.html">Ghostscript</a> documentation for details.</li>
+</ul>
 </body>
 </html>

Modified: branches/ScribusOIF/doc/en/pdfexport4.html
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/doc/en/pdfexport4.html
==============================================================================
--- branches/ScribusOIF/doc/en/pdfexport4.html (original)
+++ branches/ScribusOIF/doc/en/pdfexport4.html Sat Oct  8 20:25:29 2011
@@ -6,30 +6,32 @@
 <body>
 <h2>Creating PDF Presentations</h2>
 <h3>Presentation PDFs</h3>
-<p>Creating Presentation PDFs in Scribus, is not only easy, they work great. Using PDF in place of traditional "presentation" applications does have some advantages:</p>
+<p>Creating slide presentation PDFs in Scribus is not only easy, they also work great. Using PDF in place of traditional “presentation” applications like LibreOffice Impress or PowerPoint has the following advantages:</p>
 
 <ol>
-	<li>They are portable. You can create a presentation PDF with Scribus and display it on almost any computer with Acrobat Reader. Other types, usually require the application to be installed, and few are cross-platform.</li>
-	<li>You can use all the drawing, text manipulation and image handling tools in Scribus, which are in many cases superior to those in other presentation applications. Few can import SVG or EPS files really well.</li>
-	<li>You will have more precise typographic control of text.</li>
-	<li>Because they are created in Scribus, you can export them with a higher resolution and they will print beautifully.</li>
-<li>Unlike other presentation tools, with use of the powerful form and javascript capabilties in Scribus you can make truly interactive PDFs which can take counts, ask questions with dialogs and more. You are only limited by your imagination and scripting skills. </li>
+<li>They are portable. You can create a PDF presentation in Scribus and display it on almost any computer with Adobe Reader or another modern PDF viewer. Other formats usually require the application itself (or a specialized viewing program) to be installed, and few are cross-platform.</li>
+<li>You can use all the drawing, text manipulation and image handling tools in Scribus, which are in many cases superior to those in presentation applications. Few of them can import SVG, AI, EPS or PSD files reliably, if at all.</li>
+<li>You will have more precise typographic control of text.</li>
+<li>Because the slides are created in Scribus, you can export them with a higher resolution, and they will print beautifully.</li>
+<li>Unlike other presentation tools, with use of the powerful form and JavaScript capabilties in Scribus you can make truly interactive PDFs which can take counts, ask questions with dialogs and more. You are only limited by your imagination and JavaScript skills.</li>
 </ol>
 
 <h4>Hints:</h4>
 <ul>
-	<li>Down-sample all images to 72-96dpi. Depending on the resolution of the displaying device, you might go as high as 120dpi, but higher will not gain you sharpness. But do this in an image editing program like the GIMP. Then import them into Scribus.</li>
-	<li>Embed all fonts. This ensures the spacing and layout will remain the same no matter which platform you are using.</li> 
-	<li>You can use US Letter or A4 in landscape mode for your layout. This will most closely match the screen output of Acrobat Reader in Full Screen mode.</li>
-	<li>When displaying images like photos or screen shots, use a black or dark background on your page. They will make the colors more vibrant and give your viewers more contrast to see all the details in your slides.</li>
-	<li>Use RGB colors for your images and always use Screen/Web for Export.</li>
-	<li>One trick I have learned from using PDF for presentation. Load the PDF and run through each page once before giving the presentation, so the file is loaded in memory. This will make for smoother transitions on the screen.</li>
+<li>You should use US Letter or A4 in landscape mode as the page size for your layout. This will most closely match the screen output of PDF viewers in full screen mode.</li>	
+<li>Down-sample all images to 72–96 dpi, but do this in an image editing program like GIMP. Then import them into Scribus. Depending on the resolution of the displaying device, you might go as high as 120 dpi, but higher will not gain you sharpness. </li>
+<li>Embed all fonts. This ensures that the spacing and layout will remain the same, no matter which platform you are using.</li> 
+<li>When displaying images like photos or screenshots, use a black or dark background on your page. They will make the colors more vibrant and give your viewers more contrast to see all the details in your slides.</li>
+<li>Use RGB colors for your images and <b>always</b> use “Screen/Web” as your output target.</li>
+<li>One trick for your actual presentation in front of an audience: Load the PDF and run through each page once before giving the presentation, so the file is loaded into memory. This will make for smoother transitions on the screen.</li>
 </ul>
 <h4>Settings and Options</h4>
-<p>Presentation effects and settings fall into two categories. The first is controlling the transition between pages when running a presentation PDF for example like you would when on stage. There are a variery of effects which are in the drop down boxes and they are often not only supported in Adobe Reader, but in other PDF viewers like KPDF or Xpdf for example. Moreover, each page can its own transition, different from the others.  </p>
-<table width="100%"><tr><td align="center"><img src="images/pdfeffect1.png" title="PDF Effects" alt="PDf Effects"/></td></tr></table>
-<p>Viewer Options are the second and gives you control over how the viewing application is opened. These mostly will only work in Adobe Reader alone as they are based on javascript commands in the PDF. <strong>Special Actions</strong> are more advanced ways of controlling the viewer on opening, but requires custom javascript to work.</p>
-<table width="100%"><tr><td align="center"><img src="images/pdfeffect2.png" title="PDF Effects" alt="PDf Effects"/></td></tr></table>
+<p>Presentation effects and settings fall into two categories. The first (available in the “Extras” tab of the PDF Export dialog) is controlling the transition between slides when running a PDF presentation. There are a variety of effects which are in the drop-down boxes, and they are often not only supported in Adobe Reader, but also in recent Open Source PDF Viewers, for example Okular or Evince. Moreover, each page can have its own transition effect, different from the others:</p>
+
+<table width="100%"><tr><td align="center"><img src="images/scribus-pres1.png" title="PDF Effects" alt="PDf Effects"/></td></tr></table>
+
+<p>Viewer options are the second and give you control over how the viewing application behaves when you open the file. They are available via the “Viewer” tab in the PDF Export dialog. It is recommended that you check “Single Page” and “Use Full Screen Mode” for presentations:</p>
+<table width="100%"><tr><td align="center"><img src="images/scribus-pres2.png" title="PDF Effects" alt="PDf Effects"/></td></tr></table>
 
 </body>
 </html>

Modified: branches/ScribusOIF/doc/en/pdflavor.html
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/doc/en/pdflavor.html
==============================================================================
--- branches/ScribusOIF/doc/en/pdflavor.html (original)
+++ branches/ScribusOIF/doc/en/pdflavor.html Sat Oct  8 20:25:29 2011
@@ -1,30 +1,46 @@
-<qt>
+<html>
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+	<title>PDF Flavors</title>
+</head>
+<body>
+<h2>PDF Flavors</h2>
 
-	<title>PDF Flavors</title>
-<h2>PDF Flavor - Which one is best for you ?</h2>
+<p>Given the number of PDF “flavors” and the technical background, some may be tempted to call PDF merely a collective noun for a number of separate file formats, all of which are derivatives another format called PostScript. We cannot provide a complete technical overview over the PDF specification(s) and their relations to PostScript here, but a few notes may help to guide you through the jungle of versions and subsets.</p>
 
-<p>Answering that question, brings up many questions and bears some discussion of what are the differences. A higher version does not presume a "better" PDF and in some cases works against you.</p>
-<h4>What is the difference between versions PDF 1.2 to PDF 1.7 ?</h4>
-<p>Each version roughly parallels the release of a major version of Adobe Acrobat. The short overly simple answers:
-</p>
+<h3>PDF and PostScript</h3>
+<p>While it’s true that PDF is based on <a href="importhints1.html">PostScript</a>, it needs to be said that PDF, other than PostScript, is not a programming language. PDF and PostScript describe pages and their content using the same technology (“Adobe imaging model”), so conversion of the <i>visual</i> content between both formats works flawlessly. However, the PDF specification adds other layers of content that go beyond mere representation of graphical data on a printed page, like interactive features or scripting, which are not available in PostScript.</p>
+
+<h3>What is The Difference Between PDF Versions 1.0 to PDF 1.7?</h3>
+
+<p>Answering that question brings up many questions, but the most important thing you should be aware of is that a higher version is not necessarily a “better” PDF and in some cases can work against you.</p>
+<p>Each version parallels the release of a major version of Adobe Acrobat. Here’s a short overview:</p>
 <ul>
-<li>PDF 1.2 = Acrobat 3.0 - relatively obsolete now
-</li>
-<li>PDF 1.3 = Acrobat 4.0 - The first version of PDF which truly had all the needed features to support "press-ready" PDF's including color management, ICC profiles etc. It also added javascript, interactive and multimedia capabilities. This standard is probably the safest to send if you are unsure of the capabilities of the receiver of your file. PDF/X-3 and a number of commercial print work flows are based on PDF 1.3.</li>
-<li>PDF 1.4 = Acrobat 5.0 - Actually, introduced with Illustrator 9. The main difference to concern Scribus users is both transparency and alpha transparency capabilites. This makes a major difference in where a PDF with these features can be printed. It takes either the latest commercial RIPs or certain Level 3 PostScript printers to use these features properly. Moreover, not all Level 3 PostScript printers will handle transparency. The latest versions of Ghostscript support the advanced PDF 1.4 features Scribus can create when exporting PDF.<strong>The most distinguishing feature of PDF 1.4 for Scribus is the ability to export true transparency in PDF. </strong>Note: Often, the only way you will be able to print exactly  the transparency features viewed on-screen is to export PDF 1.4 and print from Acrobat Reader 5.x or newer. </li>
-<li>PDF 1.5 = Acrobat 6.0 - Among the most interesting for Scribus users: many improvements for "press-ready" PDF, the capability to have true layering within the PDF, PDF-X "pre-flight" capability, more security and interactive features, like the ability to add comments which are separate from the original doc. Scribus can support many PDF 1.5 features in the 1.3.x development version. PDF 1.5 can also support more sophisticated compression options for images using JPEG 2000. </li>
-<li>PDF 1.6 = Acrobat 7.0 - Refinements of the 1.5 features and more extensive use of PKI and digital signing for document control, as well as, extended commenting for group collaboration. Where it concerns Scribus, nothing of importance, except the release of Adobe Reader 7.0 for Linux. </li>
-<li>PDF 1.7 = Acrobat 8.x - Added 3D capabilities</li>
+<li><b>PDF 1.0:</b> Acrobat 1.0 – obsolete now. Not supported by Scribus.</li>
+<li><b>PDF 1.1:</b> Acrobat 2.0 – obsolete now. Not supported by Scribus.</li>
+<li><b>PDF 1.2:</b> Acrobat 3.0 – obsolete now. Not supported by Scribus.</li>
+<li><b>PDF 1.3:</b> Acrobat 4.0 – The first version of PDF which truly had all the needed features to create “press-ready” files, including color management, ICC profiles etc. It also added JavaScript, interactive and multimedia capabilities. This standard is probably the safest to use if you are unsure of the capabilities of the receiver of your file. PDF/X-3 and a number of commercial print work flows are based on PDF 1.3.</li>
+<li><b>PDF 1.4:</b> Acrobat 5.0 – The main difference to concern Scribus users is both transparency and alpha transparency capabilites. This makes a major difference in where a PDF with these features can be printed. It takes either modern commercial RIPs or certain Level 3 PostScript printers to use these features properly. Moreover, not all Level 3 PostScript printers will handle transparency. The latest versions of Ghostscript support the advanced PDF 1.4 features Scribus can create when exporting PDF. <i>Note: Often, the only way you will be able to print the transparency features viewed on-screen is to export PDF 1.4 and print from Adobe Reader 5.x or later.</i></li>
+<li><b>PDF 1.5:</b> Acrobat 6.0 – Improvements to font handling, the capability to have true layering within the PDF, more security and interactive features, like the ability to add comments which are separate from the original document. Scribus 1.4 already supports many PDF 1.5 features. PDF 1.5 can support more sophisticated compression options for images using JPEG 2000 (not supported by Scribus yet). It also added initial support for embedding multimedia files.</li>
+<li><b>PDF 1.6:</b> Acrobat 7.0 – Refinements of the 1.5 features, more extensive use of the Public Key Infrastructre (PKIX) and digital signing for document control, as well as extended commenting for group collaboration. It also added initial support for embedding 3D objects. Where it concerns Scribus, nothing of importance, except the release of Adobe Reader 7.0 for Linux. </li>
+<li><b>PDF 1.7:</b> Acrobat 8.0 – Refinements and enhancements to 3D embedding, interactive and other features, mostly unrelated to Scribus and/or commercial printing.</li>
 </ul>
+
+<h3>What about other kinds of PDF, like PDF-X and PDF-A?</h3>
+<p>The PDF format’s feature set continues to grow with every version, but not every feature is acceptable in all use-cases. Thus, workgroups at the International Standardization Organization (ISO) defined subsets of the PDF feature set, among them PDF/A or PDF/X. The purpose of PDF/A is long-term storage and accessibility of documents, i.e. the content of PDF/A files needs to be read or extracted in years, decades, perhaps centuries to come. This is, of course, different from PDF files created for commercial printing, whose main purpose is to reliably store visually important data like colors and typgraphically refined text. Below you can see the PDF export dialog in LibreOffice, an application suite which produces all kinds of “office” documents that are not suited for commercial printing:</p>
+<table width="100%"><tr><td align="center"><img src="images/pdfx1a-lo.png" alt="PDF/X-1a Export in LibreOffice" title="PDF/X-1a Export in LibreOffice" /></a></td></tr></table>
+<p>While there are some similarities in terms of features, there are also major differences, especially in the “General” tab. As you can see, the first option here is “PDF/A-1a,” an option that’s not available in Scribus, because creating documents for long-term storage is none of its major purposes (yet). You can also see that selecting “PDF/A-1a” enables or disables other features automatically (“Tagged PDF” and “Embed standard fonts” enabled, “Create PDF form” disabled). Similarly, Scribus will enable/disable some export features when you choose <a href="pdfx3.html">PDF/X-3</a> as output destination.</p>
+<p>In addition to PDF/A and PDF/X, several other PDF subsets are being developed as international standards, for instance PDF/E for engineering documents (including the embedding of 3D objects) or PDF/UA (= universal access) for visually impaired users. See the website of <a href="http://www.aiim.org/">the Association for Information and Image Management, International</a> for more information.</p>
+
+<h3>Which PDF Version Will Work Best for You?</h3>
+
 <p>In deciding which version you choose for export, you need to consider the following: </p>
 <ul>
-<li><strong>Where am I ultimately printing ?</strong> - If you are planning to have your files printed commercially, always try to ask the printer first.</li>
-<li><strong>Does my document have transparency features ?</strong> - See above and ensure the rest of your equipment or workflow can support PDF 1.4. </li>
-<li><strong>I am exporting PDF forms. How do I know end receivers of my file can use it ?</strong> - Do you know the version of Acro Reader your users will have ? The safest is to use PDF 1.3 or 1.4.</li>
-<li><strong>Do I need layers ?</strong> - Only PDF 1.5 supports this and only in the 1.3.x version of Scribus. Be aware support for PDF 1.5 is not complete in most open source viewers. Ghostscript 8.5x does support some, but not all PDF 1.5 features. </li>
+<li><i>Where will you be ultimately printing?</i> If you are planning to have your files printed commercially, always try to ask the printer first.</li>
+<li><i>Does my document have transparency features?</i> See above and ensure the rest of your equipment or workflow can support PDF 1.4+. </li>
+<li><i>I am exporting PDF forms. How do I know whether receivers of my file can use it?</i> Do you know the version of Adobe Reader your users have? The safest is to use PDF 1.3 or 1.4.</li>
+<li><i>Do I need layers?</i> Only PDF 1.5+ supports this feature. Be aware that support for PDF layers is not complete in most Open Source PDF viewers.</li>
 </ul>
 <p></p>
-<h4>What about other kinds of PDF I have read about, like PDF-X and PDF-A ?</h4>
-<p>PDF marked as any of the following: PDF/X-1:2001, X-1a:2001 and 2003; X-2:2003; X-3:2002 and 2003 are all different flavors of PDF-X, which is a way of creating a PDF with certain criteria for pre-press. Scribus supports the latest PDF-X-2:2003. Support for other versions of PDF/X is planned. </p>
-<p>PDF-A is an ISO standard based on PDF 1.4 for long term storage of public documents in an open format.</p>
+
 </qt>

Modified: branches/ScribusOIF/doc/en/pdfx3.html
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/doc/en/pdfx3.html
==============================================================================
--- branches/ScribusOIF/doc/en/pdfx3.html (original)
+++ branches/ScribusOIF/doc/en/pdfx3.html Sat Oct  8 20:25:29 2011
@@ -1,52 +1,53 @@
 <html>
 <head>
 	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-	<title>Scribus PDF/X-3 Overview</title>
+	<title>PDF/X-3</title>
 </head>
 <body>
-<h2>Scribus PDF/X-3 Overview</h2>
-<p>Support for PDF/X-3 was a major milestone in the development of Scribus. Scribus was the first page layout application to support a demanding, but open ISO standard: ISO 15930-3:2002. This type of support for high quality PDF creation had been exclusively the realm of expensive proprietary applications. Creating commercial press ready PDFs has historically been fraught with errors, especially for users unfamiliar with the nuances of PostScript, PDF distilling and varying capabilities of plate-setters or digital presses. The saying "It is hard to create a good PDF, but really easy to mess up", has a great deal of truth. The more common usage of the Adobe Acrobat Distiller family of applications for PDF creation has typically needed knowledge of at least some of the close to 100 Distiller parameters.</p>
-<p>In European countries the concept of PDF/X has been more widely accepted earlier than in North America. Much of the push for these standards has come primarily from Germany and German pre-press companies, a worldwide leader in press and high end digital imaging technology.</p>
-<p>The creation of PDF/X, currently with 3 defined ISO standards, is in part, an attempt to provide end users and creators with a vendor neutral measuring stick to vet files as suitable for professional printing or exchange with service bureaus. Scribus now has easy to understand and use options which enable end users to create 100% PDF/X-3 compliant files. By judicious use of PDF options, end users can be assured their files, if they require, to be 100% standards compliant. As always, be certain any PDFs you create can be used in the work-flow of your printer's equipment or pre-press service bureau. Not all are equipped to handle the latest in PDF technology. For example, the latest Prinergy and Harlequin image-setting work-flows are capable of supporting PDF/X-3 even with all RGB images. However, the print provider's work flow also must be able to handle this. Always consult with the commercial printer you are working with early into your production work. This almost always good advice when working with commercial printers. This avoids trouble and makes for a much less stressful situation when deadlines approach.  </p>
+<h2>PDF/X-3</h2>
+<p>Support for PDF/X-3 was a major milestone in the development of Scribus. It was the first page layout application to support this demanding, but open ISO standard (ISO 15930-3:2002).</p>
+<p>Creating commercial “press-ready” PDFs has historically been fraught with errors, especially for users unfamiliar with the nuances of PostScript, PDF distilling and varying capabilities of plate-setters or digital presses. The saying “It is hard to create a good PDF, but really easy to mess up” has a great deal of truth. The more common usage of the Adobe Acrobat Distiller family of applications for PDF creation has typically required knowledge of at least some of the close to 100 Distiller parameters.</p>
+<p>In European countries, the concept of PDF/X has been more widely and earlier adopted than in North America. Much of the push for these standards has come primarily from German and Swiss companies, many of which are worldwide leaders in press and high-end digital imaging technology.</p>
+<p>The creation of PDF/X is, in part, an attempt to provide end users and creators with a vendor-neutral measuring stick to vet files as suitable for professional printing or exchange with service bureaus. Essentially, PDF/X files are files that on the one hand only permit a certain subset of PDF features, and on the other hand make the enabling of others mandatory.</p>
+<p>Scribus provides easily accessible options that enable end users to create 100 % X-3-compliant PDF files. By judicious use of PDF options, end users can be assured that their files will be 100 % standards compliant.</p>
+<p>Before you export a PDF/X-3, make sure the file(s) you create can be used in the workflow of your printer or service bureau. Not all are equipped to handle PDF/X technology.</p>
 
-<h3>Quick Start to Creating a PDF/X-3 Conformant PDF</h3>
-<ol>
-	<li>Make sure color management is installed and working properly. You need at least one CMYK ICC printer profile installed. </li>
-	<li>Then in <strong>Edit > Preferences >Color Management</strong> make sure color management is enabled and your preferred defaults for color profiles are chosen. Ideally, the color print profile matches either and ISO printing condition or is a custom profile from your print provider.</li>
-	<li>Select <strong>File > Export...> Save as PDF..</strong> or select the PDF icon from the tool bar.</li>
-</ol>
-<p>This panel will open first and select <strong>PDF/X-3</strong> in the compatibility drop down box  as shown below. This will change the default settings, as needed, automatically. You might notice that certain options will be greyed out. More about this below. </p>
+<h3>When Should I Use PDF/X-3?</h3>
+<p>When you require <strong>very</strong> precise color reproduction <strong>and</strong> your printer will accept (or insist on) PDF/X-3 files. Without support from your printer, you are likely to have adverse color changes compared to more traditional PDF export.</p>
+
+<h3>PDF/X-3 and Color Management</h3>
+<p>The principal benefit of PDF/X-3 is the typically more accurate color conversion from RGB to a printer’s CMYK output. The accuracy comes from working in RGB colors until very late in the printing process when the printer’s own RIP does the RGB > CMYK conversion <b>and</b> by mandatory use of color profiles. Since the RIP engine has detailed knowledge of the exact color range, it is thought to offer, in most cases, an accurate conversion. PDF/X-3 does not preclude using CMYK images, but is ideal for maintaining your colors in RGB as long as possible in the process.</p>
+<p>One question is which printer profile one should use. There are two strategies: The first is to have an actual ICC profile from your printing company for the matching paper type. The second is to use a well-known printing standard as SWOP, ECI or others. Using PDF/X-3 requires cooperation with your printer, but can really improve your print color matching. As always, a short visit to your printer <strong>in advance</strong> is strongly recommended. If answers are not forthcoming, try another one. Printing is a competitive business, and alternatives almost always can be found.</p>
+
+<h3>Quickstart Guide to Creating a PDF/X-3</h3>
+<p>In the <a href="settings1.html">Document Setup</a> make sure color management is enabled and the correct color profiles are chosen. Ideally, the color print profile matches either a standarized ISO printing condition or is a custom profile from your print provider. Without color management, you won’t be able to export to PDF/X-3. Then select <i>File > Export …> Save as PDF …</i> or click the PDF icon from the toolbar.</p>
+<p>This panel will open first, and you have to select “PDF/X-3” from the “Compatibility” drop-down list as shown below. This will change the default settings, as needed, automatically. </p>
 <table width="100%"><tr><td align="center"><img src="images/pdfx3-1.png" alt="PDF Create Dialog General Tab" /></td></tr></table>
-<p>Next, select the <strong>Color</strong> tab, as shown below:</p>
+<p>Next, select the “Color” tab, as shown below:</p>
 <table width="100%"><tr><td align="center"><img src="images/pdfxcolor.png" alt="PDF Create Dialog Color Tab" /></td></tr></table>
-<p>Here is where you select color profile choices to embed in the PDF. By not selecting or embedding an ICC profile for solid colors, CMYK is automatically assigned as the color space.</p>
-<p>Next, select the <strong>Pre-Press</strong> tab, as shown below:</p>
+<p>Note that in the “Color” tab the general output target is greyed out. This is because in a PDF/X-3 workflow color space conversion to the printing device is supposed to happen as late as possible, which means it will be the printer who will do the final conversion, not you.</p>
+<p>Next, select the “Pre-Press” tab, as shown below:</p>
 <table width="100%"><tr><td align="center"><img src="images/pdfxintent.png" alt="PDF Create Dialog 
 PDF/X-3 Tab" /></td></tr></table>
-<p>This is where you can adjust the  PDF trim box which is a setting which defines the actual paper size in the PDF. This is a setting which defines how much space to add to the physical page for bleeds. <a href="http://www.prepressure.com/pdf/basics/page_boxes">PDF "Boxes" defined</a>  This is also where you  embed in the PDF the intended press condition, which is defined by the ICC printing profile. This is probably the most important choice in terms of color profiles, as it affects color throughout the whole document. You can also put in a short note about the document, which is useful later on. <strong>This cannot be left blank - as PDF/X-3 requires it. Scribus thus disables the Save button.</strong><p>
-<p>Note: Because of the exacting standards of PDF/X-3, some PDF features are disabled including encryption, presentation effects and all fonts are automatically embedded. Likewise, annotations and transparency is disabled. You should carefully follow the advice given in <a href="pdfexport1.html">PDF Export Options</a> for file preparation and choice of image formats.</p>
+<p>This is where you  embed in the PDF the intended press condition, which is defined by the ICC color profile. It’s probably the most important choice in terms of color profiles, as it affects color throughout the whole workflow. You can also put in a short note about the document, which can be useful later on. <strong>This field cannot be left blank – as the PDF/X-3 specification requires it. Scribus will disable the “Save” button if the field is empty.</strong> You can also add other pre-press features like color bars or printing marks, but you should only do so if your printing company asks for them.<p>
+<p>Note: Because of the strict requirements of PDF/X-3, some PDF features are disabled, including encryption and presentation effects; all fonts are automatically embedded or subset. Likewise, annotations and transparency won’t be exported.</p>
 
-<h3>How has Scribus been able to do this?</h3>
+
+
+<h3>What are the Differences Between PDF-X Versions?</h3>
 <ul>
-	<li>By carefully refining the code both PDF exporting and color management for maximum quality output, Scribus created PDFs can be used with confidence for output to service bureaus that can use a PDF work-flow. Many magazines, newspapers and other publications now prefer PDF/X for advertiser created files. See the notes in <a href="prepress.html">Scribus and Pre-Press Considerations</a>.</li>
-	<li>Credit must be given to Marti Maria for creating and actively maintaining <strong>little cms</strong> which is the color management system which Scribus uses. littlecms is not an end user application per se, but gives Scribus the color management tools, which were previously only available in proprietary systems.</li>
+<li><b>PDF/X-1a</b> requires the following: The color space to be CMYK/greyscale, all the fonts are embedded, and the settings within PDF indicate whether it is either pre-trapped or not. Think of this as a blind hand-off, as there is no certainty of how it will output. PDF/X-1a is widely used in North America. Support for PDF/X-1a will be added in future Scribus versions and is already in testing.</li>
+<li><b>PDF/X-2</b> is a looser standard – but with the requirement for more knowledge between the supplier and receiver of the file. Fonts are not required to be embedded, and it is possible to use OPI (Open Pre-Press Interface). PDF/X-2 also allows device-independent color spaces, like CIE L*a*b*, to be used. PDF/X-2 is rarely supported by any commercial printer.</li>
+<li><b>PDF/X-3</b> is based on PDF 1.3 and requires ICC color profiles to be resident in the PDF. This allows for RGB colors to be used in the PDF, as these will be converted to CMYK using ICC profiles as late as possible in the printing process.</li>
+<li><b>PDF/X-4</b> is based on PDF 1.4 and allows for using a major PDF 1.4 feature – transparency – in a PDF/X file. PDF/X versions prior to X-4 do not support transparency. Support for PDF/X-4 will be added in future Scribus versions and is already in testing.</li>
+<li><b>PDF/X-5</b> is based on PDF 1.5 and enables the use of PDF layers in PDF/X files. Support for PDF/X-5 will be added in future Scribus versions.</li>
 </ul>
 
-<h3>When should I use PDF/X-3?</h3>
-<p>When you require <strong>very</strong> precise color reproduction <strong>and</strong> your printer can accept PDF/X-3 files. Without support from your printer, you are likely to have adverse color changes compared to more traditional PDF export.</p>
-
-<h3>Do I really need color management?</h3>
-<p>Yes, the design of PDF/X-3 is intended to provide a fully color managed PDF work-flow, without detailed knowledge of actual printing technologies.</p>
-
-<h3>What are the differences between PDF-X versions?</h3>
-<p>In brief, <strong>PDF/X-1a</strong> requires the following: The color space to be CMYK/greyscale, all the fonts are embedded and the settings within PDF indicate whether it is either pre-trapped = true or not-trapped = false. Think of this as a blind hand-off, as there is no certainty of how it will output.</p>
-<p><strong>PDF/X-2</strong> is a looser standard - but with the requirement for more knowledge between the supplier and receiver of the file. Fonts are not required to be embedded and it is possible to use OPI (Open Press Initiative). PDF/X-2 also allows device independent color spaces, like CieL*a*b*, to be used.</p>
-<p><strong>PDF/X-3</strong> allows for color profiles to be resident in the PDF, as well as different output intents and 'DeviceN' (spot color) color space - now supported in the any version of Ghostscript 8.0+. This also allows overprinting colors.</p>
-
-<h3>How do I test and really certify Scribus PDF files are truly PDF/X-3 compliant?</h3>
+<h3>How Do I Test and Certify that Scribus PDF Files are Truly PDF/X-3 Compliant?</h3>
 <ol>
-	<li><a href="http://callas.de/en/">Callas Software</a> has provided a free of charge PDF Inspektor plug-in for Adobe Acrobat. This plug-in, checks the PDF and produces a detailed report on every fact of the PDF file, including meta informations on the file and a detailed listing of images and other PDF objects.</li>
-	<li>Some specialist PDF software including Enfocus Pit Stop Pro and the full version of PDF Inspektor can perform detailed pre-flight checks on PDF. Acrobat 6 Professional can also verify and pre-flight PDF/X-3 files.</li>
+<li><a href="http://callas.de/en/">Callas Software</a> has provided a free of charge PDF Inspektor plug-in for Adobe Acrobat. This plug-in checks the PDF and produces a detailed report on every fact of the PDF file, including meta informations on the file and a detailed listing of images and other PDF objects.</li>
+<li>Some specialist PDF software including Enfocus PitStop Pro and the full version of PDF Inspektor can perform detailed pre-flight checks on PDF. Acrobat Professional can also verify and pre-flight PDF/X files.</li>
+<li>Another option is the <a href="m www.altonatestsuite.com">Altona Suite</a>.</li>
 </ol>
 
 <h3>PDF/X Links:</h3>
@@ -54,5 +55,6 @@
 <p><a href="http://www.ddap.org/resource_center/article_index.php">http://www.ddap.org/resource_center/article_index.php</a></p>
 <p><a href="http://www.ipa.org/PDFS/pdfxguide.zip">http://www.ipa.org/PDFS/pdfxguide.zip</a></p>
 <p><a href="http://www.pdf-x.com/downloads/pdf/application_notes_pdfx3.pdf">http://www.pdf-x.com/downloads/pdf/application_notes_pdfx3.pdf</a></p>
+<p><a href=" www.pdfx-ready.ch"> www.pdfx-ready.ch</a></p>
 </body>
 </html>

Modified: branches/ScribusOIF/doc/en/toolbox2.html
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/doc/en/toolbox2.html
==============================================================================
--- branches/ScribusOIF/doc/en/toolbox2.html (original)
+++ branches/ScribusOIF/doc/en/toolbox2.html Sat Oct  8 20:25:29 2011
@@ -21,6 +21,8 @@
 <li><a href="http://www.pdfsam.org">PDF Split and Merge (PDF SaM)</a> is an even more powerful tool than jPDF Tweak and has a proven track record in pre-press environments. PDF SaM is rather a tool for professionals, whereas beginners will probably be overwhelmed by its many options. Like jPDF Tweak, PDF SaM is a Java program, but in contrast to all other Java programs in this list, the language of the graphical user interface can be changed. and there are many translations available.</li>
 <li><a href="http://www.quantumelephant.co.uk/bookbinder/bookbinder.html">Bookbinder</a> is a PDF editor for beginners and simple tasks. Its main purpose is to re-order (and re-scale, if necessary) pages in a PDF file for booklet printing and similar tasks. Bookbinder is also written in Java.</li><br>
 <table width="100%"><tr><td align="center"><img src="images/tb-bookbinder.png" alt="Bookbinder" title="Bookbinder" /></td></tr></table>
+<li>If you want to edit a PDF that comprises artwork, you can use <a href="toolbox4.html">GIMP</a>, <a href="toolbox15.html">Krita</a>, <a href="toolbox9.html">Inkscape</a> or <a href="toolbox18.html">Libre Office Draw</a>, depending on the content, as all of them can import PDFs and will let you edit the files.</li>
+<table width="100%"><tr><td align="center"><img src="images/tb-pdf-imp.png" alt="PDF import in Inkscape" title="PDF import in Inkscape" /></td></tr><tr><td><div align="center"><i>PDF import in Inkscape</i></div></td></tr></table>
 </ul>
 </body>
 </html>

Modified: branches/ScribusOIF/scribus/CMakeLists.txt
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/CMakeLists.txt
==============================================================================
--- branches/ScribusOIF/scribus/CMakeLists.txt (original)
+++ branches/ScribusOIF/scribus/CMakeLists.txt Sat Oct  8 20:25:29 2011
@@ -502,6 +502,7 @@
   canvasmode_editarc.cpp
   canvasmode_editgradient.cpp
   canvasmode_editmeshgradient.cpp
+  canvasmode_editmeshpatch.cpp
   canvasmode_editpolygon.cpp
   canvasmode_editspiral.cpp
   canvasmode_edittable.cpp

Modified: branches/ScribusOIF/scribus/canvas.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/canvas.cpp
==============================================================================
--- branches/ScribusOIF/scribus/canvas.cpp (original)
+++ branches/ScribusOIF/scribus/canvas.cpp Sat Oct  8 20:25:29 2011
@@ -274,6 +274,13 @@
 	int radius = m_doc->guidesPrefs().grabRadius;
 	return qAbs(localPoint1.x() - localPoint2.x()) < radius
 		&& qAbs(localPoint1.y() - localPoint2.y()) < radius;
+}
+
+bool Canvas::hitsCanvasPoint(FPoint globalPoint, QPointF canvasPoint) const
+{
+	double radius = m_doc->guidesPrefs().grabRadius;
+	return qAbs(globalPoint.x() - canvasPoint.x()) < radius
+		&& qAbs(globalPoint.y() - canvasPoint.y()) < radius;
 }
 
 QRect Canvas::exposedRect() const

Modified: branches/ScribusOIF/scribus/canvas.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/canvas.h
==============================================================================
--- branches/ScribusOIF/scribus/canvas.h (original)
+++ branches/ScribusOIF/scribus/canvas.h Sat Oct  8 20:25:29 2011
@@ -93,6 +93,7 @@
 	friend class CanvasMode_EditArc;
 	friend class CanvasMode_EditGradient;
 	friend class CanvasMode_EditMeshGradient;
+	friend class CanvasMode_EditMeshPatch;
 	friend class CanvasMode_EditPolygon;
 	friend class CanvasMode_EditSpiral;
 	friend class CanvasMode_EditTable;
@@ -160,6 +161,7 @@
 //	QRectF globalToCanvas(QRectF p) const;
 	bool hitsCanvasPoint(QPoint globalPoint, FPoint canvasPoint) const;
 	bool hitsCanvasPoint(QPoint globalPoint, QPointF canvasPoint) const;
+	bool hitsCanvasPoint(FPoint globalPoint, QPointF canvasPoint) const;
 	QRect exposedRect() const;
 	bool cursorOverTextFrameControl(QPoint globalPos, PageItem* frame);
 	/** Returns the framehandle or INSIDE if the position falls into the frame. */

Modified: branches/ScribusOIF/scribus/canvasmode.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/canvasmode.cpp
==============================================================================
--- branches/ScribusOIF/scribus/canvasmode.cpp (original)
+++ branches/ScribusOIF/scribus/canvasmode.cpp Sat Oct  8 20:25:29 2011
@@ -1,1469 +1,1474 @@
-/*
- For general Scribus (>=1.3.2) copyright and licensing information please refer
- to the COPYING file provided with the program. Following this notice may exist
- a copyright and/or license notice that predates the release of Scribus 1.3.2
- for which a new license (GPL+exception) is in place.
- */
-/***************************************************************************
-*                                                                         *
-*   This program is free software; you can redistribute it and/or modify  *
-*   it under the terms of the GNU General Public License as published by  *
-*   the Free Software Foundation; either version 2 of the License, or     *
-*   (at your option) any later version.                                   *
-*                                                                         *
-***************************************************************************/
-
-
-#include "canvasmode.h"
-
-#include "canvas.h"
-#include "canvasgesture_pan.h"
-#include "canvasmode_copyproperties.h"
-#include "canvasmode_create.h"
-#include "canvasmode_drawbezier.h"
-#include "canvasmode_drawfreehand.h"
-#include "canvasmode_drawcalligraphic.h"
-#include "canvasmode_edit.h"
-#include "canvasmode_editarc.h"
-#include "canvasmode_editgradient.h"
-#include "canvasmode_editmeshgradient.h"
-#include "canvasmode_editpolygon.h"
-#include "canvasmode_editspiral.h"
-#include "canvasmode_edittable.h"
-#include "canvasmode_eyedropper.h"
-#include "canvasmode_framelinks.h"
-#include "canvasmode_magnifier.h"
-#include "canvasmode_measurements.h"
-#include "canvasmode_nodeedit.h"
-#include "canvasmode_normal.h"
-#include "canvasmode_objimport.h"
-#include "canvasmode_panning.h"
-#include "canvasmode_rotate.h"
-#ifdef GESTURE_FRAME_PREVIEW
-#include "pageitempreview.h"
-#endif
-#include "pageitem_group.h"
-#include "pageitem_textframe.h"
-#include "prefsmanager.h"
-#include "selection.h"
-#include "sccolorengine.h"
-#include "scpainter.h"
-#include "scraction.h"
-#include "scribus.h"
-#include "scribusdoc.h"
-#include "scribusview.h"
-#include "ui/checkDocument.h"
-#include "ui/contextmenu.h"
-#include "ui/outlinepalette.h"
-#include "ui/pageselector.h"
-#include "ui/scrapbookpalette.h"
-#include "ui/scrspinbox.h"
-#include "ui/scresizecursor.h"
-#include "undomanager.h"
-#include "units.h"
-#include "util_icon.h"
-
-#include <QMdiArea>
-#include <QMdiSubWindow>
-#include <QPainter>
-#include <QPointF>
-
-CanvasMode::CanvasMode (ScribusView* view) :
-	QObject(),
-	m_view(view),
-	m_canvas(view->m_canvas),
-	m_doc(view->Doc),
-	m_panGesture(NULL)
-{
-	m_pen["outline"]	= QPen(Qt::gray, 1.0 , Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
-	m_pen["outline"].setCosmetic(true);
-	m_pen["selection"]	= QPen(Qt::red, 1.0, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
-	m_pen["selection"].setCosmetic(true);
-	m_pen["selection-group"] = QPen(Qt::red, 1.0 , Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
-	m_pen["selection-group"].setCosmetic(true);
-	m_pen["selection-group-inside"] = QPen(Qt::red, 1.0 , Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
-	m_pen["selection-group-inside"].setCosmetic(true);
-	m_pen["handle"]		= QPen(Qt::red, 1.0, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
-	m_pen["handle"].setCosmetic(true);
-	
-	m_brush["outline"]	= Qt::NoBrush;
-	m_brush["selection"]	= Qt::NoBrush;
-	m_brush["selection-group"] = QColor(255,0,0,10);
-	m_brush["selection-group-inside"] = Qt::NoBrush;
-	m_brush["handle"]	= Qt::red;
-
-	m_keyRepeat = false;
-	m_arrowKeyDown = false;
-}
-
-CanvasMode::~CanvasMode()
-{
-	if (m_panGesture)
-		delete m_panGesture;
-}
-
-CanvasMode* CanvasMode::createForAppMode(ScribusView* view, int appMode)
-{
-	CanvasMode* result;
-	
-	switch (appMode)
-	{
-		case modeNormal:
-		case modeStoryEditor:
-			result = new CanvasMode_Normal(view);
-			break;
-		case modeCopyProperties:
-			result = new CanvasMode_CopyProperties(view);
-			break;
-		case modeEdit:
-			result = new CanvasMode_Edit(view);
-			break;
-		case modeEditClip:
-			result = new CanvasMode_NodeEdit(view);
-			break;
-		case modeEditGradientVectors:
-			result = new CanvasMode_EditGradient(view);
-			break;
-		case modeEditMeshGradient:
-			result = new CanvasMode_EditMeshGradient(view);
-			break;
-		case modeDrawBezierLine:
-			result = new BezierMode(view);
-			break;
-		case modeDrawFreehandLine:
-			result = new FreehandMode(view);
-			break;
-		case modeDrawCalligraphicLine:
-			result = new CalligraphicMode(view);
-			break;
-		case modeDrawLine:
-		case modeDrawShapes:
-		case modeDrawImage:
-		case modeDrawLatex:
-		case modeDrawText:
-		case modeDrawTable:
-		case modeDrawTable2:
-		case modeDrawRegularPolygon:
-		case modeDrawArc:
-		case modeDrawSpiral:
-		case modeInsertPDFButton:
-		case modeInsertPDFTextfield:
-		case modeInsertPDFCheckbox:
-		case modeInsertPDFCombobox:
-		case modeInsertPDFListbox:
-		case modeInsertPDFTextAnnotation:
-		case modeInsertPDFLinkAnnotation:
-		case modeInsertPDF3DAnnotation:
-			result = new CreateMode(view);
-			break;
-		case modeEyeDropper:
-			result = new CanvasMode_EyeDropper(view);
-			break;
-		case modeImportObject:
-			result = new CanvasMode_ObjImport(view);
-			break;
-		case modeLinkFrames:
-		case modeUnlinkFrames:
-			result = new CanvasMode_FrameLinks(view);
-			break;
-		case modeMagnifier:
-			result = new CanvasMode_Magnifier(view);
-			break;
-		case modeMeasurementTool:
-			result = new MeasurementsMode(view);
-			break;
-		case modePanning:
-			result = new CanvasMode_Panning(view);
-			break;
-		case modeRotation:
-			result = new CanvasMode_Rotate(view);
-			break;
-		case modeEditArc:
-			result = new CanvasMode_EditArc(view);
-			break;
-		case modeEditPolygon:
-			result = new CanvasMode_EditPolygon(view);
-			break;
-		case modeEditSpiral:
-			result = new CanvasMode_EditSpiral(view);
-			break;
-		case modeEditTable:
-			result = new CanvasMode_EditTable(view);
-			break;
-			// more modes as they are defined...
-			
-		default:
-			result = new CanvasMode_Normal(view);
-			break;
-	}
-	return result;
-}
-
-
-void CanvasMode::updateViewMode(CanvasViewMode* viewmode) 
-{
-	viewmode->drawSelectedItemsWithControls = false;
-	viewmode->drawFramelinksWithContents = false;	
-}
-
-
-void CanvasMode::drawSelection(QPainter* psx, bool drawHandles)
-{
-//	QTime t;
-//	t.start();
-//	QTime tt;
-//	int tg(0);
-//	QStringList tu;
-	QString ds;
-	psx->scale(m_canvas->scale(), m_canvas->scale());
-	psx->translate(-m_doc->minCanvasCoordinate.x(), -m_doc->minCanvasCoordinate.y());
-	
-	psx->setClipping(true);
-	psx->setClipRegion(QRegion ( m_canvas->exposedRect() ) );
-	if (m_doc->m_Selection->isMultipleSelection())
-	{
-		PageItem *curItem(0);
-		for(int a=0; a<m_doc->m_Selection->count(); ++a)
-		{
-			curItem = m_doc->m_Selection->itemAt(a);
-			
-			if(drawHandles)
-				drawHandles = !curItem->locked();
-		}
-		
-		psx->save();
-		psx->setPen(m_pen["selection-group"]);
-		psx->setBrush(m_brush["selection-group"]);
-		double lineAdjust(psx->pen().width()/m_canvas->scale());
-		double x, y, w, h;
-		m_doc->m_Selection->setGroupRect();
-		m_doc->m_Selection->getVisualGroupRect(&x, &y, &w, &h);
-		const double markWidth = 4 / m_canvas->scale();
-		const double halfMarkWidth = 2 / m_canvas->scale();
-		
-		psx->translate(x,y);
-		x = -lineAdjust;
-		y = -lineAdjust;
-
-//		tt.start();
-		psx->drawRect(QRectF(x, y, w, h));
-		if(drawHandles)
-		{
-			psx->setBrush(m_brush["handle"]);
-			psx->setPen(m_pen["handle"]);
-			psx->drawRect(QRectF(x+w-markWidth, y+h-markWidth, markWidth, markWidth));
-			psx->drawRect(QRectF(x+w/2 - halfMarkWidth, y+h-markWidth, markWidth, markWidth));
-			psx->drawRect(QRectF(x+w/2 - halfMarkWidth, y, markWidth, markWidth));
-			psx->drawRect(QRectF(x+w-markWidth, y+h/2 - halfMarkWidth, markWidth, markWidth));
-			psx->drawRect(QRectF(x+w-markWidth, y, markWidth, markWidth));
-			psx->drawRect(QRectF(x, y, markWidth, markWidth));
-			psx->drawRect(QRectF(x, y+h/2 - halfMarkWidth, markWidth, markWidth));
-			psx->drawRect(QRectF(x, y+h-markWidth, markWidth, markWidth));
-		}
-//		tg=tt.elapsed();
-		psx->restore();
-
-		// items inside a a multi
-		if (m_doc->m_Selection->count() > 1)
-		{
-			uint docSelectionCount = m_doc->m_Selection->count();
-			PageItem *currItem;
-			for (uint a=0; a<docSelectionCount; ++a)
-			{
-				currItem = m_doc->m_Selection->itemAt(a);
-				if (!m_doc->Items->contains(currItem))
-					continue;
-				psx->save();
-				psx->setPen(m_pen["selection-group-inside"]);
-				psx->setBrush(m_brush["selection-group-inside"]);
-				double lineAdjust(psx->pen().width()/m_canvas->scale());
-				double x, y, w, h;
-				w = currItem->visualWidth() ;
-				h = currItem->visualHeight() ;
-				if (currItem->rotation() != 0)
-				{
-					psx->setRenderHint(QPainter::Antialiasing);
-					psx->translate(currItem->xPos(), currItem->yPos());
-					psx->rotate(currItem->rotation());
-					x = currItem->asLine() ? 0 : (currItem->visualXPos() - currItem->xPos() - lineAdjust);
-					y = currItem->asLine() ? (h / -2.0) : (currItem->visualYPos() - currItem->yPos() - lineAdjust);
-				}
-				else
-				{
-					psx->translate(currItem->visualXPos(), currItem->visualYPos());
-					x = currItem->asLine() ? 0 : -lineAdjust;
-					y = currItem->asLine() ? 0 : -lineAdjust;
-				}
-
-				psx->drawRect(QRectF(x, y, w, h));
-
-				psx->restore();
-			}
-		}
-	}
-	else if (m_doc->m_Selection->count() != 0)
-	{
-// 		ds = "S" + QString::number(m_doc->m_Selection->count())+" ";
-		const double markWidth = 4 / m_canvas->scale();
-		const double halfMarkWidth = 2 / m_canvas->scale();
-
-		uint docSelectionCount = m_doc->m_Selection->count();
-		PageItem *currItem;
-		
-		// FIXME when more than 1 item is selected, first Rect is drew normally (<10ms here)
-		// but followings are damn long - pm 
-		for (uint a=0; a<docSelectionCount; ++a)
-		{
-			currItem = m_doc->m_Selection->itemAt(a);
-// 			qDebug()<<"It"<<currItem->xPos()<< currItem->yPos();
-			
-			psx->save();
-			psx->setPen(m_pen["selection"]);
-			psx->setBrush(m_brush["selection"]);
-			double lineAdjust(psx->pen().width()/m_canvas->scale());
-			double x, y, w, h;
-			w = currItem->visualWidth();
-			h = currItem->visualHeight();
-			if (currItem->rotation() != 0)
-			{
-				psx->setRenderHint(QPainter::Antialiasing);
-				psx->translate(currItem->xPos(), currItem->yPos());
-				psx->rotate(currItem->rotation());
-				x = currItem->asLine() ? 0 : (currItem->visualXPos() - currItem->xPos() - lineAdjust);
-				y = currItem->asLine() ? (h / -2.0) : (currItem->visualYPos() - currItem->yPos() - lineAdjust);
-			}
-			else
-			{
-				psx->translate(currItem->visualXPos(), currItem->visualYPos());
-				x = currItem->asLine() ? 0 : -lineAdjust;
-				y = currItem->asLine() ? 0 : -lineAdjust;
-			}
-			
-//			tt.start();
-			psx->drawRect(QRectF(x, y, w, h));
-//			tu << QString::number(tt.elapsed());
-			if(drawHandles && !currItem->locked())
-			{
-				psx->setBrush(m_brush["handle"]);
-				psx->setPen(m_pen["handle"]);
-				if(currItem->asLine())
-				{
-					psx->setRenderHint(QPainter::Antialiasing);
-					psx->drawEllipse(QRectF(x+w-markWidth, y+h/2.0-markWidth, 2* markWidth,2* markWidth));
-// 					psx->setBrush(Qt::blue); // sometimes we forget which is what :)
-					psx->drawEllipse(QRectF(x-markWidth, y+h/2.0-markWidth, 2* markWidth, 2* markWidth));
-				}
-				else
-				{
-					psx->drawRect(QRectF(x+w-markWidth, y+h-markWidth, markWidth, markWidth));
-					psx->drawRect(QRectF(x+w/2 - halfMarkWidth, y+h-markWidth, markWidth, markWidth));
-					psx->drawRect(QRectF(x+w/2 - halfMarkWidth, y, markWidth, markWidth));
-					psx->drawRect(QRectF(x+w-markWidth, y+h/2 - halfMarkWidth, markWidth, markWidth));
-					psx->drawRect(QRectF(x+w-markWidth, y, markWidth, markWidth));
-					psx->drawRect(QRectF(x, y, markWidth, markWidth));
-					psx->drawRect(QRectF(x, y+h/2 - halfMarkWidth, markWidth, markWidth));
-					psx->drawRect(QRectF(x, y+h-markWidth, markWidth, markWidth));
-				}
-			}
-			
-			psx->restore();
-		}
-		
-	}
-	
-
-// 	qDebug()<<ds<< t.elapsed() <<"U"<<tu.join(",")<<"G"<<tg;
-}
-
-
-void CanvasMode::drawOutline(QPainter* p, double scalex, double scaley, double deltax, double deltay)
-{
-	p->save();
-	p->scale(m_canvas->scale(), m_canvas->scale());
-	p->translate(-m_doc->minCanvasCoordinate.x(), -m_doc->minCanvasCoordinate.y());
-	
-			
-	if (m_doc->m_Selection->count() == 1)
-	{
-		PageItem *currItem = m_doc->m_Selection->itemAt(0);
-				
-		if((scalex != 1.0) || (scaley != 1.0)) // changing size of page item
-		{
-			p->setBrush(m_brush["outline"]);
-			p->setPen(m_pen["outline"]);
-			p->translate(currItem->xPos(), currItem->yPos());
-			p->translate(deltax, deltay);
-			if (currItem->rotation() != 0)
-			{
-				p->setRenderHint(QPainter::Antialiasing);
-				p->rotate(currItem->rotation());
-			}
-			p->scale(scalex, scaley);
-			currItem->DrawPolyL(p, currItem->Clip);
-		}
-		else // moving page item
-		{
-			QRectF br(currItem->getVisualBoundingRect());
-#ifdef GESTURE_FRAME_PREVIEW
-			QImage *pixItem(0);
-			if( m_pixmapCache.contains(currItem) )
-			{
-				if( m_pixmapCache.value(currItem)->isReady() )
-					pixItem = m_pixmapCache.value(currItem)->getImage();
-			}
-			else
-			{
-				m_pixmapCache[currItem] = new PageItemPreview(currItem);
-			}
-
-			if(pixItem)
-			{
-				p->save();
-				p->translate(br.x(),br.y());
-				p->translate(deltax, deltay);
-				p->drawImage( br.toRect(), *pixItem, pixItem->rect() );
-				p->restore();
-			}
-#endif // GESTURE_FRAME_PREVIEW
-			{
-//				QRect vr(m_canvas->exposedRect());
-//				QImage img(vr.width(), vr.height(), QImage::Format_ARGB32);
-//				ScPainter scp(&img,vr. width(), vr.height());
-//				scp.translate(-m_doc->minCanvasCoordinate.x(), -m_doc->minCanvasCoordinate.y());
-////				scp.translate(currItem->xPos(), currItem->yPos());
-////				scp.translate(deltax, deltay);
-////				scp.scale(scalex, scaley);
-////				scp.scale(m_canvas->scale(), m_canvas->scale());
-//				currItem->invalid = false;
-//				currItem->DrawObj(&scp, vr);
-//				p->drawImage(vr, img, img.rect() );
-				
-				if (currItem->isGroup())
-				{
-					p->save();
-					p->setBrush(m_brush["outline"]);
-					p->setPen(m_pen["outline"]);
-					p->translate(currItem->xPos(), currItem->yPos());
-					p->translate(deltax, deltay);
-					if (currItem->rotation() != 0)
-					{
-						p->setRenderHint(QPainter::Antialiasing);
-						p->rotate(currItem->rotation());
-					}
-					p->scale(scalex, scaley);
-					PageItem_Group* gItem = currItem->asGroupFrame();
-					uint itemCountG = gItem->groupItemList.count();
-					if (itemCountG < m_canvas->moveWithFullOutlinesThreshold)
-					{
-						p->scale(gItem->width() / gItem->groupWidth, gItem->height() / gItem->groupHeight);
-						for (uint cg = 0; cg < itemCountG; cg++)
-						{
-							p->save();
-							currItem = gItem->groupItemList.at(cg);
-							p->translate(currItem->gXpos, currItem->gYpos);
-							currItem->DrawPolyL(p, currItem->Clip);
-							p->restore();
-						}
-					}
-					else
-					{
-						currItem->DrawPolyL(p, currItem->Clip);
-					}
-					p->restore();
-				}
-				else
-				{
-					p->save();
-					p->setBrush(m_brush["outline"]);
-					p->setPen(m_pen["outline"]);
-					p->translate(currItem->xPos(), currItem->yPos());
-					p->translate(deltax, deltay);
-					if (currItem->rotation() != 0)
-					{
-						p->setRenderHint(QPainter::Antialiasing);
-						p->rotate(currItem->rotation());
-					}
-					p->scale(scalex, scaley);
-					currItem->DrawPolyL(p, currItem->Clip);
-					p->restore();
-				}
-			}
-		}	
-	}
-	else if (m_doc->m_Selection->count() > 1)
-	{
-		double x, y, w, h;
-		m_doc->m_Selection->setGroupRect();
-		m_doc->m_Selection->getGroupRect(&x, &y, &w, &h);
-		uint docSelectionCount = m_doc->m_Selection->count();
-		if (docSelectionCount < m_canvas->moveWithBoxesOnlyThreshold)
-		{
-			PageItem *currItem;
-// 			p->translate(x, y);
-			for (uint a=0; a<docSelectionCount; ++a)
-			{
-				currItem = m_doc->m_Selection->itemAt(a);
-				if (!m_doc->Items->contains(currItem))
-					continue;
-				p->save();
-				if (docSelectionCount < m_canvas->moveWithFullOutlinesThreshold /*&& currItem->rotation() == 0*/)
-				{
-					if((scalex != 1.0) || (scaley != 1.0))
-					{
-						p->setBrush(m_brush["outline"]);
-						p->setPen(m_pen["outline"]);
-						p->translate(deltax, deltay);
-						p->translate(currItem->xPos() /*- x*/, currItem->yPos() /*- y*/);
-						p->scale(scalex, scaley);
-						if (currItem->rotation() != 0)
-						{
-							p->setRenderHint(QPainter::Antialiasing);
-							p->rotate(currItem->rotation());
-						}
-						currItem->DrawPolyL(p, currItem->Clip);
-					}
-					else
-					{
-						QRectF br(currItem->getVisualBoundingRect());
-#ifdef GESTURE_FRAME_PREVIEW
-						QImage *pixItem(0);
-						if( m_pixmapCache.contains(currItem) )
-						{
-							if( m_pixmapCache.value(currItem)->isReady() )
-								pixItem = m_pixmapCache.value(currItem)->getImage();
-						}
-						else
-						{
-							m_pixmapCache[currItem] = new PageItemPreview(currItem);
-						}
-			
-
-						if(pixItem)
-						{
-							p->save();
-//							p->translate(br.x() /*- x*/, br.y() /*- y*/);
-							p->drawImage( br.toRect(), *pixItem, pixItem->rect() );
-							p->restore();
-						}
-#endif  // GESTURE_FRAME_PREVIEW
-						{
-							p->save();
-							p->setBrush(m_brush["outline"]);
-							p->setPen(m_pen["outline"]);
-							p->translate(currItem->xPos(), currItem->yPos());
-							p->translate(deltax, deltay);
-							if (currItem->rotation() != 0)
-							{
-								p->setRenderHint(QPainter::Antialiasing);
-								p->rotate(currItem->rotation());
-							}
-							p->scale(scalex, scaley);
-							currItem->DrawPolyL(p, currItem->Clip);
-							p->restore();
-						}
-					}
-				}
-				else
-				{
-					p->setBrush(m_brush["outline"]);
-					p->setPen(m_pen["outline"]);
-					p->translate(deltax, deltay);
-					p->translate(x, y);
-					if (currItem->rotation() != 0)
-					{
-						p->setRenderHint(QPainter::Antialiasing);
-						p->rotate(currItem->rotation());
-					}
-					p->drawRect(QRectF(0.0, 0.0, currItem->width()+1.0, currItem->height()+1.0));
-				}
-				p->restore();
-			}
-		}
-		else
-		{
-			p->setBrush(m_brush["outline"]);
-			p->setPen(m_pen["outline"]);
-			p->translate(deltax, deltay);
-			p->translate(x, y);
-			p->scale(scalex, scaley);
-			p->drawRect(QRectF(0, 0, w, h));
-		}
-	}
-	p->restore();
-}
-
-
-void CanvasMode::setModeCursor()
-{
-	//NOTE: Merge with similar code in ScribusMainWindow::setAppMode()
-	switch (m_doc->appMode)
-	{
-		case modeDrawShapes:
-		case modeDrawArc:
-		case modeDrawSpiral:
-			qApp->changeOverrideCursor(QCursor(loadIcon("DrawFrame.xpm")));
-			break;
-		case modeDrawImage:
-			qApp->changeOverrideCursor(QCursor(loadIcon("DrawImageFrame.xpm")));
-			break;
-		case modeDrawLatex:
-			qApp->changeOverrideCursor(QCursor(loadIcon("DrawLatexFrame.xpm")));
-			break;
-		case modeDrawText:
-			qApp->changeOverrideCursor(QCursor(loadIcon("DrawTextFrame.xpm")));
-			break;
-		case modeDrawTable:
-			qApp->changeOverrideCursor(QCursor(loadIcon("DrawTable.xpm")));
-			break;
-		case modeDrawTable2:
-			qApp->changeOverrideCursor(QCursor(loadIcon("DrawTable.xpm")));
-			break;
-		case modeDrawRegularPolygon:
-			qApp->changeOverrideCursor(QCursor(loadIcon("DrawPolylineFrame.xpm")));
-			break;
-		case modeDrawLine:
-		case modeDrawBezierLine:
-			qApp->changeOverrideCursor(QCursor(Qt::CrossCursor));
-			break;
-		case modeDrawFreehandLine:
-		case modeDrawCalligraphicLine:
-			qApp->changeOverrideCursor(QCursor(loadIcon("DrawFreeLine.png"), 0, 32));
-			break;
-		case modeImportObject:
-			qApp->changeOverrideCursor(QCursor(loadIcon("DragPix.xpm")));
-			break;
-		case modeMagnifier:
-			if (m_view->Magnify)
-				qApp->changeOverrideCursor(QCursor(loadIcon("LupeZ.xpm")));
-			else
-				qApp->changeOverrideCursor(QCursor(loadIcon("LupeZm.xpm")));
-			break;
-		case modePanning:
-			qApp->changeOverrideCursor(QCursor(loadIcon("HandC.xpm")));
-			break;
-		case modeEyeDropper:
-			qApp->changeOverrideCursor(QCursor(loadIcon("colorpickercursor.png"), 0, 32));
-			break;
-		case modeMeasurementTool:
-		case modeEditGradientVectors:
-		case modeEditMeshGradient:
-		case modeInsertPDFButton:
-		case modeInsertPDFTextfield:
-		case modeInsertPDFCheckbox:
-		case modeInsertPDFCombobox:
-		case modeInsertPDFListbox:
-		case modeInsertPDFTextAnnotation:
-		case modeInsertPDFLinkAnnotation:
-		case modeInsertPDF3DAnnotation:
-		case modeEditArc:
-		case modeEditPolygon:
-		case modeEditSpiral:
-			qApp->changeOverrideCursor(QCursor(Qt::CrossCursor));
-			break;
-		default:
-			qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
-			break;
-	}
-}
-
-#ifdef GESTURE_FRAME_PREVIEW
-void CanvasMode::clearPixmapCache()
-{
-	if(m_pixmapCache.count())
-	{
-		foreach(PageItemPreview* ip, m_pixmapCache)
-		{
-			if(ip)
-				delete ip;
-		}
-		m_pixmapCache.clear();
-	}
-}
-#endif // GESTURE_FRAME_PREVIEW
-
-
-
-void CanvasMode::setResizeCursor(int how, double rot)
-{
-	switch (how)
-	{
-		case 1:
-		case 2:
-			qApp->changeOverrideCursor(ScResizeCursor(135 + rot));// Qt::SizeFDiagCursor
-			break;
-		case 3:
-		case 4:
-			qApp->changeOverrideCursor(ScResizeCursor(45 + rot));// Qt::SizeBDiagCursor
-			break;
-		case 5:
-		case 8:
-			qApp->changeOverrideCursor(ScResizeCursor(0 + rot));// Qt::SizeVerCursor
-			break;
-		case 6:
-		case 7:
-			qApp->changeOverrideCursor(ScResizeCursor(90 + rot));// Qt::SizeHorCursor
-			break;
-		default:
-			qApp->changeOverrideCursor(QCursor(Qt::SizeAllCursor));
-			break;
-	}
-}
-
-bool CanvasMode::commonMouseMove(QMouseEvent *m)
-{
-	const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
-	if ((m_canvas->m_viewMode.m_MouseButtonPressed && (m->buttons() & Qt::RightButton) && (m->modifiers() & Qt::ControlModifier)) || ((!(m->modifiers() & Qt::ControlModifier)) && (m->buttons() & Qt::MidButton)))
-	{
-		if (!m_panGesture)
-		{
-			m_panGesture = new PanGesture(this);
-		}
-		m_view->startGesture(m_panGesture);
-		m_panGesture->mousePressEvent(m); // Not an error, this is used to register current canvas point
-		return true;
-	}
-	return false;
-}
-
-void CanvasMode::commonDrawControls(QPainter* p, bool drawHandles)
-{
-	if (m_canvas->m_viewMode.operItemMoving)
-		drawOutline(p);
-	else
-		drawSelection(p, drawHandles);
-}
-
-void CanvasMode::commonDrawTextCursor(QPainter* p, PageItem_TextFrame* textframe, const QPointF& offset)
-{
-	double dx, dy, dy1;
-	QPen cPen ( Qt::black, 0.9 , Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin );
-
-	// normalize Current Position
-	textframe->itemText.normalizeCursorPosition();
-	int textCursorPos ( textframe->itemText.cursorPosition() );
-
-	if ( textframe->lastInFrame() >= signed ( textframe->itemText.length() )
-		 || textframe->itemText.length() == 0 )
-	{
-		dx = textframe->textToFrameDistLeft();
-		dy = textframe->textToFrameDistTop();
-		dy1 = textframe->textToFrameDistTop() + (textframe->itemText.defaultStyle().charStyle().fontSize() / 10.0);
-
-		cPen.setColor ( ScColorEngine::getRGBColor ( m_doc->PageColors[textframe->itemText.defaultStyle().charStyle().fillColor() ], m_doc ) );
-	}
-	else if ( textCursorPos > textframe->lastInFrame() )
-	{
-		// Happens often when typing directly into frame.
-		// And the cursor curses nothing, vertigo.
-		textCursorPos = qMax(0, textframe->lastInFrame());
-		QChar textCursorChar = textframe->itemText.text(textCursorPos);
-		if (textCursorChar == SpecialChars::PARSEP || textCursorChar == SpecialChars::LINEBREAK)
-		{
-			// The cursor must be moved to the beginning of the next line
-			FRect bbox = textframe->textLayout->boundingBox ( textCursorPos );
-			double lineSpacing(textframe->itemText.paragraphStyle(textCursorPos).lineSpacing());
-
-			// take care if cursor is not in first column
-			int curCol(1);
-			double ccPos(textframe->textLayout->boundingBox ( textCursorPos ).x());
-			double leftOffset(textframe->textToFrameDistLeft());
-			for(int ci(1); ci <= textframe->columns(); ++ci)
-			{
-				double cLeft(((ci-1) * textframe->columnWidth()) + ((ci -1) * textframe->columnGap()) + leftOffset);
-				double cRight((ci * textframe->columnWidth()) + ((ci -1) * textframe->columnGap()) + leftOffset);
-				if((cLeft <= ccPos) && (ccPos <= cRight))
-				{
-					curCol = ci;
-					break;
-				}
-			}
-			dx = (textframe->columnWidth() * (curCol - 1)) + (textframe->columnGap() * (curCol - 1))  + leftOffset;
-			dy = bbox.y();
-
-			if ( bbox.height() <= 2 )
-				dy1 = bbox.y() + textframe->itemText.charStyle ( textCursorPos ).fontSize() / 30.0;
-			else
-				dy1 = bbox.y() + bbox.height();
-
-			dy  += lineSpacing;
-			dy1 += lineSpacing;
-		}
-		else if (textCursorChar == SpecialChars::COLBREAK)
-		{
-			// A bit tricky :)
-			// We want to position the cursor at the beginning of the next column, if any.
-			// At first we need to know in which column the cursor is.
-			int curCol(1);
-			double ccPos(textframe->textLayout->boundingBox ( textCursorPos ).x());
-			double leftOffset(textframe->textToFrameDistLeft());
-			for(int ci(1); ci <= textframe->columns(); ++ci)
-			{
-				double cLeft(((ci-1) * textframe->columnWidth()) + ((ci -1) * textframe->columnGap()) + leftOffset);
-				double cRight((ci * textframe->columnWidth()) + ((ci -1) * textframe->columnGap()) + leftOffset);
-				if((cLeft <= ccPos) && (ccPos <= cRight))
-				{
-					curCol = ci;
-					break;
-				}
-			}
-			if(textframe->columns() > curCol)
-			{
-				dx = (textframe->columnWidth() * curCol) + (textframe->columnGap() * curCol)  + leftOffset;
-				dy = textframe->textToFrameDistTop();
-				dy1 = textframe->textToFrameDistTop() + textframe->textLayout->boundingBox ( textCursorPos ).height();
-			}
-			else // there is no column after the current column
-			{
-				FRect bbox = textframe->textLayout->boundingBox ( textCursorPos );
-				dx = bbox.x();
-				dy = bbox.y();
-				dx += bbox.width();
+/*
+ For general Scribus (>=1.3.2) copyright and licensing information please refer
+ to the COPYING file provided with the program. Following this notice may exist
+ a copyright and/or license notice that predates the release of Scribus 1.3.2
+ for which a new license (GPL+exception) is in place.
+ */
+/***************************************************************************
+*                                                                         *
+*   This program is free software; you can redistribute it and/or modify  *
+*   it under the terms of the GNU General Public License as published by  *
+*   the Free Software Foundation; either version 2 of the License, or     *
+*   (at your option) any later version.                                   *
+*                                                                         *
+***************************************************************************/
+
+
+#include "canvasmode.h"
+
+#include "canvas.h"
+#include "canvasgesture_pan.h"
+#include "canvasmode_copyproperties.h"
+#include "canvasmode_create.h"
+#include "canvasmode_drawbezier.h"
+#include "canvasmode_drawfreehand.h"
+#include "canvasmode_drawcalligraphic.h"
+#include "canvasmode_edit.h"
+#include "canvasmode_editarc.h"
+#include "canvasmode_editgradient.h"
+#include "canvasmode_editmeshgradient.h"
+#include "canvasmode_editmeshpatch.h"
+#include "canvasmode_editpolygon.h"
+#include "canvasmode_editspiral.h"
+#include "canvasmode_edittable.h"
+#include "canvasmode_eyedropper.h"
+#include "canvasmode_framelinks.h"
+#include "canvasmode_magnifier.h"
+#include "canvasmode_measurements.h"
+#include "canvasmode_nodeedit.h"
+#include "canvasmode_normal.h"
+#include "canvasmode_objimport.h"
+#include "canvasmode_panning.h"
+#include "canvasmode_rotate.h"
+#ifdef GESTURE_FRAME_PREVIEW
+#include "pageitempreview.h"
+#endif
+#include "pageitem_group.h"
+#include "pageitem_textframe.h"
+#include "prefsmanager.h"
+#include "selection.h"
+#include "sccolorengine.h"
+#include "scpainter.h"
+#include "scraction.h"
+#include "scribus.h"
+#include "scribusdoc.h"
+#include "scribusview.h"
+#include "ui/checkDocument.h"
+#include "ui/contextmenu.h"
+#include "ui/outlinepalette.h"
+#include "ui/pageselector.h"
+#include "ui/scrapbookpalette.h"
+#include "ui/scrspinbox.h"
+#include "ui/scresizecursor.h"
+#include "undomanager.h"
+#include "units.h"
+#include "util_icon.h"
+
+#include <QMdiArea>
+#include <QMdiSubWindow>
+#include <QPainter>
+#include <QPointF>
+
+CanvasMode::CanvasMode (ScribusView* view) :
+	QObject(),
+	m_view(view),
+	m_canvas(view->m_canvas),
+	m_doc(view->Doc),
+	m_panGesture(NULL)
+{
+	m_pen["outline"]	= QPen(Qt::gray, 1.0 , Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+	m_pen["outline"].setCosmetic(true);
+	m_pen["selection"]	= QPen(Qt::red, 1.0, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+	m_pen["selection"].setCosmetic(true);
+	m_pen["selection-group"] = QPen(Qt::red, 1.0 , Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+	m_pen["selection-group"].setCosmetic(true);
+	m_pen["selection-group-inside"] = QPen(Qt::red, 1.0 , Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+	m_pen["selection-group-inside"].setCosmetic(true);
+	m_pen["handle"]		= QPen(Qt::red, 1.0, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+	m_pen["handle"].setCosmetic(true);
+	
+	m_brush["outline"]	= Qt::NoBrush;
+	m_brush["selection"]	= Qt::NoBrush;
+	m_brush["selection-group"] = QColor(255,0,0,10);
+	m_brush["selection-group-inside"] = Qt::NoBrush;
+	m_brush["handle"]	= Qt::red;
+
+	m_keyRepeat = false;
+	m_arrowKeyDown = false;
+}
+
+CanvasMode::~CanvasMode()
+{
+	if (m_panGesture)
+		delete m_panGesture;
+}
+
+CanvasMode* CanvasMode::createForAppMode(ScribusView* view, int appMode)
+{
+	CanvasMode* result;
+	
+	switch (appMode)
+	{
+		case modeNormal:
+		case modeStoryEditor:
+			result = new CanvasMode_Normal(view);
+			break;
+		case modeCopyProperties:
+			result = new CanvasMode_CopyProperties(view);
+			break;
+		case modeEdit:
+			result = new CanvasMode_Edit(view);
+			break;
+		case modeEditClip:
+			result = new CanvasMode_NodeEdit(view);
+			break;
+		case modeEditGradientVectors:
+			result = new CanvasMode_EditGradient(view);
+			break;
+		case modeEditMeshGradient:
+			result = new CanvasMode_EditMeshGradient(view);
+			break;
+		case modeEditMeshPatch:
+			result = new CanvasMode_EditMeshPatch(view);
+			break;
+		case modeDrawBezierLine:
+			result = new BezierMode(view);
+			break;
+		case modeDrawFreehandLine:
+			result = new FreehandMode(view);
+			break;
+		case modeDrawCalligraphicLine:
+			result = new CalligraphicMode(view);
+			break;
+		case modeDrawLine:
+		case modeDrawShapes:
+		case modeDrawImage:
+		case modeDrawLatex:
+		case modeDrawText:
+		case modeDrawTable:
+		case modeDrawTable2:
+		case modeDrawRegularPolygon:
+		case modeDrawArc:
+		case modeDrawSpiral:
+		case modeInsertPDFButton:
+		case modeInsertPDFTextfield:
+		case modeInsertPDFCheckbox:
+		case modeInsertPDFCombobox:
+		case modeInsertPDFListbox:
+		case modeInsertPDFTextAnnotation:
+		case modeInsertPDFLinkAnnotation:
+		case modeInsertPDF3DAnnotation:
+			result = new CreateMode(view);
+			break;
+		case modeEyeDropper:
+			result = new CanvasMode_EyeDropper(view);
+			break;
+		case modeImportObject:
+			result = new CanvasMode_ObjImport(view);
+			break;
+		case modeLinkFrames:
+		case modeUnlinkFrames:
+			result = new CanvasMode_FrameLinks(view);
+			break;
+		case modeMagnifier:
+			result = new CanvasMode_Magnifier(view);
+			break;
+		case modeMeasurementTool:
+			result = new MeasurementsMode(view);
+			break;
+		case modePanning:
+			result = new CanvasMode_Panning(view);
+			break;
+		case modeRotation:
+			result = new CanvasMode_Rotate(view);
+			break;
+		case modeEditArc:
+			result = new CanvasMode_EditArc(view);
+			break;
+		case modeEditPolygon:
+			result = new CanvasMode_EditPolygon(view);
+			break;
+		case modeEditSpiral:
+			result = new CanvasMode_EditSpiral(view);
+			break;
+		case modeEditTable:
+			result = new CanvasMode_EditTable(view);
+			break;
+			// more modes as they are defined...
+			
+		default:
+			result = new CanvasMode_Normal(view);
+			break;
+	}
+	return result;
+}
+
+
+void CanvasMode::updateViewMode(CanvasViewMode* viewmode) 
+{
+	viewmode->drawSelectedItemsWithControls = false;
+	viewmode->drawFramelinksWithContents = false;	
+}
+
+
+void CanvasMode::drawSelection(QPainter* psx, bool drawHandles)
+{
+//	QTime t;
+//	t.start();
+//	QTime tt;
+//	int tg(0);
+//	QStringList tu;
+	QString ds;
+	psx->scale(m_canvas->scale(), m_canvas->scale());
+	psx->translate(-m_doc->minCanvasCoordinate.x(), -m_doc->minCanvasCoordinate.y());
+	
+	psx->setClipping(true);
+	psx->setClipRegion(QRegion ( m_canvas->exposedRect() ) );
+	if (m_doc->m_Selection->isMultipleSelection())
+	{
+		PageItem *curItem(0);
+		for(int a=0; a<m_doc->m_Selection->count(); ++a)
+		{
+			curItem = m_doc->m_Selection->itemAt(a);
+			
+			if(drawHandles)
+				drawHandles = !curItem->locked();
+		}
+		
+		psx->save();
+		psx->setPen(m_pen["selection-group"]);
+		psx->setBrush(m_brush["selection-group"]);
+		double lineAdjust(psx->pen().width()/m_canvas->scale());
+		double x, y, w, h;
+		m_doc->m_Selection->setGroupRect();
+		m_doc->m_Selection->getVisualGroupRect(&x, &y, &w, &h);
+		const double markWidth = 4 / m_canvas->scale();
+		const double halfMarkWidth = 2 / m_canvas->scale();
+		
+		psx->translate(x,y);
+		x = -lineAdjust;
+		y = -lineAdjust;
+
+//		tt.start();
+		psx->drawRect(QRectF(x, y, w, h));
+		if(drawHandles)
+		{
+			psx->setBrush(m_brush["handle"]);
+			psx->setPen(m_pen["handle"]);
+			psx->drawRect(QRectF(x+w-markWidth, y+h-markWidth, markWidth, markWidth));
+			psx->drawRect(QRectF(x+w/2 - halfMarkWidth, y+h-markWidth, markWidth, markWidth));
+			psx->drawRect(QRectF(x+w/2 - halfMarkWidth, y, markWidth, markWidth));
+			psx->drawRect(QRectF(x+w-markWidth, y+h/2 - halfMarkWidth, markWidth, markWidth));
+			psx->drawRect(QRectF(x+w-markWidth, y, markWidth, markWidth));
+			psx->drawRect(QRectF(x, y, markWidth, markWidth));
+			psx->drawRect(QRectF(x, y+h/2 - halfMarkWidth, markWidth, markWidth));
+			psx->drawRect(QRectF(x, y+h-markWidth, markWidth, markWidth));
+		}
+//		tg=tt.elapsed();
+		psx->restore();
+
+		// items inside a a multi
+		if (m_doc->m_Selection->count() > 1)
+		{
+			uint docSelectionCount = m_doc->m_Selection->count();
+			PageItem *currItem;
+			for (uint a=0; a<docSelectionCount; ++a)
+			{
+				currItem = m_doc->m_Selection->itemAt(a);
+				if (!m_doc->Items->contains(currItem))
+					continue;
+				psx->save();
+				psx->setPen(m_pen["selection-group-inside"]);
+				psx->setBrush(m_brush["selection-group-inside"]);
+				double lineAdjust(psx->pen().width()/m_canvas->scale());
+				double x, y, w, h;
+				w = currItem->visualWidth() ;
+				h = currItem->visualHeight() ;
+				if (currItem->rotation() != 0)
+				{
+					psx->setRenderHint(QPainter::Antialiasing);
+					psx->translate(currItem->xPos(), currItem->yPos());
+					psx->rotate(currItem->rotation());
+					x = currItem->asLine() ? 0 : (currItem->visualXPos() - currItem->xPos() - lineAdjust);
+					y = currItem->asLine() ? (h / -2.0) : (currItem->visualYPos() - currItem->yPos() - lineAdjust);
+				}
+				else
+				{
+					psx->translate(currItem->visualXPos(), currItem->visualYPos());
+					x = currItem->asLine() ? 0 : -lineAdjust;
+					y = currItem->asLine() ? 0 : -lineAdjust;
+				}
+
+				psx->drawRect(QRectF(x, y, w, h));
+
+				psx->restore();
+			}
+		}
+	}
+	else if (m_doc->m_Selection->count() != 0)
+	{
+// 		ds = "S" + QString::number(m_doc->m_Selection->count())+" ";
+		const double markWidth = 4 / m_canvas->scale();
+		const double halfMarkWidth = 2 / m_canvas->scale();
+
+		uint docSelectionCount = m_doc->m_Selection->count();
+		PageItem *currItem;
+		
+		// FIXME when more than 1 item is selected, first Rect is drew normally (<10ms here)
+		// but followings are damn long - pm 
+		for (uint a=0; a<docSelectionCount; ++a)
+		{
+			currItem = m_doc->m_Selection->itemAt(a);
+// 			qDebug()<<"It"<<currItem->xPos()<< currItem->yPos();
+			
+			psx->save();
+			psx->setPen(m_pen["selection"]);
+			psx->setBrush(m_brush["selection"]);
+			double lineAdjust(psx->pen().width()/m_canvas->scale());
+			double x, y, w, h;
+			w = currItem->visualWidth();
+			h = currItem->visualHeight();
+			if (currItem->rotation() != 0)
+			{
+				psx->setRenderHint(QPainter::Antialiasing);
+				psx->translate(currItem->xPos(), currItem->yPos());
+				psx->rotate(currItem->rotation());
+				x = currItem->asLine() ? 0 : (currItem->visualXPos() - currItem->xPos() - lineAdjust);
+				y = currItem->asLine() ? (h / -2.0) : (currItem->visualYPos() - currItem->yPos() - lineAdjust);
+			}
+			else
+			{
+				psx->translate(currItem->visualXPos(), currItem->visualYPos());
+				x = currItem->asLine() ? 0 : -lineAdjust;
+				y = currItem->asLine() ? 0 : -lineAdjust;
+			}
+			
+//			tt.start();
+			psx->drawRect(QRectF(x, y, w, h));
+//			tu << QString::number(tt.elapsed());
+			if(drawHandles && !currItem->locked())
+			{
+				psx->setBrush(m_brush["handle"]);
+				psx->setPen(m_pen["handle"]);
+				if(currItem->asLine())
+				{
+					psx->setRenderHint(QPainter::Antialiasing);
+					psx->drawEllipse(QRectF(x+w-markWidth, y+h/2.0-markWidth, 2* markWidth,2* markWidth));
+// 					psx->setBrush(Qt::blue); // sometimes we forget which is what :)
+					psx->drawEllipse(QRectF(x-markWidth, y+h/2.0-markWidth, 2* markWidth, 2* markWidth));
+				}
+				else
+				{
+					psx->drawRect(QRectF(x+w-markWidth, y+h-markWidth, markWidth, markWidth));
+					psx->drawRect(QRectF(x+w/2 - halfMarkWidth, y+h-markWidth, markWidth, markWidth));
+					psx->drawRect(QRectF(x+w/2 - halfMarkWidth, y, markWidth, markWidth));
+					psx->drawRect(QRectF(x+w-markWidth, y+h/2 - halfMarkWidth, markWidth, markWidth));
+					psx->drawRect(QRectF(x+w-markWidth, y, markWidth, markWidth));
+					psx->drawRect(QRectF(x, y, markWidth, markWidth));
+					psx->drawRect(QRectF(x, y+h/2 - halfMarkWidth, markWidth, markWidth));
+					psx->drawRect(QRectF(x, y+h-markWidth, markWidth, markWidth));
+				}
+			}
+			
+			psx->restore();
+		}
+		
+	}
+	
+
+// 	qDebug()<<ds<< t.elapsed() <<"U"<<tu.join(",")<<"G"<<tg;
+}
+
+
+void CanvasMode::drawOutline(QPainter* p, double scalex, double scaley, double deltax, double deltay)
+{
+	p->save();
+	p->scale(m_canvas->scale(), m_canvas->scale());
+	p->translate(-m_doc->minCanvasCoordinate.x(), -m_doc->minCanvasCoordinate.y());
+	
+			
+	if (m_doc->m_Selection->count() == 1)
+	{
+		PageItem *currItem = m_doc->m_Selection->itemAt(0);
+				
+		if((scalex != 1.0) || (scaley != 1.0)) // changing size of page item
+		{
+			p->setBrush(m_brush["outline"]);
+			p->setPen(m_pen["outline"]);
+			p->translate(currItem->xPos(), currItem->yPos());
+			p->translate(deltax, deltay);
+			if (currItem->rotation() != 0)
+			{
+				p->setRenderHint(QPainter::Antialiasing);
+				p->rotate(currItem->rotation());
+			}
+			p->scale(scalex, scaley);
+			currItem->DrawPolyL(p, currItem->Clip);
+		}
+		else // moving page item
+		{
+			QRectF br(currItem->getVisualBoundingRect());
+#ifdef GESTURE_FRAME_PREVIEW
+			QImage *pixItem(0);
+			if( m_pixmapCache.contains(currItem) )
+			{
+				if( m_pixmapCache.value(currItem)->isReady() )
+					pixItem = m_pixmapCache.value(currItem)->getImage();
+			}
+			else
+			{
+				m_pixmapCache[currItem] = new PageItemPreview(currItem);
+			}
+
+			if(pixItem)
+			{
+				p->save();
+				p->translate(br.x(),br.y());
+				p->translate(deltax, deltay);
+				p->drawImage( br.toRect(), *pixItem, pixItem->rect() );
+				p->restore();
+			}
+#endif // GESTURE_FRAME_PREVIEW
+			{
+//				QRect vr(m_canvas->exposedRect());
+//				QImage img(vr.width(), vr.height(), QImage::Format_ARGB32);
+//				ScPainter scp(&img,vr. width(), vr.height());
+//				scp.translate(-m_doc->minCanvasCoordinate.x(), -m_doc->minCanvasCoordinate.y());
+////				scp.translate(currItem->xPos(), currItem->yPos());
+////				scp.translate(deltax, deltay);
+////				scp.scale(scalex, scaley);
+////				scp.scale(m_canvas->scale(), m_canvas->scale());
+//				currItem->invalid = false;
+//				currItem->DrawObj(&scp, vr);
+//				p->drawImage(vr, img, img.rect() );
+				
+				if (currItem->isGroup())
+				{
+					p->save();
+					p->setBrush(m_brush["outline"]);
+					p->setPen(m_pen["outline"]);
+					p->translate(currItem->xPos(), currItem->yPos());
+					p->translate(deltax, deltay);
+					if (currItem->rotation() != 0)
+					{
+						p->setRenderHint(QPainter::Antialiasing);
+						p->rotate(currItem->rotation());
+					}
+					p->scale(scalex, scaley);
+					PageItem_Group* gItem = currItem->asGroupFrame();
+					uint itemCountG = gItem->groupItemList.count();
+					if (itemCountG < m_canvas->moveWithFullOutlinesThreshold)
+					{
+						p->scale(gItem->width() / gItem->groupWidth, gItem->height() / gItem->groupHeight);
+						for (uint cg = 0; cg < itemCountG; cg++)
+						{
+							p->save();
+							currItem = gItem->groupItemList.at(cg);
+							p->translate(currItem->gXpos, currItem->gYpos);
+							currItem->DrawPolyL(p, currItem->Clip);
+							p->restore();
+						}
+					}
+					else
+					{
+						currItem->DrawPolyL(p, currItem->Clip);
+					}
+					p->restore();
+				}
+				else
+				{
+					p->save();
+					p->setBrush(m_brush["outline"]);
+					p->setPen(m_pen["outline"]);
+					p->translate(currItem->xPos(), currItem->yPos());
+					p->translate(deltax, deltay);
+					if (currItem->rotation() != 0)
+					{
+						p->setRenderHint(QPainter::Antialiasing);
+						p->rotate(currItem->rotation());
+					}
+					p->scale(scalex, scaley);
+					currItem->DrawPolyL(p, currItem->Clip);
+					p->restore();
+				}
+			}
+		}	
+	}
+	else if (m_doc->m_Selection->count() > 1)
+	{
+		double x, y, w, h;
+		m_doc->m_Selection->setGroupRect();
+		m_doc->m_Selection->getGroupRect(&x, &y, &w, &h);
+		uint docSelectionCount = m_doc->m_Selection->count();
+		if (docSelectionCount < m_canvas->moveWithBoxesOnlyThreshold)
+		{
+			PageItem *currItem;
+// 			p->translate(x, y);
+			for (uint a=0; a<docSelectionCount; ++a)
+			{
+				currItem = m_doc->m_Selection->itemAt(a);
+				if (!m_doc->Items->contains(currItem))
+					continue;
+				p->save();
+				if (docSelectionCount < m_canvas->moveWithFullOutlinesThreshold /*&& currItem->rotation() == 0*/)
+				{
+					if((scalex != 1.0) || (scaley != 1.0))
+					{
+						p->setBrush(m_brush["outline"]);
+						p->setPen(m_pen["outline"]);
+						p->translate(deltax, deltay);
+						p->translate(currItem->xPos() /*- x*/, currItem->yPos() /*- y*/);
+						p->scale(scalex, scaley);
+						if (currItem->rotation() != 0)
+						{
+							p->setRenderHint(QPainter::Antialiasing);
+							p->rotate(currItem->rotation());
+						}
+						currItem->DrawPolyL(p, currItem->Clip);
+					}
+					else
+					{
+						QRectF br(currItem->getVisualBoundingRect());
+#ifdef GESTURE_FRAME_PREVIEW
+						QImage *pixItem(0);
+						if( m_pixmapCache.contains(currItem) )
+						{
+							if( m_pixmapCache.value(currItem)->isReady() )
+								pixItem = m_pixmapCache.value(currItem)->getImage();
+						}
+						else
+						{
+							m_pixmapCache[currItem] = new PageItemPreview(currItem);
+						}
+			
+
+						if(pixItem)
+						{
+							p->save();
+//							p->translate(br.x() /*- x*/, br.y() /*- y*/);
+							p->drawImage( br.toRect(), *pixItem, pixItem->rect() );
+							p->restore();
+						}
+#endif  // GESTURE_FRAME_PREVIEW
+						{
+							p->save();
+							p->setBrush(m_brush["outline"]);
+							p->setPen(m_pen["outline"]);
+							p->translate(currItem->xPos(), currItem->yPos());
+							p->translate(deltax, deltay);
+							if (currItem->rotation() != 0)
+							{
+								p->setRenderHint(QPainter::Antialiasing);
+								p->rotate(currItem->rotation());
+							}
+							p->scale(scalex, scaley);
+							currItem->DrawPolyL(p, currItem->Clip);
+							p->restore();
+						}
+					}
+				}
+				else
+				{
+					p->setBrush(m_brush["outline"]);
+					p->setPen(m_pen["outline"]);
+					p->translate(deltax, deltay);
+					p->translate(x, y);
+					if (currItem->rotation() != 0)
+					{
+						p->setRenderHint(QPainter::Antialiasing);
+						p->rotate(currItem->rotation());
+					}
+					p->drawRect(QRectF(0.0, 0.0, currItem->width()+1.0, currItem->height()+1.0));
+				}
+				p->restore();
+			}
+		}
+		else
+		{
+			p->setBrush(m_brush["outline"]);
+			p->setPen(m_pen["outline"]);
+			p->translate(deltax, deltay);
+			p->translate(x, y);
+			p->scale(scalex, scaley);
+			p->drawRect(QRectF(0, 0, w, h));
+		}
+	}
+	p->restore();
+}
+
+
+void CanvasMode::setModeCursor()
+{
+	//NOTE: Merge with similar code in ScribusMainWindow::setAppMode()
+	switch (m_doc->appMode)
+	{
+		case modeDrawShapes:
+		case modeDrawArc:
+		case modeDrawSpiral:
+			qApp->changeOverrideCursor(QCursor(loadIcon("DrawFrame.xpm")));
+			break;
+		case modeDrawImage:
+			qApp->changeOverrideCursor(QCursor(loadIcon("DrawImageFrame.xpm")));
+			break;
+		case modeDrawLatex:
+			qApp->changeOverrideCursor(QCursor(loadIcon("DrawLatexFrame.xpm")));
+			break;
+		case modeDrawText:
+			qApp->changeOverrideCursor(QCursor(loadIcon("DrawTextFrame.xpm")));
+			break;
+		case modeDrawTable:
+			qApp->changeOverrideCursor(QCursor(loadIcon("DrawTable.xpm")));
+			break;
+		case modeDrawTable2:
+			qApp->changeOverrideCursor(QCursor(loadIcon("DrawTable.xpm")));
+			break;
+		case modeDrawRegularPolygon:
+			qApp->changeOverrideCursor(QCursor(loadIcon("DrawPolylineFrame.xpm")));
+			break;
+		case modeDrawLine:
+		case modeDrawBezierLine:
+			qApp->changeOverrideCursor(QCursor(Qt::CrossCursor));
+			break;
+		case modeDrawFreehandLine:
+		case modeDrawCalligraphicLine:
+			qApp->changeOverrideCursor(QCursor(loadIcon("DrawFreeLine.png"), 0, 32));
+			break;
+		case modeImportObject:
+			qApp->changeOverrideCursor(QCursor(loadIcon("DragPix.xpm")));
+			break;
+		case modeMagnifier:
+			if (m_view->Magnify)
+				qApp->changeOverrideCursor(QCursor(loadIcon("LupeZ.xpm")));
+			else
+				qApp->changeOverrideCursor(QCursor(loadIcon("LupeZm.xpm")));
+			break;
+		case modePanning:
+			qApp->changeOverrideCursor(QCursor(loadIcon("HandC.xpm")));
+			break;
+		case modeEyeDropper:
+			qApp->changeOverrideCursor(QCursor(loadIcon("colorpickercursor.png"), 0, 32));
+			break;
+		case modeMeasurementTool:
+		case modeEditGradientVectors:
+		case modeEditMeshGradient:
+		case modeEditMeshPatch:
+		case modeInsertPDFButton:
+		case modeInsertPDFTextfield:
+		case modeInsertPDFCheckbox:
+		case modeInsertPDFCombobox:
+		case modeInsertPDFListbox:
+		case modeInsertPDFTextAnnotation:
+		case modeInsertPDFLinkAnnotation:
+		case modeInsertPDF3DAnnotation:
+		case modeEditArc:
+		case modeEditPolygon:
+		case modeEditSpiral:
+			qApp->changeOverrideCursor(QCursor(Qt::CrossCursor));
+			break;
+		default:
+			qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
+			break;
+	}
+}
+
+#ifdef GESTURE_FRAME_PREVIEW
+void CanvasMode::clearPixmapCache()
+{
+	if(m_pixmapCache.count())
+	{
+		foreach(PageItemPreview* ip, m_pixmapCache)
+		{
+			if(ip)
+				delete ip;
+		}
+		m_pixmapCache.clear();
+	}
+}
+#endif // GESTURE_FRAME_PREVIEW
+
+
+
+void CanvasMode::setResizeCursor(int how, double rot)
+{
+	switch (how)
+	{
+		case 1:
+		case 2:
+			qApp->changeOverrideCursor(ScResizeCursor(135 + rot));// Qt::SizeFDiagCursor
+			break;
+		case 3:
+		case 4:
+			qApp->changeOverrideCursor(ScResizeCursor(45 + rot));// Qt::SizeBDiagCursor
+			break;
+		case 5:
+		case 8:
+			qApp->changeOverrideCursor(ScResizeCursor(0 + rot));// Qt::SizeVerCursor
+			break;
+		case 6:
+		case 7:
+			qApp->changeOverrideCursor(ScResizeCursor(90 + rot));// Qt::SizeHorCursor
+			break;
+		default:
+			qApp->changeOverrideCursor(QCursor(Qt::SizeAllCursor));
+			break;
+	}
+}
+
+bool CanvasMode::commonMouseMove(QMouseEvent *m)
+{
+	const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
+	if ((m_canvas->m_viewMode.m_MouseButtonPressed && (m->buttons() & Qt::RightButton) && (m->modifiers() & Qt::ControlModifier)) || ((!(m->modifiers() & Qt::ControlModifier)) && (m->buttons() & Qt::MidButton)))
+	{
+		if (!m_panGesture)
+		{
+			m_panGesture = new PanGesture(this);
+		}
+		m_view->startGesture(m_panGesture);
+		m_panGesture->mousePressEvent(m); // Not an error, this is used to register current canvas point
+		return true;
+	}
+	return false;
+}
+
+void CanvasMode::commonDrawControls(QPainter* p, bool drawHandles)
+{
+	if (m_canvas->m_viewMode.operItemMoving)
+		drawOutline(p);
+	else
+		drawSelection(p, drawHandles);
+}
+
+void CanvasMode::commonDrawTextCursor(QPainter* p, PageItem_TextFrame* textframe, const QPointF& offset)
+{
+	double dx, dy, dy1;
+	QPen cPen ( Qt::black, 0.9 , Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin );
+
+	// normalize Current Position
+	textframe->itemText.normalizeCursorPosition();
+	int textCursorPos ( textframe->itemText.cursorPosition() );
+
+	if ( textframe->lastInFrame() >= signed ( textframe->itemText.length() )
+		 || textframe->itemText.length() == 0 )
+	{
+		dx = textframe->textToFrameDistLeft();
+		dy = textframe->textToFrameDistTop();
+		dy1 = textframe->textToFrameDistTop() + (textframe->itemText.defaultStyle().charStyle().fontSize() / 10.0);
+
+		cPen.setColor ( ScColorEngine::getRGBColor ( m_doc->PageColors[textframe->itemText.defaultStyle().charStyle().fillColor() ], m_doc ) );
+	}
+	else if ( textCursorPos > textframe->lastInFrame() )
+	{
+		// Happens often when typing directly into frame.
+		// And the cursor curses nothing, vertigo.
+		textCursorPos = qMax(0, textframe->lastInFrame());
+		QChar textCursorChar = textframe->itemText.text(textCursorPos);
+		if (textCursorChar == SpecialChars::PARSEP || textCursorChar == SpecialChars::LINEBREAK)
+		{
+			// The cursor must be moved to the beginning of the next line
+			FRect bbox = textframe->textLayout->boundingBox ( textCursorPos );
+			double lineSpacing(textframe->itemText.paragraphStyle(textCursorPos).lineSpacing());
+
+			// take care if cursor is not in first column
+			int curCol(1);
+			double ccPos(textframe->textLayout->boundingBox ( textCursorPos ).x());
+			double leftOffset(textframe->textToFrameDistLeft());
+			for(int ci(1); ci <= textframe->columns(); ++ci)
+			{
+				double cLeft(((ci-1) * textframe->columnWidth()) + ((ci -1) * textframe->columnGap()) + leftOffset);
+				double cRight((ci * textframe->columnWidth()) + ((ci -1) * textframe->columnGap()) + leftOffset);
+				if((cLeft <= ccPos) && (ccPos <= cRight))
+				{
+					curCol = ci;
+					break;
+				}
+			}
+			dx = (textframe->columnWidth() * (curCol - 1)) + (textframe->columnGap() * (curCol - 1))  + leftOffset;
+			dy = bbox.y();
+
+			if ( bbox.height() <= 2 )
+				dy1 = bbox.y() + textframe->itemText.charStyle ( textCursorPos ).fontSize() / 30.0;
+			else
+				dy1 = bbox.y() + bbox.height();
+
+			dy  += lineSpacing;
+			dy1 += lineSpacing;
+		}
+		else if (textCursorChar == SpecialChars::COLBREAK)
+		{
+			// A bit tricky :)
+			// We want to position the cursor at the beginning of the next column, if any.
+			// At first we need to know in which column the cursor is.
+			int curCol(1);
+			double ccPos(textframe->textLayout->boundingBox ( textCursorPos ).x());
+			double leftOffset(textframe->textToFrameDistLeft());
+			for(int ci(1); ci <= textframe->columns(); ++ci)
+			{
+				double cLeft(((ci-1) * textframe->columnWidth()) + ((ci -1) * textframe->columnGap()) + leftOffset);
+				double cRight((ci * textframe->columnWidth()) + ((ci -1) * textframe->columnGap()) + leftOffset);
+				if((cLeft <= ccPos) && (ccPos <= cRight))
+				{
+					curCol = ci;
+					break;
+				}
+			}
+			if(textframe->columns() > curCol)
+			{
+				dx = (textframe->columnWidth() * curCol) + (textframe->columnGap() * curCol)  + leftOffset;
+				dy = textframe->textToFrameDistTop();
+				dy1 = textframe->textToFrameDistTop() + textframe->textLayout->boundingBox ( textCursorPos ).height();
+			}
+			else // there is no column after the current column
+			{
+				FRect bbox = textframe->textLayout->boundingBox ( textCursorPos );
+				dx = bbox.x();
+				dy = bbox.y();
+				dx += bbox.width();
 				if ( bbox.height() <= 2 )
 					dy1 = bbox.y() + textframe->itemText.charStyle ( textCursorPos ).fontSize() / 30.0;
 				else
-					dy1 = bbox.y() + textframe->textLayout->boxAscent(textCursorPos);
-			}
-		}
-		else
-		{
-			FRect bbox = textframe->textLayout->boundingBox ( textCursorPos );
-			dx = bbox.x();
-			dy = bbox.y();
+					dy1 = bbox.y() + textframe->textLayout->boxAscent(textCursorPos);
+			}
+		}
+		else
+		{
+			FRect bbox = textframe->textLayout->boundingBox ( textCursorPos );
+			dx = bbox.x();
+			dy = bbox.y();
 			dx += bbox.width();
 			if ( bbox.height() <= 2 )
 				dy1 = bbox.y() + textframe->itemText.charStyle ( textCursorPos ).fontSize() / 30.0;
 			else
-				dy1 = bbox.y() + textframe->textLayout->boxAscent(textCursorPos);
-
-		}
-		cPen.setColor ( ScColorEngine::getRGBColor ( m_doc->PageColors[textframe->itemText.charStyle ( textCursorPos ).fillColor() ], m_doc ) );
-	}
-	else
-	{
-		FRect bbox = textframe->textLayout->boundingBox ( textCursorPos );
-		dx = bbox.x();
-		dy = bbox.y();
-		if ( bbox.height() <= 2 )
-			dy1 = bbox.y() + textframe->itemText.charStyle ( textCursorPos ).fontSize() / 30.0;
-		else
-			dy1 = bbox.y() + bbox.height();
-
-		cPen.setColor ( ScColorEngine::getRGBColor ( m_doc->PageColors[textframe->itemText.charStyle ( textCursorPos ).fillColor() ], m_doc ) );
-	}
-	//handle Right to Left writing
-	if ( textframe->reversed() )
-	{
-		dx=textframe->width()-dx;
-	}
-
-	p->save();
-	p->translate ( textframe->xPos(), textframe->yPos() );
-	p->rotate ( textframe->rotation() );
-
-
-	p->setPen ( cPen );
-	p->setRenderHint ( QPainter::Antialiasing, true );
-	// avoid displaying the cursor on the frameborder
-	dx = qMax ( ( cPen.widthF() / 2.0 ), dx );
-
-	dy =  qMin ( qMax ( dy,0.0 ) , textframe->height() );
-	dy1 = qMin ( qMax ( dy1,0.0 ), textframe->height() );
-
-	p->drawLine ( QLineF ( dx,dy,dx,dy1 ).translated(offset) );
-
-	p->restore();
-}
-
-void CanvasMode::commonkeyPressEvent_NormalNodeEdit(QKeyEvent *e)
-{
-	int kk = e->key();
-	QString uc = e->text();
-	ScribusMainWindow* mainWindow = m_view->m_ScMW;
-	QList<QMdiSubWindow *> windows;
-	
-	QMdiArea* mdiArea = mainWindow->mdiArea;
-	QMdiSubWindow* w  = NULL;
-	PrefsManager*   prefsManager      = PrefsManager::instance();
-	OutlinePalette* outlinePalette    = mainWindow->outlinePalette;
-	CheckDocument*  docCheckerPalette = mainWindow->docCheckerPalette;
-	QMap<QString, QPointer<ScrAction> >& scrActions(mainWindow->scrActions);
-
-	if (m_keyRepeat)
-		return;
-	m_keyRepeat = true;
-
-	int keyMod=0;
-	if (e->modifiers() & Qt::ShiftModifier)
-		keyMod |= Qt::SHIFT;
-	if (e->modifiers() & Qt::ControlModifier)
-		keyMod |= Qt::CTRL;
-	if (e->modifiers() & Qt::AltModifier)
-		keyMod |= Qt::ALT;
-	//User presses escape and we have a doc open, and we have an item selected
-	if (kk == Qt::Key_Escape)
-	{
-		m_keyRepeat = false;
-		PageItem *currItem;
-		if (m_doc->m_Selection->count() != 0)
-		{
-			currItem = m_doc->m_Selection->itemAt(0);
-			currItem->Sizing = false;
-			if (m_doc->SubMode != -1)
-			{
-				m_view->Deselect(false);
-				m_doc->Items->removeAt(currItem->ItemNr);
-			}
-			else
-				m_view->Deselect(false);
-			m_view->cancelGroupTransaction();
-		}
-		m_doc->DragP = false;
-		m_doc->leaveDrag = false;
-		m_view->stopAllDrags();
-		m_doc->SubMode = -1;
-		m_doc->ElemToLink = NULL;
-		mainWindow->slotSelect();
-		if (m_doc->m_Selection->count() == 0)
-			mainWindow->HaveNewSel(-1);
-		prefsManager->appPrefs.uiPrefs.stickyTools = false;
-		scrActions["stickyTools"]->setChecked(false);
-		return;
-	}
-	Qt::KeyboardModifiers buttonModifiers = e->modifiers();
-	/**If we have a doc and we are not changing the page or zoom level in the status bar */
-	if ((!m_view->zoomSpinBox->hasFocus()) && (!m_view->pageSelector->hasFocus()))
-	{
-		//Show our context menu
-		QKeySequence currKeySeq = QKeySequence(kk | keyMod);
-		if (currKeySeq.matches(scrActions["viewShowContextMenu"]->shortcut()) == QKeySequence::ExactMatch)
-		{
-			ContextMenu* cmen=NULL;
-			qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
-			if (m_doc->m_Selection->count() == 0)
-			{
-				//CB We should be able to get this calculated by the canvas.... it is already in m_canvas->globalToCanvas(m->globalPos());
-				FPoint fp = m_canvas->globalToCanvas(QCursor::pos());
-				cmen = new ContextMenu(mainWindow, m_doc, fp.x(), fp.y());
-			}
-			else
-				cmen = new ContextMenu(*(m_doc->m_Selection), mainWindow, m_doc);
-			if (cmen)
-			{
-				mainWindow->setUndoMode(true);
-				cmen->exec(QCursor::pos());
-				mainWindow->setUndoMode(false);
-			}
-			delete cmen;
-		}
-
-
-		/**
-		 * With no item selected we can:
-		 * - With space, get into panning mode (modePanning)
-		 * - With PageUp, scroll up
-		 * - With PageDown, scroll down
-		 * - With Tab, change active document windowActivated
-		 */
-
-		if (m_doc->m_Selection->count() == 0)
-		{
-			int pg;
-			int wheelVal = prefsManager->mouseWheelJump();
-			if ((buttonModifiers & Qt::ShiftModifier) && !(buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
-				wheelVal = qMax(qRound(wheelVal / 10.0), 1);
-			switch (kk)
-			{
-			case Qt::Key_Space:
-				m_keyRepeat = false;
-				if (m_doc->appMode == modePanning)
-					m_view->requestMode(modeNormal);
-				else
-					m_view->requestMode(modePanning);
-				return;
-				break;
-			case Qt::Key_PageUp:
-				if (m_doc->masterPageMode() || m_doc->symbolEditMode())
-					m_view->scrollBy(0, -prefsManager->mouseWheelJump());
-				else
-				{
-					pg = m_doc->currentPageNumber();
-					if ((buttonModifiers & Qt::ShiftModifier) && !(buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
-						pg--;
-					else
-						pg -= m_doc->pageSets()[m_doc->pagePositioning()].Columns;
-					if (pg > -1)
-						m_view->GotoPage(pg);
-				}
-				m_keyRepeat = false;
-				return;
-				break;
-			case Qt::Key_PageDown:
-				if (m_doc->masterPageMode() || m_doc->symbolEditMode())
-					m_view->scrollBy(0, prefsManager->mouseWheelJump());
-				else
-				{
-					pg = m_doc->currentPageNumber();
-					if ((buttonModifiers & Qt::ShiftModifier) && !(buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
-						pg++;
-					else
-						pg += m_doc->pageSets()[m_doc->pagePositioning()].Columns;
-					if (pg < static_cast<int>(m_doc->Pages->count()))
-						m_view->GotoPage(pg);
-				}
-				m_keyRepeat = false;
-				return;
-				break;
-			case Qt::Key_Left:
-				m_view->scrollBy(-wheelVal, 0);
-				m_keyRepeat = false;
-				return;
-				break;
-			case Qt::Key_Right:
-				m_view->scrollBy(wheelVal, 0);
-				m_keyRepeat = false;
-				return;
-				break;
-			case Qt::Key_Up:
-				m_view->scrollBy(0, -wheelVal);
-				m_keyRepeat = false;
-				return;
-				break;
-			case Qt::Key_Down:
-				m_view->scrollBy(0, wheelVal);
-				m_keyRepeat = false;
-				return;
-				break;
-			case Qt::Key_Tab:
-				if (buttonModifiers == Qt::ControlModifier)
-				{
-					m_keyRepeat = false;
-					windows = mdiArea->subWindowList();
-					if (windows.count() > 1)
-					{
-						for (int i = 0; i < static_cast<int>(windows.count()); ++i)
-						{
-							if (mdiArea->activeSubWindow() == windows.at(i))
-							{
-								if (i == static_cast<int>(windows.count()-1))
-									w = windows.at(0);
-								else
-									w = windows.at(i+1);
-								break;
-							}
-						}
-						outlinePalette->buildReopenVals();
-						docCheckerPalette->clearErrorList();
-						if ( w )
-							w->showNormal();
-						mainWindow->newActWin(w);
-					}
-					return;
-				}
-				break;
-			}
-		}
-		/** Now if we have an item selected
-		 * - In normal mode we can:
-		 * -- Use backspace or delete to delete the item
-		 * -- Use itemRaise action shortcut to raise an item (actionmanager.cpp connect, no code here)
-		 * -- Use itemLower action shortcut to lower an item (actionmanager.cpp connect, no code here)
-		 * -- Use the arrow keys to move an item or group around for !inches:
-		 		With no meta, by 1.0 unit
-		 		Ctrl, by 10.0 units
-		 		Shift by 0.1 units
-		 		Ctrl Shift 0.01 units
-		 	- For inches:
-		 		With no meta, by 1.0 pt
-		 		Ctrl, by 1.0 unit
-		 		Shift by 0.1 units
-		 		Ctrl Shift 0.01 units
-		 * -- Use the arrow keys to resize an item:
-		 		Alt right arrow, move right side outwards (expand)
-		 		Alt left arrow, move left side outwards (expand)
-		 		Alt Shift right arrow, move left side inwards (shrink)
-		 		Alt Shift left arrow, move right side inwards (shrink)
-		 * -- In edit mode of an image frame, use the arrow keys to resize the image:
-		 		(flows to pageitem_imageframe for control)
-		 		Alt right arrow, move right side of image outwards (expand)
-		 		Alt left arrow, move right side inwards (shrink)
-		 		Alt down arrow, move bottom side downwards (expand)
-		 		Alt up arrow, move top side inwards (shrink)
-		 */
-		if (m_doc->m_Selection->count() != 0)
-		{
-			double moveBy=1.0;
-			if (m_doc->unitIndex()!=SC_INCHES)
-			{
-				if ((buttonModifiers & Qt::ShiftModifier) && !(buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
-					moveBy=0.1;
-				else if (!(buttonModifiers & Qt::ShiftModifier) && (buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
-					moveBy=10.0;
-				else if ((buttonModifiers & Qt::ShiftModifier) && (buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
-					moveBy=0.01;
-
-				moveBy/=m_doc->unitRatio();//Lets allow movement by the current doc ratio, not only points
-			}
-			else
-			{
-				if ((buttonModifiers & Qt::ShiftModifier) && !(buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
-					moveBy=0.1/m_doc->unitRatio();
-				else if (!(buttonModifiers & Qt::ShiftModifier) && (buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
-					moveBy=1.0/m_doc->unitRatio();
-				else if ((buttonModifiers & Qt::ShiftModifier) && (buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
-					moveBy=0.01/m_doc->unitRatio();
-			}
-			bool resizing=((buttonModifiers & Qt::AltModifier) && !(buttonModifiers & Qt::ControlModifier));
-			bool resizingsmaller=(resizing && (buttonModifiers & Qt::ShiftModifier));
-			double resizeBy=1.0;
-			//CB with control locked out due to the requirement of moveby of 0.01, we cannot support
-			//resizeby 10 units unless we move to supporting modifier keys that most people dont have.
-			//if (buttonModifiers & Qt::ControlModifier)
-			//	resizeBy*=10.0;
-			resizeBy/=m_doc->unitRatio();
-			if (resizingsmaller)
-				resizeBy*=-1.0;
-
-			PageItem *currItem = m_doc->m_Selection->itemAt(0);
-
-			switch (kk)
-			{
-			case Qt::Key_Backspace:
-			case Qt::Key_Delete:
-				m_doc->itemSelection_DeleteItem();
-				break;
-				/* CB: Stop using inflexible hardcoded keys here, actions for lower/raise work without this
-					per note above with shortcuts.
-			case Qt::Key_PageUp:
-				if (!currItem->locked())
-				{
-					m_view->RaiseItem();
-				}
-				break;
-			case Qt::Key_PageDown:
-				if (!currItem->locked())
-				{
-					m_view->LowerItem();
-				}
-				break;
-				*/
-			case Qt::Key_Left:
-				if (!currItem->locked())
-				{
-					if (!resizing)
-					{
-						if ((m_doc->appMode == modeEditClip) && (m_doc->nodeEdit.hasNodeSelected()))
-						{
-							int storedClRe = m_doc->nodeEdit.ClRe;
-							if ((m_doc->nodeEdit.SelNode.count() != 0) && (m_doc->nodeEdit.EdPoints))
-							{
-								for (int itm = 0; itm < m_doc->nodeEdit.SelNode.count(); ++itm)
-								{
-									FPoint np;
-									int clRe = m_doc->nodeEdit.SelNode.at(itm);
-									if (m_doc->nodeEdit.isContourLine)
-										np = currItem->ContourLine.point(clRe);
-									else
-										np = currItem->PoLine.point(clRe);
-									m_doc->nodeEdit.ClRe = clRe;
-									np = np - FPoint(moveBy, 0);
-									m_doc->nodeEdit.moveClipPoint(currItem, np);
-								}
-							}
-							m_doc->nodeEdit.ClRe = storedClRe;
-						}
-						else
-						{
-						/* Don't use Grid or Guide Snapping when dragging Items or Groups with the keyboard */
-						/* as the user might be trying to fine tune a position */
-							bool sav1 = m_doc->SnapGuides;
-							bool sav2 = m_doc->useRaster;
-							m_doc->SnapGuides = false;
-							m_doc->useRaster = false;
-							if (m_doc->m_Selection->count() > 1)
-								m_view->startGroupTransaction(Um::Move, "", Um::IMove);
-							m_doc->moveGroup(-moveBy, 0);
-							if (m_doc->m_Selection->count() > 1)
-								m_view->endGroupTransaction();
-							m_doc->SnapGuides = sav1;
-							m_doc->useRaster = sav2;
-						}
-					}
-					else
-					{
-						//CB If in EditContour mode, allow contour line to be scaled with arrow keys too
-						if(m_doc->nodeEdit.isContourLine)
-							m_view->TransformPoly(10, 0, resizeBy/unitGetRatioFromIndex(m_doc->unitIndex()));
-						else
-						{
-							if (resizingsmaller)
-							{
-								currItem->Sizing = false;
-								m_doc->SizeItem(currItem->width()+resizeBy, currItem->height(), currItem->ItemNr);
-							}
-							else
-							{
-								m_doc->MoveItem(-resizeBy, 0, currItem, false);
-								currItem->moveImageXYOffsetBy(resizeBy/currItem->imageXScale(), 0);
-								currItem->Sizing = false;
-								m_doc->SizeItem(currItem->width()+resizeBy, currItem->height(), currItem->ItemNr);
-							}
-						}
-					}
-					currItem->update();
-					mainWindow->slotDocCh();
-				}
-				break;
-			case Qt::Key_Right:
-				if (!currItem->locked())
-				{
-					if (!resizing)
-					{
-						if ((m_doc->appMode == modeEditClip) && (m_doc->nodeEdit.hasNodeSelected()))
-						{
-							int storedClRe = m_doc->nodeEdit.ClRe;
-							if ((m_doc->nodeEdit.SelNode.count() != 0) && (m_doc->nodeEdit.EdPoints))
-							{
-								for (int itm = 0; itm < m_doc->nodeEdit.SelNode.count(); ++itm)
-								{
-									FPoint np;
-									int clRe = m_doc->nodeEdit.SelNode.at(itm);
-									if (m_doc->nodeEdit.isContourLine)
-										np = currItem->ContourLine.point(clRe);
-									else
-										np = currItem->PoLine.point(clRe);
-									m_doc->nodeEdit.ClRe = clRe;
-									np = np + FPoint(moveBy, 0);
-									m_doc->nodeEdit.moveClipPoint(currItem, np);
-								}
-							}
-							m_doc->nodeEdit.ClRe = storedClRe;
-						}
-						else
-						{
-						/* Don't use Grid or Guide Snapping when dragging Items or Groups with the keyboard */
-						/* as the user might be trying to fine tune a position */
-							bool sav1 = m_doc->SnapGuides;
-							bool sav2 = m_doc->useRaster;
-							m_doc->SnapGuides = false;
-							m_doc->useRaster = false;
-							if (m_doc->m_Selection->count() > 1)
-								m_view->startGroupTransaction(Um::Move, "", Um::IMove);
-							m_doc->moveGroup(moveBy, 0);
-							if (m_doc->m_Selection->count() > 1)
-								m_view->endGroupTransaction();
-							m_doc->SnapGuides = sav1;
-							m_doc->useRaster = sav2;
-						}
-					}
-					else
-					{
-						//CB If in EditContour mode, allow contour line to be scaled with arrow keys too
-						if(m_doc->nodeEdit.isContourLine)
-							m_view->TransformPoly(11, 0, resizeBy/unitGetRatioFromIndex(m_doc->unitIndex()));
-						else
-						{
-							if (resizingsmaller)
-							{
-								m_doc->MoveItem(-resizeBy, 0, currItem, false);
-								currItem->moveImageXYOffsetBy(resizeBy/currItem->imageXScale(), 0);
-								currItem->Sizing = false;
-								m_doc->SizeItem(currItem->width()+resizeBy, currItem->height(), currItem->ItemNr);
-							}
-							else
-							{
-								currItem->Sizing = false;
-								m_doc->SizeItem(currItem->width()+resizeBy, currItem->height(), currItem->ItemNr);
-							}
-						}
-					}
-					currItem->update();
-					mainWindow->slotDocCh();
-				}
-				break;
-			case Qt::Key_Up:
-				if (!currItem->locked())
-				{
-					if (!resizing)
-					{
-						if ((m_doc->appMode == modeEditClip) && (m_doc->nodeEdit.hasNodeSelected()))
-						{
-							int storedClRe = m_doc->nodeEdit.ClRe;
-							if ((m_doc->nodeEdit.SelNode.count() != 0) && (m_doc->nodeEdit.EdPoints))
-							{
-								for (int itm = 0; itm < m_doc->nodeEdit.SelNode.count(); ++itm)
-								{
-									FPoint np;
-									int clRe = m_doc->nodeEdit.SelNode.at(itm);
-									if (m_doc->nodeEdit.isContourLine)
-										np = currItem->ContourLine.point(clRe);
-									else
-										np = currItem->PoLine.point(clRe);
-									m_doc->nodeEdit.ClRe = clRe;
-									np = np - FPoint(0, moveBy);
-									m_doc->nodeEdit.moveClipPoint(currItem, np);
-								}
-							}
-							m_doc->nodeEdit.ClRe = storedClRe;
-						}
-						else
-						{
-						/* Don't use Grid or Guide Snapping when dragging Items or Groups with the keyboard */
-						/* as the user might be trying to fine tune a position */
-							bool sav1 = m_doc->SnapGuides;
-							bool sav2 = m_doc->useRaster;
-							m_doc->SnapGuides = false;
-							m_doc->useRaster = false;
-							if (m_doc->m_Selection->count() > 1)
-								m_view->startGroupTransaction(Um::Move, "", Um::IMove);
-							m_doc->moveGroup(0, -moveBy);
-							if (m_doc->m_Selection->count() > 1)
-								m_view->endGroupTransaction();
-							m_doc->SnapGuides = sav1;
-							m_doc->useRaster = sav2;
-						}
-					}
-					else
-					{
-						//CB If in EditContour mode, allow contour line to be scaled with arrow keys too
-						if(m_doc->nodeEdit.isContourLine)
-							m_view->TransformPoly(12, 0, resizeBy/unitGetRatioFromIndex(m_doc->unitIndex()));
-						else
-						{
-							if (resizingsmaller)
-							{
-								currItem->Sizing = false;
-								m_doc->SizeItem(currItem->width(), currItem->height()+resizeBy, currItem->ItemNr);
-							}
-							else
-							{
-								m_doc->MoveItem(0, -resizeBy, currItem, false);
-								currItem->moveImageXYOffsetBy(0, resizeBy/currItem->imageYScale());
-								currItem->Sizing = false;
-								m_doc->SizeItem(currItem->width(), currItem->height()+resizeBy, currItem->ItemNr);
-							}
-						}
-					}
-					currItem->update();
-					mainWindow->slotDocCh();
-				}
-				break;
-			case Qt::Key_Down:
-				if (!currItem->locked())
-				{
-					if (!resizing)
-					{
-						if ((m_doc->appMode == modeEditClip) && (m_doc->nodeEdit.hasNodeSelected()))
-						{
-							int storedClRe = m_doc->nodeEdit.ClRe;
-							if ((m_doc->nodeEdit.SelNode.count() != 0) && (m_doc->nodeEdit.EdPoints))
-							{
-								for (int itm = 0; itm < m_doc->nodeEdit.SelNode.count(); ++itm)
-								{
-									FPoint np;
-									int clRe = m_doc->nodeEdit.SelNode.at(itm);
-									if (m_doc->nodeEdit.isContourLine)
-										np = currItem->ContourLine.point(clRe);
-									else
-										np = currItem->PoLine.point(clRe);
-									m_doc->nodeEdit.ClRe = clRe;
-									np = np - FPoint(0, -moveBy);
-									m_doc->nodeEdit.moveClipPoint(currItem, np);
-								}
-							}
-							m_doc->nodeEdit.ClRe = storedClRe;
-						}
-						else
-						{
-						/* Don't use Grid or Guide Snapping when dragging Items or Groups with the keyboard */
-						/* as the user might be trying to fine tune a position */
-							bool sav1 = m_doc->SnapGuides;
-							bool sav2 = m_doc->useRaster;
-							m_doc->SnapGuides = false;
-							m_doc->useRaster = false;
-							if (m_doc->m_Selection->count() > 1)
-								m_view->startGroupTransaction(Um::Move, "", Um::IMove);
-							m_doc->moveGroup(0, moveBy);
-							if (m_doc->m_Selection->count() > 1)
-								m_view->endGroupTransaction();
-							m_doc->SnapGuides = sav1;
-							m_doc->useRaster = sav2;
-						}
-					}
-					else
-					{
-						//CB If in EditContour mode, allow contour line to be scaled with arrow keys too
-						if(m_doc->nodeEdit.isContourLine)
-							m_view->TransformPoly(13, 0, resizeBy/unitGetRatioFromIndex(m_doc->unitIndex()));
-						else
-						{
-							if (resizingsmaller)
-							{
-								m_doc->MoveItem(0, -resizeBy, currItem, false);
-								currItem->moveImageXYOffsetBy(0, resizeBy/currItem->imageYScale());
-								currItem->Sizing = false;
-								m_doc->SizeItem(currItem->width(), currItem->height()+resizeBy, currItem->ItemNr);
-							}
-							else
-							{
-								currItem->Sizing = false;
-								m_doc->SizeItem(currItem->width(), currItem->height()+resizeBy, currItem->ItemNr);
-							}
-						}
-					}
-					currItem->update();
-					mainWindow->slotDocCh();
-				}
-				break;
-			default:
-				break;
-			}
-		}
-	}
-	switch(kk)
-	{
-		case Qt::Key_Left:
-		case Qt::Key_Right:
-		case Qt::Key_Up:
-		case Qt::Key_Down:
-			m_arrowKeyDown = true;
-	}
-	m_keyRepeat = false;
-}
-
-void CanvasMode::commonkeyReleaseEvent(QKeyEvent *e)
-{
-	//Exit out of panning mode if Control is release while the right mouse button is pressed
-	if ((m_doc->appMode == modePanning) && (e->key() == Qt::Key_Control) && (QApplication::mouseButtons() & Qt::RightButton))
-		m_view->requestMode(modeNormal);
-	if (m_doc->appMode == modeMagnifier)
-		qApp->changeOverrideCursor(QCursor(loadIcon("LupeZ.xpm")));
-	if (e->isAutoRepeat() || !m_arrowKeyDown)
-		return;
-	switch(e->key())
-	{
-		case Qt::Key_Left:
-		case Qt::Key_Right:
-		case Qt::Key_Up:
-		case Qt::Key_Down:
-			m_arrowKeyDown = false;
-			if ((!m_view->zoomSpinBox->hasFocus()) && (!m_view->pageSelector->hasFocus()))
-			{
-				int docSelectionCount=m_doc->m_Selection->count();
-				if ((docSelectionCount != 0) && (m_doc->appMode == modeEditClip) && (m_doc->nodeEdit.hasNodeSelected()))
-				{
-					PageItem *currItem = m_doc->m_Selection->itemAt(0);
-					double xposOrig = currItem->xPos();
-					double yposOrig = currItem->yPos();
-					m_doc->AdjustItemSize(currItem);
-					if (!m_doc->nodeEdit.isContourLine)
-						currItem->ContourLine.translate(xposOrig - currItem->xPos(),yposOrig - currItem->yPos());
-					currItem->update();
-				}
-				for (int i = 0; i < docSelectionCount; ++i)
-					m_doc->m_Selection->itemAt(i)->checkChanges(true);
-				if (docSelectionCount > 1 && m_view->groupTransactionStarted())
-					m_view->endGroupTransaction();
-			}
-			break;
-	}
-}
+				dy1 = bbox.y() + textframe->textLayout->boxAscent(textCursorPos);
+
+		}
+		cPen.setColor ( ScColorEngine::getRGBColor ( m_doc->PageColors[textframe->itemText.charStyle ( textCursorPos ).fillColor() ], m_doc ) );
+	}
+	else
+	{
+		FRect bbox = textframe->textLayout->boundingBox ( textCursorPos );
+		dx = bbox.x();
+		dy = bbox.y();
+		if ( bbox.height() <= 2 )
+			dy1 = bbox.y() + textframe->itemText.charStyle ( textCursorPos ).fontSize() / 30.0;
+		else
+			dy1 = bbox.y() + bbox.height();
+
+		cPen.setColor ( ScColorEngine::getRGBColor ( m_doc->PageColors[textframe->itemText.charStyle ( textCursorPos ).fillColor() ], m_doc ) );
+	}
+	//handle Right to Left writing
+	if ( textframe->reversed() )
+	{
+		dx=textframe->width()-dx;
+	}
+
+	p->save();
+	p->translate ( textframe->xPos(), textframe->yPos() );
+	p->rotate ( textframe->rotation() );
+
+
+	p->setPen ( cPen );
+	p->setRenderHint ( QPainter::Antialiasing, true );
+	// avoid displaying the cursor on the frameborder
+	dx = qMax ( ( cPen.widthF() / 2.0 ), dx );
+
+	dy =  qMin ( qMax ( dy,0.0 ) , textframe->height() );
+	dy1 = qMin ( qMax ( dy1,0.0 ), textframe->height() );
+
+	p->drawLine ( QLineF ( dx,dy,dx,dy1 ).translated(offset) );
+
+	p->restore();
+}
+
+void CanvasMode::commonkeyPressEvent_NormalNodeEdit(QKeyEvent *e)
+{
+	int kk = e->key();
+	QString uc = e->text();
+	ScribusMainWindow* mainWindow = m_view->m_ScMW;
+	QList<QMdiSubWindow *> windows;
+	
+	QMdiArea* mdiArea = mainWindow->mdiArea;
+	QMdiSubWindow* w  = NULL;
+	PrefsManager*   prefsManager      = PrefsManager::instance();
+	OutlinePalette* outlinePalette    = mainWindow->outlinePalette;
+	CheckDocument*  docCheckerPalette = mainWindow->docCheckerPalette;
+	QMap<QString, QPointer<ScrAction> >& scrActions(mainWindow->scrActions);
+
+	if (m_keyRepeat)
+		return;
+	m_keyRepeat = true;
+
+	int keyMod=0;
+	if (e->modifiers() & Qt::ShiftModifier)
+		keyMod |= Qt::SHIFT;
+	if (e->modifiers() & Qt::ControlModifier)
+		keyMod |= Qt::CTRL;
+	if (e->modifiers() & Qt::AltModifier)
+		keyMod |= Qt::ALT;
+	//User presses escape and we have a doc open, and we have an item selected
+	if (kk == Qt::Key_Escape)
+	{
+		m_keyRepeat = false;
+		PageItem *currItem;
+		if (m_doc->m_Selection->count() != 0)
+		{
+			currItem = m_doc->m_Selection->itemAt(0);
+			currItem->Sizing = false;
+			if (m_doc->SubMode != -1)
+			{
+				m_view->Deselect(false);
+				m_doc->Items->removeAt(currItem->ItemNr);
+			}
+			else
+				m_view->Deselect(false);
+			m_view->cancelGroupTransaction();
+		}
+		m_doc->DragP = false;
+		m_doc->leaveDrag = false;
+		m_view->stopAllDrags();
+		m_doc->SubMode = -1;
+		m_doc->ElemToLink = NULL;
+		mainWindow->slotSelect();
+		if (m_doc->m_Selection->count() == 0)
+			mainWindow->HaveNewSel(-1);
+		prefsManager->appPrefs.uiPrefs.stickyTools = false;
+		scrActions["stickyTools"]->setChecked(false);
+		return;
+	}
+	Qt::KeyboardModifiers buttonModifiers = e->modifiers();
+	/**If we have a doc and we are not changing the page or zoom level in the status bar */
+	if ((!m_view->zoomSpinBox->hasFocus()) && (!m_view->pageSelector->hasFocus()))
+	{
+		//Show our context menu
+		QKeySequence currKeySeq = QKeySequence(kk | keyMod);
+		if (currKeySeq.matches(scrActions["viewShowContextMenu"]->shortcut()) == QKeySequence::ExactMatch)
+		{
+			ContextMenu* cmen=NULL;
+			qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
+			if (m_doc->m_Selection->count() == 0)
+			{
+				//CB We should be able to get this calculated by the canvas.... it is already in m_canvas->globalToCanvas(m->globalPos());
+				FPoint fp = m_canvas->globalToCanvas(QCursor::pos());
+				cmen = new ContextMenu(mainWindow, m_doc, fp.x(), fp.y());
+			}
+			else
+				cmen = new ContextMenu(*(m_doc->m_Selection), mainWindow, m_doc);
+			if (cmen)
+			{
+				mainWindow->setUndoMode(true);
+				cmen->exec(QCursor::pos());
+				mainWindow->setUndoMode(false);
+			}
+			delete cmen;
+		}
+
+
+		/**
+		 * With no item selected we can:
+		 * - With space, get into panning mode (modePanning)
+		 * - With PageUp, scroll up
+		 * - With PageDown, scroll down
+		 * - With Tab, change active document windowActivated
+		 */
+
+		if (m_doc->m_Selection->count() == 0)
+		{
+			int pg;
+			int wheelVal = prefsManager->mouseWheelJump();
+			if ((buttonModifiers & Qt::ShiftModifier) && !(buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
+				wheelVal = qMax(qRound(wheelVal / 10.0), 1);
+			switch (kk)
+			{
+			case Qt::Key_Space:
+				m_keyRepeat = false;
+				if (m_doc->appMode == modePanning)
+					m_view->requestMode(modeNormal);
+				else
+					m_view->requestMode(modePanning);
+				return;
+				break;
+			case Qt::Key_PageUp:
+				if (m_doc->masterPageMode() || m_doc->symbolEditMode())
+					m_view->scrollBy(0, -prefsManager->mouseWheelJump());
+				else
+				{
+					pg = m_doc->currentPageNumber();
+					if ((buttonModifiers & Qt::ShiftModifier) && !(buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
+						pg--;
+					else
+						pg -= m_doc->pageSets()[m_doc->pagePositioning()].Columns;
+					if (pg > -1)
+						m_view->GotoPage(pg);
+				}
+				m_keyRepeat = false;
+				return;
+				break;
+			case Qt::Key_PageDown:
+				if (m_doc->masterPageMode() || m_doc->symbolEditMode())
+					m_view->scrollBy(0, prefsManager->mouseWheelJump());
+				else
+				{
+					pg = m_doc->currentPageNumber();
+					if ((buttonModifiers & Qt::ShiftModifier) && !(buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
+						pg++;
+					else
+						pg += m_doc->pageSets()[m_doc->pagePositioning()].Columns;
+					if (pg < static_cast<int>(m_doc->Pages->count()))
+						m_view->GotoPage(pg);
+				}
+				m_keyRepeat = false;
+				return;
+				break;
+			case Qt::Key_Left:
+				m_view->scrollBy(-wheelVal, 0);
+				m_keyRepeat = false;
+				return;
+				break;
+			case Qt::Key_Right:
+				m_view->scrollBy(wheelVal, 0);
+				m_keyRepeat = false;
+				return;
+				break;
+			case Qt::Key_Up:
+				m_view->scrollBy(0, -wheelVal);
+				m_keyRepeat = false;
+				return;
+				break;
+			case Qt::Key_Down:
+				m_view->scrollBy(0, wheelVal);
+				m_keyRepeat = false;
+				return;
+				break;
+			case Qt::Key_Tab:
+				if (buttonModifiers == Qt::ControlModifier)
+				{
+					m_keyRepeat = false;
+					windows = mdiArea->subWindowList();
+					if (windows.count() > 1)
+					{
+						for (int i = 0; i < static_cast<int>(windows.count()); ++i)
+						{
+							if (mdiArea->activeSubWindow() == windows.at(i))
+							{
+								if (i == static_cast<int>(windows.count()-1))
+									w = windows.at(0);
+								else
+									w = windows.at(i+1);
+								break;
+							}
+						}
+						outlinePalette->buildReopenVals();
+						docCheckerPalette->clearErrorList();
+						if ( w )
+							w->showNormal();
+						mainWindow->newActWin(w);
+					}
+					return;
+				}
+				break;
+			}
+		}
+		/** Now if we have an item selected
+		 * - In normal mode we can:
+		 * -- Use backspace or delete to delete the item
+		 * -- Use itemRaise action shortcut to raise an item (actionmanager.cpp connect, no code here)
+		 * -- Use itemLower action shortcut to lower an item (actionmanager.cpp connect, no code here)
+		 * -- Use the arrow keys to move an item or group around for !inches:
+		 		With no meta, by 1.0 unit
+		 		Ctrl, by 10.0 units
+		 		Shift by 0.1 units
+		 		Ctrl Shift 0.01 units
+		 	- For inches:
+		 		With no meta, by 1.0 pt
+		 		Ctrl, by 1.0 unit
+		 		Shift by 0.1 units
+		 		Ctrl Shift 0.01 units
+		 * -- Use the arrow keys to resize an item:
+		 		Alt right arrow, move right side outwards (expand)
+		 		Alt left arrow, move left side outwards (expand)
+		 		Alt Shift right arrow, move left side inwards (shrink)
+		 		Alt Shift left arrow, move right side inwards (shrink)
+		 * -- In edit mode of an image frame, use the arrow keys to resize the image:
+		 		(flows to pageitem_imageframe for control)
+		 		Alt right arrow, move right side of image outwards (expand)
+		 		Alt left arrow, move right side inwards (shrink)
+		 		Alt down arrow, move bottom side downwards (expand)
+		 		Alt up arrow, move top side inwards (shrink)
+		 */
+		if (m_doc->m_Selection->count() != 0)
+		{
+			double moveBy=1.0;
+			if (m_doc->unitIndex()!=SC_INCHES)
+			{
+				if ((buttonModifiers & Qt::ShiftModifier) && !(buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
+					moveBy=0.1;
+				else if (!(buttonModifiers & Qt::ShiftModifier) && (buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
+					moveBy=10.0;
+				else if ((buttonModifiers & Qt::ShiftModifier) && (buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
+					moveBy=0.01;
+
+				moveBy/=m_doc->unitRatio();//Lets allow movement by the current doc ratio, not only points
+			}
+			else
+			{
+				if ((buttonModifiers & Qt::ShiftModifier) && !(buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
+					moveBy=0.1/m_doc->unitRatio();
+				else if (!(buttonModifiers & Qt::ShiftModifier) && (buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
+					moveBy=1.0/m_doc->unitRatio();
+				else if ((buttonModifiers & Qt::ShiftModifier) && (buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
+					moveBy=0.01/m_doc->unitRatio();
+			}
+			bool resizing=((buttonModifiers & Qt::AltModifier) && !(buttonModifiers & Qt::ControlModifier));
+			bool resizingsmaller=(resizing && (buttonModifiers & Qt::ShiftModifier));
+			double resizeBy=1.0;
+			//CB with control locked out due to the requirement of moveby of 0.01, we cannot support
+			//resizeby 10 units unless we move to supporting modifier keys that most people dont have.
+			//if (buttonModifiers & Qt::ControlModifier)
+			//	resizeBy*=10.0;
+			resizeBy/=m_doc->unitRatio();
+			if (resizingsmaller)
+				resizeBy*=-1.0;
+
+			PageItem *currItem = m_doc->m_Selection->itemAt(0);
+
+			switch (kk)
+			{
+			case Qt::Key_Backspace:
+			case Qt::Key_Delete:
+				m_doc->itemSelection_DeleteItem();
+				break;
+				/* CB: Stop using inflexible hardcoded keys here, actions for lower/raise work without this
+					per note above with shortcuts.
+			case Qt::Key_PageUp:
+				if (!currItem->locked())
+				{
+					m_view->RaiseItem();
+				}
+				break;
+			case Qt::Key_PageDown:
+				if (!currItem->locked())
+				{
+					m_view->LowerItem();
+				}
+				break;
+				*/
+			case Qt::Key_Left:
+				if (!currItem->locked())
+				{
+					if (!resizing)
+					{
+						if ((m_doc->appMode == modeEditClip) && (m_doc->nodeEdit.hasNodeSelected()))
+						{
+							int storedClRe = m_doc->nodeEdit.ClRe;
+							if ((m_doc->nodeEdit.SelNode.count() != 0) && (m_doc->nodeEdit.EdPoints))
+							{
+								for (int itm = 0; itm < m_doc->nodeEdit.SelNode.count(); ++itm)
+								{
+									FPoint np;
+									int clRe = m_doc->nodeEdit.SelNode.at(itm);
+									if (m_doc->nodeEdit.isContourLine)
+										np = currItem->ContourLine.point(clRe);
+									else
+										np = currItem->PoLine.point(clRe);
+									m_doc->nodeEdit.ClRe = clRe;
+									np = np - FPoint(moveBy, 0);
+									m_doc->nodeEdit.moveClipPoint(currItem, np);
+								}
+							}
+							m_doc->nodeEdit.ClRe = storedClRe;
+						}
+						else
+						{
+						/* Don't use Grid or Guide Snapping when dragging Items or Groups with the keyboard */
+						/* as the user might be trying to fine tune a position */
+							bool sav1 = m_doc->SnapGuides;
+							bool sav2 = m_doc->useRaster;
+							m_doc->SnapGuides = false;
+							m_doc->useRaster = false;
+							if (m_doc->m_Selection->count() > 1)
+								m_view->startGroupTransaction(Um::Move, "", Um::IMove);
+							m_doc->moveGroup(-moveBy, 0);
+							if (m_doc->m_Selection->count() > 1)
+								m_view->endGroupTransaction();
+							m_doc->SnapGuides = sav1;
+							m_doc->useRaster = sav2;
+						}
+					}
+					else
+					{
+						//CB If in EditContour mode, allow contour line to be scaled with arrow keys too
+						if(m_doc->nodeEdit.isContourLine)
+							m_view->TransformPoly(10, 0, resizeBy/unitGetRatioFromIndex(m_doc->unitIndex()));
+						else
+						{
+							if (resizingsmaller)
+							{
+								currItem->Sizing = false;
+								m_doc->SizeItem(currItem->width()+resizeBy, currItem->height(), currItem->ItemNr);
+							}
+							else
+							{
+								m_doc->MoveItem(-resizeBy, 0, currItem, false);
+								currItem->moveImageXYOffsetBy(resizeBy/currItem->imageXScale(), 0);
+								currItem->Sizing = false;
+								m_doc->SizeItem(currItem->width()+resizeBy, currItem->height(), currItem->ItemNr);
+							}
+						}
+					}
+					currItem->update();
+					mainWindow->slotDocCh();
+				}
+				break;
+			case Qt::Key_Right:
+				if (!currItem->locked())
+				{
+					if (!resizing)
+					{
+						if ((m_doc->appMode == modeEditClip) && (m_doc->nodeEdit.hasNodeSelected()))
+						{
+							int storedClRe = m_doc->nodeEdit.ClRe;
+							if ((m_doc->nodeEdit.SelNode.count() != 0) && (m_doc->nodeEdit.EdPoints))
+							{
+								for (int itm = 0; itm < m_doc->nodeEdit.SelNode.count(); ++itm)
+								{
+									FPoint np;
+									int clRe = m_doc->nodeEdit.SelNode.at(itm);
+									if (m_doc->nodeEdit.isContourLine)
+										np = currItem->ContourLine.point(clRe);
+									else
+										np = currItem->PoLine.point(clRe);
+									m_doc->nodeEdit.ClRe = clRe;
+									np = np + FPoint(moveBy, 0);
+									m_doc->nodeEdit.moveClipPoint(currItem, np);
+								}
+							}
+							m_doc->nodeEdit.ClRe = storedClRe;
+						}
+						else
+						{
+						/* Don't use Grid or Guide Snapping when dragging Items or Groups with the keyboard */
+						/* as the user might be trying to fine tune a position */
+							bool sav1 = m_doc->SnapGuides;
+							bool sav2 = m_doc->useRaster;
+							m_doc->SnapGuides = false;
+							m_doc->useRaster = false;
+							if (m_doc->m_Selection->count() > 1)
+								m_view->startGroupTransaction(Um::Move, "", Um::IMove);
+							m_doc->moveGroup(moveBy, 0);
+							if (m_doc->m_Selection->count() > 1)
+								m_view->endGroupTransaction();
+							m_doc->SnapGuides = sav1;
+							m_doc->useRaster = sav2;
+						}
+					}
+					else
+					{
+						//CB If in EditContour mode, allow contour line to be scaled with arrow keys too
+						if(m_doc->nodeEdit.isContourLine)
+							m_view->TransformPoly(11, 0, resizeBy/unitGetRatioFromIndex(m_doc->unitIndex()));
+						else
+						{
+							if (resizingsmaller)
+							{
+								m_doc->MoveItem(-resizeBy, 0, currItem, false);
+								currItem->moveImageXYOffsetBy(resizeBy/currItem->imageXScale(), 0);
+								currItem->Sizing = false;
+								m_doc->SizeItem(currItem->width()+resizeBy, currItem->height(), currItem->ItemNr);
+							}
+							else
+							{
+								currItem->Sizing = false;
+								m_doc->SizeItem(currItem->width()+resizeBy, currItem->height(), currItem->ItemNr);
+							}
+						}
+					}
+					currItem->update();
+					mainWindow->slotDocCh();
+				}
+				break;
+			case Qt::Key_Up:
+				if (!currItem->locked())
+				{
+					if (!resizing)
+					{
+						if ((m_doc->appMode == modeEditClip) && (m_doc->nodeEdit.hasNodeSelected()))
+						{
+							int storedClRe = m_doc->nodeEdit.ClRe;
+							if ((m_doc->nodeEdit.SelNode.count() != 0) && (m_doc->nodeEdit.EdPoints))
+							{
+								for (int itm = 0; itm < m_doc->nodeEdit.SelNode.count(); ++itm)
+								{
+									FPoint np;
+									int clRe = m_doc->nodeEdit.SelNode.at(itm);
+									if (m_doc->nodeEdit.isContourLine)
+										np = currItem->ContourLine.point(clRe);
+									else
+										np = currItem->PoLine.point(clRe);
+									m_doc->nodeEdit.ClRe = clRe;
+									np = np - FPoint(0, moveBy);
+									m_doc->nodeEdit.moveClipPoint(currItem, np);
+								}
+							}
+							m_doc->nodeEdit.ClRe = storedClRe;
+						}
+						else
+						{
+						/* Don't use Grid or Guide Snapping when dragging Items or Groups with the keyboard */
+						/* as the user might be trying to fine tune a position */
+							bool sav1 = m_doc->SnapGuides;
+							bool sav2 = m_doc->useRaster;
+							m_doc->SnapGuides = false;
+							m_doc->useRaster = false;
+							if (m_doc->m_Selection->count() > 1)
+								m_view->startGroupTransaction(Um::Move, "", Um::IMove);
+							m_doc->moveGroup(0, -moveBy);
+							if (m_doc->m_Selection->count() > 1)
+								m_view->endGroupTransaction();
+							m_doc->SnapGuides = sav1;
+							m_doc->useRaster = sav2;
+						}
+					}
+					else
+					{
+						//CB If in EditContour mode, allow contour line to be scaled with arrow keys too
+						if(m_doc->nodeEdit.isContourLine)
+							m_view->TransformPoly(12, 0, resizeBy/unitGetRatioFromIndex(m_doc->unitIndex()));
+						else
+						{
+							if (resizingsmaller)
+							{
+								currItem->Sizing = false;
+								m_doc->SizeItem(currItem->width(), currItem->height()+resizeBy, currItem->ItemNr);
+							}
+							else
+							{
+								m_doc->MoveItem(0, -resizeBy, currItem, false);
+								currItem->moveImageXYOffsetBy(0, resizeBy/currItem->imageYScale());
+								currItem->Sizing = false;
+								m_doc->SizeItem(currItem->width(), currItem->height()+resizeBy, currItem->ItemNr);
+							}
+						}
+					}
+					currItem->update();
+					mainWindow->slotDocCh();
+				}
+				break;
+			case Qt::Key_Down:
+				if (!currItem->locked())
+				{
+					if (!resizing)
+					{
+						if ((m_doc->appMode == modeEditClip) && (m_doc->nodeEdit.hasNodeSelected()))
+						{
+							int storedClRe = m_doc->nodeEdit.ClRe;
+							if ((m_doc->nodeEdit.SelNode.count() != 0) && (m_doc->nodeEdit.EdPoints))
+							{
+								for (int itm = 0; itm < m_doc->nodeEdit.SelNode.count(); ++itm)
+								{
+									FPoint np;
+									int clRe = m_doc->nodeEdit.SelNode.at(itm);
+									if (m_doc->nodeEdit.isContourLine)
+										np = currItem->ContourLine.point(clRe);
+									else
+										np = currItem->PoLine.point(clRe);
+									m_doc->nodeEdit.ClRe = clRe;
+									np = np - FPoint(0, -moveBy);
+									m_doc->nodeEdit.moveClipPoint(currItem, np);
+								}
+							}
+							m_doc->nodeEdit.ClRe = storedClRe;
+						}
+						else
+						{
+						/* Don't use Grid or Guide Snapping when dragging Items or Groups with the keyboard */
+						/* as the user might be trying to fine tune a position */
+							bool sav1 = m_doc->SnapGuides;
+							bool sav2 = m_doc->useRaster;
+							m_doc->SnapGuides = false;
+							m_doc->useRaster = false;
+							if (m_doc->m_Selection->count() > 1)
+								m_view->startGroupTransaction(Um::Move, "", Um::IMove);
+							m_doc->moveGroup(0, moveBy);
+							if (m_doc->m_Selection->count() > 1)
+								m_view->endGroupTransaction();
+							m_doc->SnapGuides = sav1;
+							m_doc->useRaster = sav2;
+						}
+					}
+					else
+					{
+						//CB If in EditContour mode, allow contour line to be scaled with arrow keys too
+						if(m_doc->nodeEdit.isContourLine)
+							m_view->TransformPoly(13, 0, resizeBy/unitGetRatioFromIndex(m_doc->unitIndex()));
+						else
+						{
+							if (resizingsmaller)
+							{
+								m_doc->MoveItem(0, -resizeBy, currItem, false);
+								currItem->moveImageXYOffsetBy(0, resizeBy/currItem->imageYScale());
+								currItem->Sizing = false;
+								m_doc->SizeItem(currItem->width(), currItem->height()+resizeBy, currItem->ItemNr);
+							}
+							else
+							{
+								currItem->Sizing = false;
+								m_doc->SizeItem(currItem->width(), currItem->height()+resizeBy, currItem->ItemNr);
+							}
+						}
+					}
+					currItem->update();
+					mainWindow->slotDocCh();
+				}
+				break;
+			default:
+				break;
+			}
+		}
+	}
+	switch(kk)
+	{
+		case Qt::Key_Left:
+		case Qt::Key_Right:
+		case Qt::Key_Up:
+		case Qt::Key_Down:
+			m_arrowKeyDown = true;
+	}
+	m_keyRepeat = false;
+}
+
+void CanvasMode::commonkeyReleaseEvent(QKeyEvent *e)
+{
+	//Exit out of panning mode if Control is release while the right mouse button is pressed
+	if ((m_doc->appMode == modePanning) && (e->key() == Qt::Key_Control) && (QApplication::mouseButtons() & Qt::RightButton))
+		m_view->requestMode(modeNormal);
+	if (m_doc->appMode == modeMagnifier)
+		qApp->changeOverrideCursor(QCursor(loadIcon("LupeZ.xpm")));
+	if (e->isAutoRepeat() || !m_arrowKeyDown)
+		return;
+	switch(e->key())
+	{
+		case Qt::Key_Left:
+		case Qt::Key_Right:
+		case Qt::Key_Up:
+		case Qt::Key_Down:
+			m_arrowKeyDown = false;
+			if ((!m_view->zoomSpinBox->hasFocus()) && (!m_view->pageSelector->hasFocus()))
+			{
+				int docSelectionCount=m_doc->m_Selection->count();
+				if ((docSelectionCount != 0) && (m_doc->appMode == modeEditClip) && (m_doc->nodeEdit.hasNodeSelected()))
+				{
+					PageItem *currItem = m_doc->m_Selection->itemAt(0);
+					double xposOrig = currItem->xPos();
+					double yposOrig = currItem->yPos();
+					m_doc->AdjustItemSize(currItem);
+					if (!m_doc->nodeEdit.isContourLine)
+						currItem->ContourLine.translate(xposOrig - currItem->xPos(),yposOrig - currItem->yPos());
+					currItem->update();
+				}
+				for (int i = 0; i < docSelectionCount; ++i)
+					m_doc->m_Selection->itemAt(i)->checkChanges(true);
+				if (docSelectionCount > 1 && m_view->groupTransactionStarted())
+					m_view->endGroupTransaction();
+			}
+			break;
+	}
+}

Modified: branches/ScribusOIF/scribus/canvasmode_editmeshgradient.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/canvasmode_editmeshgradient.cpp
==============================================================================
--- branches/ScribusOIF/scribus/canvasmode_editmeshgradient.cpp (original)
+++ branches/ScribusOIF/scribus/canvasmode_editmeshgradient.cpp Sat Oct  8 20:25:29 2011
@@ -98,8 +98,8 @@
 	QPen p8b = QPen(Qt::blue, 8.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin);
 	QPen p8r = QPen(Qt::red, 8.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin);
 	QPen p8m = QPen(Qt::magenta, 8.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin);
-	QPen p14r = QPen(Qt::red, 14.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin);
-	QPen p14w = QPen(Qt::white, 14.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin);
+	QPen p14r = QPen(Qt::red, 18.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin);
+	QPen p14w = QPen(Qt::white, 18.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin);
 	psx->translate(static_cast<int>(currItem->xPos()), static_cast<int>(currItem->yPos()));
 	psx->rotate(currItem->rotation());
 	psx->setPen(p1b);
@@ -151,8 +151,13 @@
 				else
 					psx->setPen(p14w);
 				psx->drawPoint(QPointF(mp1.gridPoint.x(), mp1.gridPoint.y()));
-				psx->setPen(QPen(mp1.color, 10.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin));
+				psx->setPen(QPen(mp1.color, 14.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin));
 				psx->drawPoint(QPointF(mp1.gridPoint.x(), mp1.gridPoint.y()));
+				if (isSelected)
+					psx->setPen(p8r);
+				else
+					psx->setPen(p8m);
+				psx->drawPoint(QPointF(mp1.controlColor.x(), mp1.controlColor.y()));
 			}
 			else if (m_view->editStrokeGradient == 7)
 			{
@@ -358,6 +363,7 @@
 	m_canvas->m_viewMode.operItemResizing = false;
 	m_view->MidButt = false;
 	selectedMeshPoints.clear();
+	m_keyRepeat = false;
 	Mxp = Myp = -1;
 	setModeCursor();
 	if (fromGesture)
@@ -372,6 +378,159 @@
 	selectedMeshPoints.clear();
 	m_gradientPoint = noPointDefined;
 	m_ScMW->propertiesPalette->updateColorSpecialGradient();
+}
+
+void CanvasMode_EditMeshGradient::keyPressEvent(QKeyEvent *e)
+{
+	if (selectedMeshPoints.count() == 0)
+		return;
+	int kk = e->key();
+	if (m_keyRepeat)
+		return;
+	m_keyRepeat = true;
+	e->accept();
+	Qt::KeyboardModifiers buttonModifiers = e->modifiers();
+	if ((!m_view->zoomSpinBox->hasFocus()) && (!m_view->pageSelector->hasFocus()))
+	{
+		if (m_doc->m_Selection->count() != 0)
+		{
+			double moveBy = 1.0;
+			double moveX = 0.0;
+			double moveY = 0.0;
+			bool isMoving = false;
+			bool doUpdate = false;
+			if (m_doc->unitIndex()!=SC_INCHES)
+			{
+				if ((buttonModifiers & Qt::ShiftModifier) && !(buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
+					moveBy=0.1;
+				else if (!(buttonModifiers & Qt::ShiftModifier) && (buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
+					moveBy=10.0;
+				else if ((buttonModifiers & Qt::ShiftModifier) && (buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
+					moveBy=0.01;
+				moveBy/=m_doc->unitRatio();//Lets allow movement by the current doc ratio, not only points
+			}
+			else
+			{
+				if ((buttonModifiers & Qt::ShiftModifier) && !(buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
+					moveBy=0.1/m_doc->unitRatio();
+				else if (!(buttonModifiers & Qt::ShiftModifier) && (buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
+					moveBy=1.0/m_doc->unitRatio();
+				else if ((buttonModifiers & Qt::ShiftModifier) && (buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
+					moveBy=0.01/m_doc->unitRatio();
+			}
+			moveBy /= m_canvas->m_viewMode.scale;
+			PageItem *currItem = m_doc->m_Selection->itemAt(0);
+			switch (kk)
+			{
+				case Qt::Key_7:
+					moveX = -moveBy;
+					moveY = -moveBy;
+					isMoving = true;
+					doUpdate = true;
+					break;
+				case Qt::Key_9:
+					moveX = moveBy;
+					moveY = -moveBy;
+					isMoving = true;
+					doUpdate = true;
+					break;
+				case Qt::Key_3:
+					moveX = moveBy;
+					moveY = moveBy;
+					isMoving = true;
+					doUpdate = true;
+					break;
+				case Qt::Key_1:
+					moveX = -moveBy;
+					moveY = moveBy;
+					isMoving = true;
+					doUpdate = true;
+					break;
+				case Qt::Key_Left:
+				case Qt::Key_4:
+					moveX = -moveBy;
+					isMoving = true;
+					doUpdate = true;
+					break;
+				case Qt::Key_Right:
+				case Qt::Key_6:
+					moveX = moveBy;
+					isMoving = true;
+					doUpdate = true;
+					break;
+				case Qt::Key_Up:
+				case Qt::Key_8:
+					moveY = -moveBy;
+					isMoving = true;
+					doUpdate = true;
+					break;
+				case Qt::Key_Down:
+				case Qt::Key_2:
+					moveY = moveBy;
+					isMoving = true;
+					doUpdate = true;
+					break;
+				case Qt::Key_5:
+					if (m_view->editStrokeGradient == 6)
+					{
+						QPair<int, int> selP = selectedMeshPoints[0];
+						currItem->meshGradientArray[selP.first][selP.second].controlColor = currItem->meshGradientArray[selP.first][selP.second].gridPoint;
+						doUpdate = true;
+					}
+					else if (m_view->editStrokeGradient == 7)
+					{
+						QPair<int, int> selP = selectedMeshPoints[0];
+						if (m_gradientPoint == useControlT)
+							currItem->meshGradientArray[selP.first][selP.second].controlTop = currItem->meshGradientArray[selP.first][selP.second].gridPoint;
+						else if (m_gradientPoint == useControlB)
+							currItem->meshGradientArray[selP.first][selP.second].controlBottom = currItem->meshGradientArray[selP.first][selP.second].gridPoint;
+						else if (m_gradientPoint == useControlL)
+							currItem->meshGradientArray[selP.first][selP.second].controlLeft = currItem->meshGradientArray[selP.first][selP.second].gridPoint;
+						else if (m_gradientPoint == useControlR)
+							currItem->meshGradientArray[selP.first][selP.second].controlRight = currItem->meshGradientArray[selP.first][selP.second].gridPoint;
+						doUpdate = true;
+					}
+					break;
+			}
+			if (isMoving)
+			{
+				if (m_view->editStrokeGradient == 5)
+				{
+					for (int mo = 0; mo < selectedMeshPoints.count(); mo++)
+					{
+						QPair<int, int> selP = selectedMeshPoints[mo];
+						currItem->meshGradientArray[selP.first][selP.second].moveRel(moveX, moveY);
+					}
+				}
+				else if (m_view->editStrokeGradient == 6)
+				{
+					QPair<int, int> selP = selectedMeshPoints[0];
+					currItem->meshGradientArray[selP.first][selP.second].controlColor += FPoint(moveX, moveY);
+				}
+				else if (m_view->editStrokeGradient == 7)
+				{
+					QPair<int, int> selP = selectedMeshPoints[0];
+					if (m_gradientPoint == useControlT)
+						currItem->meshGradientArray[selP.first][selP.second].controlTop += FPoint(moveX, moveY);
+					else if (m_gradientPoint == useControlB)
+						currItem->meshGradientArray[selP.first][selP.second].controlBottom += FPoint(moveX, moveY);
+					else if (m_gradientPoint == useControlL)
+						currItem->meshGradientArray[selP.first][selP.second].controlLeft += FPoint(moveX, moveY);
+					else if (m_gradientPoint == useControlR)
+						currItem->meshGradientArray[selP.first][selP.second].controlRight += FPoint(moveX, moveY);
+				}
+			}
+			if (doUpdate)
+			{
+				currItem->update();
+				QRectF upRect;
+				upRect = QRectF(QPointF(0, 0), QPointF(currItem->width(), currItem->height())).normalized();
+				upRect.translate(currItem->xPos(), currItem->yPos());
+				m_doc->regionsChanged()->update(upRect.adjusted(-10.0 - currItem->width() / 2.0, -10.0 - currItem->height() / 2.0, 10.0 + currItem->width() / 2.0, 10.0 + currItem->height() / 2.0));
+			}
+		}
+	}
+	m_keyRepeat = false;
 }
 
 void CanvasMode_EditMeshGradient::mouseDoubleClickEvent(QMouseEvent *m)
@@ -411,7 +570,6 @@
 		}
 	}
 }
-
 
 void CanvasMode_EditMeshGradient::mouseMoveEvent(QMouseEvent *m)
 {
@@ -430,7 +588,18 @@
 			npfN = FPoint(nx, ny);
 		PageItem *currItem = m_doc->m_Selection->itemAt(0);
 		FPoint npf = FPoint(npfN.x(), npfN.y(), currItem->xPos(), currItem->yPos(), currItem->rotation(), 1, 1, true);
-		m_canvas->displayXYHUD(m->globalPos(), npf.x(), npf.y());
+		if (m_view->editStrokeGradient == 6)
+		{
+			if (selectedMeshPoints.count() > 0)
+			{
+				QPair<int, int> selP = selectedMeshPoints[0];
+				FPoint cP = currItem->meshGradientArray[selP.first][selP.second].controlColor;
+				FPoint gP = currItem->meshGradientArray[selP.first][selP.second].gridPoint;
+				m_canvas->displayXYHUD(m->globalPos(), cP.x() - gP.x(), cP.y() - gP.y());
+			}
+		}
+		else
+			m_canvas->displayXYHUD(m->globalPos(), npf.x(), npf.y());
 		FPoint npx(Mxp - npfN.x(), Myp - npfN.y(), 0, 0, currItem->rotation(), 1, 1, true);
 		if (selectedMeshPoints.count() > 0)
 		{
@@ -441,6 +610,11 @@
 					QPair<int, int> selP = selectedMeshPoints[mo];
 					currItem->meshGradientArray[selP.first][selP.second].moveRel(-npx.x(), -npx.y());
 				}
+			}
+			else if (m_view->editStrokeGradient == 6)
+			{
+				QPair<int, int> selP = selectedMeshPoints[0];
+				currItem->meshGradientArray[selP.first][selP.second].controlColor -= npx;
 			}
 			else if (m_view->editStrokeGradient == 7)
 			{
@@ -502,7 +676,7 @@
 				meshPoint mp = currItem->meshGradientArray[grow][gcol];
 				QPointF gradientPoint = QPointF(mp.gridPoint.x(), mp.gridPoint.y());
 				gradientPoint = itemMatrix.map(gradientPoint);
-				if (m_canvas->hitsCanvasPoint(m->globalPos(), gradientPoint))
+				if (m_canvas->hitsCanvasPoint(mousePointDoc, gradientPoint))
 				{
 					selPoint.first = grow;
 					selPoint.second = gcol;
@@ -525,7 +699,9 @@
 				meshPoint mp = currItem->meshGradientArray[grow][gcol];
 				QPointF gradientPoint = QPointF(mp.gridPoint.x(), mp.gridPoint.y());
 				gradientPoint = itemMatrix.map(gradientPoint);
-				if (m_canvas->hitsCanvasPoint(m->globalPos(), gradientPoint))
+				QPointF gradientColorPoint = QPointF(mp.controlColor.x(), mp.controlColor.y());
+				gradientColorPoint = itemMatrix.map(gradientColorPoint);
+				if (m_canvas->hitsCanvasPoint(mousePointDoc, gradientPoint) || m_canvas->hitsCanvasPoint(mousePointDoc, gradientColorPoint))
 				{
 					selPoint.first = grow;
 					selPoint.second = gcol;
@@ -552,13 +728,13 @@
 					if (gcol == 0)
 					{
 						gradientPoint = QPointF(mp1.controlRight.x(), mp1.controlRight.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlR;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlBottom.x(), mp1.controlBottom.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlB;
 							found = true;
@@ -567,13 +743,13 @@
 					else if (gcol == currItem->meshGradientArray[grow].count()-1)
 					{
 						gradientPoint = QPointF(mp1.controlLeft.x(), mp1.controlLeft.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlL;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlBottom.x(), mp1.controlBottom.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlB;
 							found = true;
@@ -582,19 +758,19 @@
 					else
 					{
 						gradientPoint = QPointF(mp1.controlLeft.x(), mp1.controlLeft.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlL;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlRight.x(), mp1.controlRight.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlR;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlBottom.x(), mp1.controlBottom.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlB;
 							found = true;
@@ -606,13 +782,13 @@
 					if (gcol == 0)
 					{
 						gradientPoint = QPointF(mp1.controlRight.x(), mp1.controlRight.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlR;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlTop.x(), mp1.controlTop.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlT;
 							found = true;
@@ -621,13 +797,13 @@
 					else if (gcol == currItem->meshGradientArray[grow].count()-1)
 					{
 						gradientPoint = QPointF(mp1.controlTop.x(), mp1.controlTop.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlT;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlLeft.x(), mp1.controlLeft.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlL;
 							found = true;
@@ -636,19 +812,19 @@
 					else
 					{
 						gradientPoint = QPointF(mp1.controlTop.x(), mp1.controlTop.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlT;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlLeft.x(), mp1.controlLeft.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlL;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlRight.x(), mp1.controlRight.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlR;
 							found = true;
@@ -660,19 +836,19 @@
 					if (gcol == 0)
 					{
 						gradientPoint = QPointF(mp1.controlBottom.x(), mp1.controlBottom.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlB;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlTop.x(), mp1.controlTop.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlT;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlRight.x(), mp1.controlRight.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlR;
 							found = true;
@@ -681,19 +857,19 @@
 					else if (gcol == currItem->meshGradientArray[grow].count()-1)
 					{
 						gradientPoint = QPointF(mp1.controlBottom.x(), mp1.controlBottom.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlB;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlTop.x(), mp1.controlTop.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlT;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlLeft.x(), mp1.controlLeft.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlL;
 							found = true;
@@ -702,25 +878,25 @@
 					else
 					{
 						gradientPoint = QPointF(mp1.controlBottom.x(), mp1.controlBottom.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlB;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlTop.x(), mp1.controlTop.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlT;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlLeft.x(), mp1.controlLeft.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlL;
 							found = true;
 						}
 						gradientPoint = QPointF(mp1.controlRight.x(), mp1.controlRight.y());
-						if (m_canvas->hitsCanvasPoint(m->globalPos(), itemMatrix.map(gradientPoint)))
+						if (m_canvas->hitsCanvasPoint(mousePointDoc, itemMatrix.map(gradientPoint)))
 						{
 							m_gradientPoint = useControlR;
 							found = true;
@@ -746,7 +922,7 @@
 					meshPoint mp = currItem->meshGradientArray[grow][gcol];
 					QPointF gradientPoint = QPointF(mp.gridPoint.x(), mp.gridPoint.y());
 					gradientPoint = itemMatrix.map(gradientPoint);
-					if (m_canvas->hitsCanvasPoint(m->globalPos(), gradientPoint))
+					if (m_canvas->hitsCanvasPoint(mousePointDoc, gradientPoint))
 					{
 						selPoint.first = grow;
 						selPoint.second = gcol;

Modified: branches/ScribusOIF/scribus/canvasmode_editmeshgradient.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/canvasmode_editmeshgradient.h
==============================================================================
--- branches/ScribusOIF/scribus/canvasmode_editmeshgradient.h (original)
+++ branches/ScribusOIF/scribus/canvasmode_editmeshgradient.h Sat Oct  8 20:25:29 2011
@@ -52,6 +52,8 @@
 	virtual void mouseReleaseEvent(QMouseEvent *m);
 	virtual void mouseMoveEvent(QMouseEvent *m);
 	virtual void mousePressEvent(QMouseEvent *m);
+	virtual void keyPressEvent(QKeyEvent *e);
+	virtual bool handleKeyEvents() { return true; }
 	virtual void drawControls(QPainter* p);
 	void drawControlsMeshGradient(QPainter* pp, PageItem* currItem);
 
@@ -72,6 +74,7 @@
 	ScribusMainWindow* m_ScMW;
 	eMGradientPoint m_gradientPoint;
 	QList<QPair<int, int> > selectedMeshPoints;
+	bool m_keyRepeat;
 };
 
 

Modified: branches/ScribusOIF/scribus/cellarea.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/cellarea.h
==============================================================================
--- branches/ScribusOIF/scribus/cellarea.h (original)
+++ branches/ScribusOIF/scribus/cellarea.h Sat Oct  8 20:25:29 2011
@@ -9,6 +9,8 @@
 #ifndef CELLAREA_H
 #define CELLAREA_H
 
+#include "scribusapi.h"
+
 /**
  * The CellArea class is a simple representation of a rectangular area of table cells.
  *
@@ -17,7 +19,7 @@
  * purposes. The class is used during table layout when keeping track of areas of merged
  * table cells.
  */
-class CellArea
+class SCRIBUS_API CellArea
 {
 public:
 	/// Constructs a new invalid area.

Modified: branches/ScribusOIF/scribus/mesh.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/mesh.cpp
==============================================================================
--- branches/ScribusOIF/scribus/mesh.cpp (original)
+++ branches/ScribusOIF/scribus/mesh.cpp Sat Oct  8 20:25:29 2011
@@ -35,6 +35,7 @@
 	controlBottom += FPoint(dx, dy);
 	controlLeft += FPoint(dx, dy);
 	controlRight += FPoint(dx, dy);
+	controlColor += FPoint(dx, dy);
 }
 
 void meshPoint::moveAbs(double x, double y)
@@ -45,6 +46,7 @@
 	controlBottom -= delta;
 	controlLeft -= delta;
 	controlRight -= delta;
+	controlColor -= delta;
 }
 
 void meshPoint::transform(QTransform t)
@@ -55,12 +57,14 @@
 	gr.addPoint(controlBottom);
 	gr.addPoint(controlLeft);
 	gr.addPoint(controlRight);
+	gr.addPoint(controlColor);
 	gr.map(t);
 	gridPoint = gr.point(0);
 	controlTop = gr.point(1);
 	controlBottom = gr.point(2);
 	controlLeft = gr.point(3);
 	controlRight = gr.point(4);
+	controlColor = gr.point(5);
 }
 
 void meshPoint::resetTo(FPoint p)
@@ -70,4 +74,5 @@
 	controlRight = gridPoint;
 	controlTop = gridPoint;
 	controlBottom = gridPoint;
+	controlColor = gridPoint;
 }

Modified: branches/ScribusOIF/scribus/mesh.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/mesh.h
==============================================================================
--- branches/ScribusOIF/scribus/mesh.h (original)
+++ branches/ScribusOIF/scribus/mesh.h Sat Oct  8 20:25:29 2011
@@ -43,6 +43,7 @@
 	FPoint controlBottom;
 	FPoint controlLeft;
 	FPoint controlRight;
+	FPoint controlColor;
 	double transparency;
 	int    shade;
 	QString colorName;

Modified: branches/ScribusOIF/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/pageitem.cpp
==============================================================================
--- branches/ScribusOIF/scribus/pageitem.cpp (original)
+++ branches/ScribusOIF/scribus/pageitem.cpp Sat Oct  8 20:25:29 2011
@@ -749,69 +749,39 @@
 
 	QList<meshPoint> mgList;
 	meshPoint mgP;
-	mgP.gridPoint = FPoint(0.0, 0.0);
-	mgP.controlTop = mgP.gridPoint;
-	mgP.controlBottom = mgP.gridPoint;
-	mgP.controlLeft = mgP.gridPoint;
-	mgP.controlRight = mgP.gridPoint;
+	meshGradientPatch patch;
+	mgP.resetTo(FPoint(0.0, 0.0));
 	mgP.transparency = 1.0;
 	mgP.shade = 100;
 	mgP.colorName = "Black";
 	mgP.color = qcol;
 	mgList.append(mgP);
-	mgP.gridPoint = FPoint(Width / 2.0, 0.0);
-	mgP.controlTop = mgP.gridPoint;
-	mgP.controlBottom = mgP.gridPoint;
-	mgP.controlLeft = mgP.gridPoint;
-	mgP.controlRight = mgP.gridPoint;
+	patch.TL = mgP;
+	mgP.resetTo(FPoint(Width / 2.0, 0.0));
 	mgList.append(mgP);
-	mgP.gridPoint = FPoint(Width, 0.0);
-	mgP.controlTop = mgP.gridPoint;
-	mgP.controlBottom = mgP.gridPoint;
-	mgP.controlLeft = mgP.gridPoint;
-	mgP.controlRight = mgP.gridPoint;
+	mgP.resetTo(FPoint(Width, 0.0));
+	mgList.append(mgP);
+	patch.TR = mgP;
+	meshGradientArray.append(mgList);
+	mgList.clear();
+	mgP.resetTo(FPoint(0.0, Height / 2.0));
+	mgList.append(mgP);
+	mgP.resetTo(FPoint(Width / 2.0, Height / 2.0));
+	mgList.append(mgP);
+	mgP.resetTo(FPoint(Width, Height / 2.0));
 	mgList.append(mgP);
 	meshGradientArray.append(mgList);
 	mgList.clear();
-	mgP.gridPoint = FPoint(0.0, Height / 2.0);
-	mgP.controlTop = mgP.gridPoint;
-	mgP.controlBottom = mgP.gridPoint;
-	mgP.controlLeft = mgP.gridPoint;
-	mgP.controlRight = mgP.gridPoint;
+	mgP.resetTo(FPoint(0.0, Height));
 	mgList.append(mgP);
-	mgP.gridPoint = FPoint(Width / 2.0, Height / 2.0);
-	mgP.controlTop = mgP.gridPoint;
-	mgP.controlBottom = mgP.gridPoint;
-	mgP.controlLeft = mgP.gridPoint;
-	mgP.controlRight = mgP.gridPoint;
+	patch.BL = mgP;
+	mgP.resetTo(FPoint(Width / 2.0, Height));
 	mgList.append(mgP);
-	mgP.gridPoint = FPoint(Width, Height / 2.0);
-	mgP.controlTop = mgP.gridPoint;
-	mgP.controlBottom = mgP.gridPoint;
-	mgP.controlLeft = mgP.gridPoint;
-	mgP.controlRight = mgP.gridPoint;
+	mgP.resetTo(FPoint(Width, Height));
 	mgList.append(mgP);
+	patch.BR = mgP;
 	meshGradientArray.append(mgList);
-	mgList.clear();
-	mgP.gridPoint = FPoint(0.0, Height);
-	mgP.controlTop = mgP.gridPoint;
-	mgP.controlBottom = mgP.gridPoint;
-	mgP.controlLeft = mgP.gridPoint;
-	mgP.controlRight = mgP.gridPoint;
-	mgList.append(mgP);
-	mgP.gridPoint = FPoint(Width / 2.0, Height);
-	mgP.controlTop = mgP.gridPoint;
-	mgP.controlBottom = mgP.gridPoint;
-	mgP.controlLeft = mgP.gridPoint;
-	mgP.controlRight = mgP.gridPoint;
-	mgList.append(mgP);
-	mgP.gridPoint = FPoint(Width, Height);
-	mgP.controlTop = mgP.gridPoint;
-	mgP.controlBottom = mgP.gridPoint;
-	mgP.controlLeft = mgP.gridPoint;
-	mgP.controlRight = mgP.gridPoint;
-	mgList.append(mgP);
-	meshGradientArray.append(mgList);
+	meshGradientPatches.append(patch);
 
 	firstLineOffsetP = FLOPRealGlyphHeight;
 	Cols = m_Doc->itemToolPrefs().textColumns;
@@ -2857,7 +2827,7 @@
 	col4 = GrColorP4;
 }
 
-void PageItem::setMeshPointColor(int x, int y, QString color, int shade, double transparency)
+void PageItem::setMeshPointColor(int x, int y, QString color, int shade, double transparency, bool forPatch)
 {
 	QString MColor = color;
 	QColor MQColor;
@@ -2898,12 +2868,48 @@
 		VisionDefectColor defect;
 		MQColor = defect.convertDefect(MQColor, m_Doc->previewVisual);
 	}
-	if ((x > -1) && (y > -1))
-	{
-		meshGradientArray[x][y].colorName = MColor;
-		meshGradientArray[x][y].color = MQColor;
-		meshGradientArray[x][y].shade = shade;
-		meshGradientArray[x][y].transparency = transparency;
+	if (forPatch)
+	{
+		meshGradientPatch patch = meshGradientPatches[x];
+		meshPoint mp;
+		switch (y)
+		{
+			case 1:
+				meshGradientPatches[x].TL.colorName = MColor;
+				meshGradientPatches[x].TL.color = MQColor;
+				meshGradientPatches[x].TL.shade = shade;
+				meshGradientPatches[x].TL.transparency = transparency;
+				break;
+			case 2:
+				meshGradientPatches[x].TR.colorName = MColor;
+				meshGradientPatches[x].TR.color = MQColor;
+				meshGradientPatches[x].TR.shade = shade;
+				meshGradientPatches[x].TR.transparency = transparency;
+				break;
+			case 3:
+				meshGradientPatches[x].BR.colorName = MColor;
+				meshGradientPatches[x].BR.color = MQColor;
+				meshGradientPatches[x].BR.shade = shade;
+				meshGradientPatches[x].BR.transparency = transparency;
+				break;
+			case 4:
+				meshGradientPatches[x].BL.colorName = MColor;
+				meshGradientPatches[x].BL.color = MQColor;
+				meshGradientPatches[x].BL.shade = shade;
+				meshGradientPatches[x].BL.transparency = transparency;
+				break;
+		}
+
+	}
+	else
+	{
+		if ((x > -1) && (y > -1))
+		{
+			meshGradientArray[x][y].colorName = MColor;
+			meshGradientArray[x][y].color = MQColor;
+			meshGradientArray[x][y].shade = shade;
+			meshGradientArray[x][y].transparency = transparency;
+		}
 	}
 }
 
@@ -2962,6 +2968,7 @@
 			mgP.controlBottom = mgP.gridPoint;
 			mgP.controlLeft = mgP.gridPoint;
 			mgP.controlRight = mgP.gridPoint;
+			mgP.controlColor = mgP.gridPoint;
 			mgP.transparency = 1.0;
 			mgP.shade = 100;
 			mgP.colorName = MColor;
@@ -2987,6 +2994,7 @@
 			meshGradientArray[x][y].controlBottom = meshGradientArray[x][y].gridPoint;
 			meshGradientArray[x][y].controlLeft = meshGradientArray[x][y].gridPoint;
 			meshGradientArray[x][y].controlRight = meshGradientArray[x][y].gridPoint;
+			meshGradientArray[x][y].controlColor = meshGradientArray[x][y].gridPoint;
 		}
 	}
 }

Modified: branches/ScribusOIF/scribus/pageitem.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/pageitem.h
==============================================================================
--- branches/ScribusOIF/scribus/pageitem.h (original)
+++ branches/ScribusOIF/scribus/pageitem.h Sat Oct  8 20:25:29 2011
@@ -668,7 +668,7 @@
 	void setDiamondGeometry(FPoint c1, FPoint c2, FPoint c3, FPoint c4, FPoint c5);
 	void get4ColorTransparency(double &t1, double &t2, double &t3, double &t4);
 	void get4ColorColors(QString &col1, QString &col2, QString &col3, QString &col4);
-	void setMeshPointColor(int x, int y, QString color, int shade, double transparency);
+	void setMeshPointColor(int x, int y, QString color, int shade, double transparency, bool forPatch = false);
 	void createGradientMesh(int rows, int cols);
 	void resetGradientMesh();
 	void meshToShape();

Modified: branches/ScribusOIF/scribus/pageitem_table.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/pageitem_table.h
==============================================================================
--- branches/ScribusOIF/scribus/pageitem_table.h (original)
+++ branches/ScribusOIF/scribus/pageitem_table.h Sat Oct  8 20:25:29 2011
@@ -454,6 +454,12 @@
 	/// Returns a textual description of this item.
 	virtual QString infoDescription() { return QString(); }
 
+	/// Returns the Cell Areas from this table
+	QList<CellArea> cellAreas() const { return m_cellAreas; }
+
+	/// Returns the rows of the table for writing to SLA
+	QList<QList<TableCell> > cellRows() const { return m_cellRows; }
+
 signals:
 	/// This signal is emitted whenever the table changes.
 	void changed();
@@ -535,6 +541,7 @@
 	void assertValid() const;
 
 private:
+	//<<Data we need to save
 	/// List of rows of cells in the table.
 	QList<QList<TableCell> > m_cellRows;
 
@@ -556,11 +563,13 @@
 	/// List of areas of merged cells.
 	QList<CellArea> m_cellAreas;
 
+	/// Style of the table.
+	TableStyle m_style;
+	//>>End of data we need to save
+	//-----------------------------
+	//<<Live working variables/data
 	/// Set of selected cells.
 	QSet<TableCell> m_selection;
-
-	/// Style of the table.
-	TableStyle m_style;
 
 	/// The table painter to paint the table with.
 	TablePainter* m_tablePainter;
@@ -595,6 +604,7 @@
 
 	/// The logical active column.
 	int m_activeColumn;
+	//>>End of live working variables/data
 };
 
 #endif // PAGEITEM_TABLE_H

Modified: branches/ScribusOIF/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/pageitem_textframe.cpp
==============================================================================
--- branches/ScribusOIF/scribus/pageitem_textframe.cpp (original)
+++ branches/ScribusOIF/scribus/pageitem_textframe.cpp Sat Oct  8 20:25:29 2011
@@ -147,9 +147,7 @@
 				if (((docItem->ItemNr > ItemNr) && (docItem->LayerID == LayerID)) || (LayerLevItem > LayerLev && m_Doc->layerFlow(docItem->LayerID)))
 				{
 					if (docItem->textFlowAroundObject())
-					{
-						result = result.subtract(itemShape(docItem, Mp->xOffset() - Dp->xOffset(), Mp->yOffset() - Dp->yOffset()));
-					}
+						result = result.subtracted(itemShape(docItem, Mp->xOffset() - Dp->xOffset(), Mp->yOffset() - Dp->yOffset()));
 				}
 			} // for all masterItems
 			// (JG) #6009 : disable possible interaction between master text frames and normal frames
@@ -177,14 +175,13 @@
 				if (((docItem->ItemNr > ItemNr) && (docItem->LayerID == LayerID)) || (LayerLevItem > LayerLev && m_Doc->layerFlow(docItem->LayerID)))
 				{
 					if (docItem->textFlowAroundObject())
-						result = result.subtract(itemShape(docItem, 0, 0));
+						result = result.subtracted(itemShape(docItem, 0, 0));
 				}
 			} // for all docItems
 		} // if(OnMasterPage.isEmpty()		
 	} // if(!Embedded)
 	return result;
 }
-
 
 void PageItem_TextFrame::setShadow()
 {

Modified: branches/ScribusOIF/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/pdflib_core.cpp
==============================================================================
--- branches/ScribusOIF/scribus/pdflib_core.cpp (original)
+++ branches/ScribusOIF/scribus/pdflib_core.cpp Sat Oct  8 20:25:29 2011
@@ -6539,7 +6539,7 @@
 		uint shadeObjectT = newObject();
 		StartObj(shadeObjectT);
 		PutDoc("<<\n");
-		PutDoc("/ShadingType 6\n");
+		PutDoc("/ShadingType 7\n");
 		PutDoc("/ColorSpace /DeviceGray\n");
 		PutDoc("/BitsPerCoordinate 32\n");
 		PutDoc("/BitsPerComponent 16\n");
@@ -6565,6 +6565,10 @@
 				vst << encode32dVal(mp1.gridPoint.x()) << encode32dVal(-mp1.gridPoint.y()) << encode32dVal(mp1.controlRight.x()) << encode32dVal(-mp1.controlRight.y()) << encode32dVal(mp2.controlLeft.x()) << encode32dVal(-mp2.controlLeft.y());
 				vst << encode32dVal(mp2.gridPoint.x()) << encode32dVal(-mp2.gridPoint.y()) << encode32dVal(mp2.controlBottom.x()) << encode32dVal(-mp2.controlBottom.y()) << encode32dVal(mp3.controlTop.x()) << encode32dVal(-mp3.controlTop.y());
 				vst << encode32dVal(mp3.gridPoint.x()) << encode32dVal(-mp3.gridPoint.y()) << encode32dVal(mp3.controlLeft.x()) << encode32dVal(-mp3.controlLeft.y()) << encode32dVal(mp4.controlRight.x()) << encode32dVal(-mp4.controlRight.y());
+				vst << encode32dVal(mp4.controlColor.x()) << encode32dVal(-mp4.controlColor.y());
+				vst << encode32dVal(mp1.controlColor.x()) << encode32dVal(-mp1.controlColor.y());
+				vst << encode32dVal(mp2.controlColor.x()) << encode32dVal(-mp2.controlColor.y());
+				vst << encode32dVal(mp3.controlColor.x()) << encode32dVal(-mp3.controlColor.y());
 				vst << encode16dVal(TransVec[colInd4]) << encode16dVal(TransVec[colInd1]) << encode16dVal(TransVec[colInd2]) << encode16dVal(TransVec[colInd3]);
 			}
 		}
@@ -6627,7 +6631,7 @@
 	uint shadeObject = newObject();
 	StartObj(shadeObject);
 	PutDoc("<<\n");
-	PutDoc("/ShadingType 6\n");
+	PutDoc("/ShadingType 7\n");
 	if (Options.UseRGB)
 	{
 		PutDoc("/ColorSpace /DeviceRGB\n");
@@ -6688,6 +6692,10 @@
 			vs << encode32dVal(mp1.gridPoint.x()) << encode32dVal(-mp1.gridPoint.y()) << encode32dVal(mp1.controlRight.x()) << encode32dVal(-mp1.controlRight.y()) << encode32dVal(mp2.controlLeft.x()) << encode32dVal(-mp2.controlLeft.y());
 			vs << encode32dVal(mp2.gridPoint.x()) << encode32dVal(-mp2.gridPoint.y()) << encode32dVal(mp2.controlBottom.x()) << encode32dVal(-mp2.controlBottom.y()) << encode32dVal(mp3.controlTop.x()) << encode32dVal(-mp3.controlTop.y());
 			vs << encode32dVal(mp3.gridPoint.x()) << encode32dVal(-mp3.gridPoint.y()) << encode32dVal(mp3.controlLeft.x()) << encode32dVal(-mp3.controlLeft.y()) << encode32dVal(mp4.controlRight.x()) << encode32dVal(-mp4.controlRight.y());
+			vs << encode32dVal(mp4.controlColor.x()) << encode32dVal(-mp4.controlColor.y());
+			vs << encode32dVal(mp1.controlColor.x()) << encode32dVal(-mp1.controlColor.y());
+			vs << encode32dVal(mp2.controlColor.x()) << encode32dVal(-mp2.controlColor.y());
+			vs << encode32dVal(mp3.controlColor.x()) << encode32dVal(-mp3.controlColor.y());
 			encodeColor(vs, colorNames[colInd4], colorShades[colInd4], spotColorSet, spotMode);
 			encodeColor(vs, colorNames[colInd1], colorShades[colInd1], spotColorSet, spotMode);
 			encodeColor(vs, colorNames[colInd2], colorShades[colInd2], spotColorSet, spotMode);
@@ -6856,7 +6864,7 @@
 		uint shadeObjectT = newObject();
 		StartObj(shadeObjectT);
 		PutDoc("<<\n");
-		PutDoc("/ShadingType 6\n");
+		PutDoc("/ShadingType 7\n");
 		PutDoc("/ColorSpace /DeviceGray\n");
 		PutDoc("/BitsPerCoordinate 32\n");
 		PutDoc("/BitsPerComponent 16\n");
@@ -6881,6 +6889,10 @@
 			vst << encode32dVal(mp1.gridPoint.x()) << encode32dVal(-mp1.gridPoint.y()) << encode32dVal(mp1.controlRight.x()) << encode32dVal(-mp1.controlRight.y()) << encode32dVal(mp2.controlLeft.x()) << encode32dVal(-mp2.controlLeft.y());
 			vst << encode32dVal(mp2.gridPoint.x()) << encode32dVal(-mp2.gridPoint.y()) << encode32dVal(mp2.controlBottom.x()) << encode32dVal(-mp2.controlBottom.y()) << encode32dVal(mp3.controlTop.x()) << encode32dVal(-mp3.controlTop.y());
 			vst << encode32dVal(mp3.gridPoint.x()) << encode32dVal(-mp3.gridPoint.y()) << encode32dVal(mp3.controlLeft.x()) << encode32dVal(-mp3.controlLeft.y()) << encode32dVal(mp4.controlRight.x()) << encode32dVal(-mp4.controlRight.y());
+			vst << encode32dVal(mp4.controlColor.x()) << encode32dVal(-mp4.controlColor.y());
+			vst << encode32dVal(mp1.controlColor.x()) << encode32dVal(-mp1.controlColor.y());
+			vst << encode32dVal(mp2.controlColor.x()) << encode32dVal(-mp2.controlColor.y());
+			vst << encode32dVal(mp3.controlColor.x()) << encode32dVal(-mp3.controlColor.y());
 			vst << encode16dVal(TransVec[colInd4]) << encode16dVal(TransVec[colInd1]) << encode16dVal(TransVec[colInd2]) << encode16dVal(TransVec[colInd3]);
 		}
 		PutDoc("/Decode [-40000 40000 -40000 40000 0 1]\n");
@@ -6942,7 +6954,7 @@
 	uint shadeObject = newObject();
 	StartObj(shadeObject);
 	PutDoc("<<\n");
-	PutDoc("/ShadingType 6\n");
+	PutDoc("/ShadingType 7\n");
 	if (Options.UseRGB)
 	{
 		PutDoc("/ColorSpace /DeviceRGB\n");
@@ -7002,6 +7014,10 @@
 		vs << encode32dVal(mp1.gridPoint.x()) << encode32dVal(-mp1.gridPoint.y()) << encode32dVal(mp1.controlRight.x()) << encode32dVal(-mp1.controlRight.y()) << encode32dVal(mp2.controlLeft.x()) << encode32dVal(-mp2.controlLeft.y());
 		vs << encode32dVal(mp2.gridPoint.x()) << encode32dVal(-mp2.gridPoint.y()) << encode32dVal(mp2.controlBottom.x()) << encode32dVal(-mp2.controlBottom.y()) << encode32dVal(mp3.controlTop.x()) << encode32dVal(-mp3.controlTop.y());
 		vs << encode32dVal(mp3.gridPoint.x()) << encode32dVal(-mp3.gridPoint.y()) << encode32dVal(mp3.controlLeft.x()) << encode32dVal(-mp3.controlLeft.y()) << encode32dVal(mp4.controlRight.x()) << encode32dVal(-mp4.controlRight.y());
+		vs << encode32dVal(mp4.controlColor.x()) << encode32dVal(-mp4.controlColor.y());
+		vs << encode32dVal(mp1.controlColor.x()) << encode32dVal(-mp1.controlColor.y());
+		vs << encode32dVal(mp2.controlColor.x()) << encode32dVal(-mp2.controlColor.y());
+		vs << encode32dVal(mp3.controlColor.x()) << encode32dVal(-mp3.controlColor.y());
 		encodeColor(vs, colorNames[colInd4], colorShades[colInd4], spotColorSet, spotMode);
 		encodeColor(vs, colorNames[colInd1], colorShades[colInd1], spotColorSet, spotMode);
 		encodeColor(vs, colorNames[colInd2], colorShades[colInd2], spotColorSet, spotMode);

Modified: branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.cpp Sat Oct  8 20:25:29 2011
@@ -31,6 +31,7 @@
 #ifdef HAVE_OSG
 	#include "pageitem_osgframe.h"
 #endif
+#include "pageitem_table.h"
 #include "pageitem_regularpolygon.h"
 #include "pageitem_arc.h"
 #include "pageitem_spiral.h"
@@ -2701,6 +2702,7 @@
 			mp.controlBottom = FPoint(tAtt.valueAsDouble("CBX", 0.0), tAtt.valueAsDouble("CBY", 0.0));
 			mp.controlLeft   = FPoint(tAtt.valueAsDouble("CLX", 0.0), tAtt.valueAsDouble("CLY", 0.0));
 			mp.controlRight  = FPoint(tAtt.valueAsDouble("CRX", 0.0), tAtt.valueAsDouble("CRY", 0.0));
+			mp.controlColor  = FPoint(tAtt.valueAsDouble("CCX", mp.gridPoint.x()), tAtt.valueAsDouble("CCY", mp.gridPoint.y()));
 			mp.color         = SetColor(doc, mp.colorName, mp.shade);
 			mp.color.setAlphaF(mp.transparency);
 			newItem->meshGradientArray[mGArrayRows][mGArrayCols] = mp;
@@ -2722,6 +2724,7 @@
 			mp.controlBottom = FPoint(tAtt.valueAsDouble("CBX", 0.0), tAtt.valueAsDouble("CBY", 0.0));
 			mp.controlLeft   = FPoint(tAtt.valueAsDouble("CLX", 0.0), tAtt.valueAsDouble("CLY", 0.0));
 			mp.controlRight  = FPoint(tAtt.valueAsDouble("CRX", 0.0), tAtt.valueAsDouble("CRY", 0.0));
+			mp.controlColor  = FPoint(tAtt.valueAsDouble("CCX", mp.gridPoint.x()), tAtt.valueAsDouble("CCY", mp.gridPoint.y()));
 			mp.color         = SetColor(doc, mp.colorName, mp.shade);
 			mp.color.setAlphaF(mp.transparency);
 			if (mGArrayCols == 0)
@@ -3401,13 +3404,6 @@
 		z = doc->itemAdd(PageItem::TextFrame, PageItem::Unspecified, x, y, w, h, pw, CommonStrings::None, Pcolor, true);
 		currItem = doc->Items->at(z);
 		if (pagenr > -2) 
-			currItem->OwnPage = pagenr;
-		break;
-	case PageItem::Table:
-		// TODO: Actually handle pasting of tables properly.
-		z = doc->itemAdd(PageItem::Table, PageItem::Unspecified, x, y, w, h, 0.0, CommonStrings::None, CommonStrings::None, true);
-		currItem = doc->Items->at(z);
-		if (pagenr > -2)
 			currItem->OwnPage = pagenr;
 		break;
 	case PageItem::Line:
@@ -3460,6 +3456,13 @@
 		z = doc->itemAdd(PageItem::Spiral, PageItem::Unspecified, x, y, w, h, pw, Pcolor, Pcolor2, true);
 		currItem = doc->Items->at(z);
 		if (pagenr > -2) 
+			currItem->OwnPage = pagenr;
+		break;
+	case PageItem::Table:
+		// TODO: Actually handle pasting of tables properly.
+		z = doc->itemAdd(PageItem::Table, PageItem::Unspecified, x, y, w, h, 0.0, CommonStrings::None, CommonStrings::None, true);
+		currItem = doc->Items->at(z);
+		if (pagenr > -2)
 			currItem->OwnPage = pagenr;
 		break;
 	case PageItem::Multiple:
@@ -3665,6 +3668,57 @@
 		UndoManager::instance()->setUndoEnabled(true);
 	}
 
+	if (currItem->asTable())
+	{
+		PageItem_Table *tableitem = currItem->asTable();
+		int rows=attrs.valueAsInt("Rows",1);
+		int cols=attrs.valueAsInt("Columns",1);
+		tableitem->insertRows(1,rows-1);
+		tableitem->insertColumns(1,cols-1);
+		tableitem->setStyle(attrs.valueAsString("TableStyle"));
+//		QString rowPositions(attrs.valueAsString("RowPositions"));
+//		QStringList slRowPositions=rowPositions.split(" ");
+//		qDebug()<<"RowCount"<<rows<<"row positions"<<slRowPositions.count();
+
+		QString rowHeights(attrs.valueAsString("RowHeights",""));
+		if(!rowHeights.isEmpty())
+		{
+			QStringList slRowHeights=rowHeights.split(" ");
+			int i=0;
+			foreach(QString pos, slRowHeights)
+			{
+				tableitem->resizeRow(i++, pos.toDouble());
+			}
+		}
+//		QString colPositions(attrs.valueAsString("ColumnPositions"));
+//		QStringList slColPositions=colPositions.split(" ");
+		QString colWidths(attrs.valueAsString("ColumnWidths",""));
+		if(!colWidths.isEmpty())
+		{
+			QStringList slColWidths=colWidths.split(" ");
+			int j=0;
+			foreach(QString pos, slColWidths)
+			{
+				tableitem->resizeColumn(j++, pos.toDouble());
+			}
+		}
+		QString cellAreas(attrs.valueAsString("CellAreas"));
+		if(!cellAreas.isEmpty())
+		{
+			QStringList slCellAreas=cellAreas.split(" ");
+			if (slCellAreas.count()%4!=0)
+				qDebug()<<"Cell Area Count on load ! % 4";
+			for (int i = 0; i < slCellAreas.size(); i+=4)
+			{
+				int rows=slCellAreas.at(i).toInt();
+				int columns=slCellAreas.at(i+1).toInt();
+				int height=slCellAreas.at(i+2).toInt();
+				int width=slCellAreas.at(i+3).toInt();
+				tableitem->mergeCells(rows,columns,height,width);
+			}
+		}
+	}
+
 	currItem->TopLine      = attrs.valueAsBool("TopLine", false);
 	currItem->LeftLine     = attrs.valueAsBool("LeftLine", false);
 	currItem->RightLine    = attrs.valueAsBool("RightLine", false);
@@ -4474,7 +4528,7 @@
 	bool fou(false);
 	QString tmpf, tmV;
 	const StyleSet<ParagraphStyle> * docParagraphStyles = tempStyles? tempStyles : & doc->paragraphStyles();
-	PrefsManager* prefsManager = PrefsManager::instance();
+	//UNUSED: PrefsManager* prefsManager = PrefsManager::instance();
 	readParagraphStyle(doc, reader, style);
 	for (int xx=0; xx<docParagraphStyles->count(); ++xx)
 	{

Modified: branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.h
==============================================================================
--- branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.h (original)
+++ branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format.h Sat Oct  8 20:25:29 2011
@@ -130,10 +130,14 @@
 		void writeHyphenatorLists(ScXmlStreamWriter& docu);
 		void writePStyles(ScXmlStreamWriter& docu);
 		void writeCStyles(ScXmlStreamWriter& docu);
+		void writeTableStyles(ScXmlStreamWriter& docu);
+		void writeCellStyles(ScXmlStreamWriter& docu);
 		void putPStyle(ScXmlStreamWriter& docu, const ParagraphStyle & style, const QString &nodeName);
 		void putCStylePT(ScXmlStreamWriter& docu, const CharStyle & style);
 		void putCStyle(ScXmlStreamWriter& docu, const CharStyle & style);
 		void putNamedCStyle(ScXmlStreamWriter& docu, const CharStyle & style);
+		void putTableStyle(ScXmlStreamWriter& docu, const TableStyle & style);
+		void putCellStyle(ScXmlStreamWriter& docu, const CellStyle & style);
 		void writeITEXTs(ScribusDoc *doc, ScXmlStreamWriter&, PageItem* item);
 		void writeLayers(ScXmlStreamWriter& docu);
 		void writePrintOptions(ScXmlStreamWriter& docu);

Modified: branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp Sat Oct  8 20:25:29 2011
@@ -27,6 +27,7 @@
 #include "pageitem_regularpolygon.h"
 #include "pageitem_arc.h"
 #include "pageitem_spiral.h"
+#include "pageitem_table.h"
 
 #include "units.h"
 #include "util.h"
@@ -353,6 +354,8 @@
 	writeHyphenatorLists(docu);
 	writePStyles(docu);
 	writeCStyles(docu);
+	writeTableStyles(docu);
+	writeCellStyles(docu);
 	writeLinestyles(docu);
 	writeLayers(docu);
 	writePrintOptions(docu);
@@ -562,7 +565,7 @@
 	docu.writeEndElement();
 }
 
-void Scribus150Format::writePStyles(ScXmlStreamWriter & docu) 
+void Scribus150Format::writePStyles(ScXmlStreamWriter & docu)
 {
 	QList<int> styleList = m_Doc->getSortedStyleList();
 	for (int a = 0; a < styleList.count(); ++a)
@@ -751,6 +754,36 @@
 	if ( style.hasName() && style.isDefaultStyle())
 		docu.writeAttribute("DefaultStyle", style.isDefaultStyle());
 	putCStyle(docu, style);
+}
+
+void Scribus150Format::writeTableStyles(ScXmlStreamWriter& docu)
+{
+	QList<int> styleList = m_Doc->getSortedTableStyleList();
+	for (int i = 0; i < styleList.count(); ++i)
+	{
+		docu.writeStartElement("TableStyle");
+		putTableStyle(docu, m_Doc->tableStyles()[styleList[i]]);
+		docu.writeEndElement();
+	}
+}
+
+void Scribus150Format::writeCellStyles(ScXmlStreamWriter& docu)
+{
+	QList<int> styleList = m_Doc->getSortedCellStyleList();
+	for (int i = 0; i < styleList.count(); ++i)
+	{
+		docu.writeStartElement("CellStyle");
+		putCellStyle(docu, m_Doc->cellStyles()[styleList[i]]);
+		docu.writeEndElement();
+	}
+}
+
+void Scribus150Format::putTableStyle(ScXmlStreamWriter &docu, const TableStyle &style)
+{
+}
+
+void Scribus150Format::putCellStyle(ScXmlStreamWriter &docu, const CellStyle &style)
+{
 }
 
 void Scribus150Format::writeLayers(ScXmlStreamWriter & docu) 
@@ -1727,6 +1760,8 @@
 					docu.writeAttribute("CLY", mp.controlLeft.y());
 					docu.writeAttribute("CRX", mp.controlRight.x());
 					docu.writeAttribute("CRY", mp.controlRight.y());
+					docu.writeAttribute("CCX", mp.controlColor.x());
+					docu.writeAttribute("CCY", mp.controlColor.y());
 					docu.writeAttribute("NAME", mp.colorName);
 					docu.writeAttribute("SHADE", mp.shade);
 					docu.writeAttribute("TRANS", mp.transparency);
@@ -1761,6 +1796,8 @@
 					docu.writeAttribute("CLY", mp.controlLeft.y());
 					docu.writeAttribute("CRX", mp.controlRight.x());
 					docu.writeAttribute("CRY", mp.controlRight.y());
+					docu.writeAttribute("CCX", mp.controlColor.x());
+					docu.writeAttribute("CCY", mp.controlColor.y());
 					docu.writeAttribute("NAME", mp.colorName);
 					docu.writeAttribute("SHADE", mp.shade);
 					docu.writeAttribute("TRANS", mp.transparency);
@@ -1844,6 +1881,91 @@
 		if (item->asGroupFrame())
 		{
 			WriteObjects(m_Doc, docu, baseDir, 0, 0, ItemSelectionGroup, &item->groupItemList);
+		}
+		//Write all the cells and their data to the document, as sub-elements of the pageitem.
+		if (item->isTable())
+		{
+			//PTYPE == PageItem::Table or 16 (pageitem.h)
+			PageItem_Table* tableItem=item->asTable();
+			docu.writeStartElement("TableData");
+			//for each cell, write it to the doc
+			foreach (QList<TableCell> cellRow, tableItem->cellRows())
+			{
+				docu.writeStartElement("Row");
+				foreach(TableCell cell, cellRow)
+				{
+					docu.writeStartElement("Cell");
+					docu.writeAttribute("Row", cell.row());
+					docu.writeAttribute("Column",cell.column());
+					docu.writeAttribute("RowSpan", cell.rowSpan());
+					docu.writeAttribute("ColSpan",cell.columnSpan());
+					docu.writeAttribute("Style",cell.style());
+					//TODO
+					//BoundRect?
+					//ContentRect?
+					docu.writeAttribute("FillColor", cell.fillColor());
+					docu.writeAttribute("LeftPadding",cell.leftPadding());
+					docu.writeAttribute("RightPadding", cell.rightPadding());
+					docu.writeAttribute("TopPadding",cell.topPadding());
+					docu.writeAttribute("BottomPadding", cell.bottomPadding());
+
+					TableBorder tbLeft=cell.leftBorder();
+					docu.writeStartElement("TableBorderLeft");
+					docu.writeAttribute("Width", tbLeft.width());
+					foreach (TableBorderLine tbl, tbLeft.borderLines())
+					{
+						docu.writeStartElement("TableBorderLine");
+						docu.writeAttribute("Width", tbl.width());
+						docu.writeAttribute("PenStyle", tbl.style());
+						docu.writeAttribute("Color", tbl.color());
+						docu.writeEndElement();
+					}
+					docu.writeEndElement();
+
+					TableBorder tbRight=cell.rightBorder();
+					docu.writeStartElement("TableBorderRight");
+					docu.writeAttribute("Width", tbRight.width());
+					foreach (TableBorderLine tbl, tbRight.borderLines())
+					{
+						docu.writeStartElement("TableBorderLine");
+						docu.writeAttribute("Width", tbl.width());
+						docu.writeAttribute("PenStyle", tbl.style());
+						docu.writeAttribute("Color", tbl.color());
+						docu.writeEndElement();
+					}
+					docu.writeEndElement();
+
+					TableBorder tbTop=cell.topBorder();
+					docu.writeStartElement("TableBorderTop");
+					docu.writeAttribute("Width", tbTop.width());
+					foreach (TableBorderLine tbl, tbTop.borderLines())
+					{
+						docu.writeStartElement("TableBorderLine");
+						docu.writeAttribute("Width", tbl.width());
+						docu.writeAttribute("PenStyle", tbl.style());
+						docu.writeAttribute("Color", tbl.color());
+						docu.writeEndElement();
+					}
+					docu.writeEndElement();
+
+					TableBorder tbBottom=cell.bottomBorder();
+					docu.writeStartElement("TableBorderBottom");
+					docu.writeAttribute("Width", tbBottom.width());
+					foreach (TableBorderLine tbl, tbBottom.borderLines())
+					{
+						docu.writeStartElement("TableBorderLine");
+						docu.writeAttribute("Width", tbl.width());
+						docu.writeAttribute("PenStyle", tbl.style());
+						docu.writeAttribute("Color", tbl.color());
+						docu.writeEndElement();
+					}
+					docu.writeEndElement();
+					//End Cell
+					docu.writeEndElement();
+				}
+				docu.writeEndElement();
+			}
+			docu.writeEndElement();
 		}
 
 		//CB PageItemAttributes
@@ -2187,6 +2309,46 @@
 			docu.writeAttribute("BottomLINK", -1);
 		docu.writeAttribute("OwnLINK", item->ItemNr);
 	}
+
+	if (item->isTable())
+	{
+		//PTYPE == PageItem::Table or 16 (pageitem.h)
+		PageItem_Table* tableItem=item->asTable();
+		docu.writeAttribute("Rows", tableItem->rows());
+		docu.writeAttribute("Columns",tableItem->columns());
+
+		QString outputData;
+		//Row Positions
+		foreach(qreal value, tableItem->rowPositions())
+			outputData += tmp.setNum(value) + " ";
+		docu.writeAttribute("RowPositions", outputData.simplified());
+		outputData.clear();
+		//Row Heights
+		foreach(qreal value, tableItem->rowHeights())
+			outputData += tmp.setNum(value) + " ";
+		docu.writeAttribute("RowHeights", outputData.simplified());
+		outputData.clear();
+		//Column Positions
+		foreach(qreal value, tableItem->columnPositions())
+			outputData += tmp.setNum(value) + " ";
+		docu.writeAttribute("ColumnPositions", outputData.simplified());
+		outputData.clear();
+		//Column Widths
+		foreach(qreal value, tableItem->columnWidths())
+			outputData += tmp.setNum(value) + " ";
+		docu.writeAttribute("ColumnWidths", outputData.simplified());
+		outputData.clear();
+		//Cell Areas
+		//TODO Is this the best format to write these out?
+		QString tmp1,tmp2,tmp3,tmp4;
+		foreach(CellArea ca, tableItem->cellAreas())
+			outputData += tmp1.setNum(ca.row()) + " " + tmp2.setNum(ca.column()) + " " + tmp3.setNum(ca.height()) + " " + tmp4.setNum(ca.width()) + " ";
+		docu.writeAttribute("CellAreas", outputData.simplified());
+		outputData.clear();
+
+		docu.writeAttribute("TableStyle",tableItem->style());
+	}
+
 	if (item->isGroup())
 	{
 		docu.writeAttribute("groupWidth", item->groupWidth);

Modified: branches/ScribusOIF/scribus/plugins/import/pdf/slaoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/plugins/import/pdf/slaoutput.cpp
==============================================================================
--- branches/ScribusOIF/scribus/plugins/import/pdf/slaoutput.cpp (original)
+++ branches/ScribusOIF/scribus/plugins/import/pdf/slaoutput.cpp Sat Oct  8 20:25:29 2011
@@ -781,6 +781,7 @@
 		applyMask(ite);
 	}
 //	qDebug() << "Mesh of" << shading->getNPatches() << "Patches";
+	ite->meshGradientPatches.clear();
 	for (int i = 0; i < shading->getNPatches(); i++)
 	{
 		GfxPatch *patch = shading->getPatch(i);
@@ -790,6 +791,7 @@
 		patchM.BL.resetTo(FPoint(patch->x[0][0], patch->y[0][0]));
 		patchM.BL.controlTop = FPoint(patch->x[0][1], patch->y[0][1]);
 		patchM.BL.controlRight = FPoint(patch->x[1][0], patch->y[1][0]);
+		patchM.BL.controlColor = FPoint(patch->x[1][1], patch->y[1][1]);
 		u = 0;
 		v = 0;
 		if (shading->isParameterized())
@@ -813,6 +815,7 @@
 		patchM.TL.resetTo(FPoint(patch->x[0][3], patch->y[0][3]));
 		patchM.TL.controlRight = FPoint(patch->x[1][3], patch->y[1][3]);
 		patchM.TL.controlBottom = FPoint(patch->x[0][2], patch->y[0][2]);
+		patchM.TL.controlColor = FPoint(patch->x[1][2], patch->y[1][2]);
 		if (shading->isParameterized())
 		{
 			shading->getParameterizedColor (patch->color[u][v].c[0], &color);
@@ -834,6 +837,7 @@
 		patchM.TR.resetTo(FPoint(patch->x[3][3], patch->y[3][3]));
 		patchM.TR.controlBottom = FPoint(patch->x[3][2], patch->y[3][2]);
 		patchM.TR.controlLeft = FPoint(patch->x[2][3], patch->y[2][3]);
+		patchM.TR.controlColor = FPoint(patch->x[2][2], patch->y[2][2]);
 		if (shading->isParameterized())
 		{
 			shading->getParameterizedColor (patch->color[u][v].c[0], &color);
@@ -855,6 +859,7 @@
 		patchM.BR.resetTo(FPoint(patch->x[3][0], patch->y[3][0]));
 		patchM.BR.controlLeft = FPoint(patch->x[2][0], patch->y[2][0]);
 		patchM.BR.controlTop = FPoint(patch->x[3][1], patch->y[3][1]);
+		patchM.BR.controlColor = FPoint(patch->x[2][1], patch->y[2][1]);
 		if (shading->isParameterized())
 		{
 			shading->getParameterizedColor (patch->color[u][v].c[0], &color);

Modified: branches/ScribusOIF/scribus/pslib.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/pslib.cpp
==============================================================================
--- branches/ScribusOIF/scribus/pslib.cpp (original)
+++ branches/ScribusOIF/scribus/pslib.cpp Sat Oct  8 20:25:29 2011
@@ -3178,6 +3178,7 @@
 	QStringList colorValues;
 	QStringList spotColorSet;
 	QStringList tmpAddedColors;
+	QString entx = "";
 	tmpAddedColors.clear();
 	QList<int> colsSh;
 	for (int grow = 0; grow < c->meshGradientArray.count(); grow++)
@@ -3253,15 +3254,19 @@
 	PutStream("/PatternType 2\n");
 	PutStream("/Shading\n");
 	PutStream("<<\n");
-	PutStream("/ShadingType 6\n");
+        PutStream("/ShadingType 7\n");
 	if ((DoSep) || (GraySc))
+	{
 		PutStream("/ColorSpace /DeviceGray\n");
+		entx = "0 1";
+	}
 	else if ((useSpotColors) && ((spotColorSet.count() > 0) && (spotColorSet.count() < 28)))
 	{
 		PutStream("/ColorSpace [ /DeviceN [/Cyan /Magenta /Yellow /Black");
 		for (int sc = 0; sc < spotColorSet.count(); sc++)
 		{
 			PutStream(" ("+spotColorSet.at(sc)+")");
+			entx += " 0 1";
 		}
 		PutStream("]\n");
 		PutStream("/DeviceCMYK\n");
@@ -3291,8 +3296,22 @@
 		PutStream("} ]\n");
 	}
 	else
+	{
 		PutStream("/ColorSpace /DeviceCMYK\n");
-	PutStream("/DataSource [\n");
+		entx = "0 1 0 1 0 1 0 1";
+	}
+	PutStream("/BitsPerCoordinate 32\n");
+	PutStream("/BitsPerComponent 16\n");
+	PutStream("/BitsPerFlag 8\n");
+	PutStream("/Decode [-40000 40000 -40000 40000 "+entx+"]\n");
+	PutStream("/DataSource currentfile /ASCII85Decode filter /FlateDecode filter\n");
+	PutStream(">>\n");
+	PutStream(">>\n");
+	PutStream("[1 0 0 1 0 0] makepattern\n");
+	QByteArray vertStream;
+	QDataStream vst(&vertStream, QIODevice::WriteOnly);
+	vst.setByteOrder(QDataStream::BigEndian);
+	quint8 flg = 0;
 	for (int grow = 0; grow < c->meshGradientArray.count()-1; grow++)
 	{
 		for (int gcol = 0; gcol < c->meshGradientArray[grow].count()-1; gcol++)
@@ -3305,18 +3324,23 @@
 			int colInd2 = grow * c->meshGradientArray[grow].count() + gcol + 1;
 			int colInd3 = (grow + 1) * c->meshGradientArray[grow].count() + gcol + 1;
 			int colInd4 = (grow + 1) * c->meshGradientArray[grow].count() + gcol;
-			PutStream("0\n");
-			PutStream(ToStr(mp4.gridPoint.x())+" "+ToStr(-mp4.gridPoint.y())+" "+ToStr(mp4.controlTop.x())+" "+ToStr(-mp4.controlTop.y())+" "+ToStr(mp1.controlBottom.x())+" "+ToStr(-mp1.controlBottom.y())+"\n");
-			PutStream(ToStr(mp1.gridPoint.x())+" "+ToStr(-mp1.gridPoint.y())+" "+ToStr(mp1.controlRight.x())+" "+ToStr(-mp1.controlRight.y())+" "+ToStr(mp2.controlLeft.x())+" "+ToStr(-mp2.controlLeft.y())+"\n");
-			PutStream(ToStr(mp2.gridPoint.x())+" "+ToStr(-mp2.gridPoint.y())+" "+ToStr(mp2.controlBottom.x())+" "+ToStr(-mp2.controlBottom.y())+" "+ToStr(mp3.controlTop.x())+" "+ToStr(-mp3.controlTop.y())+"\n");
-			PutStream(ToStr(mp3.gridPoint.x())+" "+ToStr(-mp3.gridPoint.y())+" "+ToStr(mp3.controlLeft.x())+" "+ToStr(-mp3.controlLeft.y())+" "+ToStr(mp4.controlRight.x())+" "+ToStr(-mp4.controlRight.y())+"\n");
-			PutStream(colorValues[colInd4]+" "+colorValues[colInd1]+" "+colorValues[colInd2]+" "+colorValues[colInd3]+"\n");
-		}
-	}
-	PutStream("]\n");
-	PutStream(">>\n");
-	PutStream(">>\n");
-	PutStream("[1 0 0 1 0 0] makepattern setpattern\n");
+			vst << flg;
+			vst << encode32dVal(mp4.gridPoint.x()) << encode32dVal(-mp4.gridPoint.y()) << encode32dVal(mp4.controlTop.x()) << encode32dVal(-mp4.controlTop.y()) << encode32dVal(mp1.controlBottom.x()) << encode32dVal(-mp1.controlBottom.y());
+			vst << encode32dVal(mp1.gridPoint.x()) << encode32dVal(-mp1.gridPoint.y()) << encode32dVal(mp1.controlRight.x()) << encode32dVal(-mp1.controlRight.y()) << encode32dVal(mp2.controlLeft.x()) << encode32dVal(-mp2.controlLeft.y());
+			vst << encode32dVal(mp2.gridPoint.x()) << encode32dVal(-mp2.gridPoint.y()) << encode32dVal(mp2.controlBottom.x()) << encode32dVal(-mp2.controlBottom.y()) << encode32dVal(mp3.controlTop.x()) << encode32dVal(-mp3.controlTop.y());
+			vst << encode32dVal(mp3.gridPoint.x()) << encode32dVal(-mp3.gridPoint.y()) << encode32dVal(mp3.controlLeft.x()) << encode32dVal(-mp3.controlLeft.y()) << encode32dVal(mp4.controlRight.x()) << encode32dVal(-mp4.controlRight.y());
+			vst << encode32dVal(mp4.controlColor.x()) << encode32dVal(-mp4.controlColor.y());
+			vst << encode32dVal(mp1.controlColor.x()) << encode32dVal(-mp1.controlColor.y());
+			vst << encode32dVal(mp2.controlColor.x()) << encode32dVal(-mp2.controlColor.y());
+			vst << encode32dVal(mp3.controlColor.x()) << encode32dVal(-mp3.controlColor.y());
+			encodeColor(vst, colorValues[colInd4]);
+			encodeColor(vst, colorValues[colInd1]);
+			encodeColor(vst, colorValues[colInd2]);
+			encodeColor(vst, colorValues[colInd3]);
+		}
+	}
+	PutImageDataToStream(vertStream);
+	PutStream("setpattern\n");
 	if (fillRule)
 		PutStream("eofill\n");
 	else
@@ -3340,6 +3364,7 @@
 	QStringList colorValues;
 	QStringList spotColorSet;
 	QList<int> colsSh;
+	QString entx = "";
 	for (int col = 0; col < c->meshGradientPatches.count(); col++)
 	{
 		meshGradientPatch patch = c->meshGradientPatches[col];
@@ -3423,15 +3448,20 @@
 	PutStream("/PatternType 2\n");
 	PutStream("/Shading\n");
 	PutStream("<<\n");
-	PutStream("/ShadingType 6\n");
+	PutStream("/ShadingType 7\n");
 	if ((DoSep) || (GraySc))
+	{
 		PutStream("/ColorSpace /DeviceGray\n");
+		entx = "0 1";
+	}
 	else if ((useSpotColors) && ((spotColorSet.count() > 0) && (spotColorSet.count() < 28)))
 	{
+		entx = "0 1 0 1 0 1 0 1";
 		PutStream("/ColorSpace [ /DeviceN [/Cyan /Magenta /Yellow /Black");
 		for (int sc = 0; sc < spotColorSet.count(); sc++)
 		{
 			PutStream(" ("+spotColorSet.at(sc)+")");
+			entx += " 0 1";
 		}
 		PutStream("]\n");
 		PutStream("/DeviceCMYK\n");
@@ -3461,8 +3491,22 @@
 		PutStream("} ]\n");
 	}
 	else
+	{
 		PutStream("/ColorSpace /DeviceCMYK\n");
-	PutStream("/DataSource [\n");
+		entx = "0 1 0 1 0 1 0 1";
+	}
+	PutStream("/BitsPerCoordinate 32\n");
+	PutStream("/BitsPerComponent 16\n");
+	PutStream("/BitsPerFlag 8\n");
+	PutStream("/Decode [-40000 40000 -40000 40000 "+entx+"]\n");
+	PutStream("/DataSource currentfile /ASCII85Decode filter /FlateDecode filter\n");
+	PutStream(">>\n");
+	PutStream(">>\n");
+	PutStream("[1 0 0 1 0 0] makepattern\n");
+	QByteArray vertStream;
+	QDataStream vst(&vertStream, QIODevice::WriteOnly);
+	vst.setByteOrder(QDataStream::BigEndian);
+	quint8 flg = 0;
 	for (int col = 0; col < c->meshGradientPatches.count(); col++)
 	{
 		meshGradientPatch patch = c->meshGradientPatches[col];
@@ -3474,22 +3518,49 @@
 		int colInd2 = 4 * col + 1;
 		int colInd3 = 4 * col + 2;
 		int colInd4 = 4 * col + 3;
-		PutStream("0\n");
-		PutStream(ToStr(mp4.gridPoint.x())+" "+ToStr(-mp4.gridPoint.y())+" "+ToStr(mp4.controlTop.x())+" "+ToStr(-mp4.controlTop.y())+" "+ToStr(mp1.controlBottom.x())+" "+ToStr(-mp1.controlBottom.y())+"\n");
-		PutStream(ToStr(mp1.gridPoint.x())+" "+ToStr(-mp1.gridPoint.y())+" "+ToStr(mp1.controlRight.x())+" "+ToStr(-mp1.controlRight.y())+" "+ToStr(mp2.controlLeft.x())+" "+ToStr(-mp2.controlLeft.y())+"\n");
-		PutStream(ToStr(mp2.gridPoint.x())+" "+ToStr(-mp2.gridPoint.y())+" "+ToStr(mp2.controlBottom.x())+" "+ToStr(-mp2.controlBottom.y())+" "+ToStr(mp3.controlTop.x())+" "+ToStr(-mp3.controlTop.y())+"\n");
-		PutStream(ToStr(mp3.gridPoint.x())+" "+ToStr(-mp3.gridPoint.y())+" "+ToStr(mp3.controlLeft.x())+" "+ToStr(-mp3.controlLeft.y())+" "+ToStr(mp4.controlRight.x())+" "+ToStr(-mp4.controlRight.y())+"\n");
-		PutStream(colorValues[colInd4]+" "+colorValues[colInd1]+" "+colorValues[colInd2]+" "+colorValues[colInd3]+"\n");
-	}
-	PutStream("]\n");
-	PutStream(">>\n");
-	PutStream(">>\n");
-	PutStream("[1 0 0 1 0 0] makepattern setpattern\n");
+		vst << flg;
+		vst << encode32dVal(mp4.gridPoint.x()) << encode32dVal(-mp4.gridPoint.y()) << encode32dVal(mp4.controlTop.x()) << encode32dVal(-mp4.controlTop.y()) << encode32dVal(mp1.controlBottom.x()) << encode32dVal(-mp1.controlBottom.y());
+		vst << encode32dVal(mp1.gridPoint.x()) << encode32dVal(-mp1.gridPoint.y()) << encode32dVal(mp1.controlRight.x()) << encode32dVal(-mp1.controlRight.y()) << encode32dVal(mp2.controlLeft.x()) << encode32dVal(-mp2.controlLeft.y());
+		vst << encode32dVal(mp2.gridPoint.x()) << encode32dVal(-mp2.gridPoint.y()) << encode32dVal(mp2.controlBottom.x()) << encode32dVal(-mp2.controlBottom.y()) << encode32dVal(mp3.controlTop.x()) << encode32dVal(-mp3.controlTop.y());
+		vst << encode32dVal(mp3.gridPoint.x()) << encode32dVal(-mp3.gridPoint.y()) << encode32dVal(mp3.controlLeft.x()) << encode32dVal(-mp3.controlLeft.y()) << encode32dVal(mp4.controlRight.x()) << encode32dVal(-mp4.controlRight.y());
+		vst << encode32dVal(mp4.controlColor.x()) << encode32dVal(-mp4.controlColor.y());
+		vst << encode32dVal(mp1.controlColor.x()) << encode32dVal(-mp1.controlColor.y());
+		vst << encode32dVal(mp2.controlColor.x()) << encode32dVal(-mp2.controlColor.y());
+		vst << encode32dVal(mp3.controlColor.x()) << encode32dVal(-mp3.controlColor.y());
+		encodeColor(vst, colorValues[colInd4]);
+		encodeColor(vst, colorValues[colInd1]);
+		encodeColor(vst, colorValues[colInd2]);
+		encodeColor(vst, colorValues[colInd3]);
+	}
+	PutImageDataToStream(vertStream);
+	PutStream("setpattern\n");
 	if (fillRule)
 		PutStream("eofill\n");
 	else
 		PutStream("fill\n");
 	return;
+}
+
+
+quint32 PSLib::encode32dVal(double val)
+{
+	quint32 res = static_cast<quint32>(((val - (-40000.0)) / 80000.0) * 0xFFFFFFFF);
+	return res;
+}
+
+quint16 PSLib::encode16dVal(double val)
+{
+	quint16 m = val * 0xFFFF;
+	return m;
+}
+
+void PSLib::encodeColor(QDataStream &vs, QString col)
+{
+	QStringList gcol = col.split(" ");
+	for (int gcs = 0; gcs < gcol.count(); gcs++)
+	{
+		vs << encode16dVal(gcol[gcs].toDouble());
+	}
 }
 
 void PSLib::HandleDiamondGradient(PageItem* c, bool gcr)

Modified: branches/ScribusOIF/scribus/pslib.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/pslib.h
==============================================================================
--- branches/ScribusOIF/scribus/pslib.h (original)
+++ branches/ScribusOIF/scribus/pslib.h Sat Oct  8 20:25:29 2011
@@ -159,6 +159,10 @@
 		void WriteASCII85Bytes(const QByteArray& array);
 		void WriteASCII85Bytes(const unsigned char* array, int length);
 
+		quint32 encode32dVal(double val);
+		quint16 encode16dVal(double val);
+		void encodeColor(QDataStream &vs, QString col);
+
 		Optimization optimization;
 
 		QString ToStr(double c);

Modified: branches/ScribusOIF/scribus/scpainter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/scpainter.cpp
==============================================================================
--- branches/ScribusOIF/scribus/scpainter.cpp (original)
+++ branches/ScribusOIF/scribus/scpainter.cpp Sat Oct  8 20:25:29 2011
@@ -1272,6 +1272,10 @@
 						cairo_pattern_mesh_curve_to(mpat, mp2.controlBottom.x(), mp2.controlBottom.y(), mp3.controlTop.x(), mp3.controlTop.y(), mp3.gridPoint.x(), mp3.gridPoint.y());
 						cairo_pattern_mesh_curve_to(mpat, mp3.controlLeft.x(), mp3.controlLeft.y(), mp4.controlRight.x(), mp4.controlRight.y(), mp4.gridPoint.x(), mp4.gridPoint.y());
 						cairo_pattern_mesh_curve_to(mpat, mp4.controlTop.x(), mp4.controlTop.y(), mp1.controlBottom.x(), mp1.controlBottom.y(), mp1.gridPoint.x(), mp1.gridPoint.y());
+						cairo_pattern_mesh_set_control_point(mpat, 0, mp1.controlColor.x(),  mp1.controlColor.y());
+						cairo_pattern_mesh_set_control_point(mpat, 1, mp2.controlColor.x(),  mp2.controlColor.y());
+						cairo_pattern_mesh_set_control_point(mpat, 2, mp3.controlColor.x(),  mp3.controlColor.y());
+						cairo_pattern_mesh_set_control_point(mpat, 3, mp4.controlColor.x(),  mp4.controlColor.y());
 						mp1.color.getRgbF(&r, &g, &b, &a);
 						cairo_pattern_mesh_set_corner_color_rgba(mpat, 0, r, g, b, a);
 						mp2.color.getRgbF(&r, &g, &b, &a);
@@ -1372,6 +1376,10 @@
 					cairo_pattern_mesh_curve_to(mpat, mp2.controlBottom.x(), mp2.controlBottom.y(), mp3.controlTop.x(), mp3.controlTop.y(), mp3.gridPoint.x(), mp3.gridPoint.y());
 					cairo_pattern_mesh_curve_to(mpat, mp3.controlLeft.x(), mp3.controlLeft.y(), mp4.controlRight.x(), mp4.controlRight.y(), mp4.gridPoint.x(), mp4.gridPoint.y());
 					cairo_pattern_mesh_curve_to(mpat, mp4.controlTop.x(), mp4.controlTop.y(), mp1.controlBottom.x(), mp1.controlBottom.y(), mp1.gridPoint.x(), mp1.gridPoint.y());
+					cairo_pattern_mesh_set_control_point(mpat, 0, mp1.controlColor.x(),  mp1.controlColor.y());
+					cairo_pattern_mesh_set_control_point(mpat, 1, mp2.controlColor.x(),  mp2.controlColor.y());
+					cairo_pattern_mesh_set_control_point(mpat, 2, mp3.controlColor.x(),  mp3.controlColor.y());
+					cairo_pattern_mesh_set_control_point(mpat, 3, mp4.controlColor.x(),  mp4.controlColor.y());
 					mp1.color.getRgbF(&r, &g, &b, &a);
 					cairo_pattern_mesh_set_corner_color_rgba(mpat, 0, r, g, b, a);
 					mp2.color.getRgbF(&r, &g, &b, &a);

Modified: branches/ScribusOIF/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/scribusdoc.cpp
==============================================================================
--- branches/ScribusOIF/scribus/scribusdoc.cpp (original)
+++ branches/ScribusOIF/scribus/scribusdoc.cpp Sat Oct  8 20:25:29 2011
@@ -1118,6 +1118,70 @@
 			if ((pp >= 0) && (!retList2.contains(pp)))
 				retList2.prepend(pp);
 			par = (pp >= 0) ? docCharStyles[pp].parent() : QString();
+		}
+		for (int r = 0; r < retList2.count(); ++r)
+		{
+			if (!retList.contains(retList2[r]))
+				retList.append(retList2[r]);
+		}
+	}
+	return retList;
+}
+
+QList<int> ScribusDoc::getSortedTableStyleList()
+{
+	QList<int> retList;
+	for (int ff = 0; ff < docTableStyles.count(); ++ff)
+	{
+		if (docTableStyles[ff].parent().isEmpty())
+		{
+			if (!retList.contains(ff))
+				retList.append(ff);
+			continue;
+		}
+
+		QList<int> retList2;
+		QString name = docTableStyles[ff].name();
+		QString par  = docTableStyles[ff].parent();
+		retList2.prepend(ff);
+		while ((!par.isEmpty()) && (par != name))
+		{
+			int pp = docTableStyles.find(par);
+			if ((pp >= 0) && (!retList2.contains(pp)))
+				retList2.prepend(pp);
+			par = (pp >= 0) ? docTableStyles[pp].parent() : QString();
+		}
+		for (int r = 0; r < retList2.count(); ++r)
+		{
+			if (!retList.contains(retList2[r]))
+				retList.append(retList2[r]);
+		}
+	}
+	return retList;
+}
+
+QList<int> ScribusDoc::getSortedCellStyleList()
+{
+	QList<int> retList;
+	for (int ff = 0; ff < docCellStyles.count(); ++ff)
+	{
+		if (docCellStyles[ff].parent().isEmpty())
+		{
+			if (!retList.contains(ff))
+				retList.append(ff);
+			continue;
+		}
+
+		QList<int> retList2;
+		QString name = docCellStyles[ff].name();
+		QString par  = docCellStyles[ff].parent();
+		retList2.prepend(ff);
+		while ((!par.isEmpty()) && (par != name))
+		{
+			int pp = docCellStyles.find(par);
+			if ((pp >= 0) && (!retList2.contains(pp)))
+				retList2.prepend(pp);
+			par = (pp >= 0) ? docCellStyles[pp].parent() : QString();
 		}
 		for (int r = 0; r < retList2.count(); ++r)
 		{

Modified: branches/ScribusOIF/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/scribusdoc.h
==============================================================================
--- branches/ScribusOIF/scribus/scribusdoc.h (original)
+++ branches/ScribusOIF/scribus/scribusdoc.h Sat Oct  8 20:25:29 2011
@@ -578,6 +578,8 @@
 	
 	QList<int> getSortedStyleList();
 	QList<int> getSortedCharStyleList();
+	QList<int> getSortedTableStyleList();
+	QList<int> getSortedCellStyleList();
 	
 	void redefineStyles(const StyleSet<ParagraphStyle>& newStyles, bool removeUnused=false);
 	/**

Modified: branches/ScribusOIF/scribus/scribusstructs.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/scribusstructs.h
==============================================================================
--- branches/ScribusOIF/scribus/scribusstructs.h (original)
+++ branches/ScribusOIF/scribus/scribusstructs.h Sat Oct  8 20:25:29 2011
@@ -318,7 +318,8 @@
 	modeEditPolygon,
 	modeDrawSpiral,
 	modeEditSpiral,
-	modeEditTable
+	modeEditTable,
+	modeEditMeshPatch
 };
 
 struct AlignObjs

Modified: branches/ScribusOIF/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/scribusview.cpp
==============================================================================
--- branches/ScribusOIF/scribus/scribusview.cpp (original)
+++ branches/ScribusOIF/scribus/scribusview.cpp Sat Oct  8 20:25:29 2011
@@ -2534,7 +2534,15 @@
 	else
 		rememberOldZoomLocation(mx,my);
 	double newScale = m_canvas->scale() * static_cast<double>(Doc->opToolPrefs().magStep)/100.0;
-	zoom(oldX, oldY, newScale, true);
+	if (Doc->m_Selection->count() != 0)
+	{
+		PageItem *currItem = Doc->m_Selection->itemAt(0);
+		double zPointX = currItem->xPos() + currItem->width() / 2.0;
+		double zPointY = currItem->yPos() + currItem->height() / 2.0;
+		zoom( qRound(zPointX), qRound(zPointY), newScale, false);
+	}
+	else
+		zoom(oldX, oldY, newScale, true);
 }
 
 /** Verkleinert die Ansicht */
@@ -2552,7 +2560,15 @@
 	else
 		rememberOldZoomLocation(mx,my);
 	double newScale = m_canvas->scale() / (static_cast<double>(Doc->opToolPrefs().magStep)/100.0);
-	zoom(oldX, oldY, newScale, true);
+	if (Doc->m_Selection->count() != 0)
+	{
+		PageItem *currItem = Doc->m_Selection->itemAt(0);
+		double zPointX = currItem->xPos() + currItem->width() / 2.0;
+		double zPointY = currItem->yPos() + currItem->height() / 2.0;
+		zoom( qRound(zPointX), qRound(zPointY), newScale, false);
+	}
+	else
+		zoom(oldX, oldY, newScale, true);
 }
 
 #if 0

Modified: branches/ScribusOIF/scribus/scribusview.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/scribusview.h
==============================================================================
--- branches/ScribusOIF/scribus/scribusview.h (original)
+++ branches/ScribusOIF/scribus/scribusview.h Sat Oct  8 20:25:29 2011
@@ -101,6 +101,7 @@
 	friend class CanvasMode_Edit;
 	friend class CanvasMode_EditGradient;
 	friend class CanvasMode_EditMeshGradient;
+	friend class CanvasMode_EditMeshPatch;
 	friend class CanvasMode_EditPolygon;
 	friend class CanvasMode_EditArc;
 	friend class CanvasMode_EditSpiral;

Modified: branches/ScribusOIF/scribus/styles/charstyle.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/styles/charstyle.h
==============================================================================
--- branches/ScribusOIF/scribus/styles/charstyle.h (original)
+++ branches/ScribusOIF/scribus/styles/charstyle.h Sat Oct  8 20:25:29 2011
@@ -118,7 +118,7 @@
 	static void  desaxeRules(const Xml_string& prefixPattern, desaxe::Digester& ruleset, Xml_string elemtag = saxxDefaultElem);
 	
 	virtual void saxx(SaxHandler& handler, const Xml_string& elemtag) const;
-	virtual void saxx(SaxHandler& handler)                     const { saxx(handler, saxxDefaultElem); }
+	virtual void saxx(SaxHandler& handler) const { saxx(handler, saxxDefaultElem); }
 	
 
 	void getNamedResources(ResourceCollection& lists) const;

Modified: branches/ScribusOIF/scribus/styles/paragraphstyle.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/styles/paragraphstyle.h
==============================================================================
--- branches/ScribusOIF/scribus/styles/paragraphstyle.h (original)
+++ branches/ScribusOIF/scribus/styles/paragraphstyle.h Sat Oct  8 20:25:29 2011
@@ -73,7 +73,7 @@
 	static void  desaxeRules(const Xml_string& prefixPattern, desaxe::Digester& ruleset, Xml_string elemtag = saxxDefaultElem);
 	
 	virtual void saxx(SaxHandler& handler, const Xml_string& elemtag) const;
-	virtual void saxx(SaxHandler& handler)                     const { saxx(handler, saxxDefaultElem); }
+	virtual void saxx(SaxHandler& handler) const { saxx(handler, saxxDefaultElem); }
 	
 
 	void getNamedResources(ResourceCollection& lists) const;

Modified: branches/ScribusOIF/scribus/styles/tablestyle.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/styles/tablestyle.cpp
==============================================================================
--- branches/ScribusOIF/scribus/styles/tablestyle.cpp (original)
+++ branches/ScribusOIF/scribus/styles/tablestyle.cpp Sat Oct  8 20:25:29 2011
@@ -8,6 +8,7 @@
  */
 
 #include "commonstrings.h"
+#include "desaxe/saxiohelper.h"
 #include "util_math.h"
 #include "tableborder.h"
 #include "tablestyle.h"
@@ -77,3 +78,41 @@
 
 	// TODO: Do we need to do something else? E.g. CharStyle calls its updateFeatures().
 }
+
+void TableStyle::saxx(SaxHandler& handler, const Xml_string& elemtag) const
+{
+	/*
+	Xml_attr att;
+	Style::saxxAttributes(att);
+#define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
+	if (!inh_##attr_NAME) \
+		att.insert(# attr_NAME, toXMLString(m_##attr_NAME));
+#include "tablestyle.attrdefs.cxx"
+#undef ATTRDEF
+	if (!name().isEmpty())
+		att["id"] = mkXMLName(elemtag + name());
+	handler.begin(elemtag, att);
+//	if (hasParent() && parentStyle())
+//		parentStyle()->saxx(handler);
+	handler.end(elemtag);
+	*/
+}
+
+using namespace desaxe;
+
+const Xml_string TableStyle::saxxDefaultElem("tablestyle");
+
+void TableStyle::desaxeRules(const Xml_string& prefixPattern, Digester& ruleset, Xml_string elemtag)
+{
+	/*
+	Xml_string stylePrefix(Digester::concat(prefixPattern, elemtag));
+	ruleset.addRule(stylePrefix, Factory<TableStyle>());
+	ruleset.addRule(stylePrefix, IdRef<TableStyle>());
+	Style::desaxeRules<TableStyle>(prefixPattern, ruleset, elemtag);
+#define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \
+	ruleset.addRule(stylePrefix, SetAttributeWithConversion<TableStyle, attr_TYPE> ( & TableStyle::set##attr_NAME,  # attr_NAME, &parse<attr_TYPE> ));
+#include "tablestyle.attrdefs.cxx"
+#undef ATTRDEF
+*/
+}
+

Modified: branches/ScribusOIF/scribus/styles/tablestyle.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/styles/tablestyle.h
==============================================================================
--- branches/ScribusOIF/scribus/styles/tablestyle.h (original)
+++ branches/ScribusOIF/scribus/styles/tablestyle.h Sat Oct  8 20:25:29 2011
@@ -57,11 +57,11 @@
 	 */
 	TableStyle& operator=(const TableStyle& other);
 
-	/// Not implemented.
-	virtual void saxx(SaxHandler& handler, const Xml_string& elemtag) const {};
+	static const Xml_string saxxDefaultElem;
+	static void  desaxeRules(const Xml_string& prefixPattern, desaxe::Digester& ruleset, Xml_string elemtag = saxxDefaultElem);
 
-	/// Not implemented.
-	virtual void saxx(SaxHandler& handler) const {};
+	virtual void saxx(SaxHandler& handler, const Xml_string& elemtag) const;
+	virtual void saxx(SaxHandler& handler) const { saxx(handler, saxxDefaultElem); };
 
 	/**
 	 * Returns the display name of the table style.

Modified: branches/ScribusOIF/scribus/ui/colorcombo.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/ui/colorcombo.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/colorcombo.cpp (original)
+++ branches/ScribusOIF/scribus/ui/colorcombo.cpp Sat Oct  8 20:25:29 2011
@@ -54,7 +54,10 @@
 	{
 		clb->clear();
 		if ( insertNone )
+		{
 			clb->addItem(CommonStrings::tr_NoneColor);
+			clb->item(0)->setData(Qt::UserRole, CommonStrings::None);
+		}
 		if ( pixType == ColorCombo::fancyPixmaps )
 			clb->insertItems(list, ColorListBox::fancyPixmap);
 		else if ( pixType == ColorCombo::widePixmaps )
@@ -102,7 +105,7 @@
 void ColorCombo::initColorList(ColorList *colorList, ScribusDoc *doc, QString colorValue)
 {
 	clear();
-	addItem(CommonStrings::tr_NoneColor);
+	addItem(CommonStrings::tr_NoneColor, CommonStrings::None);
 	if (colorValue == CommonStrings::None)
 		setCurrentIndex(count()-1);
 	ColorList::Iterator endOfColorList(colorList->end());

Modified: branches/ScribusOIF/scribus/ui/colorlistbox.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/ui/colorlistbox.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/colorlistbox.cpp (original)
+++ branches/ScribusOIF/scribus/ui/colorlistbox.cpp Sat Oct  8 20:25:29 2011
@@ -202,6 +202,30 @@
 	connect(this, SIGNAL(showContextMenue()), this, SLOT(slotRightClick()));
 }
 
+void ColorListBox::changeEvent(QEvent *e)
+{
+	if (e->type() == QEvent::LanguageChange)
+	{
+		languageChange();
+		return;
+	}
+	QListWidget::changeEvent(e);
+}
+
+void ColorListBox::languageChange()
+{
+	if (this->count() > 0)
+	{
+		QModelIndexList result;
+		QModelIndex start = model()->index(0, 0, this->rootIndex());
+		result =  model()->match(start, Qt::UserRole, CommonStrings::None, 1, Qt::MatchExactly | Qt::MatchCaseSensitive);
+		if (result.isEmpty())
+			return;
+		int index = result.first().row();
+		QListWidgetItem* item = this->item(index);
+		item->setText(CommonStrings::tr_NoneColor);
+	}
+}
 
 QString ColorListBox::currentColor() const
 {
@@ -292,6 +316,11 @@
 void ColorListBox::addItem(QString text)
 {
 	QListWidget::addItem(text);
+	if (text == CommonStrings::None || text == CommonStrings::tr_NoneColor)
+	{
+		QListWidgetItem* item = this->item(count() - 1);
+		item->setData(Qt::UserRole, CommonStrings::None);
+	}
 }
 
 void ColorListBox::insertSmallPixmapItems(ColorList& list)

Modified: branches/ScribusOIF/scribus/ui/colorlistbox.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/ui/colorlistbox.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/colorlistbox.h (original)
+++ branches/ScribusOIF/scribus/ui/colorlistbox.h Sat Oct  8 20:25:29 2011
@@ -80,6 +80,8 @@
 		/*! \brief Standard QListBox like constructor.
 		Just there are initialized pixmaps for icon drawing. */
 		ColorListBox(QWidget * parent = 0);
+		
+		virtual void changeEvent(QEvent *e);
 
 		QString currentColor() const;
 
@@ -116,13 +118,14 @@
 		ColorList *cList;
 	private slots:
 		void slotRightClick();
+	protected slots:
+		virtual void languageChange();
 	signals:
 		void showContextMenue();
 	protected:
 		bool viewportEvent(QEvent *event);
 		static int initialized;
 		static int sortRule;
-		int m_selectedRow;
 		ColorListBox::PixmapType m_type;
 };
 

Modified: branches/ScribusOIF/scribus/ui/cpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/ui/cpalette.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/cpalette.cpp (original)
+++ branches/ScribusOIF/scribus/ui/cpalette.cpp Sat Oct  8 20:25:29 2011
@@ -112,6 +112,7 @@
 	connect(CGradDia, SIGNAL(meshToShape()), this, SLOT(meshGradientToShape()));
 	connect(CGradDia, SIGNAL(reset1Control()), this, SLOT(resetOneControlPoint()));
 	connect(CGradDia, SIGNAL(resetAllControl()), this, SLOT(resetAllControlPoints()));
+	connect(CGradDia, SIGNAL(removePatch()), this, SLOT(handleRemovePatch()));
 	connect(gradientType, SIGNAL(activated(int)), this, SLOT(slotGradType(int)));
 	connect(gradEdit, SIGNAL(gradientChanged()) , this, SLOT(handleFillGradient()));
 	connect(editPatternProps, SIGNAL(clicked()) , this, SLOT(changePatternProps()));
@@ -299,7 +300,10 @@
 		strokeModeCombo->setCurrentIndex(1);
 	else
 		strokeModeCombo->setCurrentIndex(0);
-	setMeshPoint();
+	if (currentItem->GrType == 12)
+		setMeshPatchPoint();
+	else
+		setMeshPoint();
 	editMeshColors->setEnabled(!CGradDia->isVisible());
 	gradEditButton->setEnabled(true);
 
@@ -1133,6 +1137,8 @@
 	{
 		if (currentItem->GrType == 11)
 			editStrokeGradient = 6;
+		else if (currentItem->GrType == 12)
+			editStrokeGradient = 8;
 		else
 			editStrokeGradient = 0;
 		gradEditButton->setEnabled(false);
@@ -1177,16 +1183,51 @@
 	int grow = currentItem->selectedMeshPointX;
 	int gcol = currentItem->selectedMeshPointY;
 	int cont = currentItem->selectedMeshControlPoint;
-	if ((grow == -1) || (gcol == -1))
-		return;
-	if (cont == 1)
-		currentItem->meshGradientArray[grow][gcol].controlTop    = currentItem->meshGradientArray[grow][gcol].gridPoint;
-	else if (cont == 2)
-		currentItem->meshGradientArray[grow][gcol].controlBottom = currentItem->meshGradientArray[grow][gcol].gridPoint;
-	else if (cont == 3)
-		currentItem->meshGradientArray[grow][gcol].controlLeft   = currentItem->meshGradientArray[grow][gcol].gridPoint;
-	else if (cont == 4)
-		currentItem->meshGradientArray[grow][gcol].controlRight  = currentItem->meshGradientArray[grow][gcol].gridPoint;
+	if (currentItem->GrType == 12)
+	{
+		if ((grow == -1) || (gcol == 0))
+			return;
+		switch (gcol)
+		{
+			case 1:
+				if (cont == 2)
+					currentItem->meshGradientPatches[grow].TL.controlBottom    = currentItem->meshGradientPatches[grow].TL.gridPoint;
+				if (cont == 4)
+					currentItem->meshGradientPatches[grow].TL.controlRight  = currentItem->meshGradientPatches[grow].TL.gridPoint;
+				break;
+			case 2:
+				if (cont == 2)
+					currentItem->meshGradientPatches[grow].TR.controlBottom = currentItem->meshGradientPatches[grow].TR.gridPoint;
+				if (cont == 3)
+					currentItem->meshGradientPatches[grow].TR.controlLeft   = currentItem->meshGradientPatches[grow].TR.gridPoint;
+				break;
+			case 3:
+				if (cont == 1)
+					currentItem->meshGradientPatches[grow].BR.controlTop    = currentItem->meshGradientPatches[grow].BR.gridPoint;
+				if (cont == 3)
+					currentItem->meshGradientPatches[grow].BR.controlLeft   = currentItem->meshGradientPatches[grow].BR.gridPoint;
+				break;
+			case 4:
+				if (cont == 1)
+					currentItem->meshGradientPatches[grow].BL.controlTop    = currentItem->meshGradientPatches[grow].BL.gridPoint;
+				if (cont == 4)
+					currentItem->meshGradientPatches[grow].BL.controlRight  = currentItem->meshGradientPatches[grow].BL.gridPoint;
+				break;
+		}
+	}
+	else
+	{
+		if ((grow == -1) || (gcol == -1))
+			return;
+		if (cont == 1)
+			currentItem->meshGradientArray[grow][gcol].controlTop    = currentItem->meshGradientArray[grow][gcol].gridPoint;
+		else if (cont == 2)
+			currentItem->meshGradientArray[grow][gcol].controlBottom = currentItem->meshGradientArray[grow][gcol].gridPoint;
+		else if (cont == 3)
+			currentItem->meshGradientArray[grow][gcol].controlLeft   = currentItem->meshGradientArray[grow][gcol].gridPoint;
+		else if (cont == 4)
+			currentItem->meshGradientArray[grow][gcol].controlRight  = currentItem->meshGradientArray[grow][gcol].gridPoint;
+	}
 	currentItem->update();
 	currentDoc->regionsChanged()->update(QRect());
 }
@@ -1195,12 +1236,47 @@
 {
 	int grow = currentItem->selectedMeshPointX;
 	int gcol = currentItem->selectedMeshPointY;
-	if ((grow == -1) || (gcol == -1))
-		return;
-	currentItem->meshGradientArray[grow][gcol].controlTop    = currentItem->meshGradientArray[grow][gcol].gridPoint;
-	currentItem->meshGradientArray[grow][gcol].controlLeft   = currentItem->meshGradientArray[grow][gcol].gridPoint;
-	currentItem->meshGradientArray[grow][gcol].controlRight  = currentItem->meshGradientArray[grow][gcol].gridPoint;
-	currentItem->meshGradientArray[grow][gcol].controlBottom = currentItem->meshGradientArray[grow][gcol].gridPoint;
+	if (currentItem->GrType == 12)
+	{
+		if ((grow == -1) || (gcol == 0))
+			return;
+		switch (gcol)
+		{
+			case 1:
+				currentItem->meshGradientPatches[grow].TL.controlTop    = currentItem->meshGradientPatches[grow].TL.gridPoint;
+				currentItem->meshGradientPatches[grow].TL.controlLeft   = currentItem->meshGradientPatches[grow].TL.gridPoint;
+				currentItem->meshGradientPatches[grow].TL.controlRight  = currentItem->meshGradientPatches[grow].TL.gridPoint;
+				currentItem->meshGradientPatches[grow].TL.controlBottom = currentItem->meshGradientPatches[grow].TL.gridPoint;
+				break;
+			case 2:
+				currentItem->meshGradientPatches[grow].TR.controlTop    = currentItem->meshGradientPatches[grow].TR.gridPoint;
+				currentItem->meshGradientPatches[grow].TR.controlLeft   = currentItem->meshGradientPatches[grow].TR.gridPoint;
+				currentItem->meshGradientPatches[grow].TR.controlRight  = currentItem->meshGradientPatches[grow].TR.gridPoint;
+				currentItem->meshGradientPatches[grow].TR.controlBottom = currentItem->meshGradientPatches[grow].TR.gridPoint;
+				break;
+			case 3:
+				currentItem->meshGradientPatches[grow].BR.controlTop    = currentItem->meshGradientPatches[grow].BR.gridPoint;
+				currentItem->meshGradientPatches[grow].BR.controlLeft   = currentItem->meshGradientPatches[grow].BR.gridPoint;
+				currentItem->meshGradientPatches[grow].BR.controlRight  = currentItem->meshGradientPatches[grow].BR.gridPoint;
+				currentItem->meshGradientPatches[grow].BR.controlBottom = currentItem->meshGradientPatches[grow].BR.gridPoint;
+				break;
+			case 4:
+				currentItem->meshGradientPatches[grow].BL.controlTop    = currentItem->meshGradientPatches[grow].BL.gridPoint;
+				currentItem->meshGradientPatches[grow].BL.controlLeft   = currentItem->meshGradientPatches[grow].BL.gridPoint;
+				currentItem->meshGradientPatches[grow].BL.controlRight  = currentItem->meshGradientPatches[grow].BL.gridPoint;
+				currentItem->meshGradientPatches[grow].BL.controlBottom = currentItem->meshGradientPatches[grow].BL.gridPoint;
+				break;
+		}
+	}
+	else
+	{
+		if ((grow == -1) || (gcol == -1))
+			return;
+		currentItem->meshGradientArray[grow][gcol].controlTop    = currentItem->meshGradientArray[grow][gcol].gridPoint;
+		currentItem->meshGradientArray[grow][gcol].controlLeft   = currentItem->meshGradientArray[grow][gcol].gridPoint;
+		currentItem->meshGradientArray[grow][gcol].controlRight  = currentItem->meshGradientArray[grow][gcol].gridPoint;
+		currentItem->meshGradientArray[grow][gcol].controlBottom = currentItem->meshGradientArray[grow][gcol].gridPoint;
+	}
 	currentItem->update();
 	currentDoc->regionsChanged()->update(QRect());
 }
@@ -1230,6 +1306,11 @@
 			CGradDia->selectMesh();
 			editMeshColors->setEnabled(false);
 		}
+		else if (currentItem->GrType == 12)
+		{
+			CGradDia->selectPatchMesh();
+			editMeshColors->setEnabled(false);
+		}
 		else if (currentItem->GrType == 13)
 			CGradDia->selectConical();
 		CGradDia->show();
@@ -1245,6 +1326,8 @@
 		editStrokeGradient = 4;
 	else if (currentItem->GrType == 11)
 		editStrokeGradient = 5;
+	else if (currentItem->GrType == 12)
+		editStrokeGradient = 9;
 	else
 		editStrokeGradient = 0;
 	emit editGradient(editStrokeGradient);
@@ -1291,7 +1374,7 @@
 
 void Cpalette::setMeshPoint()
 {
-	if ((currentItem->selectedMeshPointX > -1) && (currentItem->selectedMeshPointY > -1l))
+	if ((currentItem->selectedMeshPointX > -1) && (currentItem->selectedMeshPointY > -1))
 	{
 		colorMeshPoint->setEnabled(true);
 		shadeMeshPoint->setEnabled(true);
@@ -1309,8 +1392,23 @@
 	}
 }
 
-void Cpalette::setMeshControlPoint()
-{
+void Cpalette::endPatchAdd()
+{
+	CGradDia->endPAddButton();
+}
+
+void Cpalette::handleRemovePatch()
+{
+	if ((currentItem->selectedMeshPointX > -1) && (currentItem->meshGradientPatches.count() > 1))
+	{
+		currentItem->meshGradientPatches.removeAt(currentItem->selectedMeshPointX);
+		currentItem->selectedMeshPointX = -1;
+		CGradDia->changebuttonRemovePatch((currentItem->selectedMeshPointX > -1) && (currentItem->meshGradientPatches.count() > 1));
+		currentItem->update();
+		currentDoc->regionsChanged()->update(QRect());
+		editStrokeGradient = 9;
+		emit editGradient(editStrokeGradient);
+	}
 }
 
 void Cpalette::updateMeshPoint()
@@ -1319,8 +1417,49 @@
 	if (color == CommonStrings::tr_NoneColor)
 		color = CommonStrings::None;
 	double t = transparencyMeshPoint->value() / 100.0;
-	currentItem->setMeshPointColor(currentItem->selectedMeshPointX, currentItem->selectedMeshPointY, color, shadeMeshPoint->value(), t);
+	currentItem->setMeshPointColor(currentItem->selectedMeshPointX, currentItem->selectedMeshPointY, color, shadeMeshPoint->value(), t, currentDoc->view()->editStrokeGradient == 8);
 	currentItem->update();
+}
+
+void Cpalette::setMeshPatchPoint()
+{
+	if ((currentItem->selectedMeshPointX > -1) && (currentItem->selectedMeshPointY > 0))
+	{
+		colorMeshPoint->setEnabled(true);
+		shadeMeshPoint->setEnabled(true);
+		transparencyMeshPoint->setEnabled(true);
+		meshGradientPatch patch = currentItem->meshGradientPatches[currentItem->selectedMeshPointX];
+		meshPoint mp;
+		switch (currentItem->selectedMeshPointY)
+		{
+			case 1:
+				mp = patch.TL;
+				break;
+			case 2:
+				mp = patch.TR;
+				break;
+			case 3:
+				mp = patch.BR;
+				break;
+			case 4:
+				mp = patch.BL;
+				break;
+		}
+		setCurrentComboItem(colorMeshPoint, mp.colorName);
+		shadeMeshPoint->setValue(mp.shade);
+		transparencyMeshPoint->setValue(mp.transparency * 100);
+	}
+	else
+	{
+		colorMeshPoint->setEnabled(false);
+		shadeMeshPoint->setEnabled(false);
+		transparencyMeshPoint->setEnabled(false);
+	}
+}
+
+void Cpalette::setMeshPatch()
+{
+	CGradDia->changebuttonRemovePatch((currentItem->selectedMeshPointX > -1) && (currentItem->meshGradientPatches.count() > 1));
 }
 
 void Cpalette::changePatternProps()

Modified: branches/ScribusOIF/scribus/ui/cpalette.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/ui/cpalette.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/cpalette.h (original)
+++ branches/ScribusOIF/scribus/ui/cpalette.h Sat Oct  8 20:25:29 2011
@@ -118,7 +118,10 @@
 	void setActiveGradDia(bool active);
 	void setSpecialGradient(double x1, double y1, double x2, double y2, double fx, double fy, double sg, double sk, double cx, double cy);
 	void setMeshPoint();
-	void setMeshControlPoint();
+	void endPatchAdd();
+	void handleRemovePatch();
+	void setMeshPatch();
+	void setMeshPatchPoint();
 	void updateMeshPoint();
 	void changePatternProps();
 	void changePatternPropsStroke();

Modified: branches/ScribusOIF/scribus/ui/gradientvectorbase.ui
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/ui/gradientvectorbase.ui
==============================================================================
--- branches/ScribusOIF/scribus/ui/gradientvectorbase.ui (original)
+++ branches/ScribusOIF/scribus/ui/gradientvectorbase.ui Sat Oct  8 20:25:29 2011
@@ -9,8 +9,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>248</width>
-    <height>163</height>
+    <width>251</width>
+    <height>180</height>
    </rect>
   </property>
   <property name="minimumSize">
@@ -748,6 +748,178 @@
           <size>
            <width>20</width>
            <height>62</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="pagePatch">
+      <layout class="QVBoxLayout" name="verticalLayout_3">
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_3">
+         <item>
+          <layout class="QGridLayout" name="gridLayout_7">
+           <item row="0" column="0">
+            <widget class="QToolButton" name="editPPoint">
+             <property name="minimumSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+             <property name="toolTip">
+              <string>Edit Grid Points</string>
+             </property>
+             <property name="text">
+              <string/>
+             </property>
+             <property name="checkable">
+              <bool>true</bool>
+             </property>
+             <property name="autoExclusive">
+              <bool>true</bool>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="0">
+            <widget class="QToolButton" name="editPControlPoints">
+             <property name="minimumSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+             <property name="toolTip">
+              <string>Edit Control Points</string>
+             </property>
+             <property name="text">
+              <string/>
+             </property>
+             <property name="checkable">
+              <bool>true</bool>
+             </property>
+             <property name="autoExclusive">
+              <bool>true</bool>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="1">
+            <widget class="QToolButton" name="resetPControlPoint">
+             <property name="enabled">
+              <bool>false</bool>
+             </property>
+             <property name="minimumSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+             <property name="toolTip">
+              <string>Reset selected Control Point</string>
+             </property>
+             <property name="text">
+              <string/>
+             </property>
+             <property name="checkable">
+              <bool>false</bool>
+             </property>
+             <property name="autoExclusive">
+              <bool>false</bool>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="2">
+            <widget class="QToolButton" name="resetAllPControlPoints">
+             <property name="enabled">
+              <bool>false</bool>
+             </property>
+             <property name="minimumSize">
+              <size>
+               <width>22</width>
+               <height>22</height>
+              </size>
+             </property>
+             <property name="toolTip">
+              <string>Reset all Control Points</string>
+             </property>
+             <property name="text">
+              <string/>
+             </property>
+             <property name="checkable">
+              <bool>false</bool>
+             </property>
+             <property name="autoExclusive">
+              <bool>false</bool>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer_3">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_4">
+         <item>
+          <widget class="QPushButton" name="buttonAddPatch">
+           <property name="enabled">
+            <bool>true</bool>
+           </property>
+           <property name="text">
+            <string>Add Patch</string>
+           </property>
+           <property name="checkable">
+            <bool>true</bool>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QPushButton" name="buttonRemovePatch">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+           <property name="text">
+            <string>Remove Patch</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer_4">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>13</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <spacer name="verticalSpacer_2">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>32</height>
           </size>
          </property>
         </spacer>

Modified: branches/ScribusOIF/scribus/ui/gradientvectordialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/ui/gradientvectordialog.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/gradientvectordialog.cpp (original)
+++ branches/ScribusOIF/scribus/ui/gradientvectordialog.cpp Sat Oct  8 20:25:29 2011
@@ -71,6 +71,12 @@
 	connect(buttonPoLIne, SIGNAL(clicked()), this, SIGNAL(meshToShape()));
 	connect(resetControlPoint, SIGNAL(clicked()), this, SIGNAL(reset1Control()));
 	connect(resetAllControlPoints, SIGNAL(clicked()), this, SIGNAL(resetAllControl()));
+	connect(editPPoint, SIGNAL(clicked()), this, SLOT(handlePEditButton()));
+	connect(editPControlPoints, SIGNAL(clicked()), this, SLOT(handlePEditControlButton()));
+	connect(buttonAddPatch, SIGNAL(clicked()), this, SLOT(handlePAddButton()));
+	connect(buttonRemovePatch, SIGNAL(clicked()), this, SIGNAL(removePatch()));
+	connect(resetPControlPoint, SIGNAL(clicked()), this, SIGNAL(reset1Control()));
+	connect(resetAllPControlPoints, SIGNAL(clicked()), this, SIGNAL(resetAllControl()));
 	QSize iconSize = QSize(22, 22);
 	editPoints->setIcon(QIcon(loadIcon("MoveNode.png")));
 	editPoints->setIconSize(iconSize);
@@ -80,6 +86,14 @@
 	resetControlPoint->setIconSize(iconSize);
 	resetAllControlPoints->setIcon(QIcon(loadIcon("ResetNode.png")));
 	resetAllControlPoints->setIconSize(iconSize);
+	editPPoint->setIcon(QIcon(loadIcon("MoveNode.png")));
+	editPPoint->setIconSize(iconSize);
+	editPControlPoints->setIcon(QIcon(loadIcon("MoveKontrol.png")));
+	editPControlPoints->setIconSize(iconSize);
+	resetPControlPoint->setIcon(QIcon(loadIcon("Reset1Node.png")));
+	resetPControlPoint->setIconSize(iconSize);
+	resetAllPControlPoints->setIcon(QIcon(loadIcon("ResetNode.png")));
+	resetAllPControlPoints->setIconSize(iconSize);
 	languageChange();
 	selectLinear();
 }
@@ -135,6 +149,13 @@
 	resize(minimumSizeHint());
 }
 
+void GradientVectorDialog::selectPatchMesh()
+{
+	stackedWidget->setCurrentIndex(5);
+	editPPoint->setChecked(true);
+	resize(minimumSizeHint());
+}
+
 void GradientVectorDialog::languageChange()
 {
 	retranslateUi(this);
@@ -159,6 +180,53 @@
 		resetControlPoint->setEnabled(true);
 		emit editGradient(7);
 	}
+}
+
+void GradientVectorDialog::handlePEditButton()
+{
+	if (editPPoint->isChecked())
+	{
+		resetAllPControlPoints->setEnabled(false);
+		resetPControlPoint->setEnabled(false);
+		emit editGradient(9);
+	}
+}
+
+void GradientVectorDialog::handlePEditControlButton()
+{
+	if (editPControlPoints->isChecked())
+	{
+		resetAllPControlPoints->setEnabled(true);
+		resetPControlPoint->setEnabled(true);
+		emit editGradient(10);
+	}
+}
+
+void GradientVectorDialog::handlePAddButton()
+{
+	editPPoint->setChecked(true);
+	editPPoint->setEnabled(false);
+	editPControlPoints->setEnabled(false);
+	resetAllPControlPoints->setEnabled(false);
+	resetPControlPoint->setEnabled(false);
+	buttonAddPatch->setEnabled(false);
+	emit editGradient(11);
+}
+
+void GradientVectorDialog::endPAddButton()
+{
+	editPPoint->setChecked(true);
+	editPPoint->setEnabled(true);
+	editPControlPoints->setEnabled(true);
+	resetAllPControlPoints->setEnabled(false);
+	resetPControlPoint->setEnabled(false);
+	buttonAddPatch->setChecked(false);
+	buttonAddPatch->setEnabled(true);
+}
+
+void GradientVectorDialog::changebuttonRemovePatch(bool val)
+{
+	buttonRemovePatch->setEnabled(val);
 }
 
 void GradientVectorDialog::setValues(double x1, double y1, double x2, double y2, double fx, double fy, double sg, double sk, double cx, double cy)

Modified: branches/ScribusOIF/scribus/ui/gradientvectordialog.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/ui/gradientvectordialog.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/gradientvectordialog.h (original)
+++ branches/ScribusOIF/scribus/ui/gradientvectordialog.h Sat Oct  8 20:25:29 2011
@@ -51,11 +51,17 @@
 	void selectFourColor();
 	void selectDiamond();
 	void selectMesh();
+	void selectPatchMesh();
 
 public slots:
 	void languageChange();
 	void handleEditButton();
 	void handleEditControlButton();
+	void handlePEditButton();
+	void handlePEditControlButton();
+	void handlePAddButton();
+	void endPAddButton();
+	void changebuttonRemovePatch(bool val);
 	void setValues(double x1, double y1, double x2, double y2, double fx, double fy, double sg, double sk, double cx, double cy);
 	void changeSpecialL();
 	void changeSpecialR();
@@ -71,6 +77,7 @@
 	void meshToShape();
 	void reset1Control();
 	void resetAllControl();
+	void removePatch();
 
 };
 #endif

Modified: branches/ScribusOIF/scribus/ui/outlinepalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/ui/outlinepalette.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/outlinepalette.cpp (original)
+++ branches/ScribusOIF/scribus/ui/outlinepalette.cpp Sat Oct  8 20:25:29 2011
@@ -164,7 +164,7 @@
  
 	filterEdit = new QLineEdit;
 	filterEdit->setToolTip( tr("Enter a keyword or regular expression to filter the outline.") );
-	QShortcut* filterShortcut = new QShortcut( QKeySequence( tr( "Ctrl+F", "Filter the Outline using a keyword" ) ), this );
+//	QShortcut* filterShortcut = new QShortcut( QKeySequence( tr( "Ctrl+F", "Filter the Outline using a keyword" ) ), this );
 	filterLabel = new QLabel( tr("Filter:") );
 	filterLabel->setBuddy( filterEdit );
 
@@ -216,7 +216,7 @@
 	connect(reportDisplay, SIGNAL(itemSelectionChanged()), this, SLOT(slotMultiSelect()));
 	connect(reportDisplay, SIGNAL(itemChanged(QTreeWidgetItem*, int)), this, SLOT(slotDoRename(QTreeWidgetItem*, int)));
 	connect(filterEdit, SIGNAL(textChanged(const QString&)), this, SLOT(filterTree(const QString&)));
-	connect(filterShortcut, SIGNAL(activated()), filterEdit, SLOT(setFocus()));
+//	connect(filterShortcut, SIGNAL(activated()), filterEdit, SLOT(setFocus()));
 }
 
 void OutlinePalette::setMainWindow(ScribusMainWindow *mw)

Modified: branches/ScribusOIF/scribus/ui/propertiespalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/ui/propertiespalette.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertiespalette.cpp (original)
+++ branches/ScribusOIF/scribus/ui/propertiespalette.cpp Sat Oct  8 20:25:29 2011
@@ -816,6 +816,8 @@
 			{
 				if ((stroke == 5) || (stroke == 6) || (stroke == 7))
 					m_ScMW->view->requestMode(modeEditMeshGradient);
+				else if ((stroke == 8) || (stroke == 9) || (stroke == 10) || (stroke == 11))
+					m_ScMW->view->requestMode(modeEditMeshPatch);
 				else
 					m_ScMW->view->requestMode(modeEditGradientVectors);
 			}
@@ -951,6 +953,11 @@
 	Cpal->gradEditButton->setChecked(on);
 }
 
+void PropertiesPalette::endPatchAdd()
+{
+	Cpal->endPatchAdd();
+}
+
 void PropertiesPalette::updateColorSpecialGradient()
 {
 	if (!m_haveDoc)
@@ -974,8 +981,10 @@
 			Cpal->setSpecialGradient(currItem->GrControl1.x() * dur, currItem->GrControl1.y() * dur, currItem->GrControl2.x() * dur, currItem->GrControl2.y() * dur, currItem->GrControl3.x() * dur, currItem->GrControl3.y() * dur, currItem->GrControl4.x() * dur, currItem->GrControl4.y() * dur, currItem->GrControl5.x(), currItem->GrControl5.y());
 		else if ((m_ScMW->view->editStrokeGradient == 5) || (m_ScMW->view->editStrokeGradient == 6))
 			Cpal->setMeshPoint();
-		else if (m_ScMW->view->editStrokeGradient == 7)
-			Cpal->setMeshControlPoint();
+		else if (m_ScMW->view->editStrokeGradient == 8)
+			Cpal->setMeshPatchPoint();
+		else if (m_ScMW->view->editStrokeGradient == 9)
+			Cpal->setMeshPatch();
 		else if (!currItem->isGroup())
 			Tpal->setSpecialGradient(currItem->GrMaskStartX * dur, currItem->GrMaskStartY * dur, currItem->GrMaskEndX * dur, currItem->GrMaskEndY * dur, currItem->GrMaskFocalX * dur, currItem->GrMaskFocalY * dur, currItem->GrMaskScale, currItem->GrMaskSkew);
 	}

Modified: branches/ScribusOIF/scribus/ui/propertiespalette.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/scribus/ui/propertiespalette.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/propertiespalette.h (original)
+++ branches/ScribusOIF/scribus/ui/propertiespalette.h Sat Oct  8 20:25:29 2011
@@ -56,7 +56,8 @@
 
 	virtual void changeEvent(QEvent *e);
 	virtual void closeEvent(QCloseEvent *closeEvent);
-	
+
+	void endPatchAdd();
 	void updateColorSpecialGradient();
 	const VGradient getMaskGradient();
 	const VGradient getMaskGradientGroup();

Modified: branches/ScribusOIF/win32/vc9/Scribus.vcproj
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16895&path=/branches/ScribusOIF/win32/vc9/Scribus.vcproj
==============================================================================
--- branches/ScribusOIF/win32/vc9/Scribus.vcproj (original)
+++ branches/ScribusOIF/win32/vc9/Scribus.vcproj Sat Oct  8 20:25:29 2011
@@ -477,6 +477,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\scribus\canvasmode_editmeshpatch.cpp"
+				>
+			</File>
+			<File
 				RelativePath="..\..\scribus\canvasmode_editpolygon.cpp"
 				>
 			</File>
@@ -2750,6 +2754,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\scribus\canvasmode_editmeshpatch.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\scribus\canvasmode_editpolygon.h"
 				>
 				<FileConfiguration
@@ -8857,11 +8865,11 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\..\scribus-1.5.x-svn\Scribus\scribus\ui\ui_propertywidget_imagebase.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\scribus\ui\ui_propertywidget_imagebase.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\..\scribus-1.5.x-svn\Scribus\scribus\ui\ui_propertywidget_imagebase.h"
 				>
 			</File>
 			<File




More information about the scribus-commit mailing list