[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/kspread/ui
From:       Marijn Kruisselbrink <m.kruisselbrink () student ! tue ! nl>
Date:       2010-07-30 8:16:22
Message-ID: 20100730081622.ADFB7AC7A9 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1157096 by mkruisselbrink:

fix clicking on hyperlinks when the link is in a cell that obscures other cells

 M  +4 -4      CellToolBase.cpp  
 M  +9 -1      CellView.cpp  
 M  +1 -1      CellView.h  


--- trunk/koffice/kspread/ui/CellToolBase.cpp #1157095:1157096
@@ -945,9 +945,9 @@
         QString url;
         const CellView cellView = sheetView->cellView(col, row);
         if (selection()->activeSheet()->layoutDirection() == Qt::RightToLeft) {
-            url = cellView.testAnchor(cell, cell.width() - position.x() + xpos, \
position.y() - ypos); +            url = cellView.testAnchor(sheetView, cell, \
cell.width() - position.x() + xpos, position.y() - ypos);  } else {
-            url = cellView.testAnchor(cell, position.x() - xpos, position.y() - \
ypos); +            url = cellView.testAnchor(sheetView, cell, position.x() - xpos, \
position.y() - ypos);  }
         if (!url.isEmpty()) {
             useCursor(Qt::PointingHandCursor);
@@ -1209,9 +1209,9 @@
             QString url;
             const CellView cellView = sheetView->cellView(col, row);
             if (selection()->activeSheet()->layoutDirection() == Qt::RightToLeft) {
-                url = cellView.testAnchor(cell, cell.width() - position.x() + xpos, \
position.y() - ypos); +                url = cellView.testAnchor(sheetView, cell, \
cell.width() - position.x() + xpos, position.y() - ypos);  } else {
-                url = cellView.testAnchor(cell, position.x() - xpos, position.y() - \
ypos); +                url = cellView.testAnchor(sheetView, cell, position.x() - \
xpos, position.y() - ypos);  }
             if (!url.isEmpty()) {
                 return new HyperlinkStrategy(this, event->point,
--- trunk/koffice/kspread/ui/CellView.cpp #1157095:1157096
@@ -292,8 +292,16 @@
     return QRectF(d->textX, d->textY, d->textWidth, d->textWidth);
 }
 
-QString CellView::testAnchor(const Cell& cell, qreal x, qreal y) const
+QString CellView::testAnchor(SheetView* sheetView, const Cell& cell, qreal x, qreal \
y) const  {
+    if (isObscured()) {
+        Sheet* sheet = cell.sheet();
+        Cell otherCell = Cell(sheet, d->obscuringCellX, d->obscuringCellY);
+        const CellView& otherView = sheetView->cellView(otherCell.column(), \
otherCell.row()); +        if (cell.column() != otherCell.column()) x += \
sheet->columnPosition(cell.column()) - sheet->columnPosition(otherCell.column()); +   \
if (cell.row() != otherCell.row()) y += sheet->rowPosition(cell.row()) - \
sheet->rowPosition(otherCell.row()); +        return otherView.testAnchor(sheetView, \
otherCell, x, y); +    }
     if (cell.link().isEmpty())
         return QString();
 
--- trunk/koffice/kspread/ui/CellView.h #1157095:1157096
@@ -143,7 +143,7 @@
      */
     QRectF textRect() const;
 
-    QString testAnchor(const Cell& cell, qreal x, qreal y) const;
+    QString testAnchor(SheetView* sheetView, const Cell& cell, qreal x, qreal y) \
const;  
     bool hitTestFilterButton(const Cell& cell, const QRect& cellRect, const QPoint& \
position) const;  


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic