Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 3f9e6926 authored by Casper Boemann's avatar Casper Boemann

------------------------------------------------------------------------

r1180146 | staniek | 2010-09-27 09:33:21 +0200 (Mon, 27 Sep 2010) | 2 lines
Changed paths:
   M /trunk/koffice/plugins/chartshape/ChartProxyModel.cpp
   M /trunk/koffice/plugins/chartshape/kdchart/src/KDChartCartesianGrid.cpp

warnings--

------------------------------------------------------------------------
r1180147 | staniek | 2010-09-27 09:35:31 +0200 (Mon, 27 Sep 2010) | 2 lines
Changed paths:
   M /trunk/koffice/filters/kword/msword-odf/wv2/src/word97_generated.cpp

Fixed warning: ‘shifterU16’ is used uninitialized in this function


------------------------------------------------------------------------
r1180155 | danders | 2010-09-27 10:12:12 +0200 (Mon, 27 Sep 2010) | 2 lines
Changed paths:
   M /trunk/koffice/kplato/kptpart.cpp
   M /trunk/koffice/kplato/kptview.cpp
   M /trunk/koffice/kplato/libs/kernel/kptschedulerplugin.cpp
   M /trunk/koffice/kplato/libs/kernel/kpttask.cpp
   M /trunk/koffice/kplato/libs/ui/kptintervaledit.cpp
   M /trunk/koffice/kplato/libs/ui/kpttaskdescriptiondialog.cpp
   M /trunk/koffice/kplato/libs/ui/kpttaskeditor.cpp
   M /trunk/koffice/kplato/libs/ui/reports/reportview.cpp
   M /trunk/koffice/kplato/libs/ui/reports/reportview.h
   M /trunk/koffice/kplato/plugins/schedulers/rcps/KPlatoRCPSScheduler.cpp
   M /trunk/koffice/kplato/templates/Simple/Basicproject.desktop

krazy issues.


------------------------------------------------------------------------
r1180164 | scripty | 2010-09-27 10:23:31 +0200 (Mon, 27 Sep 2010) | 1 line
Changed paths:
   M /trunk/koffice/kplato/templates/Simple/Basicproject.desktop

SVN_SILENT made messages (.desktop file, second try)

------------------------------------------------------------------------
r1180209 | mkruisselbrink | 2010-09-27 13:21:42 +0200 (Mon, 27 Sep 2010) | 2 lines
Changed paths:
   M /trunk/koffice/plugins/pictureshape/PictureShape.cpp

in odf an image is also allowed to have text on it, so properly load&save this text
BUG: 249853
------------------------------------------------------------------------
r1180210 | mkruisselbrink | 2010-09-27 13:22:03 +0200 (Mon, 27 Sep 2010) | 1 line
Changed paths:
   M /trunk/koffice/libs/odf/KoGenStyle.h

make property and attribute getters public, so it is possible to access previously stored data in already generated KoGenStyle instances
------------------------------------------------------------------------
r1180211 | mkruisselbrink | 2010-09-27 13:22:05 +0200 (Mon, 27 Sep 2010) | 2 lines
Changed paths:
   M /trunk/koffice/filters/kspread/xlsx/XlsxXmlWorksheetReader.cpp

when cells are merged we need to get the right/bottom border from the style of the cells in the last row/column of the merged area
BUG: 239764

------------------------------------------------------------------------
r1180224 | rempt | 2010-09-27 14:37:07 +0200 (Mon, 27 Sep 2010) | 1 line
Changed paths:
   M /trunk/koffice/krita/ui/widgets/kis_scratch_pad.cpp

Fix warning
------------------------------------------------------------------------
r1180225 | rempt | 2010-09-27 14:37:24 +0200 (Mon, 27 Sep 2010) | 1 line
Changed paths:
   M /trunk/koffice/libs/pigment/KoColorSpace.h

Fix compilation.

------------------------------------------------------------------------
r1180305 | nikolaus | 2010-09-27 17:44:02 +0200 (Mon, 27 Sep 2010) | 2 lines
Changed paths:
   M /trunk/koffice/kspread/dialogs/SortDialog.cpp

Allow sorting when only one column/row is selected.


------------------------------------------------------------------------
r1180343 | adamc | 2010-09-27 20:37:41 +0200 (Mon, 27 Sep 2010) | 5 lines
Changed paths:
   M /trunk/koffice/krita/ui/widgets/kis_scratch_pad.cpp

