fixed thumbnails number vs real number of scene when a dnd on mode document is realized

preferencesAboutTextFull
Claudio Valerio 11 years ago
parent cab036fe9e
commit 98b3ccccf1
  1. 2
      src/adaptors/UBSvgSubsetAdaptor.cpp
  2. 10
      src/document/UBDocumentContainer.h
  3. 5
      src/gui/UBDocumentNavigator.cpp
  4. 1
      src/gui/UBDocumentTreeWidget.cpp
  5. 3
      src/gui/UBPageNavigationWidget.cpp

@ -64,8 +64,6 @@
#include "core/UBApplication.h"
#include "core/UBTextTools.h"
#include "document/UBDocumentContainer.h"
#include "pdf/PDFRenderer.h"
#include "core/memcheck.h"

@ -41,8 +41,8 @@ class UBDocumentContainer : public QObject
int pageCount(){return mDocumentThumbs.size();}
const QPixmap* pageAt(int index){return mDocumentThumbs[index];}
static int pageFromSceneIndex(int sceneIndex);
static int sceneIndexFromPage(int sceneIndex);
static int pageFromSceneIndex(int sceneIndex);
static int sceneIndexFromPage(int sceneIndex);
void duplicatePages(QList<int>& pageIndexes);
bool movePageToIndex(int source, int target);
@ -51,15 +51,17 @@ class UBDocumentContainer : public QObject
void updatePage(int index);
void addEmptyThumbPage();
void insertThumbPage(int index);
private:
UBDocumentProxy* mCurrentDocument;
QList<const QPixmap*> mDocumentThumbs;
protected:
void deleteThumbPage(int index);
void updateThumbPage(int index);
void insertThumbPage(int index);
void reloadThumbnails();
signals:

@ -99,6 +99,11 @@ void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source)
for(int i = 0; i < source->selectedDocument()->pageCount(); i++)
{
//claudio This is a very bad hack and shows a architectural problem
// source->selectedDocument()->pageCount() != source->pageCount()
if(i>=source->pageCount())
source->insertThumbPage(i);
const QPixmap* pix = source->pageAt(i);
Q_ASSERT(!pix->isNull());
int pageIndex = UBDocumentContainer::pageFromSceneIndex(i);

@ -24,6 +24,7 @@
#include "UBDocumentTreeWidget.h"
#include "document/UBDocumentProxy.h"
//#include "document/UBDocumentContainer.h"
#include "core/UBSettings.h"
#include "core/UBApplication.h"

@ -25,9 +25,6 @@
#include "core/UBApplication.h"
#include "board/UBBoardController.h"
#include "document/UBDocumentContainer.h"
#include "globals/UBGlobals.h"
#include "core/memcheck.h"

Loading…
Cancel
Save