summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2004-04-24 13:50:11 (UTC)
committer mickeyl <mickeyl>2004-04-24 13:50:11 (UTC)
commit0e24210ea7aa2deaf2facf29c366413aa93d0482 (patch) (unidiff)
tree1adae72f49c3f5005be836e6e7525dc79fb098cd
parent9ac401fbe5c80f710757926920d734e93a7e159b (diff)
downloadopie-0e24210ea7aa2deaf2facf29c366413aa93d0482.zip
opie-0e24210ea7aa2deaf2facf29c366413aa93d0482.tar.gz
opie-0e24210ea7aa2deaf2facf29c366413aa93d0482.tar.bz2
gcc 3.4 fixlet
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-sheet/sheet.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/noncore/apps/opie-sheet/sheet.cpp b/noncore/apps/opie-sheet/sheet.cpp
index d4419af..88847da 100644
--- a/noncore/apps/opie-sheet/sheet.cpp
+++ b/noncore/apps/opie-sheet/sheet.cpp
@@ -2028,133 +2028,133 @@ void Sheet::setTextAlign(int row, int col, Qt::AlignmentFlags flags)
2028 cellData->alignment=flags; 2028 cellData->alignment=flags;
2029 emit sheetModified(); 2029 emit sheetModified();
2030 } 2030 }
2031} 2031}
2032 2032
2033Qt::AlignmentFlags Sheet::getAlignment(int row, int col) 2033Qt::AlignmentFlags Sheet::getAlignment(int row, int col)
2034{ 2034{
2035 typeCellData *cellData=findCellData(row, col); 2035 typeCellData *cellData=findCellData(row, col);
2036 if (!cellData) cellData=&defaultCellData; 2036 if (!cellData) cellData=&defaultCellData;
2037 return cellData->alignment; 2037 return cellData->alignment;
2038} 2038}
2039 2039
2040void Sheet::setTextFont(int row, int col, const QFont &font, const QColor &color) 2040void Sheet::setTextFont(int row, int col, const QFont &font, const QColor &color)
2041{ 2041{
2042 typeCellData *cellData=findCellData(row, col); 2042 typeCellData *cellData=findCellData(row, col);
2043 if (!cellData) cellData=createCellData(row, col); 2043 if (!cellData) cellData=createCellData(row, col);
2044 if (cellData) 2044 if (cellData)
2045 { 2045 {
2046 cellData->font=font; 2046 cellData->font=font;
2047 cellData->fontColor=color; 2047 cellData->fontColor=color;
2048 emit sheetModified(); 2048 emit sheetModified();
2049 } 2049 }
2050} 2050}
2051 2051
2052QFont Sheet::getFont(int row, int col) 2052QFont Sheet::getFont(int row, int col)
2053{ 2053{
2054 typeCellData *cellData=findCellData(row, col); 2054 typeCellData *cellData=findCellData(row, col);
2055 if (!cellData) cellData=&defaultCellData; 2055 if (!cellData) cellData=&defaultCellData;
2056 return cellData->font; 2056 return cellData->font;
2057} 2057}
2058 2058
2059QColor Sheet::getFontColor(int row, int col) 2059QColor Sheet::getFontColor(int row, int col)
2060{ 2060{
2061 typeCellData *cellData=findCellData(row, col); 2061 typeCellData *cellData=findCellData(row, col);
2062 if (!cellData) cellData=&defaultCellData; 2062 if (!cellData) cellData=&defaultCellData;
2063 return cellData->fontColor; 2063 return cellData->fontColor;
2064} 2064}
2065 2065
2066void Sheet::setPen(int row, int col, int vertical, const QPen &pen) 2066void Sheet::setPen(int row, int col, int vertical, const QPen &pen)
2067{ 2067{
2068 typeCellData *cellData=findCellData(row, col); 2068 typeCellData *cellData=findCellData(row, col);
2069 if (!cellData) cellData=createCellData(row, col); 2069 if (!cellData) cellData=createCellData(row, col);
2070 if (cellData) 2070 if (cellData)
2071 { 2071 {
2072 if (vertical) 2072 if (vertical)
2073 cellData->borders.right=pen; 2073 cellData->borders.right=pen;
2074 else 2074 else
2075 cellData->borders.bottom=pen; 2075 cellData->borders.bottom=pen;
2076 emit sheetModified(); 2076 emit sheetModified();
2077 } 2077 }
2078} 2078}
2079 2079
2080QPen Sheet::getPen(int row, int col, int vertical) 2080QPen Sheet::getPen(int row, int col, int vertical)
2081{ 2081{
2082 typeCellData *cellData=findCellData(row, col); 2082 typeCellData *cellData=findCellData(row, col);
2083 if (!cellData) cellData=&defaultCellData; 2083 if (!cellData) cellData=&defaultCellData;
2084 return (vertical ? cellData->borders.right : cellData->borders.bottom); 2084 return (vertical ? cellData->borders.right : cellData->borders.bottom);
2085} 2085}
2086 2086
2087void Sheet::getSelection(int *row1, int *col1, int *row2, int *col2) 2087void Sheet::getSelection(int *row1, int *col1, int *row2, int *col2)
2088{ 2088{
2089 int selectionNo=currentSelection(); 2089 int selectionNo=currentSelection();
2090 if (selectionNo>=0) 2090 if (selectionNo>=0)
2091 { 2091 {
2092 QTableSelection selection(selection(selectionNo)); 2092 QTableSelection select(selection(selectionNo));
2093 *row1=selection.topRow(); 2093 *row1=select.topRow();
2094 *row2=selection.bottomRow(); 2094 *row2=select.bottomRow();
2095 *col1=selection.leftCol(); 2095 *col1=select.leftCol();
2096 *col2=selection.rightCol(); 2096 *col2=select.rightCol();
2097 } 2097 }
2098 else 2098 else
2099 { 2099 {
2100 *row1=*row2=currentRow(); 2100 *row1=*row2=currentRow();
2101 *col1=*col2=currentColumn(); 2101 *col1=*col2=currentColumn();
2102 } 2102 }
2103} 2103}
2104 2104
2105void Sheet::editClear() 2105void Sheet::editClear()
2106{ 2106{
2107 int row1, row2, col1, col2; 2107 int row1, row2, col1, col2;
2108 getSelection(&row1, &col1, &row2, &col2); 2108 getSelection(&row1, &col1, &row2, &col2);
2109 2109
2110 int row, col; 2110 int row, col;
2111 for (row=row1; row<=row2; ++row) 2111 for (row=row1; row<=row2; ++row)
2112 for (col=col1; col<=col2; ++col) 2112 for (col=col1; col<=col2; ++col)
2113 { 2113 {
2114 setText(row, col, ""); 2114 setText(row, col, "");
2115 slotCellChanged(row, col); 2115 slotCellChanged(row, col);
2116 } 2116 }
2117} 2117}
2118 2118
2119void Sheet::editCopy() 2119void Sheet::editCopy()
2120{ 2120{
2121 clipboardData.clear(); 2121 clipboardData.clear();
2122 2122
2123 int row1, row2, col1, col2; 2123 int row1, row2, col1, col2;
2124 getSelection(&row1, &col1, &row2, &col2); 2124 getSelection(&row1, &col1, &row2, &col2);
2125 2125
2126 typeCellData *cellData, *newCellData; 2126 typeCellData *cellData, *newCellData;
2127 int row, col; 2127 int row, col;
2128 for (row=row1; row<=row2; ++row) 2128 for (row=row1; row<=row2; ++row)
2129 for (col=col1; col<=col2; ++col) 2129 for (col=col1; col<=col2; ++col)
2130 { 2130 {
2131 cellData=findCellData(row, col); 2131 cellData=findCellData(row, col);
2132 if (cellData) 2132 if (cellData)
2133 { 2133 {
2134 newCellData=new typeCellData; 2134 newCellData=new typeCellData;
2135 *newCellData=*cellData; 2135 *newCellData=*cellData;
2136 newCellData->row-=row1; 2136 newCellData->row-=row1;
2137 newCellData->col-=col1; 2137 newCellData->col-=col1;
2138 clipboardData.append(newCellData); 2138 clipboardData.append(newCellData);
2139 } 2139 }
2140 } 2140 }
2141} 2141}
2142 2142
2143void Sheet::editCut() 2143void Sheet::editCut()
2144{ 2144{
2145 editCopy(); 2145 editCopy();
2146 editClear(); 2146 editClear();
2147} 2147}
2148 2148
2149void Sheet::editPaste(bool onlyContents) 2149void Sheet::editPaste(bool onlyContents)
2150{ 2150{
2151 int row1=currentRow(), col1=currentColumn(); 2151 int row1=currentRow(), col1=currentColumn();
2152 typeCellData *cellData, *tempCellData; 2152 typeCellData *cellData, *tempCellData;
2153 2153
2154 for (tempCellData=clipboardData.first(); tempCellData; tempCellData=clipboardData.next()) 2154 for (tempCellData=clipboardData.first(); tempCellData; tempCellData=clipboardData.next())
2155 { 2155 {
2156 cellData=findCellData(tempCellData->row+row1, tempCellData->col+col1); 2156 cellData=findCellData(tempCellData->row+row1, tempCellData->col+col1);
2157 if (!cellData) cellData=createCellData(tempCellData->row+row1, tempCellData->col+col1); 2157 if (!cellData) cellData=createCellData(tempCellData->row+row1, tempCellData->col+col1);
2158 if (cellData) 2158 if (cellData)
2159 { 2159 {
2160 if (onlyContents) 2160 if (onlyContents)