enabled transactions in the scratchpad. they don't get recorded, so no
undo. this was needed to make the filter brush work correctly.

BUG: 227533


------------------------------------------------------------------------
r1180363 | staniek | 2010-09-27 21:18:51 +0200 (Mon, 27 Sep 2010) | 2 lines
Changed paths:
   M /trunk/koffice/tools/f-office/FoDocumentRdf.cpp
   M /trunk/koffice/tools/f-office/FoDocumentRdf.h

chmod -x

------------------------------------------------------------------------
r1180364 | mkruisselbrink | 2010-09-27 21:20:16 +0200 (Mon, 27 Sep 2010) | 2 lines
Changed paths:
   M /trunk/koffice/filters/kspread/xlsx/XlsxXmlDrawingReader.cpp
   M /trunk/koffice/filters/kspread/xlsx/XlsxXmlDrawingReader.h
   M /trunk/koffice/filters/kspread/xlsx/XlsxXmlWorksheetReader.cpp
   M /trunk/koffice/filters/kspread/xlsx/XlsxXmlWorksheetReader_p.h
   M /trunk/koffice/filters/libmsooxml/MsooXmlCommonReaderDrawingMLImpl.h

add another bunch of hack to the DrawingML code to make it possible for it to load at least text boxes in xlsx files. But this entire DrawingML reading code really desperately needs to be rewritten (and redesigned) if we ever want it to be able to properly support loading DrawingML instead of adding hack upon hack.
Also colors are still completely messed up, but at least it sort of does something now.

------------------------------------------------------------------------
r1180366 | zander | 2010-09-27 21:32:53 +0200 (Mon, 27 Sep 2010) | 1 line
Changed paths:
   M /trunk/koffice/libs/flake/KoShape.h

Fix typo

------------------------------------------------------------------------
r1180368 | zander | 2010-09-27 21:33:35 +0200 (Mon, 27 Sep 2010) | 1 line
Changed paths:
   M /trunk/koffice/plugins/chartshape/ChartShape.cpp

Fix init-order warning
------------------------------------------------------------------------
r1180369 | zander | 2010-09-27 21:33:37 +0200 (Mon, 27 Sep 2010) | 1 line
Changed paths:
   M /trunk/koffice/plugins/dockers/shapeselector/Canvas.cpp

Remove unused code
------------------------------------------------------------------------
r1180370 | zander | 2010-09-27 21:33:40 +0200 (Mon, 27 Sep 2010) | 1 line
Changed paths:
   M /trunk/koffice/libs/flake/KoInsets.h

Add 'clear' method to cheaply clear the insets
------------------------------------------------------------------------
r1180371 | zander | 2010-09-27 21:33:42 +0200 (Mon, 27 Sep 2010) | 3 lines
Changed paths:
   M /trunk/koffice/plugins/textshape/TextTool.cpp
   M /trunk/koffice/plugins/textshape/tests/TestTextTool.cpp

A line with no text still has a position.

BUG: 213238
------------------------------------------------------------------------
r1180372 | zander | 2010-09-27 21:33:45 +0200 (Mon, 27 Sep 2010) | 1 line
Changed paths:
   M /trunk/koffice/libs/flake/KoToolProxy.h

Replace API docs with something a bit more true

------------------------------------------------------------------------
r1180382 | berger | 2010-09-27 22:15:08 +0200 (Mon, 27 Sep 2010) | 4 lines
Changed paths:
   M /trunk/koffice/krita/image/kis_convolution_worker.h

Fix: feather selection crashes
Fix: convolution worker does not respect channels flags



------------------------------------------------------------------------
r1180395 | zander | 2010-09-27 23:02:25 +0200 (Mon, 27 Sep 2010) | 1 line
Changed paths:
   M /trunk/koffice/kword/part/frames/KWFrame.cpp

Properly write out if the frame will be copied

------------------------------------------------------------------------
r1180402 | piggz | 2010-09-27 23:20:40 +0200 (Mon, 27 Sep 2010) | 6 lines
Changed paths:
   M /trunk/koffice/kexi/migration/importtablewizard.cpp
   M /trunk/koffice/kexi/migration/importtablewizard.h
   M /trunk/koffice/kexi/migration/kspread/kspreadmigrate.cpp

Fix memory leak
Fix crash and memory corruption by not deleting things that shouldnt be deleted
Clear the table list when visiting the page
Ensure an ods document is closed before opening another
CCMAIL:staniek@kde.org
BUG:250164

