fixed issue 1131 and 1161

preferencesAboutTextFull
Claudio Valerio 12 years ago
parent 3607318f83
commit dc272ce305
  1. 5
      src/board/UBBoardView.cpp
  2. 12
      src/domain/UBGraphicsScene.cpp
  3. 24
      src/domain/UBGraphicsWidgetItem.cpp
  4. 5
      src/domain/UBGraphicsWidgetItem.h

@ -781,7 +781,6 @@ void UBBoardView::handleItemMouseMove(QMouseEvent *event)
// at simple - in google map widget - mouse move events doesn't comes to web page from rectangle of wearch bar on bottom right corner of widget. // at simple - in google map widget - mouse move events doesn't comes to web page from rectangle of wearch bar on bottom right corner of widget.
if (mWidgetMoved && UBGraphicsW3CWidgetItem::Type == movingItem->type()) if (mWidgetMoved && UBGraphicsW3CWidgetItem::Type == movingItem->type())
movingItem->setPos(posBeforeMove); movingItem->setPos(posBeforeMove);
} }
} }
@ -1083,8 +1082,8 @@ UBBoardView::mouseMoveEvent (QMouseEvent *event)
event->accept (); event->accept ();
} }
if((event->pos() - mLastPressedMousePos).manhattanLength() < QApplication::startDragDistance()) if((event->pos() - mLastPressedMousePos).manhattanLength() < QApplication::startDragDistance())
mWidgetMoved = true; mWidgetMoved = true;
} }
void void

@ -303,12 +303,10 @@ UBGraphicsScene::UBGraphicsScene(UBDocumentProxy* parent, bool enableUndoRedoSta
UBGraphicsScene::~UBGraphicsScene() UBGraphicsScene::~UBGraphicsScene()
{ {
if (mCurrentStroke) if (mCurrentStroke && mCurrentStroke->polygons().empty()){
if (mCurrentStroke->polygons().empty()) delete mCurrentStroke;
{ mCurrentStroke = NULL;
delete mCurrentStroke; }
mCurrentStroke = NULL;
}
if (mZLayerController) if (mZLayerController)
delete mZLayerController; delete mZLayerController;
@ -2310,5 +2308,5 @@ void UBGraphicsScene::setToolCursor(int tool)
void UBGraphicsScene::initStroke() void UBGraphicsScene::initStroke()
{ {
mCurrentStroke = new UBGraphicsStroke(); mCurrentStroke = new UBGraphicsStroke();
} }

@ -119,7 +119,8 @@ void UBGraphicsWidgetItem::initialize()
void UBGraphicsWidgetItem::onLinkClicked(const QUrl& url) void UBGraphicsWidgetItem::onLinkClicked(const QUrl& url)
{ {
UBApplication::webController->loadUrl(url); //UBApplication::webController->loadUrl(url);
load(url);
} }
void UBGraphicsWidgetItem::initialLayoutCompleted() void UBGraphicsWidgetItem::initialLayoutCompleted()
@ -147,24 +148,6 @@ QString UBGraphicsWidgetItem::mainHtmlFileName()
return mMainHtmlFileName; return mMainHtmlFileName;
} }
bool UBGraphicsWidgetItem::hasEmbededObjects()
{
if (page()->mainFrame()) {
QList<UBWebKitUtils::HtmlObject> htmlObjects = UBWebKitUtils::objectsInFrame(page()->mainFrame());
return htmlObjects.length() > 0;
}
return false;
}
bool UBGraphicsWidgetItem::hasEmbededFlash()
{
if (hasEmbededObjects())
return page()->mainFrame()->toHtml().contains("application/x-shockwave-flash");
else
return false;
}
bool UBGraphicsWidgetItem::canBeContent() bool UBGraphicsWidgetItem::canBeContent()
{ {
// if we under MAC OS // if we under MAC OS
@ -886,9 +869,6 @@ UBGraphicsW3CWidgetItem::UBGraphicsW3CWidgetItem(const QUrl& pWidgetUrl, QGraphi
/* is it a valid local file ? */ /* is it a valid local file ? */
QFile f(mMainHtmlUrl.toLocalFile()); QFile f(mMainHtmlUrl.toLocalFile());
qDebug() << mMainHtmlFileName;
qDebug() << mMainHtmlUrl.toLocalFile();
if(!f.exists()) if(!f.exists())
mMainHtmlUrl = QUrl(mMainHtmlFileName); mMainHtmlUrl = QUrl(mMainHtmlFileName);

@ -62,9 +62,6 @@ class UBGraphicsWidgetItem : public QGraphicsWebView, public UBItem, public UBRe
QUrl widgetUrl(); QUrl widgetUrl();
QString mainHtmlFileName(); QString mainHtmlFileName();
bool hasEmbededObjects();
bool hasEmbededFlash();
bool canBeContent(); bool canBeContent();
bool canBeTool(); bool canBeTool();
@ -162,7 +159,7 @@ class UBGraphicsWidgetItem : public QGraphicsWebView, public UBItem, public UBRe
void mainFrameLoadFinished(bool ok); void mainFrameLoadFinished(bool ok);
private slots: private slots:
void onLinkClicked(const QUrl& url); void onLinkClicked(const QUrl& url);
void initialLayoutCompleted(); void initialLayoutCompleted();
private: private:

Loading…
Cancel
Save