------------------------------------------------------------------------
r1180409 | staniek | 2010-09-27 23:45:48 +0200 (Mon, 27 Sep 2010) | 1 line
Changed paths:
   M /trunk/koffice/kexi/formeditor/WidgetTreeWidget.cpp

Forms: fix possible crash when activating tab page

------------------------------------------------------------------------
r1180417 | staniek | 2010-09-28 00:40:25 +0200 (Tue, 28 Sep 2010) | 5 lines
Changed paths:
   M /trunk/koffice/kexi/core/kexisharedactionhost.cpp
   M /trunk/koffice/kexi/core/kexisharedactionhost.h
   M /trunk/koffice/kexi/doc/dev/CHANGELOG-Kexi-js
   M /trunk/koffice/kexi/main/KexiMainWindow.cpp
   M /trunk/koffice/kexi/main/KexiMainWindow.h

Forms
*Widgets Tree:
**fix delete widget action in context menu (and possibly other actions)



------------------------------------------------------------------------
r1180425 | adamc | 2010-09-28 01:21:43 +0200 (Tue, 28 Sep 2010) | 4 lines
Changed paths:
   M /trunk/koffice/krita/plugins/extensions/dockers/colorselectorng/kis_common_colors.cpp
   M /trunk/koffice/krita/plugins/extensions/dockers/colorselectorng/kis_common_colors.h
   M /trunk/koffice/krita/plugins/extensions/dockers/colorselectorng/kis_common_colors_recalculation_runner.cpp
   M /trunk/koffice/krita/plugins/extensions/dockers/colorselectorng/kis_common_colors_recalculation_runner.h

- fix bug, where switching of autoupdate of image colours didn't work.
- speed up calculation of image colours by using dmitry's sugestion
(update only needed region and listen to sigImageUpdated(const QRect &))



svn path=/branches/work/koffice-essen/; revision=1180480
parent 55f1cb09
......@@ -24,6 +24,7 @@
#include "kis_repeat_iterators_pixel.h"
#include "kis_painter.h"
#include <QBitArray>
struct StandardIteratorFactory {
typedef KisHLineIteratorPixel HLineIterator;
......@@ -84,13 +85,14 @@ protected:
{
QBitArray painterChannelFlags = m_painter->channelFlags();
if (painterChannelFlags.isEmpty()) {
painterChannelFlags = QBitArray(4, true);
painterChannelFlags = QBitArray(src->colorSpace()->channelCount(), true);
}
Q_ASSERT(painterChannelFlags.size() == src->colorSpace()->channelCount());
QList<KoChannelInfo *> channelInfo = src->colorSpace()->channels();
QList<KoChannelInfo *> convChannelList;
for (qint32 c = 0; c < channelInfo.count(); ++c) {
if (painterChannelFlags.testBit(channelInfo[c]->channelType())) {
if (painterChannelFlags.testBit(channelInfo[c]->index())) {
convChannelList.append(channelInfo[c]);
}
}
......
......@@ -22,6 +22,7 @@
#include <QColor>
#include <QRunnable>
#include <QThreadPool>
#include <QApplication>
#include <KConfig>
#include <KConfigGroup>
......@@ -63,7 +64,10 @@ void KisCommonColors::setCanvas(KisCanvas2 *canvas)
if(cfg.readEntry("commonColorsAutoUpdate", false)) {
connect(m_canvas->image(), SIGNAL(sigImageUpdated(const QRect &)),
&m_recalculationTimer, SLOT(start()), Qt::UniqueConnection);
connect(m_canvas->image(), SIGNAL(sigImageUpdated(const QRect &)),
this, SLOT(setDirty(const QRect &)), Qt::UniqueConnection);
}
m_imageCache = QImage(m_canvas->image()->size(), QImage::Format_ARGB32_Premultiplied);
}
KisColorSelectorBase* KisCommonColors::createPopup() const
......@@ -78,17 +82,21 @@ void KisCommonColors::updateSettings()
{
KisColorPatches::updateSettings();
if(!m_canvas)
if(!(m_canvas && m_canvas->image()))
return;
KConfigGroup cfg = KGlobal::config()->group("advancedColorSelector");
if(cfg.readEntry("commonColorsAutoUpdate", false)) {
connect(m_canvas->image(), SIGNAL(sigImageUpdated(const QRect &)),
&m_recalculationTimer, SLOT(start()), Qt::UniqueConnection);
connect(m_canvas->image(), SIGNAL(sigImageUpdated(const QRect &)),
this, SLOT(setDirty(const QRect &)), Qt::UniqueConnection);
}
else {
connect(m_canvas->image(), SIGNAL(sigImageUpdated(const QRect &)),
disconnect(m_canvas->image(), SIGNAL(sigImageUpdated(const QRect &)),
&m_recalculationTimer, SLOT(start()));
disconnect(m_canvas->image(), SIGNAL(sigImageUpdated(const QRect &)),
this, SLOT(setDirty(const QRect &)));
}
m_reloadButton->setEnabled(true);
......@@ -114,15 +122,37 @@ void KisCommonColors::recalculate()
return;
}
m_reloadButton->setEnabled(false);
qApp->processEvents();
updateImageCache();
KisCommonColorsRecalculationRunner* runner = new KisCommonColorsRecalculationRunner(m_imageCache, patchCount(), this);
QThreadPool::globalInstance()->start(runner);
}
void KisCommonColors::setDirty(const QRect &rc)
{
m_dirtyRegion+=rc;
}
void KisCommonColors::updateImageCache()
{
KisImageWSP kisImage = m_canvas->image();
KisConfig cfg;
const KoColorProfile* profile = KoColorSpaceRegistry::instance()->profileByName(cfg.monitorProfile());
kisImage->lock();
QImage qImage = kisImage->convertToQImage(0,0, kisImage->width(), kisImage->height(), profile);
kisImage->unlock();
QVector<QRect> rects = m_dirtyRegion.rects();
foreach(QRect rect, rects) {
kisImage->lock();
QImage imagePart = kisImage->convertToQImage(rect, profile);
kisImage->unlock();
for(int i=0; i<imagePart.width(); i++) {
for(int j=0; j<imagePart.height(); j++) {
m_imageCache.setPixel(i+rect.x(), j+rect.y(), imagePart.pixel(i, j));
}
}
}
KisCommonColorsRecalculationRunner* runner = new KisCommonColorsRecalculationRunner(/*kisImage, */qImage, patchCount(), this);
QThreadPool::globalInstance()->start(runner);
m_dirtyRegion = QRegion();
}
......@@ -38,8 +38,12 @@ public:
public slots:
void updateSettings();
void recalculate();
void setDirty(const QRect &rc);
private:
void updateImageCache();
QImage m_imageCache;
QRegion m_dirtyRegion;
QMutex m_mutex;
QTimer m_recalculationTimer;
QPushButton* m_reloadButton;
......
......@@ -191,21 +191,23 @@ QList<QRgb> KisCommonColorsRecalculationRunner::getColors()
int width = imageData.width();
int height = imageData.height();
QImage tmpImage;
int pixelCount = height*width;
if(pixelCount> (1<<16)) {
qreal factor = sqrt((1<<16)/(qreal) pixelCount);
imageData=imageData.scaledToWidth(width*factor);
width=imageData.width();
height=imageData.height();
tmpImage=imageData.scaledToWidth(width*factor);
}
width=imageData.width();
height=imageData.height();
else {
tmpImage=imageData;
}
width=tmpImage.width();
height=tmpImage.height();
QSet<QRgb> colorList;
for (int i=0; i<width; i++) {
for (int j=0; j<height; j++) {
colorList.insert(imageData.pixel(i, j)|qRgba(0,0,0,255));
colorList.insert(tmpImage.pixel(i, j)|qRgba(0,0,0,255));
}
}
......
......@@ -12,7 +12,7 @@ class KisCommonColors;
class KisCommonColorsRecalculationRunner : public QRunnable
{
public:
KisCommonColorsRecalculationRunner(QImage data, int numberOfColors, KisCommonColors* parentObj)
KisCommonColorsRecalculationRunner(const QImage &data, int numberOfColors, KisCommonColors* parentObj)
: imageData(data),
numColors(numberOfColors),
parent(parentObj)
......@@ -23,7 +23,7 @@ public:
QList<QRgb> getColors();
private:
QImage imageData;
const QImage& imageData;
int numColors;
KisCommonColors* parent;
};
......
......@@ -35,6 +35,7 @@
#include <kis_gradient_painter.h>
#include <kis_paintop_settings.h>
#include <kis_default_bounds.h>
#include <kis_dumb_undo_adapter.h>
class KisScratchPadDefaultBounds : public KisDefaultBounds
{
......@@ -52,8 +53,8 @@ KisScratchPad::KisScratchPad(QWidget *parent)
, m_backgroundColor(Qt::white, KoColorSpaceRegistry::instance()->rgb8())
, m_canvasColor(Qt::white)
, m_toolMode(HOVERING)
, m_paintLayer(0)
, m_paintDevice(0)
, m_paintLayer(0)
, m_backgroundMode(SOLID_COLOR)
, m_displayProfile(0)
, m_painter(0)
......@@ -359,6 +360,7 @@ void KisScratchPad::initPainting(QEvent* event) {
m_painter = new KisPainter(targetDevice);
m_painter->beginTransaction("scratchpad stroke");
if (m_paintIncremental) {
m_painter->setCompositeOp(m_compositeOp);
......@@ -442,7 +444,7 @@ void KisScratchPad::endPaint(QEvent *event) {
KisLayerSP layer = dynamic_cast<KisLayer*>(currentNode().data());
if (layer && !m_paintIncremental) {
// m_painter->deleteTransaction();
m_painter->deleteTransaction();
KisIndirectPaintingSupport *indirect =
dynamic_cast<KisIndirectPaintingSupport*>(layer.data());
......@@ -451,7 +453,8 @@ void KisScratchPad::endPaint(QEvent *event) {
indirect->mergeToLayer(layer, m_incrementalDirtyRegion, QString("scratchpaint"));
m_incrementalDirtyRegion = QRegion();
} else {
// m_painter->endTransaction(image()->undoAdapter());
KisDumbUndoAdapter dua;
m_painter->endTransaction(&dua);
}
}
......
/* This file is part of the KDE project
* Copyright (C) 2006 Thomas Zander <zander@kde.org>
* Copyright (C) 2006, 2010 Thomas Zander <zander@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -50,6 +50,14 @@ public:
KoInsets() : top(0.), bottom(0.), left(0.), right(0.) {
}
/// clears the insets so all sides are set to zero
void clear() {
top = 0;
bottom = 0;
left = 0;
right = 0;
}
qreal top; ///< Top inset
qreal bottom; ///< Bottom inset
qreal left; ///< Left inset
......
......@@ -541,7 +541,7 @@ public:
/// Sets the new shadow, removing the old one
void setShadow(KoShapeShadow *shadow);
/// Returns the currently set shadow or 0 if there is now shadow set
/// Returns the currently set shadow or 0 if there is no shadow set
KoShapeShadow *shadow() const;
/**
......
/* This file is part of the KDE project
*
* Copyright (c) 2006, 2010 Boudewijn Rempt <boud@valdyas.org>
* Copyright (C) 2006-2007 Thomas Zander <zander@kde.org>
* Copyright (C) 2006-2010 Thomas Zander <zander@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -42,13 +42,14 @@ class QInputMethodEvent;
class KoPointerEvent;
/**
* Simple proxy interface that provides a point d'appui for canvas
* implementations to pass events to the current tool. For the paint
* event it is possible that there more than one tool is asked to
* paint their decorations because tools can be stacked.
* Tool proxy object which allows an application to address the current tool.
*
* The implementator of KoToolProxy should be solely responsible
* for knowing which tool is currently in the user's hands.
* Applications typically have a canvas and a canvas requires a tool for
* the user to do anything. Since the flake system is responsible for handling
* tools and also to change the active tool when needed we provide one class
* that can be used by an application canvas to route all the native events too
* which will transparantly be routed to the active tool. Without the application
* having to bother about which tool is active.
*/
class FLAKE_EXPORT KoToolProxy : public QObject
{
......
......@@ -253,7 +253,7 @@ public:
LastPropertyType = ChildElement
};
/// Add a property to the style
/// Add a property to the style. Passing DefaultType as property type uses a style-type specific property type.
void addProperty(const QString &propName, const QString &propValue, PropertyType type = DefaultType) {
if (type == DefaultType) {
type = m_propertyType;
......@@ -393,14 +393,22 @@ public:
/// Not needed for QMap, but can still be useful
bool operator==(const KoGenStyle &other) const;
private:
QString property(const QString &propName, PropertyType type) const {
/**
* Returns a property of this style. In prinicpal this class is meant to be write-only, but
* some exceptional cases having read-support as well is very useful. Passing DefaultType
* as property type uses a style-type specific property type.
*/
QString property(const QString &propName, PropertyType type = DefaultType) const {
if (type == DefaultType) {
type = m_propertyType;
}
const QMap<QString, QString>::const_iterator it = m_properties[type].constFind(propName);
if (it != m_properties[type].constEnd())
return it.value();
return QString();
}
/// Returns an attribute of this style. In prinicpal this class is meant to be write-only, but some exceptional cases having read-support as well is very useful.
QString attribute(const QString &propName) const {
const QMap<QString, QString>::const_iterator it = m_attributes.constFind(propName);
if (it != m_attributes.constEnd())
......@@ -408,7 +416,7 @@ private:
return QString();
}
private:
#ifndef NDEBUG
void printDebug() const;
#endif
......
......@@ -592,7 +592,7 @@ protected:
const KoColorConversionTransformation* toRgbA16Converter() const;
const KoColorConversionTransformation* fromRgbA16Converter() const;
private:
protected:
/**
* Returns the thread-local conversion cache. If it doesn't exist
......
......@@ -298,8 +298,8 @@ QList<DataSet*> ChartProxyModel::Private::createDataSetsFromRegion( QList<DataSe
}
bool useCategories =
dataDirection == Qt::Horizontal && firstRowIsLabel ||
dataDirection == Qt::Vertical && firstColumnIsLabel;
(dataDirection == Qt::Horizontal && firstRowIsLabel) ||
(dataDirection == Qt::Vertical && firstColumnIsLabel);
// Regions shared by all data sets: categories and x-data
categoryDataRegion = CellRegion(); // member variable
......
......@@ -272,8 +272,8 @@ public:
ChartShape::Private::Private( ChartShape *shape )
: resourceManager(0)
, internalModel( 0 )
: internalModel(0),
resourceManager(0)
{
// Register the owner.
this->shape = shape;
......
......@@ -580,7 +580,7 @@ static void calculateSteps(
{
//qDebug("-----------------------------------\nstart: %f end: %f power-of-ten: %i", start_, end_, power);
qreal distance;
qreal distance = 0.0;
steps = 0.0;
const int lastIdx = list.count()-1;
......
......@@ -124,7 +124,6 @@ void Canvas::mousePressEvent(QMouseEvent *event)
FolderShape *folder = dynamic_cast<FolderShape*>(shape);
if ((event->buttons() & Qt::LeftButton) && itemStore()->mainFolder() == 0 && folder) {
QPointF localPoint = pe.point - folder->position();
KoInsets insets = folder->borderInsets();
if (localPoint.x() <= 5 || localPoint.x() >= folder->size().width() - 10
|| localPoint.y() >= folder->size().height() - 5) {
m_currentStrategy = new ResizeFolderStrategy(this, folder, pe);
......
......@@ -32,6 +32,7 @@
#include <KoStoreDevice.h>
#include <KoUnit.h>
#include <KoGenStyle.h>
#include <KoTextOnShapeContainer.h>
#include <QPainter>
#include <QTimer>
......@@ -203,6 +204,9 @@ void PictureShape::saveOdf(KoShapeSavingContext &context) const
writer.addAttribute("xlink:show", "embed");
writer.addAttribute("xlink:actuate", "onLoad");
writer.addAttribute("xlink:href", name);
if (parent()) {
parent()->saveOdfChildElements(context);
}
writer.endElement(); // draw:image
saveOdfCommonChildElements(context);
writer.endElement(); // draw:frame
......@@ -238,6 +242,8 @@ bool PictureShape::loadOdfFrameElement(const KoXmlElement &element, KoShapeLoadi
}
}
KoTextOnShapeContainer::tryWrapShape(this, element, context);
return true;
}
......
......@@ -1465,10 +1465,10 @@ QRectF TextTool::textRect(int startPosition, int endPosition) const
if (startPosition > endPosition)
qSwap(startPosition, endPosition);
QTextBlock block = m_textShapeData->document()->findBlock(startPosition);
if (!block.isValid() || block.length() == 1) // length of 1 means only linefeed. I.e. empty
if (!block.isValid())
return QRectF();
QTextLine line1 = block.layout()->lineForTextPosition(startPosition - block.position());
if (! line1.isValid())
if (!line1.isValid())
return QRectF();
qreal startX = line1.cursorToX(startPosition - block.position());
if (startPosition == endPosition)
......
......@@ -45,8 +45,7 @@ void TestTextTool::testTextRect()
QCOMPARE(tool.textRect(0, 0).topLeft(), QPointF());
// second line should be lower.
//qDebug() << tool.textRect(4, 4);
QEXPECT_FAIL("", "bug 213238", Abort);
// bug 213238
QVERIFY(tool.textRect(4, 4).topLeft().y() > 0);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment